Skip to content

Commit 36592d4

Browse files
committed
Added Quit Prompt option, removed -fitz option (from Ironwail)
1 parent e2cfde3 commit 36592d4

7 files changed

Lines changed: 34 additions & 24 deletions

File tree

Quake/cl_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ cvar_t cl_maxpitch = {"cl_maxpitch", "90", CVAR_ARCHIVE}; // johnfitz -- variab
5151
cvar_t cl_minpitch = {"cl_minpitch", "-90", CVAR_ARCHIVE}; // johnfitz -- variable pitch clamping
5252

5353
cvar_t cl_startdemos = {"cl_startdemos", "1", CVAR_ARCHIVE};
54+
cvar_t cl_confirmquit = {"cl_confirmquit", "0", CVAR_ARCHIVE};
5455

5556
client_static_t cls;
5657
client_state_t cl;
@@ -1399,6 +1400,7 @@ void CL_Init (void)
13991400
Cvar_RegisterVariable (&cl_minpitch); // johnfitz -- variable pitch clamping
14001401

14011402
Cvar_RegisterVariable (&cl_startdemos);
1403+
Cvar_RegisterVariable (&cl_confirmquit);
14021404

14031405
Cmd_AddCommand ("entities", CL_PrintEntities_f);
14041406
Cmd_AddCommand ("disconnect", CL_Disconnect_f);

Quake/common.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ cvar_t cmdline = {"cmdline", "", CVAR_ROM /*|CVAR_SERVERINFO*/}; /* sending cmdl
4949

5050
static qboolean com_modified; // set true if using non-id files
5151

52-
qboolean fitzmode;
5352
qboolean multiuser;
5453

5554
static void COM_Path_f (void);
@@ -1938,9 +1937,6 @@ void COM_Init (void)
19381937
if (bytes[0] != 0x78 || bytes[1] != 0x56 || bytes[2] != 0x34 || bytes[3] != 0x12)
19391938
Sys_Error ("Unsupported endianism. Only little endian is supported");
19401939

1941-
if (COM_CheckParm ("-fitz"))
1942-
fitzmode = true;
1943-
19441940
if (COM_CheckParm ("-validation"))
19451941
vulkan_globals.validation = true;
19461942

@@ -2587,7 +2583,7 @@ static void COM_AddGameDirectoryRoot (const char *base, const char *dir, unsigne
25872583
com_searchpaths = search;
25882584
}
25892585

2590-
if ((i == 0) && (path_id == 1) && add_embedded && !fitzmode)
2586+
if ((i == 0) && (path_id == 1) && add_embedded)
25912587
{
25922588
size_t vkquake_pak_size_compressed = vkquake_pak_size, vkquake_pak_size_extracted = vkquake_pak_decompressed_size;
25932589
if (!vkquake_pak_extracted)

Quake/common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ qfilesize_t FS_filelength (fshandle_t *fh);
484484

485485
extern struct cvar_s registered;
486486
extern qboolean standard_quake, rogue, hipnotic;
487-
extern qboolean fitzmode;
488487
/* if true, run in fitzquake mode disabling custom quakespasm hacks */
489488

490489
#endif /* _Q_COMMON_H */

Quake/gl_screen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ static void SCR_DrawClock (cb_context_t *cbx)
692692
shown_pause = true;
693693
}
694694

695-
if ((scr_clock.value == 0 && scr_clock_off <= 0 && !(sb_showscores && !fitzmode && scr_autoclock.value)) || scr_viewsize.value >= 130)
695+
if ((scr_clock.value == 0 && scr_clock_off <= 0 && !(sb_showscores && scr_autoclock.value)) || scr_viewsize.value >= 130)
696696
return;
697697

698698
scr_clock_off -= host_frametime / (cls.demospeed ? cls.demospeed : 1.f);

Quake/host_cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3098,7 +3098,7 @@ static void Host_Startdemos_f (void)
30983098
if (!sv.active && cls.demonum != -1 && !cls.demoplayback)
30993099
{
31003100
cls.demonum = 0;
3101-
if (!fitzmode && !cl_startdemos.value)
3101+
if (!cl_startdemos.value)
31023102
{ /* QuakeSpasm customization: */
31033103
/* go straight to menu, no CL_NextDemo */
31043104
cls.demonum = -1;

Quake/menu.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ extern qboolean keydown[256];
112112

113113
extern cvar_t scr_fov;
114114
extern cvar_t scr_showfps;
115+
extern cvar_t cl_confirmquit;
115116
extern cvar_t scr_style;
116117
extern cvar_t autoload;
117118
extern cvar_t autofastload;
@@ -666,7 +667,7 @@ void M_Main_Key (int key)
666667
key_dest = key_game;
667668
m_state = m_none;
668669
cls.demonum = m_save_demonum;
669-
if (!fitzmode && !cl_startdemos.value) /* QuakeSpasm customization: */
670+
if (!cl_startdemos.value) /* QuakeSpasm customization: */
670671
break;
671672
if (cls.demonum != -1 && !cls.demoplayback && cls.state != ca_connected)
672673
CL_NextDemo ();
@@ -1395,6 +1396,7 @@ enum
13951396
GAME_OPT_AUTOLOAD,
13961397
GAME_OPT_STARTUP_DEMOS,
13971398
GAME_OPT_SHOWFPS,
1399+
GAME_OPT_CONFIRMQUIT,
13981400
GAME_OPTIONS_ITEMS
13991401
};
14001402

@@ -1533,6 +1535,9 @@ static void M_GameOptions_AdjustSliders (int dir, qboolean mouse)
15331535
case GAME_OPT_SHOWFPS:
15341536
Cvar_SetValue ("scr_showfps", ((int)scr_showfps.value + 2 + dir) % 2);
15351537
break;
1538+
case GAME_OPT_CONFIRMQUIT:
1539+
Cvar_SetValue ("cl_confirmquit", ((int)cl_confirmquit.value + 2 + dir) % 2);
1540+
break;
15361541
}
15371542
}
15381543

