- more CVARs.

This commit is contained in:
Christoph Oelckers 2019-10-27 09:53:09 +01:00
parent cdc5044f07
commit 038c1ba4ba
6 changed files with 10 additions and 9 deletions

View file

@ -10,6 +10,7 @@
#include "compat.h"
#include "osd.h"
#include "timer.h"
#include "c_cvars.h"
#ifdef DEBUGGINGAIDS
@ -22,8 +23,7 @@ extern char modechange;
extern char nogl;
extern int32_t swapcomplete;
extern int32_t r_borderless;
extern int32_t r_displayindex;
EXTERN_CVAR(Int, r_borderless);
// video
extern int32_t r_usenewaspect, newaspect_enable;

View file

@ -140,8 +140,8 @@ int32_t r_usenewaspect = 1, newaspect_enable=0;
uint32_t r_screenxy = 0;
int32_t r_fpgrouscan = 1;
int32_t r_displayindex = 0;
int32_t r_borderless = 2;
CVAR(int, r_displayindex, 0, CVAR_ARCHIVE|CVAR_VIDEOCONFIG)
CVAR(Int, r_borderless, 2, CVAR_ARCHIVE | CVAR_VIDEOCONFIG)
int32_t globalflags;
float g_videoGamma = DEFAULT_GAMMA;

View file

@ -1400,7 +1400,7 @@ void C_ArchiveCVars (FConfigFile *f, uint32_t filter)
while (cvar)
{
if ((cvar->Flags &
(CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_AUTO|CVAR_SERVERINFO|CVAR_USERINFO|CVAR_NOSAVE))
(CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_AUTO|CVAR_SERVERINFO|CVAR_USERINFO|CVAR_NOSAVE|CVAR_VIDEOCONFIG))
== filter)
{
cvarlist.Push(cvar);

View file

@ -388,6 +388,11 @@ void FGameConfigFile::ArchiveGameData (const char *gamename)
ClearCurrentSection ();
C_ArchiveCVars (this, CVAR_ARCHIVE);
strncpy(subsection, "VideoSettings", sublen);
SetSection(section, true);
ClearCurrentSection();
C_ArchiveCVars(this, CVAR_ARCHIVE|CVAR_VIDEOCONFIG);
#if 0
// Do not overwrite the serverinfo section if playing a netgame, and
// this machine was not the initial host.

View file

@ -437,7 +437,6 @@ bool G_AllowAutoload()
#if 0
//CONFIG_PutNumber("Screen Setup", "ScreenBPP", ud.setup.bpp);
CONFIG_PutNumber("Screen Setup", "ScreenDisplay", r_displayindex);
CONFIG_PutNumber("Screen Setup", "ScreenHeight", ud.setup.ydim);
CONFIG_PutNumber("Screen Setup", "ScreenMode", ud.setup.fullscreen);
CONFIG_PutNumber("Screen Setup", "ScreenWidth", ud.setup.xdim);
@ -510,8 +509,6 @@ GameConfig->SetValueForKey("Comm Setup", "RTSName", &ud.rtsname[0]);
static osdcvardata_t cvars_engine[] =
{
{ "lz4compressionlevel","adjust LZ4 compression level used for savegames",(void *) &lz4CompressionLevel, CVAR_INT, 1, 32 },
{ "r_borderless", "borderless windowed mode: 0: never 1: always 2: if resolution matches desktop", (void *) &r_borderless, CVAR_INT|CVAR_RESTARTVID, 0, 2 },
{ "r_displayindex","index of output display",(void *)&r_displayindex, CVAR_INT|CVAR_RESTARTVID, 0, 10 },
{ "r_usenewaspect","enable/disable new screen aspect ratio determination code",(void *) &r_usenewaspect, CVAR_BOOL, 0, 1 },
{ "r_screenaspect","if using r_usenewaspect and in fullscreen, screen aspect ratio in the form XXYY, e.g. 1609 for 16:9",
(void *) &r_screenxy, SCREENASPECT_CVAR_TYPE, 0, 9999 },

View file

@ -191,7 +191,6 @@ int CONFIG_ReadSetup(void)
windowy = -1;
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq", (int32_t *)&maxrefreshfreq);
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenDisplay", &r_displayindex);
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenHeight", &ud.setup.ydim);
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenMode", &ud.setup.fullscreen);
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenWidth", &ud.setup.xdim);