diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-23 17:30:34 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-23 17:30:34 +0400 |
commit | 70f1b45430b09e3d522b3633645e180d725de82c (patch) | |
tree | 6634ddfbda3c1bc896960566397d0b66397d7a57 /source/gameengine | |
parent | 0d347e12ea7bb863edbbc3cf40ac6b682c32e638 (diff) |
Fix for part of bug #18496: issue with light state switching
when using Dome.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/common/GPC_RenderTools.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_Dome.cpp | 35 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_Dome.h | 3 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 6 |
5 files changed, 20 insertions, 28 deletions
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp index 9dbda3f195b..e393b6d9af4 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp @@ -68,8 +68,8 @@ void KX_BlenderRenderTools::BeginFrame(RAS_IRasterizer* rasty) { m_clientobject = NULL; m_lastlightlayer = -1; - m_lastlighting = false; m_lastauxinfo = NULL; + m_lastlighting = true; /* force disable in DisableOpenGLLights() */ DisableOpenGLLights(); } diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index eafdb8a96bb..1a0d985a864 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -76,8 +76,8 @@ void GPC_RenderTools::BeginFrame(RAS_IRasterizer* rasty) { m_clientobject = NULL; m_lastlightlayer = -1; - m_lastlighting = false; m_lastauxinfo = NULL; + m_lastlighting = true; /* force disable in DisableOpenGLLights() */ DisableOpenGLLights(); } diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index bcff00af76c..077e2ce33b7 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -52,18 +52,18 @@ KX_Dome::KX_Dome ( struct Text* warptext ): - m_canvas(canvas), - m_rasterizer(rasterizer), - m_rendertools(rendertools), - m_engine(engine), + dlistSupported(false), + canvaswidth(-1), canvasheight(-1), m_drawingmode(engine->GetDrawType()), m_size(size), m_resolution(res), m_mode(mode), m_angle(angle), m_resbuffer(resbuf), - canvaswidth(-1), canvasheight(-1), - dlistSupported(false) + m_canvas(canvas), + m_rasterizer(rasterizer), + m_rendertools(rendertools), + m_engine(engine) { warp.usemesh = false; @@ -206,7 +206,7 @@ void KX_Dome::CalculateImageSize(void) canvasheight = m_canvas->GetHeight(); m_buffersize = (canvaswidth > canvasheight?canvasheight:canvaswidth); - m_buffersize *= m_resbuffer; //reduce buffer size for better performance + m_buffersize = (int)(m_buffersize*m_resbuffer); //reduce buffer size for better performance int i = 0; while ((1 << i) <= m_buffersize) @@ -230,8 +230,6 @@ void KX_Dome::CalculateImageSize(void) } bool KX_Dome::CreateDL(){ - int i,j; - dlistId = glGenLists((GLsizei) m_numimages); if (dlistId != 0) { if(m_mode == DOME_FISHEYE){ @@ -409,7 +407,7 @@ y varies from -1 to 1 u and v vary from 0 to 1 i ranges from 0 to 1, if negative don't draw that mesh node */ - int i,j,k; + int i; int nodeX=0, nodeY=0; vector<STR_String> columns, lines; @@ -431,7 +429,7 @@ i ranges from 0 to 1, if negative don't draw that mesh node warp.n_width = atoi(columns[0]); warp.n_height = atoi(columns[1]); - if (lines.size() < 2 + (warp.n_width * warp.n_height)){ + if ((int)lines.size() < 2 + (warp.n_width * warp.n_height)){ printf("Error: Warp Mesh File with insufficient data!\n"); return false; }else{ @@ -1543,8 +1541,6 @@ void KX_Dome::Draw(void) void KX_Dome::DrawEnvMap(void) { - int i,j; - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -1675,7 +1671,7 @@ void KX_Dome::DrawEnvMap(void) void KX_Dome::DrawDomeFisheye(void) { - int i,j; + int i; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); @@ -1759,7 +1755,7 @@ void KX_Dome::DrawDomeFisheye(void) void KX_Dome::DrawPanorama(void) { - int i,j; + int i; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -1846,8 +1842,6 @@ void KX_Dome::DrawPanorama(void) void KX_Dome::DrawDomeWarped(void) { - int i,j; - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -1880,10 +1874,6 @@ void KX_Dome::DrawDomeWarped(void) glEnable(GL_TEXTURE_2D); glColor3f(1.0,1.0,1.0); - - float uv_width = (float)(warp.bufferwidth-1) / warp.imagewidth; - float uv_height = (float)(warp.bufferheight-1) / warp.imageheight; - if (dlistSupported){ glBindTexture(GL_TEXTURE_2D, domefacesId[m_numfaces]); glCallList(dlistId + m_numfaces); @@ -1934,4 +1924,5 @@ void KX_Dome::RenderDomeFrame(KX_Scene* scene, KX_Camera* cam, int i) // restore the original orientation cam->NodeSetLocalOrientation(camori); cam->NodeUpdateGS(0.f); -}
\ No newline at end of file +} + diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h index 762b09e6429..84f0c5c72ed 100644 --- a/source/gameengine/Ketsji/KX_Dome.h +++ b/source/gameengine/Ketsji/KX_Dome.h @@ -181,4 +181,5 @@ protected: KX_KetsjiEngine* m_engine; }; -#endif
\ No newline at end of file +#endif + diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index ef43d6b176c..63db54a296e 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -145,8 +145,6 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system) m_stereo(false), m_curreye(0), - m_usedome(false), - m_logger(NULL), // Set up timing info display variables @@ -164,7 +162,9 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system) m_overrideFrameColor(false), m_overrideFrameColorR(0.0), m_overrideFrameColorG(0.0), - m_overrideFrameColorB(0.0) + m_overrideFrameColorB(0.0), + + m_usedome(false) { // Initialize the time logger m_logger = new KX_TimeCategoryLogger (25); |