@@ -1688,6 +1693,11 @@ static void M_GameOptions_Draw (cb_context_t *cbx)
16881693
M_Print (cbx, MENU_LABEL_X, y, "Show FPS");
16891694
M_DrawCheckbox (cbx, MENU_VALUE_X, y, scr_showfps.value);
16901695
break;
1696+
1697+
case GAME_OPT_CONFIRMQUIT:
1698+
M_Print (cbx, MENU_LABEL_X, y, "Quit Prompt");
1699+
M_DrawCheckbox (cbx, MENU_VALUE_X, y, cl_confirmquit.value);
1700+
break;
16911701
}
16921702
}
16931703

@@ -3494,6 +3504,7 @@ static void M_Quit_Char (int key)
34943504

34953505
case 'y':
34963506
case 'Y':
3507+
case ' ':
34973508
m_is_quitting = true;
34983509
IN_Deactivate (true);
34993510
key_dest = key_console;
@@ -3513,10 +3524,13 @@ static qboolean M_Quit_TextEntry (void)
35133524
static void M_Quit_Draw (cb_context_t *cbx) // johnfitz -- modified for new quit message
35143525
{
35153526
char msg1[40];
3516-
char msg2[] = "by Axel Gneiting"; /* msg2/msg3 are mostly [40] */
3517-
char msg3[] = "Press y to quit";
3527+
char msg2[] = "by Axel Gneiting and devs"; /* msg2/msg3 are mostly [40] */
3528+
char msg3[] = "Press y/space to quit";
35183529
int boxlen;
35193530

3531+
if (!cl_confirmquit.value)
3532+
return;
3533+
35203534
if (was_in_menus)
35213535
{
35223536
m_state = m_quit_prevstate;
@@ -4568,7 +4582,7 @@ void M_Draw (cb_context_t *cbx)
45684582
break;
45694583

45704584
case m_quit:
4571-
if (!fitzmode)
4585+
if (!cl_confirmquit.value)
45724586
{ /* QuakeSpasm customization: */
45734587
/* Quit now! S.A. */
45744588
m_is_quitting = true;

Quake/sbar.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -501,20 +501,19 @@ void Sbar_SoloScoreboard (cb_context_t *cbx)
501501
char cleanname[sizeof (cl.levelname)];
502502
COM_SanitizeDescriptionString (cleanname, sizeof (cleanname), cl.levelname, false);
503503

504-
if (!fitzmode)
505-
{ /* QuakeSpasm customization: */
506-
q_snprintf (str, sizeof (str), "skill %i", (int)(skill.value + 0.5));
507-
Sbar_DrawString (cbx, (left + right) / 2 - strlen (str) * 4, 12, str);
504+
/* QuakeSpasm customization: */
505+
q_snprintf (str, sizeof (str), "skill %i", (int)(skill.value + 0.5));
506+
Sbar_DrawString (cbx, (left + right) / 2 - strlen (str) * 4, 12, str);
508507

509-
q_snprintf (str, sizeof (str), "%s (%s)", cleanname, cl.mapname);
508+
q_snprintf (str, sizeof (str), "%s (%s)", cleanname, cl.mapname);
509+
510+
len = strlen (str);
511+
if (len > 40)
512+
Sbar_DrawScrollString (cbx, 0, 4, 320, str);
513+
else
514+
Sbar_DrawString (cbx, 160 - len * 4, 4, str);
515+
return;
510516

511-
len = strlen (str);
512-
if (len > 40)
513-
Sbar_DrawScrollString (cbx, 0, 4, 320, str);
514-
else
515-
Sbar_DrawString (cbx, 160 - len * 4, 4, str);
516-
return;
517-
}
518517
minutes = cl.time / 60;
519518
seconds = cl.time - 60 * minutes;
520519
tens = seconds / 10;

0 commit comments

Comments
 (0)