From 85d0a3c5203a09cfe640acbe77019e1a0c7cc2b4 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Fri, 26 Jan 2018 04:34:43 +0000 Subject: [PATCH] New userdef structure "menubackground" Set to 0 to disable the black transparent mask below the in-game menu. Patch from Fox. git-svn-id: https://svn.eduke32.com/eduke32@6585 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/config.cpp | 1 + source/duke3d/src/game.h | 2 +- source/duke3d/src/gamedef.cpp | 1 + source/duke3d/src/gamedef.h | 1 + source/duke3d/src/gamestructures.cpp | 2 ++ source/duke3d/src/menus.cpp | 2 +- 6 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source/duke3d/src/config.cpp b/source/duke3d/src/config.cpp index 0f846d0dc..d6e471f4b 100644 --- a/source/duke3d/src/config.cpp +++ b/source/duke3d/src/config.cpp @@ -248,6 +248,7 @@ void CONFIG_SetDefaults(void) ud.weaponscale = 100; ud.textscale = 200; ud.screenfade = 1; + ud.menubackground = 1; ud.config.CheckForUpdates = 1; diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index 06ad49552..bd3549d8d 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -244,7 +244,7 @@ typedef struct { char wchoice[MAX_WEAPONS]; uint8_t user_map; - uint8_t screenfade; + uint8_t screenfade, menubackground; } user_defs; extern user_defs ud; diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 7f1bf3013..90eee258b 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -1235,6 +1235,7 @@ const memberlabel_t UserdefsLabels[]= { "screenarea_x2", USERDEFS_SCREENAREA_X2, 0, 0 }, { "screenarea_y2", USERDEFS_SCREENAREA_Y2, 0, 0 }, { "screenfade", USERDEFS_SCREENFADE, 0, 0 }, + { "menubackground", USERDEFS_MENUBACKGROUND, 0, 0 }, { NULL, -1, 0, 0 } // END OF LIST }; diff --git a/source/duke3d/src/gamedef.h b/source/duke3d/src/gamedef.h index 2d523aa0e..a5a8a174b 100644 --- a/source/duke3d/src/gamedef.h +++ b/source/duke3d/src/gamedef.h @@ -533,6 +533,7 @@ enum UserdefsLabel_t USERDEFS_SCREENAREA_X2, USERDEFS_SCREENAREA_Y2, USERDEFS_SCREENFADE, + USERDEFS_MENUBACKGROUND, USERDEFS_END }; diff --git a/source/duke3d/src/gamestructures.cpp b/source/duke3d/src/gamestructures.cpp index eeb06edc2..ae6077cf8 100644 --- a/source/duke3d/src/gamestructures.cpp +++ b/source/duke3d/src/gamestructures.cpp @@ -177,6 +177,7 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum) case USERDEFS_SCREENAREA_X2: labelNum = ud.screenarea_x2; break; case USERDEFS_SCREENAREA_Y2: labelNum = ud.screenarea_y2; break; case USERDEFS_SCREENFADE: labelNum = ud.screenfade; break; + case USERDEFS_MENUBACKGROUND: labelNum = ud.menubackground; break; default: labelNum = -1; break; } @@ -304,6 +305,7 @@ void __fastcall VM_SetUserdef(int32_t const labelNum, int32_t const iSet) case USERDEFS_SCREENAREA_X2: ud.screenarea_x2 = iSet; break; case USERDEFS_SCREENAREA_Y2: ud.screenarea_y2 = iSet; break; case USERDEFS_SCREENFADE: ud.screenfade = iSet; break; + case USERDEFS_MENUBACKGROUND: ud.menubackground = iSet; break; default: break; } } diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index 51d37c1e8..0722dad95 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -6508,7 +6508,7 @@ void M_DisplayMenus(void) g_player[myconnectindex].ps->gm &= (0xff-MODE_TYPE); // g_player[myconnectindex].ps->fta = 0; - int32_t const backgroundOK = Menu_BlackTranslucentBackgroundOK(g_currentMenu); + int32_t const backgroundOK = ud.menubackground && Menu_BlackTranslucentBackgroundOK(g_currentMenu); // need EVENT_DISPLAYMENUBACKGROUND here