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;
|
||||
|
||||
resolution_mode_t resolution_mode, default_resolution_mode;
|
||||
|
||||
boolean use_vsync; // killough 2/8/98: controls whether vsync is called
|
||||
int hires, default_hires; // killough 11/98
|
||||
boolean use_aspect;
|
||||
boolean uncapped, default_uncapped; // [FG] uncapped rendering frame rate
|
||||
int fpslimit; // when uncapped, limit framerate to this value
|
||||
@ -994,6 +995,11 @@ static void ResetResolution(int height)
|
||||
{
|
||||
int w, h;
|
||||
|
||||
if (height > native_height_adjusted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
actualheight = use_aspect ? (int)(height * 1.2) : height;
|
||||
video.height = height;
|
||||
|
||||
@ -1025,7 +1031,7 @@ static void ResetResolution(int height)
|
||||
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.width = (int)(actualheight * aspect_ratio);
|
||||
@ -1168,7 +1174,7 @@ static void I_InitVideoParms(void)
|
||||
int p, tmp_scalefactor;
|
||||
|
||||
I_ResetInvalidDisplayIndex();
|
||||
hires = default_hires;
|
||||
resolution_mode = default_resolution_mode;
|
||||
uncapped = default_uncapped;
|
||||
grabmouse = default_grabmouse;
|
||||
|
||||
@ -1343,6 +1349,23 @@ static void I_InitGraphicsMode(void)
|
||||
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)
|
||||
{
|
||||
int w, h;
|
||||
@ -1428,9 +1451,9 @@ static void CreateSurfaces(void)
|
||||
R_InitAnyRes();
|
||||
ST_InitRes();
|
||||
|
||||
if (!hires)
|
||||
if (resolution_mode != RES_DRS)
|
||||
{
|
||||
ResetResolution(SCREENHEIGHT);
|
||||
ResetResolution(CurrentResolutionMode());
|
||||
}
|
||||
|
||||
ResetLogicalSize();
|
||||
@ -1470,10 +1493,10 @@ static void I_ReinitGraphicsMode(void)
|
||||
|
||||
void I_ResetScreen(void)
|
||||
{
|
||||
hires = default_hires;
|
||||
resolution_mode = default_resolution_mode;
|
||||
|
||||
ResetResolution(hires ? native_height_adjusted : SCREENHEIGHT);
|
||||
ResetLogicalSize(); // Switch to new graphics mode
|
||||
ResetResolution(CurrentResolutionMode());
|
||||
ResetLogicalSize();
|
||||
|
||||
if (automapactive)
|
||||
AM_Start(); // Reset automap dimensions
|
||||
|
@ -55,6 +55,15 @@ enum
|
||||
NUM_RATIOS
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
RES_ORIGINAL,
|
||||
RES_DOUBLE,
|
||||
RES_TRIPLE,
|
||||
RES_DRS,
|
||||
NUM_RES
|
||||
} resolution_mode_t;
|
||||
|
||||
// [FG] support more joystick and mouse buttons
|
||||
#define MAX_JSB NUM_CONTROLLER_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 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 uncapped, default_uncapped; // [FG] uncapped rendering frame rate
|
||||
|
@ -3770,6 +3770,10 @@ enum {
|
||||
gen2_end1,
|
||||
};
|
||||
|
||||
static const char *resolution_mode_strings[] = {
|
||||
"original", "double", "triple", "high", NULL
|
||||
};
|
||||
|
||||
int midi_player_menu;
|
||||
|
||||
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},
|
||||
|
||||
{"High Resolution", S_YESNO, m_null, M_X, M_Y+ gen1_hires*M_SPC,
|
||||
{"hires"}, 0, M_ResetScreen},
|
||||
{"Resolution Mode", S_CHOICE, m_null, M_X, M_Y+ gen1_hires*M_SPC,
|
||||
{"resolution_mode"}, 0, M_ResetScreen, resolution_mode_strings},
|
||||
|
||||
{"Widescreen Rendering", S_YESNO, m_null, M_X, M_Y+ gen1_widescreen*M_SPC,
|
||||
{"widescreen"}, 0, M_ResetScreen},
|
||||
@ -7203,7 +7207,6 @@ void M_ResetSetupMenu(void)
|
||||
|
||||
void M_ResetSetupMenuVideo(void)
|
||||
{
|
||||
DISABLE_ITEM(!hires, enem_settings1[enem1_fuzz]);
|
||||
M_EnableDisableFPSLimit();
|
||||
}
|
||||
|
||||
|
@ -134,9 +134,9 @@ default_t defaults[] = {
|
||||
//
|
||||
|
||||
{ // killough 11/98: hires
|
||||
"hires", (config_t *) &default_hires, NULL,
|
||||
{1}, {0,1}, number, ss_none, wad_no,
|
||||
"1 to enable 640x400 resolution for rendering scenes"
|
||||
"resolution_mode", (config_t *) &default_resolution_mode, NULL,
|
||||
{RES_DRS}, {RES_ORIGINAL, NUM_RES - 1}, number, ss_none, wad_no,
|
||||
"0 - original 200p, 1 - double 400p, 2 - triple 600p, 4 - native (dynamic)"
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -23,9 +23,6 @@
|
||||
|
||||
#include "doomstat.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 "v_trans.h"
|
||||
#include "v_video.h"
|
||||
@ -285,7 +282,7 @@ void WriteGeneratedLumpWad(const char *filename)
|
||||
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 y1lookup[SCREENHEIGHT + 1];
|
||||
|
Loading…
x
Reference in New Issue
Block a user