scene so that g_scene can be deprecated later.undefined
| @@ -31,9 +31,9 @@ public: | |||||
| m_ready = false; | m_ready = false; | ||||
| } | } | ||||
| virtual void TickDraw(float seconds) | |||||
| virtual void TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| if (!m_ready) | if (!m_ready) | ||||
| { | { | ||||
| @@ -66,9 +66,9 @@ public: | |||||
| m_matrix = proj * view * model * anim; | m_matrix = proj * view * model * anim; | ||||
| } | } | ||||
| virtual void TickDraw(float seconds) | |||||
| virtual void TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| if (!m_ready) | if (!m_ready) | ||||
| { | { | ||||
| @@ -36,9 +36,9 @@ public: | |||||
| m_ready = false; | m_ready = false; | ||||
| } | } | ||||
| virtual void TickDraw(float seconds) | |||||
| virtual void TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| m_time += seconds; | m_time += seconds; | ||||
| @@ -65,9 +65,9 @@ public: | |||||
| ++m_frames; | ++m_frames; | ||||
| } | } | ||||
| virtual void TickDraw(float seconds) | |||||
| virtual void TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| /* Initialise GPU data */ | /* Initialise GPU data */ | ||||
| if (!m_ready) | if (!m_ready) | ||||
| @@ -112,9 +112,9 @@ public: | |||||
| * mat4::rotate(m_gears[4].m3 - 80.0f, vec3(0, 1, 0)); | * mat4::rotate(m_gears[4].m3 - 80.0f, vec3(0, 1, 0)); | ||||
| } | } | ||||
| virtual void TickDraw(float seconds) | |||||
| virtual void TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| if (!m_ready) | if (!m_ready) | ||||
| { | { | ||||
| @@ -138,7 +138,7 @@ public: | |||||
| for (int i = 0; i < m_gears.Count(); i++) | for (int i = 0; i < m_gears.Count(); i++) | ||||
| { | { | ||||
| g_scene->AddPrimitive(m_gears[i].m1, m_mat * m_gears[i].m2); | |||||
| scene.AddPrimitive(m_gears[i].m1, m_mat * m_gears[i].m2); | |||||
| } | } | ||||
| } | } | ||||
| @@ -63,9 +63,9 @@ public: | |||||
| WorldEntity::TickGame(seconds); | WorldEntity::TickGame(seconds); | ||||
| } | } | ||||
| virtual void TickDraw(float seconds) | |||||
| virtual void TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| if (!m_ready) | if (!m_ready) | ||||
| { | { | ||||
| @@ -77,7 +77,7 @@ public: | |||||
| { | { | ||||
| int frame = (int)(m_sprites[i].m2 * FRAME_COUNT); | int frame = (int)(m_sprites[i].m2 * FRAME_COUNT); | ||||
| // m_sprites[i].m1.z = frame; | // m_sprites[i].m1.z = frame; | ||||
| g_scene->AddTile(m_tileset, frame, | |||||
| scene.AddTile(m_tileset, frame, | |||||
| (ivec3)m_sprites[i].m1, 0, vec2(2.f), 0.f); | (ivec3)m_sprites[i].m1, 0, vec2(2.f), 0.f); | ||||
| } | } | ||||
| } | } | ||||
| @@ -138,9 +138,9 @@ public: | |||||
| m_matrix = proj * view * model * anim; | m_matrix = proj * view * model * anim; | ||||
| } | } | ||||
| virtual void TickDraw(float seconds) | |||||
| virtual void TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| if (!m_ready) | if (!m_ready) | ||||
| { | { | ||||
| @@ -51,9 +51,9 @@ public: | |||||
| m_color /= x; | m_color /= x; | ||||
| } | } | ||||
| virtual void TickDraw(float seconds) | |||||
| virtual void TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| if (!m_ready) | if (!m_ready) | ||||
| { | { | ||||
| @@ -428,9 +428,9 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| virtual void TickDraw(float seconds) | |||||
| virtual void TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| static float const vertices[] = | static float const vertices[] = | ||||
| { | { | ||||
| @@ -94,9 +94,9 @@ public: | |||||
| m_color /= x; | m_color /= x; | ||||
| } | } | ||||
| virtual void TickDraw(float seconds) | |||||
| virtual void TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| if (!m_ready) | if (!m_ready) | ||||
| { | { | ||||
| @@ -239,9 +239,9 @@ void Camera::TickGame(float seconds) | |||||
| WorldEntity::TickGame(seconds); | WorldEntity::TickGame(seconds); | ||||
| } | } | ||||
| void Camera::TickDraw(float seconds) | |||||
| void Camera::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| } | } | ||||
| } /* namespace lol */ | } /* namespace lol */ | ||||
| @@ -83,7 +83,7 @@ public: | |||||
| protected: | protected: | ||||
| virtual void TickGame(float seconds); | virtual void TickGame(float seconds); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| //private: | //private: | ||||
| public: | public: | ||||
| @@ -67,9 +67,9 @@ void DebugRecord::TickGame(float seconds) | |||||
| Entity::TickGame(seconds); | Entity::TickGame(seconds); | ||||
| } | } | ||||
| void DebugRecord::TickDraw(float seconds) | |||||
| void DebugRecord::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| Entity::TickDraw(seconds); | |||||
| Entity::TickDraw(seconds, scene); | |||||
| ivec2 size = Video::GetSize(); | ivec2 size = Video::GetSize(); | ||||
| @@ -31,7 +31,7 @@ public: | |||||
| protected: | protected: | ||||
| virtual void TickGame(float seconds); | virtual void TickGame(float seconds); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| private: | private: | ||||
| DebugRecordData *m_data; | DebugRecordData *m_data; | ||||
| @@ -68,13 +68,13 @@ void Emitter::TickGame(float seconds) | |||||
| Entity::TickGame(seconds); | Entity::TickGame(seconds); | ||||
| } | } | ||||
| void Emitter::TickDraw(float seconds) | |||||
| void Emitter::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| Entity::TickDraw(seconds); | |||||
| Entity::TickDraw(seconds, scene); | |||||
| for (int i = 0; i < data->nparticles; i++) | for (int i = 0; i < data->nparticles; i++) | ||||
| g_scene->AddTile(data->tileset, data->particles[i], | |||||
| data->positions[i], 0, vec2(1.0f), 0.0f); | |||||
| scene.AddTile(data->tileset, data->particles[i], | |||||
| data->positions[i], 0, vec2(1.0f), 0.0f); | |||||
| } | } | ||||
| void Emitter::AddParticle(int id, vec3 pos, vec3 vel) | void Emitter::AddParticle(int id, vec3 pos, vec3 vel) | ||||
| @@ -34,7 +34,7 @@ public: | |||||
| protected: | protected: | ||||
| virtual void TickGame(float seconds); | virtual void TickGame(float seconds); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| private: | private: | ||||
| EmitterData *data; | EmitterData *data; | ||||
| @@ -67,7 +67,7 @@ void Entity::TickGame(float seconds) | |||||
| #endif | #endif | ||||
| } | } | ||||
| void Entity::TickDraw(float seconds) | |||||
| void Entity::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| (void)seconds; | (void)seconds; | ||||
| #if !LOL_BUILD_RELEASE | #if !LOL_BUILD_RELEASE | ||||
| @@ -61,7 +61,7 @@ protected: | |||||
| virtual void InitDraw(); | virtual void InitDraw(); | ||||
| virtual void TickGame(float seconds); | virtual void TickGame(float seconds); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, class Scene &scene); | |||||
| enum | enum | ||||
| { | { | ||||
| @@ -58,9 +58,9 @@ Font::~Font() | |||||
| delete data; | delete data; | ||||
| } | } | ||||
| void Font::TickDraw(float seconds) | |||||
| void Font::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| Entity::TickDraw(seconds); | |||||
| Entity::TickDraw(seconds, scene); | |||||
| } | } | ||||
| char const *Font::GetName() | char const *Font::GetName() | ||||
| @@ -32,7 +32,7 @@ public: | |||||
| protected: | protected: | ||||
| /* Inherited from Entity */ | /* Inherited from Entity */ | ||||
| virtual char const *GetName(); | virtual char const *GetName(); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| public: | public: | ||||
| /* New methods */ | /* New methods */ | ||||
| @@ -55,9 +55,9 @@ void Gradient::TickGame(float seconds) | |||||
| Entity::TickGame(seconds); | Entity::TickGame(seconds); | ||||
| } | } | ||||
| void Gradient::TickDraw(float seconds) | |||||
| void Gradient::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| Entity::TickDraw(seconds); | |||||
| Entity::TickDraw(seconds, scene); | |||||
| float const vertex[] = { m_bbox[0].x, m_bbox[0].y, 0.0f, | float const vertex[] = { m_bbox[0].x, m_bbox[0].y, 0.0f, | ||||
| m_bbox[1].x, m_bbox[0].y, 0.0f, | m_bbox[1].x, m_bbox[0].y, 0.0f, | ||||
| @@ -33,7 +33,7 @@ public: | |||||
| protected: | protected: | ||||
| virtual void TickGame(float seconds); | virtual void TickGame(float seconds); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| private: | private: | ||||
| GradientData *data; | GradientData *data; | ||||
| @@ -54,11 +54,11 @@ void Layer::Render(int /* x */, int /* y */, int /* z */) | |||||
| for (int j = 0; j < height; j++) | for (int j = 0; j < height; j++) | ||||
| for (int i = 0; i < width; i++) | for (int i = 0; i < width; i++) | ||||
| if (data[j * width + i]) | if (data[j * width + i]) | ||||
| g_scene->AddTile(data[j * width + i], | |||||
| vec3(x + i * 32, | |||||
| y + j * 32 - altitude, | |||||
| altitude + z), | |||||
| orientation); | |||||
| scene.AddTile(data[j * width + i], | |||||
| vec3(x + i * 32, | |||||
| y + j * 32 - altitude, | |||||
| altitude + z), | |||||
| orientation); | |||||
| #endif | #endif | ||||
| } | } | ||||
| @@ -69,9 +69,9 @@ void Light::TickGame(float seconds) | |||||
| WorldEntity::TickGame(seconds); | WorldEntity::TickGame(seconds); | ||||
| } | } | ||||
| void Light::TickDraw(float seconds) | |||||
| void Light::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| g_scene->AddLight(this); | g_scene->AddLight(this); | ||||
| } | } | ||||
| @@ -90,7 +90,7 @@ public: | |||||
| protected: | protected: | ||||
| virtual void TickGame(float seconds); | virtual void TickGame(float seconds); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| private: | private: | ||||
| vec4 m_color; | vec4 m_color; | ||||
| @@ -122,9 +122,9 @@ void D3d9Input::TickGame(float seconds) | |||||
| #endif | #endif | ||||
| } | } | ||||
| void D3d9Input::TickDraw(float seconds) | |||||
| void D3d9Input::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| Entity::TickDraw(seconds); | |||||
| Entity::TickDraw(seconds, scene); | |||||
| } | } | ||||
| } /* namespace lol */ | } /* namespace lol */ | ||||
| @@ -31,7 +31,7 @@ public: | |||||
| protected: | protected: | ||||
| virtual void TickGame(float seconds); | virtual void TickGame(float seconds); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| private: | private: | ||||
| D3d9InputData *m_data; | D3d9InputData *m_data; | ||||
| @@ -155,9 +155,9 @@ void SdlInput::TickGame(float seconds) | |||||
| #endif | #endif | ||||
| } | } | ||||
| void SdlInput::TickDraw(float seconds) | |||||
| void SdlInput::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| Entity::TickDraw(seconds); | |||||
| Entity::TickDraw(seconds, scene); | |||||
| #if _WIN32 | #if _WIN32 | ||||
| m_data->Tick(seconds); | m_data->Tick(seconds); | ||||
| @@ -34,7 +34,7 @@ public: | |||||
| protected: | protected: | ||||
| virtual void TickGame(float seconds); | virtual void TickGame(float seconds); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| private: | private: | ||||
| SdlInputData *m_data; | SdlInputData *m_data; | ||||
| @@ -79,9 +79,9 @@ void XboxInput::TickGame(float seconds) | |||||
| Entity::TickGame(seconds); | Entity::TickGame(seconds); | ||||
| } | } | ||||
| void XboxInput::TickDraw(float seconds) | |||||
| void XboxInput::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| Entity::TickDraw(seconds); | |||||
| Entity::TickDraw(seconds, scene); | |||||
| #if defined _XBOX | #if defined _XBOX | ||||
| for (int i = 0; i < m_data->m_joysticks.Count(); i++) | for (int i = 0; i < m_data->m_joysticks.Count(); i++) | ||||
| @@ -31,7 +31,7 @@ public: | |||||
| protected: | protected: | ||||
| virtual void TickGame(float seconds); | virtual void TickGame(float seconds); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| private: | private: | ||||
| XboxInputData *m_data; | XboxInputData *m_data; | ||||
| @@ -46,11 +46,11 @@ void Sprite::TickGame(float seconds) | |||||
| Entity::TickGame(seconds); | Entity::TickGame(seconds); | ||||
| } | } | ||||
| void Sprite::TickDraw(float seconds) | |||||
| void Sprite::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| Entity::TickDraw(seconds); | |||||
| Entity::TickDraw(seconds, scene); | |||||
| g_scene->AddTile(data->tileset, data->id, m_position, 0, vec2(1.0f), 0.0f); | |||||
| scene.AddTile(data->tileset, data->id, m_position, 0, vec2(1.0f), 0.0f); | |||||
| } | } | ||||
| Sprite::~Sprite() | Sprite::~Sprite() | ||||
| @@ -32,7 +32,7 @@ public: | |||||
| protected: | protected: | ||||
| virtual void TickGame(float seconds); | virtual void TickGame(float seconds); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| private: | private: | ||||
| SpriteData *data; | SpriteData *data; | ||||
| @@ -77,9 +77,9 @@ void Text::SetAlign(int align) | |||||
| data->align = align; | data->align = align; | ||||
| } | } | ||||
| void Text::TickDraw(float seconds) | |||||
| void Text::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| Entity::TickDraw(seconds); | |||||
| Entity::TickDraw(seconds, scene); | |||||
| int length = data->m_text.Count(); | int length = data->m_text.Count(); | ||||
| if (length) | if (length) | ||||
| @@ -43,7 +43,7 @@ public: | |||||
| }; | }; | ||||
| protected: | protected: | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| private: | private: | ||||
| TextData *data; | TextData *data; | ||||
| @@ -398,7 +398,7 @@ void TickerData::DrawThreadTick() | |||||
| e->GetName(), e); | e->GetName(), e); | ||||
| e->m_tickstate = Entity::STATE_PRETICK_DRAW; | e->m_tickstate = Entity::STATE_PRETICK_DRAW; | ||||
| #endif | #endif | ||||
| e->TickDraw(data->deltatime); | |||||
| e->TickDraw(data->deltatime, *g_scene); | |||||
| #if !LOL_BUILD_RELEASE | #if !LOL_BUILD_RELEASE | ||||
| if (e->m_tickstate != Entity::STATE_POSTTICK_DRAW) | if (e->m_tickstate != Entity::STATE_POSTTICK_DRAW) | ||||
| Log::Error("entity %s [%p] missed super draw tick\n", | Log::Error("entity %s [%p] missed super draw tick\n", | ||||
| @@ -182,9 +182,9 @@ TileSet::~TileSet() | |||||
| delete m_data; | delete m_data; | ||||
| } | } | ||||
| void TileSet::TickDraw(float seconds) | |||||
| void TileSet::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| Entity::TickDraw(seconds); | |||||
| Entity::TickDraw(seconds, scene); | |||||
| if (IsDestroying()) | if (IsDestroying()) | ||||
| { | { | ||||
| @@ -42,7 +42,7 @@ public: | |||||
| /* Inherited from Entity */ | /* Inherited from Entity */ | ||||
| virtual char const *GetName(); | virtual char const *GetName(); | ||||
| protected: | protected: | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| public: | public: | ||||
| /* New methods */ | /* New methods */ | ||||
| @@ -46,9 +46,9 @@ void WorldEntity::TickGame(float seconds) | |||||
| Entity::TickGame(seconds); | Entity::TickGame(seconds); | ||||
| } | } | ||||
| void WorldEntity::TickDraw(float seconds) | |||||
| void WorldEntity::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| Entity::TickDraw(seconds); | |||||
| Entity::TickDraw(seconds, scene); | |||||
| } | } | ||||
| } /* namespace lol */ | } /* namespace lol */ | ||||
| @@ -38,7 +38,7 @@ protected: | |||||
| virtual ~WorldEntity(); | virtual ~WorldEntity(); | ||||
| virtual void TickGame(float seconds); | virtual void TickGame(float seconds); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| }; | }; | ||||
| } /* namespace lol */ | } /* namespace lol */ | ||||
| @@ -564,9 +564,9 @@ void BtPhysTest::TickGame(float seconds) | |||||
| #endif //USE_CHARACTER | #endif //USE_CHARACTER | ||||
| } | } | ||||
| void BtPhysTest::TickDraw(float seconds) | |||||
| void BtPhysTest::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| if (m_init_status != 2) | if (m_init_status != 2) | ||||
| return; | return; | ||||
| @@ -39,7 +39,7 @@ public: | |||||
| protected: | protected: | ||||
| virtual void TickGame(float seconds); | virtual void TickGame(float seconds); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| void InitApp(); | void InitApp(); | ||||
| @@ -686,9 +686,9 @@ public: | |||||
| #endif //WINDOWS | #endif //WINDOWS | ||||
| } | } | ||||
| virtual void TickDraw(float seconds) | |||||
| virtual void TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| if (!m_init || !m_first_tick) | if (!m_init || !m_first_tick) | ||||
| return; | return; | ||||
| @@ -824,12 +824,12 @@ public: | |||||
| //Camera projection | //Camera projection | ||||
| mat4 new_proj = mat_obj_offset * mat_count_offset * mat_align * mat_count_scale * save_proj; | mat4 new_proj = mat_obj_offset * mat_count_offset * mat_align * mat_count_scale * save_proj; | ||||
| m_camera->SetProjection(new_proj); | m_camera->SetProjection(new_proj); | ||||
| g_scene->AddPrimitive(*m_meshes[i].m1, m_mat); | |||||
| scene.AddPrimitive(*m_meshes[i].m1, m_mat); | |||||
| g_renderer->Clear(ClearMask::Depth); | g_renderer->Clear(ClearMask::Depth); | ||||
| } | } | ||||
| m_camera->SetProjection(save_proj); | m_camera->SetProjection(save_proj); | ||||
| #else | #else | ||||
| g_scene->AddPrimitive(*m_meshes[i].m1, m_mat); | |||||
| scene.AddPrimitive(*m_meshes[i].m1, m_mat); | |||||
| #endif //ALL_FEATURES | #endif //ALL_FEATURES | ||||
| } | } | ||||
| } | } | ||||
| @@ -839,7 +839,7 @@ public: | |||||
| { | { | ||||
| m_camera->SetProjection(mat_gizmo); | m_camera->SetProjection(mat_gizmo); | ||||
| if (m_ssetup->m_show_gizmo) | if (m_ssetup->m_show_gizmo) | ||||
| g_scene->AddPrimitive(*m_gizmos[GZ_Editor], m_mat); | |||||
| scene.AddPrimitive(*m_gizmos[GZ_Editor], m_mat); | |||||
| if (m_ssetup->m_show_lights) | if (m_ssetup->m_show_lights) | ||||
| { | { | ||||
| @@ -851,12 +851,12 @@ public: | |||||
| //dir light | //dir light | ||||
| if (ltmp->GetType() == LightType::Directional) | if (ltmp->GetType() == LightType::Directional) | ||||
| { | { | ||||
| g_scene->AddPrimitive(*m_gizmos[GZ_LightPos], m_mat * inverse(local)); | |||||
| g_scene->AddPrimitive(*m_gizmos[GZ_LightDir], inverse(world) * inverse(mat4::lookat(vec3::zero, -ltmp->GetPosition(), vec3::axis_y))); | |||||
| scene.AddPrimitive(*m_gizmos[GZ_LightPos], m_mat * inverse(local)); | |||||
| scene.AddPrimitive(*m_gizmos[GZ_LightDir], inverse(world) * inverse(mat4::lookat(vec3::zero, -ltmp->GetPosition(), vec3::axis_y))); | |||||
| } | } | ||||
| else //point light | else //point light | ||||
| { | { | ||||
| g_scene->AddPrimitive(*m_gizmos[GZ_LightPos], m_mat * local); | |||||
| scene.AddPrimitive(*m_gizmos[GZ_LightPos], m_mat * local); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -80,9 +80,9 @@ void Nacl_PhysTest::TickGame(float seconds) | |||||
| Ticker::Shutdown(); | Ticker::Shutdown(); | ||||
| } | } | ||||
| void Nacl_PhysTest::TickDraw(float seconds) | |||||
| void Nacl_PhysTest::TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| if (!m_ready) | if (!m_ready) | ||||
| { | { | ||||
| @@ -18,7 +18,7 @@ public: | |||||
| protected: | protected: | ||||
| virtual void TickGame(float seconds); | virtual void TickGame(float seconds); | ||||
| virtual void TickDraw(float seconds); | |||||
| virtual void TickDraw(float seconds, Scene &scene); | |||||
| private: | private: | ||||
| enum | enum | ||||
| @@ -317,9 +317,9 @@ protected: | |||||
| WorldEntity::TickGame(seconds); | WorldEntity::TickGame(seconds); | ||||
| } | } | ||||
| virtual void TickDraw(float seconds) | |||||
| virtual void TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| WorldEntity::TickDraw(seconds); | |||||
| WorldEntity::TickDraw(seconds, scene); | |||||
| #if CAT_MODE | #if CAT_MODE | ||||
| if (!m_is_phys || m_custom_shader) | if (!m_is_phys || m_custom_shader) | ||||
| @@ -334,9 +334,9 @@ protected: | |||||
| else if (m_should_render) | else if (m_should_render) | ||||
| { | { | ||||
| if (m_is_character) | if (m_is_character) | ||||
| g_scene->AddPrimitive(m_mesh, m_character->GetTransform()); | |||||
| scene.AddPrimitive(m_mesh, m_character->GetTransform()); | |||||
| else | else | ||||
| g_scene->AddPrimitive(m_mesh, m_physics->GetTransform()); | |||||
| scene.AddPrimitive(m_mesh, m_physics->GetTransform()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -44,7 +44,7 @@ public: | |||||
| } | } | ||||
| virtual void TickDraw(float seconds) | |||||
| virtual void TickDraw(float seconds, Scene &scene) | |||||
| { | { | ||||
| } | } | ||||