Skip to content

Commit

Permalink
Revert "Removed CVAR autofastload", expose it instead as separate Opt…
Browse files Browse the repository at this point in the history
…ion:

Game > Fast loading on/off

This reverts commit a6d37c4.
  • Loading branch information
vsonnier committed Jul 27, 2024
1 parent db6ecf3 commit d5aae5a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
2 changes: 2 additions & 0 deletions Quake/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ cvar_t coop = {"coop", "0", CVAR_NONE}; // 0 or 1
cvar_t pausable = {"pausable", "1", CVAR_NONE};

cvar_t autoload = {"autoload", "1", CVAR_ARCHIVE};
cvar_t autofastload = {"autofastload", "0", CVAR_ARCHIVE};

cvar_t developer = {"developer", "0", CVAR_NONE};

Expand Down Expand Up @@ -363,6 +364,7 @@ void Host_InitLocal (void)
Cvar_RegisterVariable (&pausable);

Cvar_RegisterVariable (&autoload);
Cvar_RegisterVariable (&autofastload);

Cvar_RegisterVariable (&temp1);

Expand Down
3 changes: 2 additions & 1 deletion Quake/host_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

extern cvar_t pausable;
extern cvar_t autoload;
extern cvar_t autofastload;

int current_skill;

Expand Down Expand Up @@ -1306,7 +1307,7 @@ static void Host_Loadgame_f (void)
float spawn_parms[NUM_TOTAL_SPAWN_PARMS];
qboolean was_recording = cls.demorecording;
int old_skill = current_skill;
qboolean fastload = !!strstr (Cmd_Argv (0), "fast") || autoload.value >= 3;
qboolean fastload = !!strstr (Cmd_Argv (0), "fast") || autofastload.value;

if (cmd_source != src_command)
return;
Expand Down
24 changes: 13 additions & 11 deletions Quake/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ extern cvar_t scr_fov;
extern cvar_t scr_showfps;
extern cvar_t scr_style;
extern cvar_t autoload;
extern cvar_t autofastload;
extern cvar_t r_rtshadows;
extern cvar_t r_particles;
extern cvar_t r_md5models;
Expand Down Expand Up @@ -1345,6 +1346,7 @@ enum
GAME_OPT_HUD_DETAIL,
GAME_OPT_HUD_STYLE,
GAME_OPT_CROSSHAIR,
GAME_OPT_FAST_LOADING,
GAME_OPT_AUTOLOAD,
GAME_OPT_STARTUP_DEMOS,
GAME_OPT_SHOWFPS,
Expand Down Expand Up @@ -1443,8 +1445,11 @@ static void M_GameOptions_AdjustSliders (int dir, qboolean mouse)
case GAME_OPT_HUD_STYLE:
Cvar_SetValue ("scr_style", ((int)scr_style.value + 3 + dir) % 3);
break;
case GAME_OPT_AUTOLOAD: // load last save behaviour
Cvar_SetValue ("autoload", ((int)autoload.value + 4 + dir) % 4);
case GAME_OPT_FAST_LOADING: // load last save on death
Cvar_SetValue ("autofastload", ((int)autofastload.value + 2 + dir) % 2);
break;
case GAME_OPT_AUTOLOAD: // load last save on death
Cvar_SetValue ("autoload", ((int)autoload.value + 3 + dir) % 3);
break;
case GAME_OPT_STARTUP_DEMOS:
Cvar_SetValue ("cl_startdemos", ((int)cl_startdemos.value + 2 + dir) % 2);
Expand Down Expand Up @@ -1583,17 +1588,14 @@ static void M_GameOptions_Draw (cb_context_t *cbx)
M_PrintHighlighted (cbx, MENU_VALUE_X + 2, y - 1, ".");
break;

case GAME_OPT_FAST_LOADING:
M_Print (cbx, MENU_LABEL_X, y, "Fast loading");
M_Print (cbx, MENU_VALUE_X, y, (autofastload.value > 0) ? "on" : "off");
break;

case GAME_OPT_AUTOLOAD:
M_Print (cbx, MENU_LABEL_X, y, "Load last save");

if (autoload.value >= 2)
{
M_Print (cbx, MENU_VALUE_X, y, (autoload.value >= 3) ? "Ultra-fast" : "fast");
}
else
{
M_Print (cbx, MENU_VALUE_X, y, autoload.value ? "on" : "off");
}
M_Print (cbx, MENU_VALUE_X, y, (autoload.value >= 2) ? "fast" : (autoload.value ? "on" : "off"));
break;

case GAME_OPT_STARTUP_DEMOS:
Expand Down

0 comments on commit d5aae5a

Please sign in to comment.