From 65e5ebcdbc88a1538303b4fb6c48c8dc860ee45b Mon Sep 17 00:00:00 2001 From: helixhorned Date: Fri, 14 Dec 2012 19:27:55 +0000 Subject: [PATCH] Add command line option "-rotatesprite-no-widescreen". This global option will set bit 1024 and clear bits 256 and 512 for all rotatesprite calls, fixing complex HUD drawing code relying on precise alignment of individual elements (widescreen rotatesprite is entirely unsuitable for this purpose). git-svn-id: https://svn.eduke32.com/eduke32@3284 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/build.h | 1 + polymer/eduke32/build/src/engine.c | 7 +++++++ polymer/eduke32/source/game.c | 10 +++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 7dbd9bc89..75c2c63f3 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -441,6 +441,7 @@ EXTERN char *palookup[MAXPALOOKUPS]; EXTERN char parallaxtype, showinvisibility; EXTERN int32_t parallaxyoffs, parallaxyscale; EXTERN int32_t visibility, parallaxvisibility; +EXTERN int32_t g_rotatespriteNoWidescreen; EXTERN int32_t windowx1, windowy1, windowx2, windowy2; EXTERN int16_t startumost[MAXXDIM], startdmost[MAXXDIM]; diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 20daab03c..ca376ba46 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -7011,6 +7011,13 @@ static void dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t int32_t ouryxaspect, ourxyaspect; UNREFERENCED_PARAMETER(uniqid); + + if (g_rotatespriteNoWidescreen) + { + dastat |= 1024; + dastat &= ~(512+256); + } + //============================================================================= //POLYMOST BEGINS #ifdef USE_OPENGL if (rendmode >= 3 && qsetmode == 200) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index af4f8522f..9053cc586 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -3388,7 +3388,8 @@ void G_HandleMirror(int32_t x, int32_t y, int32_t z, int32_t a, int32_t horiz, i if (g_mirrorCount==0) { - // XXX: can we have g_mirrorCount==0 but gotpic'd MIRROR? + // NOTE: We can have g_mirrorCount==0 but gotpic'd MIRROR, + // for example in LNGA2. gotpic[MIRROR>>3] &= ~(1<<(MIRROR&7)); #ifdef DEBUGGINGAIDS initprintf("Called G_HandleMirror() with g_mirrorCount==0!\n"); @@ -8154,6 +8155,7 @@ static void G_ShowDebugHelp(void) #endif "-nologo\t\tSkip the logo anim\n" "-ns/-nm\t\tDisable sound or music\n" + "-rotatesprite-no-widescreen\tpass bit 1024 to all CON rotatesprite calls\n" "-q#\t\tFake multiplayer with # (2-8) players\n" "-z#/-condebug\tEnable line-by-line CON compile debugging at level #\n" "-conversion YYYYMMDD\tSelects CON script version for compatibility with older mods\n" @@ -8907,6 +8909,12 @@ static void G_CheckCommandLine(int32_t argc, const char **argv) i++; continue; } + if (!Bstrcasecmp(c+1,"rotatesprite-no-widescreen")) + { + g_rotatespriteNoWidescreen = 1; + i++; + continue; + } #if !defined(_WIN32) if (!Bstrcasecmp(c+1,"usecwd")) {