- connected the screen size CVAR and slider with Shadow Warrior's internal setting.

This commit is contained in:
Christoph Oelckers 2019-12-07 21:39:17 +01:00
parent 8f90cc8324
commit f2d0665557
5 changed files with 20 additions and 80 deletions

View file

@ -144,7 +144,7 @@ CVARD(Bool, demoplay_showsync, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/dis
// Sound
CUSTOM_CVARD(Bool, snd_ambience, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "enables/disables ambient sounds") // Not implemented for Blood
CUSTOM_CVARD(Bool, snd_ambience, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL, "enables/disables ambient sounds") // Not implemented for Blood
{
gi->SetAmbience(self);
}
@ -229,7 +229,7 @@ bool G_ChangeHudLayout(int direction)
return true;
}
}
else if (hud_size < 11)
else if (direction > 0 && hud_size < 11)
{
int layout = hud_size + 1;
while (!gi->validate_hud(layout) && layout <= 11) layout++;

View file

@ -1071,15 +1071,13 @@ ResizeView(PLAYERp pp)
if (buttonMap.ButtonDown(gamefunc_Shrink_Screen)) // &&
{
buttonMap.ClearButton(gamefunc_Shrink_Screen);
SetBorder(pp, gs.BorderNum + 1);
SetRedrawScreen(pp);
G_ChangeHudLayout(-1);
}
if (buttonMap.ButtonDown(gamefunc_Enlarge_Screen)) // &&
{
buttonMap.ClearButton(gamefunc_Enlarge_Screen);
SetBorder(pp, gs.BorderNum - 1);
SetRedrawScreen(pp);
G_ChangeHudLayout(1);
}
}
}

View file

@ -177,7 +177,7 @@ SWBOOL NoDemoStartup = FALSE;
SWBOOL FirstTimeIntoGame;
extern uint8_t RedBookSong[40];
SWBOOL BorderAdjust = TRUE;
SWBOOL BorderAdjust = FALSE;
SWBOOL LocationInfo = 0;
void drawoverheadmap(int cposx, int cposy, int czoom, short cang);
int DispFrameRate = FALSE;
@ -2988,6 +2988,7 @@ int32_t GameInterface::app_main()
int cnt = 0;
uint32_t TotalMemory;
BorderAdjust = true;
SW_ExtInit();
CONFIG_ReadSetup();
@ -4326,8 +4327,18 @@ void Saveable_Init_Dynamic()
saveable_build.numdata = NUM_SAVEABLE_ITEMS(saveable_build_data);
}
/*extern*/ bool GameInterface::validate_hud(int requested_size) { return requested_size; }
/*extern*/ void GameInterface::set_hud_layout(int requested_size) { /* the relevant setting is gs.BorderNum */}
/*extern*/ bool GameInterface::validate_hud(int requested_size)
{
return requested_size != 10 && requested_size != 8;
}
/*extern*/ void GameInterface::set_hud_layout(int requested_size)
{
if (requested_size >= 11) requested_size = 9;
else if (requested_size >= 9) requested_size = 8;
gs.BorderNum = 9 - requested_size;
SetBorder(Player + myconnectindex, gs.BorderNum);
SetRedrawScreen(Player + myconnectindex);
}
/*extern*/ void GameInterface::set_hud_scale(int requested_size) { /* the relevant setting is gs.BorderNum */ }
::GameInterface* CreateInterface()

View file

@ -665,75 +665,6 @@ SWBOOL MNU_ShareWareMessage()
}
#if 0
void
MNU_DoSlider(short dir, MenuItem_p item, SWBOOL draw)
{
case sldr_scrsize:
{
short bnum;
barwidth = SLDR_SCRSIZEMAX;
slidersettings[sldr_scrsize] = gs.BorderNum;
slidersettings[sldr_scrsize] -= dir;
offset = slidersettings[sldr_scrsize];
if (TEST(item->flags, mf_disabled))
break;
////DSPRINTF(ds,"BorderNum %d",gs.BorderNum);
//MONO_PRINT(ds);
offset = max(offset, short(0));
offset = min(offset, short(SLDR_SCRSIZEMAX - 1));
bnum = offset;
offset = (SLDR_SCRSIZEMAX-1) - offset;
slidersettings[sldr_scrsize] = offset;
if (!BorderAdjust)
gs.BorderNum = bnum;
SetBorder(&Player[myconnectindex], bnum);
break;
}
case sldr_bordertile:
barwidth = SLDR_BORDERTILEMAX;
offset = slidersettings[sldr_bordertile] += dir;
if (TEST(item->flags, mf_disabled))
break;
offset = max(offset, short(0));
offset = min(offset, short(SLDR_BORDERTILEMAX - 1));
slidersettings[sldr_bordertile] = offset;
if (gs.BorderTile != offset)
{
gs.BorderTile = offset;
SetRedrawScreen(&Player[myconnectindex]);
}
break;
case sldr_playercolor:
barwidth = SLDR_PLAYERCOLORMAX;
offset = slidersettings[sldr_playercolor] += dir;
if (TEST(item->flags, mf_disabled))
break;
offset = max(offset, short(0));
offset = min(offset, short(SLDR_PLAYERCOLORMAX - 1));
slidersettings[sldr_playercolor] = offset;
extra_text = playercolors[offset];
MNU_DrawString(OPT_XSIDE+78, item->y, extra_text, 1, PALETTE_PLAYER0+offset);
gs.NetColor = offset;
break;
}
#endif

View file

@ -1008,7 +1008,7 @@ OptionValue "PlayerColors"
//10, "$TXT_COLOR_YELLOW"
}
OptionValie "PlayerColorsSW"
OptionValue "PlayerColorsSW"
{
0, "$TXT_COLOR_BROWN"
1, "$TXT_COLOR_GRAY"
@ -1184,7 +1184,7 @@ OptionMenu "HUDOptions" //protected
{
Title "$OPTMNU_HUD"
Slider "$DSPLYMNU_SCREENSIZE", "hud_size", 3.0, 12.0, 1.0, 0
Slider "$DSPLYMNU_SCREENSIZE", "hud_size", 0.0, 11.0, 1.0, -1
ifgame(duke, nam, ww2gi, redneck, redneckrides, fury) // Fixme: The scaling really needs to be taken out of the game code.
{
Slider "$DSPLYMNU_SBSCALE", "hud_scale", 0.3, 1.0, 0.1, 2