mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- implemented proper screen size scaling for Exhumed.
This commit is contained in:
parent
dcbb936a9b
commit
a7b020d1a8
4 changed files with 33 additions and 29 deletions
|
@ -611,6 +611,7 @@ int RunGame()
|
||||||
InitFileSystem(usedgroups);
|
InitFileSystem(usedgroups);
|
||||||
if (usedgroups.Size() == 0) return 0;
|
if (usedgroups.Size() == 0) return 0;
|
||||||
|
|
||||||
|
// Handle CVARs with game specific defaults here.
|
||||||
if (g_gameType & GAMEFLAG_BLOOD)
|
if (g_gameType & GAMEFLAG_BLOOD)
|
||||||
{
|
{
|
||||||
mus_redbook.SetGenericRepDefault(false, CVAR_Bool); // Blood should default to CD Audio off - all other games must default to on.
|
mus_redbook.SetGenericRepDefault(false, CVAR_Bool); // Blood should default to CD Audio off - all other games must default to on.
|
||||||
|
@ -622,6 +623,11 @@ int RunGame()
|
||||||
hud_size.SetGenericRepDefault(8, CVAR_Int);
|
hud_size.SetGenericRepDefault(8, CVAR_Int);
|
||||||
hud_size_max = 9;
|
hud_size_max = 9;
|
||||||
}
|
}
|
||||||
|
if (g_gameType & GAMEFLAG_PSEXHUMED)
|
||||||
|
{
|
||||||
|
hud_size.SetGenericRepDefault(7, CVAR_Int);
|
||||||
|
hud_size_max = 8;
|
||||||
|
}
|
||||||
|
|
||||||
G_ReadConfig(currentGame);
|
G_ReadConfig(currentGame);
|
||||||
|
|
||||||
|
|
|
@ -986,44 +986,38 @@ static const char *safeStrtok(char *s, const char *d)
|
||||||
return r ? r : "";
|
return r ? r : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GameInterface::set_hud_layout(int layout)
|
||||||
|
{
|
||||||
|
if (layout == 8)
|
||||||
|
{
|
||||||
|
if (!bFullScreen)
|
||||||
|
{
|
||||||
|
bFullScreen = true;
|
||||||
|
screensize = 0;
|
||||||
|
UnMaskStatus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
screensize = (7 - clamp(layout, 0, 7)) * 2;
|
||||||
|
bFullScreen = false;
|
||||||
|
UpdateScreenSize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CheckKeys()
|
void CheckKeys()
|
||||||
{
|
{
|
||||||
if (buttonMap.ButtonDown(gamefunc_Enlarge_Screen))
|
if (buttonMap.ButtonDown(gamefunc_Enlarge_Screen))
|
||||||
{
|
{
|
||||||
if (screensize == 0)
|
|
||||||
{
|
|
||||||
if (!bFullScreen)
|
|
||||||
{
|
|
||||||
bFullScreen = kTrue;
|
|
||||||
UnMaskStatus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
screensize--;
|
|
||||||
if (screensize < 0) {
|
|
||||||
screensize = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateScreenSize();
|
|
||||||
}
|
|
||||||
buttonMap.ClearButton(gamefunc_Enlarge_Screen);
|
buttonMap.ClearButton(gamefunc_Enlarge_Screen);
|
||||||
|
G_ChangeHudLayout(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buttonMap.ButtonDown(gamefunc_Shrink_Screen))
|
if (buttonMap.ButtonDown(gamefunc_Shrink_Screen))
|
||||||
{
|
{
|
||||||
if (bFullScreen)
|
|
||||||
{
|
|
||||||
bFullScreen = kFalse;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((screensize + 1) < 15)
|
|
||||||
screensize++;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateScreenSize();
|
|
||||||
buttonMap.ClearButton(gamefunc_Shrink_Screen);
|
buttonMap.ClearButton(gamefunc_Shrink_Screen);
|
||||||
|
G_ChangeHudLayout(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// go to 3rd person view?
|
// go to 3rd person view?
|
||||||
|
|
|
@ -277,7 +277,7 @@ struct GameInterface : ::GameInterface
|
||||||
void UpdateScreenSize() override;
|
void UpdateScreenSize() override;
|
||||||
bool GenerateSavePic() override;
|
bool GenerateSavePic() override;
|
||||||
bool validate_hud(int) override { return true; }
|
bool validate_hud(int) override { return true; }
|
||||||
void set_hud_layout(int size) override {}
|
void set_hud_layout(int size) override;
|
||||||
void set_hud_scale(int size) override {}
|
void set_hud_scale(int size) override {}
|
||||||
void DrawNativeMenuText(int fontnum, int state, double xpos, double ypos, float fontscale, const char* text, int flags) override;
|
void DrawNativeMenuText(int fontnum, int state, double xpos, double ypos, float fontscale, const char* text, int flags) override;
|
||||||
void MenuOpened() override;
|
void MenuOpened() override;
|
||||||
|
|
|
@ -1210,6 +1210,10 @@ OptionMenu "HUDOptions" //protected
|
||||||
{
|
{
|
||||||
Slider "$DSPLYMNU_SCREENSIZE", "hud_size", 0.0, 9.0, 1.0, -1
|
Slider "$DSPLYMNU_SCREENSIZE", "hud_size", 0.0, 9.0, 1.0, -1
|
||||||
}
|
}
|
||||||
|
ifgame(exhumed)
|
||||||
|
{
|
||||||
|
Slider "$DSPLYMNU_SCREENSIZE", "hud_size", 0.0, 8.0, 1.0, -1
|
||||||
|
}
|
||||||
|
|
||||||
Option "$DSPLYMNU_LEVELSTATS", "hud_stats", "OnOff"
|
Option "$DSPLYMNU_LEVELSTATS", "hud_stats", "OnOff"
|
||||||
ifgame(duke, nam, ww2gi, redneck, redneckrides, fury)
|
ifgame(duke, nam, ww2gi, redneck, redneckrides, fury)
|
||||||
|
|
Loading…
Reference in a new issue