- converted noautoload and forcesetup flags to CVARs.

This commit is contained in:
Christoph Oelckers 2019-10-27 09:38:55 +01:00
parent 4b5ec2aabb
commit cdc5044f07
33 changed files with 94 additions and 299 deletions

View file

@ -100,7 +100,6 @@ bool bCustomName = false;
char bAddUserMap = false;
bool bNoDemo = false;
bool bQuickStart = true;
bool bNoAutoLoad = false;
int gMusicPrevLoadedEpisode = -1;
int gMusicPrevLoadedLevel = -1;
@ -1222,8 +1221,9 @@ void ParseOptions(void)
switch (option)
{
case -3:
ThrowError("Invalid argument: %s", OptFull);
fallthrough__;
//ThrowError("Invalid argument: %s", OptFull);
//fallthrough__;
break; // do not error out - this isn't the only code reading the args anymore.
case 29:
#ifdef USE_QHEAP
if (OptArgc < 1)
@ -1412,8 +1412,6 @@ void ParseOptions(void)
//bNoCDAudio = 1;
break;
case 32:
initprintf("Autoload disabled\n");
bNoAutoLoad = true;
break;
case 33:
break;
@ -1542,7 +1540,7 @@ int app_main(int argc, char const * const * argv)
ScanINIFiles();
#ifdef STARTUP_SETUP_WINDOW
if (readSetup < 0 || (!gNoSetup && (configversion != BYTEVERSION || gSetup.forcesetup)) || gCommandSetup)
if (readSetup < 0 || (!gNoSetup && (displaysetup)) || gCommandSetup)
{
if (quitevent || !gi->startwin_run())
{
@ -1552,7 +1550,7 @@ int app_main(int argc, char const * const * argv)
}
#endif
G_LoadGroups(!bNoAutoLoad && !gSetup.noautoload);
G_LoadGroups();
initprintf("Initializing OSD...\n");
@ -2077,7 +2075,7 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass)
else
{
initprintf("Using file \"%s\" as game data.\n", fileName);
if (!bNoAutoLoad && !gSetup.noautoload)
if (G_AllowAutoload())
G_DoAutoload(fileName);
}
}
@ -2109,7 +2107,7 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass)
}
case T_NOAUTOLOAD:
if (firstPass)
bNoAutoLoad = true;
gNoAutoLoad = true;
break;
case T_MUSIC:
{

View file

@ -32,6 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "baselayer.h"
#include "cmdlib.h"
#include "palette.h"
#include "gamecvars.h"
#ifdef _WIN32
# define NEED_SHLWAPI_H
@ -179,7 +180,7 @@ static int32_t G_TryLoadingGrp(char const * const grpfile)
return i;
}
void G_LoadGroups(int32_t autoload)
void G_LoadGroups()
{
if (g_modDir[0] != '/')
{
@ -206,7 +207,7 @@ void G_LoadGroups(int32_t autoload)
const char *grpfile = G_GrpFile();
G_TryLoadingGrp(grpfile);
if (autoload)
if (G_AllowAutoload())
{
G_LoadGroupsInDir("autoload");
@ -248,7 +249,7 @@ void G_LoadGroups(int32_t autoload)
{
g_groupFileHandle = j;
initprintf("Using file \"%s\" as game data.\n", CommandGrps->str);
if (autoload)
if (G_AllowAutoload())
G_DoAutoload(CommandGrps->str);
}

View file

@ -520,7 +520,7 @@ extern void G_ExtInit(void);
void G_LoadGroupsInDir(const char *dirname);
void G_DoAutoload(const char *dirname);
extern void G_LoadGroups(int32_t autoload);
extern void G_LoadGroups();
extern void G_SetupGlobalPsky(void);

View file

@ -58,9 +58,6 @@ BEGIN_BLD_NS
int32_t scripthandle;
int32_t setupread;
int32_t mus_restartonload;
int32_t configversion;
int32_t CheckForUpdates;
int32_t LastUpdateCheck;
char szPlayerName[MAXPLAYERNAME];
int32_t gTurnSpeed;
int32_t gDetail;
@ -134,17 +131,13 @@ void CONFIG_SetDefaults(void)
gSetup.bpp = 8;
#endif
gSetup.forcesetup = 1;
gSetup.noautoload = 1;
gSetup.fullscreen = 1;
//snd_ambience = 1;
//ud.config.AutoAim = 1;
CheckForUpdates = 1;
gBrightness = 8;
//ud.config.ShowWeapons = 0;
configversion = 0;
//ud.crosshair = 1;
//ud.default_skill = 1;
gUpscaleFactor = 0;
@ -241,12 +234,6 @@ int CONFIG_ReadSetup(void)
Bstrncpyz(szPlayerName, tempbuf, sizeof(szPlayerName));
//SCRIPT_GetString(scripthandle, "Comm Setup","RTSName",&ud.rtsname[0]);
SCRIPT_GetNumber(scripthandle, "Setup", "ConfigVersion", &configversion);
SCRIPT_GetNumber(scripthandle, "Setup", "ForceSetup", &gSetup.forcesetup);
SCRIPT_GetNumber(scripthandle, "Setup", "NoAutoLoad", &gSetup.noautoload);
if (gNoSetup == 0 && g_modDir[0] == '/')
{
struct Bstat st;
@ -289,19 +276,6 @@ int CONFIG_ReadSetup(void)
if (gSetup.bpp < 8) gSetup.bpp = 32;
#ifdef POLYMER
int32_t rendmode = 0;
SCRIPT_GetNumber(scripthandle, "Screen Setup", "Polymer", &rendmode);
glrendmode = (rendmode > 0) ? REND_POLYMER : REND_POLYMOST;
#endif
//SCRIPT_GetNumber(scripthandle, "Misc", "Executions", &ud.executions);
#ifdef _WIN32
SCRIPT_GetNumber(scripthandle, "Updates", "CheckForUpdates", &CheckForUpdates);
SCRIPT_GetNumber(scripthandle, "Updates", "LastUpdateCheck", &LastUpdateCheck);
#endif
setupread = 1;
return 0;
}

View file

@ -38,9 +38,6 @@ BEGIN_BLD_NS
extern int32_t scripthandle;
extern int32_t setupread;
extern int32_t configversion;
extern int32_t CheckForUpdates;
extern int32_t LastUpdateCheck;
extern char szPlayerName[MAXPLAYERNAME];
extern int32_t gTurnSpeed;
extern int32_t gDetail;

View file

@ -32,8 +32,6 @@ typedef struct {
int32_t xdim;
int32_t ydim;
int32_t bpp;
int32_t forcesetup;
int32_t noautoload;
} ud_setup_t;
extern ud_setup_t gSetup;

View file

@ -232,10 +232,10 @@ static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
}
return TRUE;
case IDCALWAYSSHOW:
settings.shared.forcesetup = IsDlgButtonChecked(hwndDlg, IDCALWAYSSHOW) == BST_CHECKED;
displaysetup = !!IsDlgButtonChecked(hwndDlg, IDCALWAYSSHOW) == BST_CHECKED;
return TRUE;
case IDCAUTOLOAD:
settings.shared.noautoload = (IsDlgButtonChecked(hwndDlg, IDCAUTOLOAD) != BST_CHECKED);
noautoload = (IsDlgButtonChecked(hwndDlg, IDCAUTOLOAD) != BST_CHECKED);
return TRUE;
case IDCGAMEDIR:

View file

@ -1073,64 +1073,3 @@ void CONFIG_WriteControllerSettings()
}
}
#if 0
// todo
CONFIG_PutNumber("Misc", "Executions", ud.executions);
CONFIG_PutNumber("Setup", "ConfigVersion", BYTEVERSION_EDUKE32);
CONFIG_PutNumber("Setup", "ForceSetup", ud.setup.forcesetup);
CONFIG_PutNumber("Setup", "NoAutoLoad", ud.setup.noautoload);
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);
if (g_grpNamePtr && !g_addonNum)
GameConfig->SetValueForKey("Setup", "SelectedGRP", g_grpNamePtr);
#ifdef STARTUP_SETUP_WINDOW
if (g_noSetup == 0)
GameConfig->SetValueForKey("Setup", "ModDir", &g_modDir[0]);
#endif
// exit early after only updating the values that can be changed from the startup window
if (flags & 1)
{
SCRIPT_Save(g_setupFileName);
SCRIPT_Free(ud.config.scripthandle);
return;
}
CONFIG_PutNumber("Screen Setup", "MaxRefreshFreq", maxrefreshfreq);
CONFIG_PutNumber("Screen Setup", "WindowPosX", windowx);
CONFIG_PutNumber("Screen Setup", "WindowPosY", windowy);
CONFIG_PutNumber("Screen Setup", "WindowPositioning", windowpos);
if (!NAM_WW2GI)
{
CONFIG_PutNumber("Screen Setup", "Out", ud.lockout);
GameConfig->SetValueForKey("Screen Setup", "Password", ud.pwlockout);
}
#ifdef _WIN32
CONFIG_PutNumber("Updates", "CheckForUpdates", ud.config.CheckForUpdates);
CONFIG_PutNumber("Updates", "LastUpdateCheck", ud.config.LastUpdateCheck);
#endif
GameConfig->SetValueForKey("Comm Setup", "PlayerName", &szPlayerName[0]);
GameConfig->SetValueForKey("Comm Setup", "RTSName", &ud.rtsname[0]);
SCRIPT_Save(g_setupFileName);
if ((flags & 2) == 0)
SCRIPT_Free(ud.config.scripthandle);
OSD_Printf("Wrote %s\n", g_setupFileName);
CONFIG_WriteSettings();
Bfflush(NULL);
#endif

View file

@ -43,6 +43,7 @@
#include "control.h"
#include "_control.h"
#include "gamecontrol.h"
#include "m_argv.h"
/* Notes
@ -418,6 +419,51 @@ CUSTOM_CVARD(String, wchoice, "3457860291", CVAR_ARCHIVE | CVAR_NOINITCALL | CVA
CVARD(Bool, r_voxels, true, CVAR_ARCHIVE, "enable/disable automatic sprite->voxel rendering")
//==========================================================================
//
// Global setup that formerly wasn't CVARs but merely global stuff saved in the config.
//
//==========================================================================
CVAR(Bool, displaysetup, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
bool gNoAutoLoad; // for overrides from the def files
CVAR(Bool, noautoload, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
bool G_AllowAutoload()
{
if (noautoload || gNoAutoLoad || Args->CheckParm("-noautoload")) return false;
return true;
}
#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);
//GameConfig->SetValueForKey("Setup", "SelectedGRP", g_grpNamePtr);
//GameConfig->SetValueForKey("Setup", "ModDir", &g_modDir[0]);
CONFIG_PutNumber("Screen Setup", "MaxRefreshFreq", maxrefreshfreq);
CONFIG_PutNumber("Screen Setup", "WindowPosX", windowx);
CONFIG_PutNumber("Screen Setup", "WindowPosY", windowy);
CONFIG_PutNumber("Screen Setup", "WindowPositioning", windowpos);
if (!NAM_WW2GI)
{
CONFIG_PutNumber("Screen Setup", "Out", ud.lockout);
GameConfig->SetValueForKey("Screen Setup", "Password", ud.pwlockout);
}
GameConfig->SetValueForKey("Comm Setup", "PlayerName", &szPlayerName[0]);
GameConfig->SetValueForKey("Comm Setup", "RTSName", &ud.rtsname[0]);
#endif
#if 0
// These have to wait until the HUD code is cleaned up (no idea which may survive and which won't.)

View file

@ -94,8 +94,13 @@ extern int32_t g_MyAimMode;
EXTERN_CVAR(Bool, in_mousemode)
EXTERN_CVAR(String, wchoice)
EXTERN_CVAR(Bool, displaysetup)
EXTERN_CVAR(Bool, noautoload)
extern bool gNoAutoLoad;
extern float r_ambientlightrecip;
extern int hud_statusbarrange; // will be set by the game's configuration setup.
bool G_ChangeHudLayout(int direction);
bool G_CheckAutorun(bool button);
int G_FPSLimit(void);
bool G_AllowAutoload();

View file

@ -32,7 +32,6 @@ BEGIN_DUKE_NS
int32_t g_commandSetup = 0;
int32_t g_noSetup = 0;
int32_t g_noAutoLoad = 0;
int32_t g_noSound = 0;
int32_t g_noMusic = 0;
const char *CommandMap = NULL;
@ -310,13 +309,6 @@ void G_CheckCommandLine(int32_t argc, char const * const * argv)
continue;
}
#endif
if (!Bstrcasecmp(c+1, "noautoload"))
{
initprintf("Autoload disabled\n");
g_noAutoLoad = 1;
i++;
continue;
}
#ifndef NETCODE_DISABLE
if (!Bstrcasecmp(c+1, "net"))
{

View file

@ -34,7 +34,6 @@ extern void G_ShowDebugHelp(void);
extern int32_t g_commandSetup;
extern int32_t g_noSetup;
extern int32_t g_noAutoLoad;
extern int32_t g_noSound;
extern int32_t g_noMusic;
extern const char *CommandMap;

View file

@ -381,7 +381,7 @@ static int32_t G_LoadGrpDependencyChain(grpfile_t const * const grp)
return i;
}
void G_LoadGroups(int32_t autoload)
void G_LoadGroups()
{
if (g_modDir[0] != '/')
{
@ -439,7 +439,7 @@ void G_LoadGroups(int32_t autoload)
i = G_TryLoadingGrp(grpfile);
}
if (autoload)
if (G_AllowAutoload())
{
G_LoadGroupsInDir("autoload");
@ -482,7 +482,7 @@ void G_LoadGroups(int32_t autoload)
{
g_groupFileHandle = j;
initprintf("Using file \"%s\" as game data.\n", CommandGrps->str);
if (autoload)
if (G_AllowAutoload())
G_DoAutoload(CommandGrps->str);
}

View file

@ -121,7 +121,7 @@ extern void G_CleanupSearchPaths(void);
extern void G_ExtInit(void);
extern void G_ScanGroups(void);
extern void G_LoadGroups(int32_t autoload);
extern void G_LoadGroups();
extern const char * G_GetInstallPath(int32_t insttype);

View file

@ -75,8 +75,6 @@ void CONFIG_SetDefaults(void)
g_player[0].ps->aim_mode = 1;
ud.setup.forcesetup = 1;
ud.setup.noautoload = 1;
ud.setup.fullscreen = 1;
ud.althud = 1;
@ -84,9 +82,7 @@ void CONFIG_SetDefaults(void)
ud.brightness = 8;
ud.camerasprite = -1;
ud.color = 0;
ud.config.CheckForUpdates = 1;
ud.config.ShowWeapons = 0;
ud.configversion = 0;
ud.default_skill = 1;
ud.detail = 0;
ud.display_bonus_screen = 1;
@ -167,10 +163,6 @@ int CONFIG_ReadSetup(void)
SCRIPT_GetString(ud.config.scripthandle, "Comm Setup","RTSName",&ud.rtsname[0]);
SCRIPT_GetNumber(ud.config.scripthandle, "Setup", "ConfigVersion", &ud.configversion);
SCRIPT_GetNumber(ud.config.scripthandle, "Setup", "ForceSetup", &ud.setup.forcesetup);
SCRIPT_GetNumber(ud.config.scripthandle, "Setup", "NoAutoLoad", &ud.setup.noautoload);
if (g_noSetup == 0 && g_modDir[0] == '/')
{
SCRIPT_GetString(ud.config.scripthandle, "Setup","ModDir",&g_modDir[0]);
@ -209,19 +201,6 @@ int CONFIG_ReadSetup(void)
if (ud.setup.bpp < 8) ud.setup.bpp = 32;
#ifdef POLYMER
int32_t rendmode = 0;
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Polymer", &rendmode);
glrendmode = (rendmode > 0) ? REND_POLYMER : REND_POLYMOST;
#endif
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "Executions", &ud.executions);
#ifdef _WIN32
SCRIPT_GetNumber(ud.config.scripthandle, "Updates", "CheckForUpdates", &ud.config.CheckForUpdates);
SCRIPT_GetNumber(ud.config.scripthandle, "Updates", "LastUpdateCheck", &ud.config.LastUpdateCheck);
#endif
ud.config.setupread = 1;
return 0;
}

View file

@ -5340,7 +5340,7 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass)
else
{
initprintf("Using file \"%s\" as game data.\n", fileName);
if (!g_noAutoLoad && !ud.setup.noautoload)
if (G_AllowAutoload())
G_DoAutoload(fileName);
}
}
@ -5372,7 +5372,7 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass)
}
case T_NOAUTOLOAD:
if (firstPass)
g_noAutoLoad = 1;
gNoAutoLoad = 1;
break;
case T_MUSIC:
{
@ -6354,7 +6354,7 @@ int app_main(int argc, const char * const*argv)
G_ScanGroups();
#ifdef STARTUP_SETUP_WINDOW
if (readSetup < 0 || (!g_noSetup && (ud.configversion != BYTEVERSION_EDUKE32 || ud.setup.forcesetup)) || g_commandSetup)
if (readSetup < 0 || (!g_noSetup && (displaysetup)) || g_commandSetup)
{
if (quitevent || !gi->startwin_run())
{
@ -6365,7 +6365,7 @@ int app_main(int argc, const char * const*argv)
#endif
g_logFlushWindow = 0;
G_LoadGroups(!g_noAutoLoad && !ud.setup.noautoload);
G_LoadGroups();
// flushlogwindow = 1;
G_CleanupSearchPaths();
@ -6487,10 +6487,6 @@ int app_main(int argc, const char * const*argv)
g_mostConcurrentPlayers = ud.multimode; // XXX: redundant?
++ud.executions;
//CONFIG_WriteSetup(1);
//CONFIG_ReadSetup();
char const * rtsname = g_rtsNamePtr ? g_rtsNamePtr : ud.rtsname;
RTS_Init(rtsname);

View file

@ -161,8 +161,6 @@ typedef struct {
int32_t xdim;
int32_t ydim;
int32_t bpp;
int32_t forcesetup;
int32_t noautoload;
} ud_setup_t;
typedef struct {
@ -181,7 +179,7 @@ typedef struct {
int32_t menu_slidebarz, menu_slidebarmargin, menu_slidecursorz;
int32_t menu_scrollbartilenum, menu_scrollbarz, menu_scrollcursorz;
int32_t entered_name,screen_tilting,fta_on,executions;
int32_t entered_name,screen_tilting,fta_on;
int32_t m_coop,coop,screen_size,lockout;
int32_t playerai,angleinterpolation;
@ -193,8 +191,6 @@ typedef struct {
int32_t playerbest;
int32_t configversion;
int32_t default_volume, default_skill;
int32_t returnvar[MAX_RETURN_VALUES-1];
@ -234,8 +230,6 @@ typedef struct {
int32_t scripthandle;
int32_t setupread;
int32_t CheckForUpdates;
int32_t LastUpdateCheck;
} config;
ud_setup_t setup;

View file

@ -1410,7 +1410,7 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int const lParm2)
case USERDEFS_SCREEN_TILTING: labelNum = ud.screen_tilting; break;
case USERDEFS_SHADOWS: labelNum = r_shadows; break;
case USERDEFS_FTA_ON: labelNum = ud.fta_on; break;
case USERDEFS_EXECUTIONS: labelNum = ud.executions; break;
case USERDEFS_EXECUTIONS: labelNum = 1; break;
case USERDEFS_AUTO_RUN: labelNum = cl_autorun; break;
case USERDEFS_COORDS: labelNum = cl_showcoords; break;
case USERDEFS_TICKRATE: labelNum = r_showfps; break;
@ -1598,7 +1598,7 @@ void __fastcall VM_SetUserdef(int const labelNum, int const lParm2, int32_t cons
case USERDEFS_SCREEN_TILTING: ud.screen_tilting = iSet; break;
case USERDEFS_SHADOWS: r_shadows.SetGenericRepDefault(iSet, CVAR_Int); break;
case USERDEFS_FTA_ON: ud.fta_on = iSet; break;
case USERDEFS_EXECUTIONS: ud.executions = iSet; break;
case USERDEFS_EXECUTIONS: break; // what was this supposed to accomplish?
case USERDEFS_AUTO_RUN: cl_autorun.SetGenericRepDefault(iSet, CVAR_Int); break;
case USERDEFS_COORDS: cl_showcoords.SetGenericRepDefault(iSet, CVAR_Int); break;
case USERDEFS_TICKRATE: r_showfps = iSet; break;

View file

@ -386,25 +386,9 @@ static MenuEntry_t ME_SKILL_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_C
static MenuEntry_t ME_SKILL[MAXSKILLS];
static MenuEntry_t *MEL_SKILL[MAXSKILLS];
#ifdef EDUKE32_SIMPLE_MENU
static MenuLink_t MEO_GAMESETUP_SAVESETUP = { MENU_SAVESETUP, MA_Advance, };
static MenuEntry_t ME_GAMESETUP_SAVESETUP = MAKE_MENUENTRY( "Save setup", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_SAVESETUP, Link );
#endif
#if defined STARTUP_SETUP_WINDOW && !defined EDUKE32_SIMPLE_MENU
static MenuOption_t MEO_GAMESETUP_STARTWIN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.setup.forcesetup );
static MenuEntry_t ME_GAMESETUP_STARTWIN = MAKE_MENUENTRY( "Startup window:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_STARTWIN, Option );
#endif
static char const *MEOSN_GAMESETUP_AIM_AUTO[] = { "Never", "Always", "Hitscan only",
#ifdef EDUKE32_ANDROID_MENU
"Extra wide"
#endif
};
static int32_t MEOSV_GAMESETUP_AIM_AUTO[] = { 0, 1, 2,
#ifdef EDUKE32_ANDROID_MENU
3,
#endif
};
static MenuOptionSet_t MEOS_GAMESETUP_AIM_AUTO = MAKE_MENUOPTIONSET( MEOSN_GAMESETUP_AIM_AUTO, MEOSV_GAMESETUP_AIM_AUTO, 0x2 );
@ -424,24 +408,11 @@ static MenuOptionSet_t MEOS_DemoRec = MAKE_MENUOPTIONSET( MEOSN_DemoRec, NULL, 0
static MenuOption_t MEO_GAMESETUP_DEMOREC = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.m_recstat );
static MenuEntry_t ME_GAMESETUP_DEMOREC = MAKE_MENUENTRY( "Record demo:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_DEMOREC, Option );
#ifdef _WIN32
static MenuOption_t MEO_GAMESETUP_UPDATES = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.config.CheckForUpdates );
static MenuEntry_t ME_GAMESETUP_UPDATES = MAKE_MENUENTRY( "Online updates:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_UPDATES, Option );
#endif
static MenuOption_t MEO_ADULTMODE = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.lockout);
static MenuEntry_t ME_ADULTMODE = MAKE_MENUENTRY( "Parental lock:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_ADULTMODE, Option );
// static MenuLink_t MEO_ADULTMODE_PASSWORD = { MENU_ADULTPASSWORD, MA_None, };
// static MenuEntry_t ME_ADULTMODE_PASSWORD = MAKE_MENUENTRY( "Enter Password", &MF_Redfont, &, &MEO_ADULTMODE_PASSWORD, Link );
#ifdef EDUKE32_ANDROID_MENU
static MenuOption_t MEO_GAMESETUP_CROUCHLOCK = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &droidinput.toggleCrouch);
static MenuEntry_t ME_GAMESETUP_CROUCHLOCK = MAKE_MENUENTRY("Crouch lock:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_CROUCHLOCK, Option);
static MenuOption_t MEO_GAMESETUP_QUICKSWITCH = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &droidinput.quickSelectWeapon);
static MenuEntry_t ME_GAMESETUP_QUICKSWITCH = MAKE_MENUENTRY("Quick weapon switch:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_QUICKSWITCH, Option);
#endif
#if defined(EDUKE32_ANDROID_MENU) || !defined(EDUKE32_SIMPLE_MENU)
static MenuLink_t MEO_GAMESETUP_CHEATS = { MENU_CHEATS, MA_Advance, };
static MenuEntry_t ME_GAMESETUP_CHEATS = MAKE_MENUENTRY( "Cheats", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_CHEATS, Link );
@ -453,9 +424,6 @@ static MenuEntry_t *MEL_GAMESETUP[] = {
#endif
#ifndef EDUKE32_ANDROID_MENU
&ME_GAMESETUP_DEMOREC,
#ifdef _WIN32
&ME_GAMESETUP_UPDATES,
#endif
#endif
&ME_GAMESETUP_CHEATS,
};
@ -3284,10 +3252,6 @@ static int32_t Menu_EntryOptionModify(MenuEntry_t *entry, int32_t newOption)
if ((ps->gm&MODE_GAME))
G_CloseDemoWrite();
}
#ifdef _WIN32
else if (entry == &ME_GAMESETUP_UPDATES)
ud.config.LastUpdateCheck = 0;
#endif
else if (entry == &ME_GAMESETUP_WEAPSWITCH_PICKUP)
{
ud.weaponswitch = ud.weaponswitch & ~(1|4);

View file

@ -48,6 +48,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "keyboard.h"
#include "startwin.game.h"
#include "windows_inc.h"
#include "gamecvars.h"
#pragma warning(disable:4244) // There's just a bit too much of these in here...
@ -225,10 +226,10 @@ static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
}
return TRUE;
case IDCALWAYSSHOW:
settings.shared.forcesetup = IsDlgButtonChecked(hwndDlg, IDCALWAYSSHOW) == BST_CHECKED;
displaysetup = IsDlgButtonChecked(hwndDlg, IDCALWAYSSHOW) == BST_CHECKED;
return TRUE;
case IDCAUTOLOAD:
settings.shared.noautoload = (IsDlgButtonChecked(hwndDlg, IDCAUTOLOAD) != BST_CHECKED);
noautoload = (IsDlgButtonChecked(hwndDlg, IDCAUTOLOAD) != BST_CHECKED);
return TRUE;
case IDCGAMEDIR:
if (HIWORD(wParam) == CBN_SELCHANGE)

View file

@ -32,7 +32,6 @@ BEGIN_RR_NS
int32_t g_commandSetup = 0;
int32_t g_noSetup = 0;
int32_t g_noAutoLoad = 0;
int32_t g_noSound = 0;
int32_t g_noMusic = 0;
const char *CommandMap = NULL;
@ -285,22 +284,6 @@ void G_CheckCommandLine(int32_t argc, char const * const * argv)
i++;
continue;
}
#if defined RENDERTYPEWIN
if (!Bstrcasecmp(c+1, "nodinput"))
{
initprintf("DirectInput (joystick) support disabled\n");
di_disabled = 1;
i++;
continue;
}
#endif
if (!Bstrcasecmp(c+1, "noautoload"))
{
initprintf("Autoload disabled\n");
g_noAutoLoad = 1;
i++;
continue;
}
#ifndef NETCODE_DISABLE
if (!Bstrcasecmp(c+1, "net"))
{

View file

@ -33,7 +33,6 @@ extern void G_ShowDebugHelp(void);
extern int32_t g_commandSetup;
extern int32_t g_noSetup;
extern int32_t g_noAutoLoad;
extern int32_t g_noSound;
extern int32_t g_noMusic;
extern const char *CommandMap;

View file

@ -9,6 +9,7 @@
#include "palette.h"
#include "cmdlib.h"
#include "grpscan.h"
#include "gamecvars.h"
#ifdef _WIN32
# define NEED_SHLWAPI_H
@ -338,7 +339,7 @@ static int32_t G_LoadGrpDependencyChain(grpfile_t const * const grp)
return i;
}
void G_LoadGroups(int32_t autoload)
void G_LoadGroups()
{
if (g_modDir[0] != '/')
{
@ -396,7 +397,7 @@ void G_LoadGroups(int32_t autoload)
i = G_TryLoadingGrp(grpfile);
}
if (autoload)
if (G_AllowAutoload())
{
G_LoadGroupsInDir("autoload");
@ -437,7 +438,7 @@ void G_LoadGroups(int32_t autoload)
{
g_groupFileHandle = j;
initprintf("Using file \"%s\" as game data.\n", CommandGrps->str);
if (autoload)
if (G_AllowAutoload())
G_DoAutoload(CommandGrps->str);
}

View file

@ -129,7 +129,7 @@ extern void G_CleanupSearchPaths(void);
extern void G_ExtInit(void);
extern void G_ScanGroups(void);
extern void G_LoadGroups(int32_t autoload);
extern void G_LoadGroups();
extern const char * G_GetInstallPath(int32_t insttype);

View file

@ -99,13 +99,10 @@ void CONFIG_SetDefaults(void)
ud.team = 0;
ud.angleinterpolation = 0;
ud.setup.forcesetup = 1;
ud.setup.noautoload = 1;
ud.setup.fullscreen = 1;
ud.display_bonus_screen = 1;
ud.show_level_text = 1;
ud.configversion = 0;
ud.screenfade = 1;
ud.menubackground = 1;
ud.default_skill = 1;
@ -115,8 +112,6 @@ void CONFIG_SetDefaults(void)
ud.menu_scrollbarz = 65536;
ud.menu_scrollcursorz = 65536;
ud.config.CheckForUpdates = 1;
Bstrcpy(ud.rtsname, G_DefaultRtsFile());
Bstrcpy(szPlayerName, "Player");
@ -172,10 +167,6 @@ int32_t CONFIG_ReadSetup(void)
SCRIPT_GetString(ud.config.scripthandle, "Comm Setup","RTSName",&ud.rtsname[0]);
SCRIPT_GetNumber(ud.config.scripthandle, "Setup", "ConfigVersion", &ud.configversion);
SCRIPT_GetNumber(ud.config.scripthandle, "Setup", "ForceSetup", &ud.setup.forcesetup);
SCRIPT_GetNumber(ud.config.scripthandle, "Setup", "NoAutoLoad", &ud.setup.noautoload);
if (g_noSetup == 0 && g_modDir[0] == '/')
{
SCRIPT_GetString(ud.config.scripthandle, "Setup","ModDir",&g_modDir[0]);
@ -210,19 +201,6 @@ int32_t CONFIG_ReadSetup(void)
if (ud.setup.bpp < 8) ud.setup.bpp = 32;
#ifdef POLYMER
int32_t rendmode = 0;
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Polymer", &rendmode);
glrendmode = (rendmode > 0) ? REND_POLYMER : REND_POLYMOST;
#endif
SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "Executions", &ud.executions);
#ifdef _WIN32
SCRIPT_GetNumber(ud.config.scripthandle, "Updates", "CheckForUpdates", &ud.config.CheckForUpdates);
SCRIPT_GetNumber(ud.config.scripthandle, "Updates", "LastUpdateCheck", &ud.config.LastUpdateCheck);
#endif
ud.config.setupread = 1;
return 0;
}

View file

@ -6825,7 +6825,7 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass)
else
{
initprintf("Using file \"%s\" as game data.\n", fileName);
if (!g_noAutoLoad && !ud.setup.noautoload)
if (G_AllowAutoload())
G_DoAutoload(fileName);
}
}
@ -6857,7 +6857,7 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass)
}
case T_NOAUTOLOAD:
if (firstPass)
g_noAutoLoad = 1;
gNoAutoLoad = 1;
break;
case T_MUSIC:
{
@ -7479,11 +7479,6 @@ static void G_Startup(void)
}
}
if (VOLUMEONE)
{
initprintf("*** You have run Duke Nukem 3D %d times. ***\n\n",ud.executions);
}
for (i=0; i<MAXPLAYERS; i++)
g_player[i].playerreadyflag = 0;
@ -7728,7 +7723,7 @@ int app_main(int argc, char const * const * argv)
G_ScanGroups();
#ifdef STARTUP_SETUP_WINDOW
if (readSetup < 0 || (!g_noSetup && (ud.configversion != BYTEVERSION_EDUKE32 || ud.setup.forcesetup)) || g_commandSetup)
if (readSetup < 0 || (!g_noSetup && (displaysetup)) || g_commandSetup)
{
if (quitevent || !gi->startwin_run())
{
@ -7739,7 +7734,7 @@ int app_main(int argc, char const * const * argv)
#endif
g_logFlushWindow = 0;
G_LoadGroups(!g_noAutoLoad && !ud.setup.noautoload);
G_LoadGroups();
// flushlogwindow = 1;
G_CleanupSearchPaths();
@ -7868,10 +7863,6 @@ int app_main(int argc, char const * const * argv)
g_mostConcurrentPlayers = ud.multimode; // XXX: redundant?
++ud.executions;
//CONFIG_WriteSetup(1);
//CONFIG_ReadSetup();
char const * rtsname = g_rtsNamePtr ? g_rtsNamePtr : ud.rtsname;
RTS_Init(rtsname);

View file

@ -142,8 +142,6 @@ typedef struct {
int32_t xdim;
int32_t ydim;
int32_t bpp;
int32_t forcesetup;
int32_t noautoload;
} ud_setup_t;
typedef struct {
@ -160,7 +158,7 @@ typedef struct {
int32_t menu_slidebarz, menu_slidebarmargin, menu_slidecursorz;
int32_t menu_scrollbartilenum, menu_scrollbarz, menu_scrollcursorz;
int32_t entered_name,screen_tilting,fta_on,executions;
int32_t entered_name,screen_tilting,fta_on;
int32_t m_coop,coop,screen_size,lockout,crosshair;
int32_t playerai,angleinterpolation;
@ -172,8 +170,6 @@ typedef struct {
int32_t playerbest;
int32_t configversion;
int32_t default_volume, default_skill;
//int32_t returnvar[MAX_RETURN_VALUES-1];
@ -194,9 +190,6 @@ typedef struct {
int32_t scripthandle;
int32_t setupread;
int32_t CheckForUpdates;
int32_t LastUpdateCheck;
} config;
ud_setup_t setup;

View file

@ -374,25 +374,9 @@ static MenuEntry_t ME_SKILL_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_C
static MenuEntry_t ME_SKILL[MAXSKILLS];
static MenuEntry_t *MEL_SKILL[MAXSKILLS];
#ifdef EDUKE32_SIMPLE_MENU
static MenuLink_t MEO_GAMESETUP_SAVESETUP = { MENU_SAVESETUP, MA_Advance, };
static MenuEntry_t ME_GAMESETUP_SAVESETUP = MAKE_MENUENTRY( "Save setup", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_SAVESETUP, Link );
#endif
#if defined STARTUP_SETUP_WINDOW && !defined EDUKE32_SIMPLE_MENU
static MenuOption_t MEO_GAMESETUP_STARTWIN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.setup.forcesetup );
static MenuEntry_t ME_GAMESETUP_STARTWIN = MAKE_MENUENTRY( "Startup window:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_STARTWIN, Option );
#endif
static char const *MEOSN_GAMESETUP_AIM_AUTO[] = { "Never", "Always", "Hitscan only",
#ifdef EDUKE32_ANDROID_MENU
"Extra wide"
#endif
};
static int32_t MEOSV_GAMESETUP_AIM_AUTO[] = { 0, 1, 2,
#ifdef EDUKE32_ANDROID_MENU
3,
#endif
};
static MenuOptionSet_t MEOS_GAMESETUP_AIM_AUTO = MAKE_MENUOPTIONSET( MEOSN_GAMESETUP_AIM_AUTO, MEOSV_GAMESETUP_AIM_AUTO, 0x2 );
@ -409,11 +393,6 @@ static MenuOptionSet_t MEOS_DemoRec = MAKE_MENUOPTIONSET( MEOSN_DemoRec, NULL, 0
static MenuOption_t MEO_GAMESETUP_DEMOREC = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.m_recstat );
static MenuEntry_t ME_GAMESETUP_DEMOREC = MAKE_MENUENTRY( "Record demo:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_DEMOREC, Option );
#ifdef _WIN32
static MenuOption_t MEO_GAMESETUP_UPDATES = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.config.CheckForUpdates );
static MenuEntry_t ME_GAMESETUP_UPDATES = MAKE_MENUENTRY( "Online updates:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_UPDATES, Option );
#endif
static MenuOption_t MEO_ADULTMODE = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.lockout);
static MenuEntry_t ME_ADULTMODE = MAKE_MENUENTRY( "Parental lock:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_ADULTMODE, Option );
// static MenuLink_t MEO_ADULTMODE_PASSWORD = { MENU_ADULTPASSWORD, MA_None, };
@ -443,9 +422,6 @@ static MenuEntry_t *MEL_GAMESETUP[] = {
&ME_GAMESETUP_CROUCHLOCK,
#else
&ME_GAMESETUP_DEMOREC,
#ifdef _WIN32
//&ME_GAMESETUP_UPDATES,
#endif
#endif
&ME_GAMESETUP_CHEATS,
};
@ -3673,10 +3649,6 @@ static int32_t Menu_EntryOptionModify(MenuEntry_t *entry, int32_t newOption)
if ((ps->gm&MODE_GAME))
G_CloseDemoWrite();
}
#ifdef _WIN32
else if (entry == &ME_GAMESETUP_UPDATES)
ud.config.LastUpdateCheck = 0;
#endif
else if (entry == &ME_GAMESETUP_WEAPSWITCH_PICKUP)
{
ud.weaponswitch = ud.weaponswitch & ~(1|4);

View file

@ -223,10 +223,10 @@ static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
}
return TRUE;
case IDCALWAYSSHOW:
settings.shared.forcesetup = IsDlgButtonChecked(hwndDlg, IDCALWAYSSHOW) == BST_CHECKED;
displaysetup = IsDlgButtonChecked(hwndDlg, IDCALWAYSSHOW) == BST_CHECKED;
return TRUE;
case IDCAUTOLOAD:
settings.shared.noautoload = (IsDlgButtonChecked(hwndDlg, IDCAUTOLOAD) != BST_CHECKED);
noautoload = (IsDlgButtonChecked(hwndDlg, IDCAUTOLOAD) != BST_CHECKED);
return TRUE;
case IDCINPUT:
return TRUE;

View file

@ -79,7 +79,6 @@ int32_t ScreenMode = 1;
int32_t ScreenWidth = 640;
int32_t ScreenHeight = 480;
int32_t ScreenBPP = 8;
int32_t ForceSetup = 1;
char RTSName[MAXRTSNAMELENGTH];
static int32_t scripthandle = -1;

View file

@ -44,7 +44,6 @@ extern int32_t ScreenHeight;
extern int32_t ScreenBPP;
extern int32_t ScreenBufferMode;
extern int32_t VesaBufferMode;
extern int32_t ForceSetup;
#if 0

View file

@ -3558,7 +3558,7 @@ int32_t app_main(int32_t argc, char const * const * argv)
i = CONFIG_ReadSetup();
#if defined RENDERTYPEWIN || (defined RENDERTYPESDL && (defined __APPLE__ || defined HAVE_GTK2))
if (i < 0 || ForceSetup || CommandSetup)
if (i < 0 || displaysetup || CommandSetup)
{
if (quitevent || !startwin_run())
{

View file

@ -32,7 +32,6 @@ static struct
{
int fullscreen;
int xdim, ydim, bpp;
int forcesetup;
int usemouse, usejoy;
char selectedgrp[BMAX_PATH+1];
int samplerate, bitspersample, channels;
@ -119,7 +118,7 @@ static void PopulateForm(int pgs)
{
int curidx = -1;
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCALWAYSSHOW), (settings.forcesetup ? BST_CHECKED : BST_UNCHECKED));
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCALWAYSSHOW), (displaysetup ? BST_CHECKED : BST_UNCHECKED));
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCINPUTMOUSE), (settings.usemouse ? BST_CHECKED : BST_UNCHECKED));
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCINPUTJOY), (settings.usejoy ? BST_CHECKED : BST_UNCHECKED));
@ -216,7 +215,7 @@ static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
}
return TRUE;
case IDCALWAYSSHOW:
settings.forcesetup = IsDlgButtonChecked(hwndDlg, IDCALWAYSSHOW) == BST_CHECKED;
displaysetup = IsDlgButtonChecked(hwndDlg, IDCALWAYSSHOW) == BST_CHECKED;
return TRUE;
case IDCINPUTMOUSE:
settings.usemouse = IsDlgButtonChecked(hwndDlg, IDCINPUTMOUSE) == BST_CHECKED;
@ -634,7 +633,6 @@ int startwin_run(void)
settings.samplerate = snd_mixrate;
settings.bitspersample = 16;
settings.channels = snd_numchannels;
settings.forcesetup = ForceSetup;
settings.usemouse = UseMouse;
settings.usejoy = UseJoystick;
Bstrncpyz(settings.selectedgrp, G_GrpFile(), BMAX_PATH);
@ -662,7 +660,6 @@ int startwin_run(void)
ScreenWidth = settings.xdim;
ScreenHeight = settings.ydim;
ScreenBPP = settings.bpp;
ForceSetup = settings.forcesetup;
UseMouse = settings.usemouse;
UseJoystick = settings.usejoy;
clearGrpNamePtr();