mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -04:00
add menu options
This commit is contained in:
parent
19027209fd
commit
9921171a9d
@ -48,8 +48,9 @@
|
|||||||
|
|
||||||
video_t video;
|
video_t video;
|
||||||
|
|
||||||
|
resolution_mode_t resolution_mode, default_resolution_mode;
|
||||||
|
|
||||||
boolean use_vsync; // killough 2/8/98: controls whether vsync is called
|
boolean use_vsync; // killough 2/8/98: controls whether vsync is called
|
||||||
int hires, default_hires; // killough 11/98
|
|
||||||
boolean use_aspect;
|
boolean use_aspect;
|
||||||
boolean uncapped, default_uncapped; // [FG] uncapped rendering frame rate
|
boolean uncapped, default_uncapped; // [FG] uncapped rendering frame rate
|
||||||
int fpslimit; // when uncapped, limit framerate to this value
|
int fpslimit; // when uncapped, limit framerate to this value
|
||||||
@ -994,6 +995,11 @@ static void ResetResolution(int height)
|
|||||||
{
|
{
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
|
if (height > native_height_adjusted)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
actualheight = use_aspect ? (int)(height * 1.2) : height;
|
actualheight = use_aspect ? (int)(height * 1.2) : height;
|
||||||
video.height = height;
|
video.height = height;
|
||||||
|
|
||||||
@ -1025,7 +1031,7 @@ static void ResetResolution(int height)
|
|||||||
h = 3;
|
h = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
double aspect_ratio = (double)w / (double)h;
|
double aspect_ratio = MIN(2.4, (double)w / (double)h);
|
||||||
|
|
||||||
video.unscaledw = (int)(ACTUALHEIGHT * aspect_ratio);
|
video.unscaledw = (int)(ACTUALHEIGHT * aspect_ratio);
|
||||||
video.width = (int)(actualheight * aspect_ratio);
|
video.width = (int)(actualheight * aspect_ratio);
|
||||||
@ -1168,7 +1174,7 @@ static void I_InitVideoParms(void)
|
|||||||
int p, tmp_scalefactor;
|
int p, tmp_scalefactor;
|
||||||
|
|
||||||
I_ResetInvalidDisplayIndex();
|
I_ResetInvalidDisplayIndex();
|
||||||
hires = default_hires;
|
resolution_mode = default_resolution_mode;
|
||||||
uncapped = default_uncapped;
|
uncapped = default_uncapped;
|
||||||
grabmouse = default_grabmouse;
|
grabmouse = default_grabmouse;
|
||||||
|
|
||||||
@ -1343,6 +1349,23 @@ static void I_InitGraphicsMode(void)
|
|||||||
SDL_RenderSetIntegerScale(renderer, integer_scaling ? SDL_TRUE : SDL_FALSE);
|
SDL_RenderSetIntegerScale(renderer, integer_scaling ? SDL_TRUE : SDL_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int CurrentResolutionMode(void)
|
||||||
|
{
|
||||||
|
switch (resolution_mode)
|
||||||
|
{
|
||||||
|
case RES_ORIGINAL:
|
||||||
|
return SCREENHEIGHT;
|
||||||
|
case RES_DOUBLE:
|
||||||
|
return SCREENHEIGHT * 2;
|
||||||
|
case RES_TRIPLE:
|
||||||
|
return SCREENHEIGHT * 3;
|
||||||
|
case RES_DRS:
|
||||||
|
return native_height_adjusted;
|
||||||
|
default:
|
||||||
|
return native_height_adjusted;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void CreateSurfaces(void)
|
static void CreateSurfaces(void)
|
||||||
{
|
{
|
||||||
int w, h;
|
int w, h;
|
||||||
@ -1428,9 +1451,9 @@ static void CreateSurfaces(void)
|
|||||||
R_InitAnyRes();
|
R_InitAnyRes();
|
||||||
ST_InitRes();
|
ST_InitRes();
|
||||||
|
|
||||||
if (!hires)
|
if (resolution_mode != RES_DRS)
|
||||||
{
|
{
|
||||||
ResetResolution(SCREENHEIGHT);
|
ResetResolution(CurrentResolutionMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
ResetLogicalSize();
|
ResetLogicalSize();
|
||||||
@ -1470,10 +1493,10 @@ static void I_ReinitGraphicsMode(void)
|
|||||||
|
|
||||||
void I_ResetScreen(void)
|
void I_ResetScreen(void)
|
||||||
{
|
{
|
||||||
hires = default_hires;
|
resolution_mode = default_resolution_mode;
|
||||||
|
|
||||||
ResetResolution(hires ? native_height_adjusted : SCREENHEIGHT);
|
ResetResolution(CurrentResolutionMode());
|
||||||
ResetLogicalSize(); // Switch to new graphics mode
|
ResetLogicalSize();
|
||||||
|
|
||||||
if (automapactive)
|
if (automapactive)
|
||||||
AM_Start(); // Reset automap dimensions
|
AM_Start(); // Reset automap dimensions
|
||||||
|
@ -47,14 +47,23 @@ extern video_t video;
|
|||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
RATIO_ORIG,
|
RATIO_ORIG,
|
||||||
RATIO_MATCH_SCREEN,
|
RATIO_MATCH_SCREEN,
|
||||||
RATIO_16_10,
|
RATIO_16_10,
|
||||||
RATIO_16_9,
|
RATIO_16_9,
|
||||||
RATIO_21_9,
|
RATIO_21_9,
|
||||||
NUM_RATIOS
|
NUM_RATIOS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
RES_ORIGINAL,
|
||||||
|
RES_DOUBLE,
|
||||||
|
RES_TRIPLE,
|
||||||
|
RES_DRS,
|
||||||
|
NUM_RES
|
||||||
|
} resolution_mode_t;
|
||||||
|
|
||||||
// [FG] support more joystick and mouse buttons
|
// [FG] support more joystick and mouse buttons
|
||||||
#define MAX_JSB NUM_CONTROLLER_BUTTONS
|
#define MAX_JSB NUM_CONTROLLER_BUTTONS
|
||||||
#define MAX_MB NUM_MOUSE_BUTTONS
|
#define MAX_MB NUM_MOUSE_BUTTONS
|
||||||
@ -78,7 +87,7 @@ void I_ToggleVsync(void); // [JN] Calls native SDL vsync toggle
|
|||||||
|
|
||||||
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 hires, default_hires; // killough 11/98
|
extern int resolution_mode, default_resolution_mode; // killough 11/98
|
||||||
|
|
||||||
extern boolean use_aspect;
|
extern boolean use_aspect;
|
||||||
extern boolean uncapped, default_uncapped; // [FG] uncapped rendering frame rate
|
extern boolean uncapped, default_uncapped; // [FG] uncapped rendering frame rate
|
||||||
|
@ -3770,6 +3770,10 @@ enum {
|
|||||||
gen2_end1,
|
gen2_end1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const char *resolution_mode_strings[] = {
|
||||||
|
"original", "double", "triple", "high", NULL
|
||||||
|
};
|
||||||
|
|
||||||
int midi_player_menu;
|
int midi_player_menu;
|
||||||
|
|
||||||
static const char *midi_player_menu_strings[MAX_MIDI_PLAYER_MENU_ITEMS];
|
static const char *midi_player_menu_strings[MAX_MIDI_PLAYER_MENU_ITEMS];
|
||||||
@ -3877,8 +3881,8 @@ setup_menu_t gen_settings1[] = { // General Settings screen1
|
|||||||
|
|
||||||
{"Video" ,S_SKIP|S_TITLE, m_null, M_X, M_Y},
|
{"Video" ,S_SKIP|S_TITLE, m_null, M_X, M_Y},
|
||||||
|
|
||||||
{"High Resolution", S_YESNO, m_null, M_X, M_Y+ gen1_hires*M_SPC,
|
{"Resolution Mode", S_CHOICE, m_null, M_X, M_Y+ gen1_hires*M_SPC,
|
||||||
{"hires"}, 0, M_ResetScreen},
|
{"resolution_mode"}, 0, M_ResetScreen, resolution_mode_strings},
|
||||||
|
|
||||||
{"Widescreen Rendering", S_YESNO, m_null, M_X, M_Y+ gen1_widescreen*M_SPC,
|
{"Widescreen Rendering", S_YESNO, m_null, M_X, M_Y+ gen1_widescreen*M_SPC,
|
||||||
{"widescreen"}, 0, M_ResetScreen},
|
{"widescreen"}, 0, M_ResetScreen},
|
||||||
@ -7203,7 +7207,6 @@ void M_ResetSetupMenu(void)
|
|||||||
|
|
||||||
void M_ResetSetupMenuVideo(void)
|
void M_ResetSetupMenuVideo(void)
|
||||||
{
|
{
|
||||||
DISABLE_ITEM(!hires, enem_settings1[enem1_fuzz]);
|
|
||||||
M_EnableDisableFPSLimit();
|
M_EnableDisableFPSLimit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,9 +134,9 @@ default_t defaults[] = {
|
|||||||
//
|
//
|
||||||
|
|
||||||
{ // killough 11/98: hires
|
{ // killough 11/98: hires
|
||||||
"hires", (config_t *) &default_hires, NULL,
|
"resolution_mode", (config_t *) &default_resolution_mode, NULL,
|
||||||
{1}, {0,1}, number, ss_none, wad_no,
|
{RES_DRS}, {RES_ORIGINAL, NUM_RES - 1}, number, ss_none, wad_no,
|
||||||
"1 to enable 640x400 resolution for rendering scenes"
|
"0 - original 200p, 1 - double 400p, 2 - triple 600p, 4 - native (dynamic)"
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -23,9 +23,6 @@
|
|||||||
|
|
||||||
#include "doomstat.h"
|
#include "doomstat.h"
|
||||||
#include "doomtype.h"
|
#include "doomtype.h"
|
||||||
#include "r_draw.h"
|
|
||||||
#include "r_main.h"
|
|
||||||
#include "m_bbox.h"
|
|
||||||
#include "w_wad.h" /* needed for color translation lump lookup */
|
#include "w_wad.h" /* needed for color translation lump lookup */
|
||||||
#include "v_trans.h"
|
#include "v_trans.h"
|
||||||
#include "v_video.h"
|
#include "v_video.h"
|
||||||
@ -285,7 +282,7 @@ void WriteGeneratedLumpWad(const char *filename)
|
|||||||
free(lumps);
|
free(lumps);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define WIDE_SCREENWIDTH 576 // corresponds to 2.4:1 in original resolution
|
#define WIDE_SCREENWIDTH 576 // corresponds to 2.4 aspect ratio
|
||||||
|
|
||||||
static int x1lookup[WIDE_SCREENWIDTH + 1];
|
static int x1lookup[WIDE_SCREENWIDTH + 1];
|
||||||
static int y1lookup[SCREENHEIGHT + 1];
|
static int y1lookup[SCREENHEIGHT + 1];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user