mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-24 04:29:34 -04:00
better support for -1,-2,-3 command line parameters (#1644)
This commit is contained in:
parent
3704eeff92
commit
9d23fcf221
@ -59,7 +59,9 @@
|
|||||||
|
|
||||||
#include "icon.c"
|
#include "icon.c"
|
||||||
|
|
||||||
int current_video_height;
|
int current_video_height, default_current_video_height;
|
||||||
|
static int GetCurrentVideoHeight(void);
|
||||||
|
|
||||||
boolean dynamic_resolution;
|
boolean dynamic_resolution;
|
||||||
|
|
||||||
boolean use_vsync; // killough 2/8/98: controls whether vsync is called
|
boolean use_vsync; // killough 2/8/98: controls whether vsync is called
|
||||||
@ -79,7 +81,8 @@ boolean toggle_fullscreen;
|
|||||||
boolean toggle_exclusive_fullscreen;
|
boolean toggle_exclusive_fullscreen;
|
||||||
|
|
||||||
int video_display = 0; // display index
|
int video_display = 0; // display index
|
||||||
int window_width, window_height;
|
static int window_width, window_height;
|
||||||
|
int default_window_width, default_window_height;
|
||||||
int window_position_x, window_position_y;
|
int window_position_x, window_position_y;
|
||||||
|
|
||||||
// [AM] Fractional part of the current tic, in the half-open
|
// [AM] Fractional part of the current tic, in the half-open
|
||||||
@ -1388,6 +1391,10 @@ static void I_InitVideoParms(void)
|
|||||||
// SDL may report native refresh rate as zero.
|
// SDL may report native refresh rate as zero.
|
||||||
native_refresh_rate = mode.refresh_rate;
|
native_refresh_rate = mode.refresh_rate;
|
||||||
|
|
||||||
|
current_video_height = default_current_video_height;
|
||||||
|
window_width = default_window_width;
|
||||||
|
window_height = default_window_height;
|
||||||
|
|
||||||
widescreen = default_widescreen;
|
widescreen = default_widescreen;
|
||||||
uncapped = default_uncapped;
|
uncapped = default_uncapped;
|
||||||
grabmouse = default_grabmouse;
|
grabmouse = default_grabmouse;
|
||||||
@ -1468,6 +1475,9 @@ static void I_InitVideoParms(void)
|
|||||||
if (p && strcasecmp("-skipsec", myargv[p - 1]))
|
if (p && strcasecmp("-skipsec", myargv[p - 1]))
|
||||||
{
|
{
|
||||||
scalefactor = tmp_scalefactor;
|
scalefactor = tmp_scalefactor;
|
||||||
|
GetCurrentVideoHeight();
|
||||||
|
MN_UpdateDynamicResolutionItem();
|
||||||
|
MN_DisableResolutionScaleItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
//!
|
//!
|
||||||
@ -1492,7 +1502,7 @@ static void I_InitVideoParms(void)
|
|||||||
fullscreen = true;
|
fullscreen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
MN_SetupResetMenuVideo();
|
MN_UpdateFpsLimitItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void I_InitGraphicsMode(void)
|
static void I_InitGraphicsMode(void)
|
||||||
@ -1597,8 +1607,13 @@ void I_GetResolutionScaling(resolution_scaling_t *rs)
|
|||||||
rs->step = 50;
|
rs->step = 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CurrentResolutionHeight(void)
|
static int GetCurrentVideoHeight(void)
|
||||||
{
|
{
|
||||||
|
if (scalefactor > 0)
|
||||||
|
{
|
||||||
|
current_video_height = scalefactor * SCREENHEIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
current_video_height =
|
current_video_height =
|
||||||
BETWEEN(SCREENHEIGHT, native_height_adjusted, current_video_height);
|
BETWEEN(SCREENHEIGHT, native_height_adjusted, current_video_height);
|
||||||
|
|
||||||
@ -1656,8 +1671,9 @@ static void CreateSurfaces(int w, int h)
|
|||||||
|
|
||||||
I_InitDiskFlash();
|
I_InitDiskFlash();
|
||||||
|
|
||||||
SDL_SetWindowMinimumSize(screen, video.unscaledw * 2,
|
int n = (scalefactor == 1 ? 1 : 2);
|
||||||
use_aspect ? ACTUALHEIGHT * 2 : SCREENHEIGHT * 2);
|
SDL_SetWindowMinimumSize(screen, video.unscaledw * n,
|
||||||
|
use_aspect ? ACTUALHEIGHT * n : SCREENHEIGHT * n);
|
||||||
|
|
||||||
if (!fullscreen)
|
if (!fullscreen)
|
||||||
{
|
{
|
||||||
@ -1686,7 +1702,7 @@ static void I_ReinitGraphicsMode(void)
|
|||||||
window_position_y = 0;
|
window_position_y = 0;
|
||||||
|
|
||||||
I_InitGraphicsMode();
|
I_InitGraphicsMode();
|
||||||
ResetResolution(CurrentResolutionHeight(), true);
|
ResetResolution(GetCurrentVideoHeight(), true);
|
||||||
CreateSurfaces(video.pitch, video.height);
|
CreateSurfaces(video.pitch, video.height);
|
||||||
ResetLogicalSize();
|
ResetLogicalSize();
|
||||||
}
|
}
|
||||||
@ -1697,12 +1713,9 @@ void I_ResetScreen(void)
|
|||||||
|
|
||||||
widescreen = default_widescreen;
|
widescreen = default_widescreen;
|
||||||
|
|
||||||
ResetResolution(CurrentResolutionHeight(), true);
|
ResetResolution(GetCurrentVideoHeight(), true);
|
||||||
CreateSurfaces(video.pitch, video.height);
|
CreateSurfaces(video.pitch, video.height);
|
||||||
ResetLogicalSize();
|
ResetLogicalSize();
|
||||||
|
|
||||||
SDL_SetWindowMinimumSize(screen, video.unscaledw * 2,
|
|
||||||
use_aspect ? ACTUALHEIGHT * 2 : SCREENHEIGHT * 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_ShutdownGraphics(void)
|
void I_ShutdownGraphics(void)
|
||||||
@ -1712,6 +1725,13 @@ void I_ShutdownGraphics(void)
|
|||||||
SDL_GetWindowPosition(screen, &window_position_x, &window_position_y);
|
SDL_GetWindowPosition(screen, &window_position_x, &window_position_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scalefactor == 0)
|
||||||
|
{
|
||||||
|
default_window_width = window_width;
|
||||||
|
default_window_height = window_height;
|
||||||
|
default_current_video_height = current_video_height;
|
||||||
|
}
|
||||||
|
|
||||||
UpdateGrab();
|
UpdateGrab();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1726,7 +1746,7 @@ void I_InitGraphics(void)
|
|||||||
|
|
||||||
I_InitVideoParms();
|
I_InitVideoParms();
|
||||||
I_InitGraphicsMode(); // killough 10/98
|
I_InitGraphicsMode(); // killough 10/98
|
||||||
ResetResolution(CurrentResolutionHeight(), true);
|
ResetResolution(GetCurrentVideoHeight(), true);
|
||||||
CreateSurfaces(video.pitch, video.height);
|
CreateSurfaces(video.pitch, video.height);
|
||||||
ResetLogicalSize();
|
ResetLogicalSize();
|
||||||
|
|
||||||
|
@ -70,7 +70,8 @@ extern boolean drs_skip_frame;
|
|||||||
|
|
||||||
extern boolean use_vsync; // killough 2/8/98: controls whether vsync is called
|
extern boolean use_vsync; // killough 2/8/98: controls whether vsync is called
|
||||||
extern boolean disk_icon; // killough 10/98
|
extern boolean disk_icon; // killough 10/98
|
||||||
extern int current_video_height;
|
|
||||||
|
extern int current_video_height, default_current_video_height;
|
||||||
|
|
||||||
# define DRS_MIN_HEIGHT 400
|
# define DRS_MIN_HEIGHT 400
|
||||||
extern boolean dynamic_resolution;
|
extern boolean dynamic_resolution;
|
||||||
|
@ -75,7 +75,7 @@ extern int showMessages;
|
|||||||
extern int show_toggle_messages;
|
extern int show_toggle_messages;
|
||||||
extern int show_pickup_messages;
|
extern int show_pickup_messages;
|
||||||
|
|
||||||
extern int window_width, window_height;
|
extern int default_window_width, default_window_height;
|
||||||
extern int window_position_x, window_position_y;
|
extern int window_position_x, window_position_y;
|
||||||
extern boolean flipcorpses; // [crispy] randomly flip corpse, blood and death
|
extern boolean flipcorpses; // [crispy] randomly flip corpse, blood and death
|
||||||
// animation sprites
|
// animation sprites
|
||||||
@ -132,7 +132,7 @@ default_t defaults[] = {
|
|||||||
|
|
||||||
{
|
{
|
||||||
"current_video_height",
|
"current_video_height",
|
||||||
(config_t *) ¤t_video_height, NULL,
|
(config_t *) &default_current_video_height, NULL,
|
||||||
{600}, {SCREENHEIGHT, UL}, number, ss_none, wad_no,
|
{600}, {SCREENHEIGHT, UL}, number, ss_none, wad_no,
|
||||||
"vertical resolution (600p by default)"
|
"vertical resolution (600p by default)"
|
||||||
},
|
},
|
||||||
@ -237,7 +237,7 @@ default_t defaults[] = {
|
|||||||
// window width
|
// window width
|
||||||
{
|
{
|
||||||
"window_width",
|
"window_width",
|
||||||
(config_t *) &window_width, NULL,
|
(config_t *) &default_window_width, NULL,
|
||||||
{1065}, {0, UL}, number, ss_none, wad_no,
|
{1065}, {0, UL}, number, ss_none, wad_no,
|
||||||
"window width"
|
"window width"
|
||||||
},
|
},
|
||||||
@ -245,7 +245,7 @@ default_t defaults[] = {
|
|||||||
// window height
|
// window height
|
||||||
{
|
{
|
||||||
"window_height",
|
"window_height",
|
||||||
(config_t *) &window_height, NULL,
|
(config_t *) &default_window_height, NULL,
|
||||||
{600}, {0, UL}, number, ss_none, wad_no,
|
{600}, {0, UL}, number, ss_none, wad_no,
|
||||||
"window height"
|
"window height"
|
||||||
},
|
},
|
||||||
|
@ -59,11 +59,13 @@ void MN_ForcedLoadGame(const char *msg); // killough 5/15/98: forced loadgames
|
|||||||
void MN_Trans(void); // killough 11/98: reset translucency
|
void MN_Trans(void); // killough 11/98: reset translucency
|
||||||
void MN_ResetMenu(void); // killough 11/98: reset main menu ordering
|
void MN_ResetMenu(void); // killough 11/98: reset main menu ordering
|
||||||
void MN_SetupResetMenu(void);
|
void MN_SetupResetMenu(void);
|
||||||
void MN_SetupResetMenuVideo(void);
|
|
||||||
void MN_ResetTimeScale(void);
|
void MN_ResetTimeScale(void);
|
||||||
void MN_DrawCredits(void); // killough 11/98
|
void MN_DrawCredits(void); // killough 11/98
|
||||||
void MN_SetHUFontKerning(void);
|
void MN_SetHUFontKerning(void);
|
||||||
void MN_DisableVoxelsRenderingItem(void);
|
void MN_DisableVoxelsRenderingItem(void);
|
||||||
|
void MN_UpdateDynamicResolutionItem(void);
|
||||||
|
void MN_DisableResolutionScaleItem(void);
|
||||||
|
void MN_UpdateFpsLimitItem(void);
|
||||||
|
|
||||||
extern int traditional_menu; // display the menu traditional way
|
extern int traditional_menu; // display the menu traditional way
|
||||||
|
|
||||||
|
@ -1839,12 +1839,16 @@ int resolution_scale;
|
|||||||
static const char **GetResolutionScaleStrings(void)
|
static const char **GetResolutionScaleStrings(void)
|
||||||
{
|
{
|
||||||
const char **strings = NULL;
|
const char **strings = NULL;
|
||||||
|
|
||||||
resolution_scaling_t rs;
|
resolution_scaling_t rs;
|
||||||
I_GetResolutionScaling(&rs);
|
I_GetResolutionScaling(&rs);
|
||||||
|
|
||||||
array_push(strings, "100%");
|
array_push(strings, "100%");
|
||||||
|
|
||||||
|
if (current_video_height == SCREENHEIGHT)
|
||||||
|
{
|
||||||
|
resolution_scale = 0;
|
||||||
|
}
|
||||||
|
|
||||||
int val = SCREENHEIGHT * 2;
|
int val = SCREENHEIGHT * 2;
|
||||||
char buf[8];
|
char buf[8];
|
||||||
int i;
|
int i;
|
||||||
@ -1870,8 +1874,6 @@ static const char **GetResolutionScaleStrings(void)
|
|||||||
return strings;
|
return strings;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void UpdateDynamicResolutionItem(void);
|
|
||||||
|
|
||||||
static void ResetVideoHeight(void)
|
static void ResetVideoHeight(void)
|
||||||
{
|
{
|
||||||
const char **strings = GetStrings(str_resolution_scale);
|
const char **strings = GetStrings(str_resolution_scale);
|
||||||
@ -1915,7 +1917,7 @@ static void ResetVideoHeight(void)
|
|||||||
VX_ResetMaxDist();
|
VX_ResetMaxDist();
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateDynamicResolutionItem();
|
MN_UpdateDynamicResolutionItem();
|
||||||
|
|
||||||
resetneeded = true;
|
resetneeded = true;
|
||||||
}
|
}
|
||||||
@ -1933,8 +1935,6 @@ static void UpdateFOV(void)
|
|||||||
setsizeneeded = true; // run R_ExecuteSetViewSize;
|
setsizeneeded = true; // run R_ExecuteSetViewSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ToggleUncapped(void);
|
|
||||||
|
|
||||||
static void ToggleFullScreen(void)
|
static void ToggleFullScreen(void)
|
||||||
{
|
{
|
||||||
toggle_fullscreen = true;
|
toggle_fullscreen = true;
|
||||||
@ -1995,7 +1995,7 @@ static setup_menu_t gen_settings1[] = {
|
|||||||
MI_GAP,
|
MI_GAP,
|
||||||
|
|
||||||
{"Uncapped Framerate", S_ONOFF, M_X, M_SPC, {"uncapped"}, m_null, input_null,
|
{"Uncapped Framerate", S_ONOFF, M_X, M_SPC, {"uncapped"}, m_null, input_null,
|
||||||
str_empty, ToggleUncapped},
|
str_empty, MN_UpdateFpsLimitItem},
|
||||||
|
|
||||||
{"Framerate Limit", S_NUM, M_X, M_SPC, {"fpslimit"}, m_null, input_null,
|
{"Framerate Limit", S_NUM, M_X, M_SPC, {"fpslimit"}, m_null, input_null,
|
||||||
str_empty, CoerceFPSLimit},
|
str_empty, CoerceFPSLimit},
|
||||||
@ -2016,6 +2016,11 @@ static setup_menu_t gen_settings1[] = {
|
|||||||
MI_END
|
MI_END
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void MN_DisableResolutionScaleItem(void)
|
||||||
|
{
|
||||||
|
DisableItem(true, gen_settings1, "resolution_scale");
|
||||||
|
}
|
||||||
|
|
||||||
static void UpdateSfxVolume(void)
|
static void UpdateSfxVolume(void)
|
||||||
{
|
{
|
||||||
S_SetSfxVolume(snd_SfxVolume);
|
S_SetSfxVolume(snd_SfxVolume);
|
||||||
@ -2345,7 +2350,7 @@ static setup_menu_t *gen_settings[] = {
|
|||||||
gen_settings5, gen_settings6, NULL
|
gen_settings5, gen_settings6, NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static void UpdateDynamicResolutionItem(void)
|
void MN_UpdateDynamicResolutionItem(void)
|
||||||
{
|
{
|
||||||
DisableItem(current_video_height <= DRS_MIN_HEIGHT, gen_settings1,
|
DisableItem(current_video_height <= DRS_MIN_HEIGHT, gen_settings1,
|
||||||
"dynamic_resolution");
|
"dynamic_resolution");
|
||||||
@ -2356,7 +2361,7 @@ static void UpdateAdvancedSoundItems(void)
|
|||||||
DisableItem(snd_module != SND_MODULE_3D, gen_settings2, "snd_hrtf");
|
DisableItem(snd_module != SND_MODULE_3D, gen_settings2, "snd_hrtf");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ToggleUncapped(void)
|
void MN_UpdateFpsLimitItem(void)
|
||||||
{
|
{
|
||||||
DisableItem(!default_uncapped, gen_settings1, "fpslimit");
|
DisableItem(!default_uncapped, gen_settings1, "fpslimit");
|
||||||
setrefreshneeded = true;
|
setrefreshneeded = true;
|
||||||
@ -3809,16 +3814,11 @@ void MN_SetupResetMenu(void)
|
|||||||
DisableItem(deh_set_blood_color, enem_settings1, "colored_blood");
|
DisableItem(deh_set_blood_color, enem_settings1, "colored_blood");
|
||||||
DisableItem(!brightmaps_found || force_brightmaps, gen_settings5,
|
DisableItem(!brightmaps_found || force_brightmaps, gen_settings5,
|
||||||
"brightmaps");
|
"brightmaps");
|
||||||
|
DisableItem(default_current_video_height <= DRS_MIN_HEIGHT, gen_settings1,
|
||||||
|
"dynamic_resolution");
|
||||||
UpdateInterceptsEmuItem();
|
UpdateInterceptsEmuItem();
|
||||||
UpdateDynamicResolutionItem();
|
|
||||||
CoerceFPSLimit();
|
CoerceFPSLimit();
|
||||||
UpdateCrosshairItems();
|
UpdateCrosshairItems();
|
||||||
UpdateCenteredWeaponItem();
|
UpdateCenteredWeaponItem();
|
||||||
UpdateAdvancedSoundItems();
|
UpdateAdvancedSoundItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MN_SetupResetMenuVideo(void)
|
|
||||||
{
|
|
||||||
ToggleUncapped();
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user