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 | |
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')
8 files changed, 15 insertions, 31 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index d136131e82f..03401f0e8b8 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -361,8 +361,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c camzoom = 2.0; } - - ketsjiengine->SetDrawType(v3d->drawtype); + rasterizer->SetDrawingMode(v3d->drawtype); ketsjiengine->SetCameraZoom(camzoom); // if we got an exitcode 3 (KX_EXIT_REQUEST_START_OTHER_GAME) load a different file 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); diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index 0776a02a79a..887ebc476b0 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -195,7 +195,7 @@ public: /** * BeginFrame is called at the start of each frame. */ - virtual bool BeginFrame(int drawingmode, double time) = 0; + virtual bool BeginFrame(double time) = 0; /** * ClearColorBuffer clears the color buffer. diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index e03be54e87b..63355696082 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -100,6 +100,7 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas, int storage) m_usingoverrideshader(false), m_clientobject(NULL), m_auxilaryClientInfo(NULL), + m_drawingmode(KX_TEXTURED), m_texco_num(0), m_attrib_num(0), //m_last_alphablend(GPU_BLEND_SOLID), @@ -330,10 +331,9 @@ void RAS_OpenGLRasterizer::Exit() EndFrame(); } -bool RAS_OpenGLRasterizer::BeginFrame(int drawingmode, double time) +bool RAS_OpenGLRasterizer::BeginFrame(double time) { m_time = time; - SetDrawingMode(drawingmode); // Blender camera routine destroys the settings if (m_drawingmode < KX_SOLID) diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h index d03e06c3b31..ae9e89cd8cc 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h @@ -166,7 +166,7 @@ public: virtual bool SetMaterial(const RAS_IPolyMaterial &mat); virtual bool Init(); virtual void Exit(); - virtual bool BeginFrame(int drawingmode, double time); + virtual bool BeginFrame(double time); virtual void ClearColorBuffer(); virtual void ClearDepthBuffer(); virtual void ClearCachingInfo(void); diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index 6908bc6db9c..18474932879 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -199,7 +199,7 @@ void ImageRender::Render() m_canvas->SetViewPort(m_position[0], m_position[1], m_position[0]+m_capSize[0]-1, m_position[1]+m_capSize[1]-1); m_canvas->ClearColor(m_background[0], m_background[1], m_background[2], m_background[3]); m_canvas->ClearBuffer(RAS_ICanvas::COLOR_BUFFER|RAS_ICanvas::DEPTH_BUFFER); - m_rasterizer->BeginFrame(RAS_IRasterizer::KX_TEXTURED,m_engine->GetClockTime()); + m_rasterizer->BeginFrame(m_engine->GetClockTime()); m_engine->SetWorldSettings(m_scene->GetWorldInfo()); m_rasterizer->SetAuxilaryClientInfo(m_scene); m_rasterizer->DisplayFog(); |