瀏覽代碼

Remove unuseful helper functions

Daniele Bartolini 12 年之前
父節點
當前提交
defe935697
共有 2 個文件被更改,包括 3 次插入91 次删除
  1. 2 74
      engine/World.cpp
  2. 1 17
      engine/World.h

+ 2 - 74
engine/World.cpp

@@ -114,30 +114,6 @@ Camera* World::lookup_camera(CameraId camera)
 	return m_cameras.lookup(camera);
 }
 
-//-----------------------------------------------------------------------------
-Mesh* World::lookup_mesh(MeshId mesh)
-{
-	return m_render_world.lookup_mesh(mesh);
-}
-
-//-----------------------------------------------------------------------------
-Sprite* World::lookup_sprite(SpriteId sprite)
-{
-	return m_render_world.lookup_sprite(sprite);
-}
-
-//-----------------------------------------------------------------------------
-Actor* World::lookup_actor(ActorId actor)
-{
-	return m_physics_world.lookup_actor(actor);
-}
-
-//-----------------------------------------------------------------------------
-Controller* World::lookup_controller(ControllerId controller)
-{
-	return m_physics_world.lookup_controller(controller);
-}
-
 //-----------------------------------------------------------------------------
 void World::update(float dt)
 {
@@ -184,54 +160,6 @@ void World::destroy_camera(CameraId id)
 	CE_DELETE(m_camera_pool, camera);
 }
 
-//-----------------------------------------------------------------------------
-MeshId World::create_mesh(ResourceId id, SceneGraph& sg, int32_t node)
-{
-	return m_render_world.create_mesh(id, sg, node);
-}
-
-//-----------------------------------------------------------------------------
-void World::destroy_mesh(MeshId id)
-{
-	m_render_world.destroy_mesh(id);
-}
-
-//-----------------------------------------------------------------------------
-SpriteId World::create_sprite(ResourceId id, SceneGraph& sg, int32_t node)
-{
-	return m_render_world.create_sprite(id, sg, node);
-}
-
-//-----------------------------------------------------------------------------
-void World::destroy_sprite(SpriteId id)
-{
-	m_render_world.destroy_sprite(id);
-}
-
-//-----------------------------------------------------------------------------
-ActorId	World::create_actor(SceneGraph& sg, int32_t node, ActorType::Enum type)
-{
-	return m_physics_world.create_actor(sg, node, type);
-}
-
-//-----------------------------------------------------------------------------
-void World::destroy_actor(ActorId id)
-{
-	m_physics_world.destroy_actor(id);
-}
-
-//-----------------------------------------------------------------------------
-ControllerId World::create_controller(const PhysicsResource* pr)
-{
-	return m_physics_world.create_controller(pr);
-}
-
-//-----------------------------------------------------------------------------
-void World::destroy_controller(ControllerId id)
-{
-	m_physics_world.destroy_controller(id);
-}
-
 //-----------------------------------------------------------------------------
 SoundId World::play_sound(const char* name, const bool loop, const float volume, const Vector3& pos, const float range)
 {
@@ -324,9 +252,9 @@ void World::set_sound_volume(SoundId id, const float vol)
 }
 
 //-----------------------------------------------------------------------------
-RenderWorld& World::render_world()
+RenderWorld* World::render_world()
 {
-	return m_render_world;
+	return &m_render_world;
 }
 
 //-----------------------------------------------------------------------------

+ 1 - 17
engine/World.h

@@ -95,10 +95,6 @@ public:
 
 	Unit*								lookup_unit(UnitId unit);
 	Camera*								lookup_camera(CameraId camera);
-	Mesh*								lookup_mesh(MeshId mesh);
-	Sprite*								lookup_sprite(SpriteId sprite);
-	Actor*								lookup_actor(ActorId actor);
-	Controller*							lookup_controller(ControllerId controller);
 
 	void								update(float dt);
 	void								render(Camera* camera);
@@ -106,18 +102,6 @@ public:
 	CameraId							create_camera(SceneGraph& sg, int32_t node);
 	void								destroy_camera(CameraId id);
 
-	MeshId								create_mesh(ResourceId id, SceneGraph& sg, int32_t node);
-	void								destroy_mesh(MeshId id);
-
-	SpriteId							create_sprite(ResourceId id, SceneGraph& sg, int32_t node);
-	void								destroy_sprite(SpriteId id);
-
-	ActorId								create_actor(SceneGraph& sg, int32_t node, ActorType::Enum type);
-	void								destroy_actor(ActorId id);
-
-	ControllerId						create_controller(const PhysicsResource* pr);
-	void								destroy_controller(ControllerId id);
-
 	SoundId								play_sound(const char* name, const bool loop = false, const float volume = 1.0f, const Vector3& pos = Vector3::ZERO, const float range = 50.0f);
 	void								stop_sound(SoundId sound);
 	void								link_sound(SoundId sound, Unit* unit, int32_t node);
@@ -126,7 +110,7 @@ public:
 	void								set_sound_range(SoundId sound, const float range);
 	void								set_sound_volume(SoundId sound, const float vol);
 
-	RenderWorld&						render_world();
+	RenderWorld*						render_world();
 	PhysicsWorld*						physics_world();
 
 private: