From 0796c0e66e843f194b63471d004e6d4821af2fa8 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 26 Jan 2013 17:07:58 +0000 Subject: [PATCH] Don't apply GL fogging to wall lines drawn in game's "light" overhead view. git-svn-id: https://svn.eduke32.com/eduke32@3438 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/build.h | 21 +++++++++++++++++++++ polymer/eduke32/build/include/polymer.h | 2 +- polymer/eduke32/source/astub.c | 16 ---------------- polymer/eduke32/source/game.c | 8 ++++++++ 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index d32b12ca7..ae5f37fce 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -1058,6 +1058,27 @@ void hash_delete(hashtable_t *t, const char *s); extern void initialize_engine_globals(void); +// XXX: These assume that glbuild.h is already #include'd +static inline void push_nofog(void) +{ +#ifdef USE_OPENGL + if (rendmode >= REND_POLYMOST) + { + bglPushAttrib(GL_ENABLE_BIT); + bglDisable(GL_FOG); + } +#endif +} + +static inline void pop_nofog(void) +{ +#ifdef USE_OPENGL + if (rendmode >= REND_POLYMOST) + bglPopAttrib(); +#endif +} + + #ifdef EXTERNC } #endif diff --git a/polymer/eduke32/build/include/polymer.h b/polymer/eduke32/build/include/polymer.h index 39d9ffb96..7888e6c23 100644 --- a/polymer/eduke32/build/include/polymer.h +++ b/polymer/eduke32/build/include/polymer.h @@ -20,8 +20,8 @@ # include "compat.h" # include "baselayer.h" -# include "build.h" # include "glbuild.h" +# include "build.h" # include "osd.h" # include "hightile.h" # include "mdsprite.h" diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 4e5bcc91e..ca6831b0b 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -2917,22 +2917,6 @@ static void ReadPaletteTable(void) }// end ReadPaletteTable -// XXX: this belongs into some engine header? -static inline void push_nofog(void) -{ -#ifdef USE_OPENGL - bglPushAttrib(GL_ENABLE_BIT); - bglDisable(GL_FOG); -#endif -} - -static inline void pop_nofog(void) -{ -#ifdef USE_OPENGL - bglPopAttrib(); -#endif -} - static void m32_showmouse(void) { int32_t i, col; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 9741258d1..657973c16 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -2143,6 +2143,8 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 xvect2 = mulscale16(xvect,yxaspect); yvect2 = mulscale16(yvect,yxaspect); + push_nofog(); + //Draw red lines for (i=numsectors-1; i>=0; i--) { @@ -2188,6 +2190,8 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 } } + pop_nofog(); + //Draw sprites k = g_player[screenpeek].ps->i; for (i=numsectors-1; i>=0; i--) @@ -2334,6 +2338,8 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 } } + push_nofog(); + //Draw white lines for (i=numsectors-1; i>=0; i--) { @@ -2376,6 +2382,8 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 } } + pop_nofog(); + setaspect_new(); for (TRAVERSE_CONNECT(p))