From ef01c34346f30c37c47d406f4560e2ff6e75aa4a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 19 Dec 2019 09:31:39 +0100 Subject: [PATCH] - fixed status bar initialization for all games. Also deleted a few obsolete config variables for the old menu. --- source/blood/src/blood.cpp | 2 +- source/blood/src/config.cpp | 2 -- source/blood/src/config.h | 1 - source/duke3d/src/config.cpp | 7 ------- source/duke3d/src/game.cpp | 1 + source/duke3d/src/game.h | 4 +--- source/duke3d/src/gamestructures.cpp | 28 ++++++++++++++-------------- source/rr/src/config.cpp | 10 ---------- source/rr/src/game.cpp | 1 + source/rr/src/game.h | 4 +--- source/sw/src/border.cpp | 1 + source/sw/src/game.cpp | 2 ++ 12 files changed, 22 insertions(+), 41 deletions(-) diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index 1873485cb..ab8fbdb6a 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -1191,7 +1191,7 @@ int GameInterface::app_main() netInitialize(true); scrSetGameMode( ScreenMode, ScreenWidth, ScreenHeight, ScreenBPP); scrSetGamma(gGamma); - viewResizeView(gViewSize); + hud_size.Callback(); initprintf("Initializing sound system\n"); sndInit(); gChoke.sub_83ff0(518, sub_84230); diff --git a/source/blood/src/config.cpp b/source/blood/src/config.cpp index c4201adb0..286b98282 100644 --- a/source/blood/src/config.cpp +++ b/source/blood/src/config.cpp @@ -52,7 +52,6 @@ BEGIN_BLD_NS int32_t gTurnSpeed; int32_t gDetail; int32_t cl_weaponswitch; -int32_t gAutoRun; int32_t gFollowMap; int32_t gOverlayMap; int32_t gRotateMap; @@ -104,7 +103,6 @@ void CONFIG_SetDefaults(void) gViewSize = 2; gTurnSpeed = 92; gDetail = 4; - gAutoRun = 0; gFollowMap = 1; gOverlayMap = 0; gRotateMap = 0; diff --git a/source/blood/src/config.h b/source/blood/src/config.h index 41758f109..da51e612b 100644 --- a/source/blood/src/config.h +++ b/source/blood/src/config.h @@ -34,7 +34,6 @@ BEGIN_BLD_NS extern int32_t gTurnSpeed; extern int32_t gDetail; -extern int32_t gAutoRun; extern int32_t gFollowMap; extern int32_t gOverlayMap; extern int32_t gRotateMap; diff --git a/source/duke3d/src/config.cpp b/source/duke3d/src/config.cpp index 93d36764a..6922be453 100644 --- a/source/duke3d/src/config.cpp +++ b/source/duke3d/src/config.cpp @@ -77,14 +77,7 @@ void CONFIG_SetDefaults(void) ud.display_bonus_screen = 1; hud_position = 0; - ud.menu_scrollbartilenum = -1; - ud.menu_scrollbarz = 65536; - ud.menu_scrollcursorz = 65536; - ud.menu_slidebarmargin = 65536; - ud.menu_slidebarz = 65536; - ud.menu_slidecursorz = 65536; ud.menubackground = 1; - ud.runkey_mode = 0; ud.screen_size = 4; ud.screen_tilting = 1; ud.screenfade = 1; diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 50f94bdb1..219487beb 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -5805,6 +5805,7 @@ int GameInterface::app_main() { I_Error("app_main: There was a problem initializing the Build engine: %s\n", engineerrstr); } + hud_size.Callback(); S_InitSound(); diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index 4c03b754a..c17d64a31 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -141,13 +141,11 @@ typedef struct { int32_t camera_time,folfvel,folavel,folx,foly,fola; int32_t reccnt; - int32_t runkey_mode,statusbarscale,weaponswitch; // JBF 20031125 + int32_t statusbarscale,weaponswitch; // JBF 20031125 int32_t statusbarmode; int32_t noexits; int32_t althud; int32_t statusbarflags, statusbarrange; - int32_t menu_slidebarz, menu_slidebarmargin, menu_slidecursorz; - int32_t menu_scrollbartilenum, menu_scrollbarz, menu_scrollcursorz; int32_t entered_name,screen_tilting; int32_t coop,screen_size; diff --git a/source/duke3d/src/gamestructures.cpp b/source/duke3d/src/gamestructures.cpp index f698b7912..cb56ffa7c 100644 --- a/source/duke3d/src/gamestructures.cpp +++ b/source/duke3d/src/gamestructures.cpp @@ -1473,7 +1473,7 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int const lParm2) case USERDEFS_SHOW_LEVEL_TEXT: labelNum = ud.show_level_text; break; case USERDEFS_WEAPONSCALE: labelNum = hud_weaponscale; break; case USERDEFS_TEXTSCALE: labelNum = hud_textscale; break; - case USERDEFS_RUNKEY_MODE: labelNum = ud.runkey_mode; break; + case USERDEFS_RUNKEY_MODE: labelNum = cl_runmode; break; case USERDEFS_M_ORIGIN_X: labelNum = ud.returnvar[0]; break; case USERDEFS_M_ORIGIN_Y: labelNum = ud.returnvar[1]; break; case USERDEFS_PLAYERBEST: labelNum = ud.playerbest; break; @@ -1502,9 +1502,9 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int const lParm2) case USERDEFS_STATUSBARRANGE: labelNum = ud.statusbarrange; break; case USERDEFS_STATUSBARCUSTOM: labelNum = hud_custom; break; case USERDEFS_HUDONTOP: labelNum = hud_position; break; - case USERDEFS_MENU_SLIDEBARZ: labelNum = ud.menu_slidebarz; break; - case USERDEFS_MENU_SLIDEBARMARGIN: labelNum = ud.menu_slidebarmargin; break; - case USERDEFS_MENU_SLIDECURSORZ: labelNum = ud.menu_slidecursorz; break; + case USERDEFS_MENU_SLIDEBARZ: labelNum = 65536; break; + case USERDEFS_MENU_SLIDEBARMARGIN: labelNum = 65536; break; + case USERDEFS_MENU_SLIDECURSORZ: labelNum = 65536; break; case USERDEFS_GLOBAL_R: labelNum = globalr; break; case USERDEFS_GLOBAL_G: labelNum = globalg; break; case USERDEFS_GLOBAL_B: labelNum = globalb; break; @@ -1534,9 +1534,9 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int const lParm2) case USERDEFS_MUSIC_EPISODE: labelNum = ud.music_episode; break; // Problem: This info is utterly meaningless with the new music system. case USERDEFS_MUSIC_LEVEL: labelNum = ud.music_level; break; case USERDEFS_SHADOW_PAL: labelNum = ud.shadow_pal; break; - case USERDEFS_MENU_SCROLLBARTILENUM: labelNum = ud.menu_scrollbartilenum; break; - case USERDEFS_MENU_SCROLLBARZ: labelNum = ud.menu_scrollbarz; break; - case USERDEFS_MENU_SCROLLCURSORZ: labelNum = ud.menu_scrollcursorz; break; + case USERDEFS_MENU_SCROLLBARTILENUM: labelNum = -1; break; + case USERDEFS_MENU_SCROLLBARZ: labelNum = 65536; break; + case USERDEFS_MENU_SCROLLCURSORZ: labelNum = 65536; break; case USERDEFS_RETURN: if (lParm2 == 0) labelNum = aGameVars[g_returnVarID].global; @@ -1666,7 +1666,7 @@ void __fastcall VM_SetUserdef(int const labelNum, int const lParm2, int32_t cons case USERDEFS_SHOW_LEVEL_TEXT: ud.show_level_text = iSet; break; case USERDEFS_WEAPONSCALE: hud_weaponscale.SetGenericRepDefault(iSet, CVAR_Int); break; case USERDEFS_TEXTSCALE: hud_textscale.SetGenericRepDefault(iSet, CVAR_Int); break; - case USERDEFS_RUNKEY_MODE: ud.runkey_mode = iSet; break; + case USERDEFS_RUNKEY_MODE: cl_runmode.SetGenericRepDefault(iSet, CVAR_Int); break; case USERDEFS_M_ORIGIN_X: ud.returnvar[0] = iSet; break; case USERDEFS_M_ORIGIN_Y: ud.returnvar[1] = iSet; break; case USERDEFS_GLOBALFLAGS: globalflags = iSet; break; @@ -1695,9 +1695,9 @@ void __fastcall VM_SetUserdef(int const labelNum, int const lParm2, int32_t cons case USERDEFS_STATUSBARRANGE: ud.statusbarrange = iSet; break; case USERDEFS_STATUSBARCUSTOM: hud_custom.SetGenericRepDefault(iSet, CVAR_Int); break; case USERDEFS_HUDONTOP: hud_position.SetGenericRepDefault(iSet, CVAR_Int); break; - case USERDEFS_MENU_SLIDEBARZ: ud.menu_slidebarz = iSet; break; - case USERDEFS_MENU_SLIDEBARMARGIN: ud.menu_slidebarmargin = iSet; break; - case USERDEFS_MENU_SLIDECURSORZ: ud.menu_slidecursorz = iSet; break; + case USERDEFS_MENU_SLIDEBARZ: break; + case USERDEFS_MENU_SLIDEBARMARGIN: break; + case USERDEFS_MENU_SLIDECURSORZ: break; case USERDEFS_GLOBAL_R: globalr = iSet; break; case USERDEFS_GLOBAL_G: globalg = iSet; break; case USERDEFS_GLOBAL_B: globalb = iSet; break; @@ -1737,9 +1737,9 @@ void __fastcall VM_SetUserdef(int const labelNum, int const lParm2, int32_t cons case USERDEFS_SLIDEBAR_PALSELECTED: ud.slidebar_palselected = iSet; break; case USERDEFS_SLIDEBAR_PALDISABLED: ud.slidebar_paldisabled = iSet; break; case USERDEFS_SHADOW_PAL: ud.shadow_pal = iSet; break; - case USERDEFS_MENU_SCROLLBARTILENUM: ud.menu_scrollbartilenum = iSet; break; - case USERDEFS_MENU_SCROLLBARZ: ud.menu_scrollbarz = iSet; break; - case USERDEFS_MENU_SCROLLCURSORZ: ud.menu_scrollcursorz = iSet; break; + case USERDEFS_MENU_SCROLLBARTILENUM: break; + case USERDEFS_MENU_SCROLLBARZ: break; + case USERDEFS_MENU_SCROLLCURSORZ: break; case USERDEFS_RETURN: if (lParm2 == 0) aGameVars[g_returnVarID].global = iSet; diff --git a/source/rr/src/config.cpp b/source/rr/src/config.cpp index e46e80aa9..351874c8e 100644 --- a/source/rr/src/config.cpp +++ b/source/rr/src/config.cpp @@ -62,20 +62,13 @@ void CONFIG_SetDefaults(void) ScreenBPP = 32; g_player[0].ps->aim_mode = 1; ud.config.ShowOpponentWeapons = 0; - ud.althud = 1; ud.automsg = 0; ud.camerasprite = -1; ud.camera_time = 0;//4; - ud.menu_slidebarz = 65536; - ud.menu_slidebarmargin = RR ? 6 * 65536 : 65536; - ud.menu_slidecursorz = RR ? 32768 : 65536; - ud.runkey_mode = 0; - ud.screen_size = 4; ud.screen_tilting = 1; ud.statusbarflags = STATUSBAR_NOSHRINK; - ud.statusbarmode = 1; ud.statusbarscale = 100; playerteam = 0; ud.angleinterpolation = 0; @@ -88,9 +81,6 @@ void CONFIG_SetDefaults(void) ud.menubackground = 1; ud.slidebar_paldisabled = 1; ud.shadow_pal = 4; - ud.menu_scrollbartilenum = -1; - ud.menu_scrollbarz = 65536; - ud.menu_scrollcursorz = 65536; } diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index f5afca3d9..ab84e5699 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -7261,6 +7261,7 @@ int GameInterface::app_main() { I_Error("app_main: There was a problem initializing the Build engine: %s\n", engineerrstr); } + hud_size.Callback(); S_InitSound(); diff --git a/source/rr/src/game.h b/source/rr/src/game.h index 254f94079..5660e5e61 100644 --- a/source/rr/src/game.h +++ b/source/rr/src/game.h @@ -143,13 +143,11 @@ typedef struct { int32_t camera_time,folfvel,folavel,folx,foly,fola; int32_t reccnt; - int32_t runkey_mode,statusbarscale,weaponswitch; // JBF 20031125 + int32_t statusbarscale,weaponswitch; // JBF 20031125 int32_t statusbarmode; int32_t noexits,automsg; int32_t althud; int32_t statusbarflags, statusbarrange; - int32_t menu_slidebarz, menu_slidebarmargin, menu_slidecursorz; - int32_t menu_scrollbartilenum, menu_scrollbarz, menu_scrollcursorz; int32_t entered_name,screen_tilting; int32_t coop,screen_size,lockout,crosshair; diff --git a/source/sw/src/border.cpp b/source/sw/src/border.cpp index ac5609702..e6ea9db38 100644 --- a/source/sw/src/border.cpp +++ b/source/sw/src/border.cpp @@ -545,6 +545,7 @@ void SetBorder(PLAYERp pp, int value) gs.BorderNum = SIZ(BorderInfoValues) - 1; return; } + if (xdim == 0) return; // game not set up yet. BorderSetView(pp, &Xdim, &Ydim, &ScreenSize); diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 1e9a738cc..f9f398a15 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -1905,6 +1905,7 @@ void MenuLevel(void) //drawscreen as fast as you can DrawMenuLevelScreen(); + DoUpdateSounds(); videoNextPage(); } @@ -2881,6 +2882,7 @@ int32_t GameInterface::app_main() { I_Error("There was a problem initialising the Build engine: %s", engineerrstr); } + hud_size.Callback(); if (!DetectShareware()) {