diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2014-03-25 07:11:11 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2014-03-25 07:11:11 +0400 |
commit | 9d244e0ad7cb523e58ba76758da28655a942ac09 (patch) | |
tree | d0fe0014e23931f2c9d0c33ae0ab33dfb2190e2c /source/gameengine/Ketsji | |
parent | b66a9543bbcf86646b46af1da7ed0c4d035c7f98 (diff) |
Code cleanup: Removing KX_KetsjiEngine::m_drawingmode
The rasterizer is already handling this, and there is
no need to duplicate the data.
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_Dome.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 21 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.h | 10 |
3 files changed, 9 insertions, 24 deletions
diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index 43d74487542..71d7257a907 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -61,7 +61,7 @@ KX_Dome::KX_Dome ( ): dlistSupported(false), canvaswidth(-1), canvasheight(-1), - m_drawingmode(engine->GetDrawType()), + m_drawingmode(rasterizer->GetDrawingMode()), m_resolution(res), m_mode(mode), m_angle(angle), diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index e6b22420d90..1bcfc4c974b 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -142,8 +142,7 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system) m_exitcode(KX_EXIT_REQUEST_NO_REQUEST), m_exitstring(""), - - m_drawingmode(5), + m_cameraZoom(1.0), m_overrideCam(false), @@ -184,6 +183,7 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system) #ifdef WITH_PYTHON m_pyprofiledict = PyDict_New(); #endif + } @@ -487,7 +487,7 @@ bool KX_KetsjiEngine::BeginFrame() { ClearFrame(); - m_rasterizer->BeginFrame(m_drawingmode , m_kxsystem->GetTimeInSeconds()); + m_rasterizer->BeginFrame(m_kxsystem->GetTimeInSeconds()); return true; } @@ -837,7 +837,7 @@ void KX_KetsjiEngine::Render() // clear the entire game screen with the border color // only once per frame m_canvas->BeginDraw(); - if (m_drawingmode == RAS_IRasterizer::KX_TEXTURED) { + if (m_rasterizer->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) { m_canvas->SetViewPort(0, 0, m_canvas->GetWidth(), m_canvas->GetHeight()); if (m_overrideFrameColor) { @@ -1018,7 +1018,7 @@ void KX_KetsjiEngine::SetBackGround(KX_WorldInfo* wi) { if (wi->hasWorld()) { - if (m_drawingmode == RAS_IRasterizer::KX_TEXTURED) + if (m_rasterizer->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) { m_rasterizer->SetBackColor( wi->getBackColorRed(), @@ -1043,7 +1043,7 @@ void KX_KetsjiEngine::SetWorldSettings(KX_WorldInfo* wi) wi->getAmbientColorBlue() ); - if (m_drawingmode >= RAS_IRasterizer::KX_SOLID) + if (m_rasterizer->GetDrawingMode() >= RAS_IRasterizer::KX_SOLID) { if (wi->hasMist()) { @@ -1060,13 +1060,6 @@ void KX_KetsjiEngine::SetWorldSettings(KX_WorldInfo* wi) } - -void KX_KetsjiEngine::SetDrawType(int drawingmode) -{ - m_drawingmode = drawingmode; -} - - void KX_KetsjiEngine::EnableCameraOverride(const STR_String& forscene) { @@ -1166,7 +1159,7 @@ void KX_KetsjiEngine::RenderShadowBuffers(KX_Scene *scene) light->Update(); - if (m_drawingmode == RAS_IRasterizer::KX_TEXTURED && light->HasShadowBuffer()) { + if (m_rasterizer->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED && light->HasShadowBuffer()) { /* make temporary camera */ RAS_CameraData camdata = RAS_CameraData(); KX_Camera *cam = new KX_Camera(scene, scene->m_callbacks, camdata, true, true); diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index e7fb250c2d9..85cd8bba2de 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -127,12 +127,7 @@ private: int m_exitcode; STR_String m_exitstring; - /** - * Some drawing parameters, the drawing mode - * (wire/flat/texture), and the camera zoom - * factor. - */ - int m_drawingmode; + float m_cameraZoom; bool m_overrideCam; @@ -261,9 +256,6 @@ public: void GetSceneViewport(KX_Scene* scene, KX_Camera* cam, RAS_Rect& area, RAS_Rect& viewport); - void SetDrawType(int drawingtype); - int GetDrawType() { return m_drawingmode; } - void SetCameraZoom(float camzoom); void EnableCameraOverride(const STR_String& forscene); |