From bf1fb6f08e5107a7e8ab9e7cec1cbd38c892a63f Mon Sep 17 00:00:00 2001 From: Jens Ayton Date: Tue, 25 Sep 2012 21:21:26 +0000 Subject: [PATCH] Fix for rainbow dust. git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5366 127b21dd-08f5-0310-b4b7-95ae10353056 --- src/Core/Entities/DustEntity.m | 5 +++++ src/Core/OOPlanetDrawable.m | 8 -------- src/Core/OOSkyDrawable.m | 1 + src/Core/Universe.m | 1 - 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Core/Entities/DustEntity.m b/src/Core/Entities/DustEntity.m index 9755bd09..f35b2f3b 100644 --- a/src/Core/Entities/DustEntity.m +++ b/src/Core/Entities/DustEntity.m @@ -308,6 +308,8 @@ enum OOGL(glDisable(GL_TEXTURE_2D)); OOGL(glEnable(GL_BLEND)); + OOGL(glDisableClientState(GL_TEXTURE_COORD_ARRAY)); + OOGL(glDepthMask(GL_FALSE)); if (warp_stars) { @@ -360,6 +362,9 @@ enum OOGL(glDisable(GL_FOG)); } + OOGL(glEnableClientState(GL_TEXTURE_COORD_ARRAY)); + OOGL(glDepthMask(GL_TRUE)); + CheckOpenGLErrors(@"DustEntity after drawing %@", self); } diff --git a/src/Core/OOPlanetDrawable.m b/src/Core/OOPlanetDrawable.m index 9809af8a..b420f7bc 100644 --- a/src/Core/OOPlanetDrawable.m +++ b/src/Core/OOPlanetDrawable.m @@ -230,14 +230,6 @@ OOGL(glVertexPointer(3, GL_FLOAT, 0, kOOPlanetVertices)); OOGL(glTexCoordPointer(2, GL_FLOAT, 0, kOOPlanetTexCoords)); -#ifndef NDEBUG - if (gDebugFlags & DEBUG_MISC) - { - LogOpenGLState(); - gDebugFlags &= ~DEBUG_MISC; - } -#endif - // FIXME: instead of GL_RESCALE_NORMAL, consider copying and transforming the vertex array for each planet. OOGL(glEnable(GL_RESCALE_NORMAL)); OOGL(glEnableClientState(GL_NORMAL_ARRAY)); diff --git a/src/Core/OOSkyDrawable.m b/src/Core/OOSkyDrawable.m index 27cd10bc..8a99ee49 100644 --- a/src/Core/OOSkyDrawable.m +++ b/src/Core/OOSkyDrawable.m @@ -231,6 +231,7 @@ static OOColor *SaturatedColorInRange(OOColor *color1, OOColor *color2); } // Restore state + OOGL(glDisableClientState(GL_COLOR_ARRAY)); OOGL(glPopAttrib()); } diff --git a/src/Core/Universe.m b/src/Core/Universe.m index 0619c4df..8c6670f0 100644 --- a/src/Core/Universe.m +++ b/src/Core/Universe.m @@ -2467,7 +2467,6 @@ GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEVEL, DOC } - - (void) selectIntro2Previous { demo_stage = DEMO_SHOW_THING;