dp_doom: disable screen size up/down and save/load keybindings

This commit is contained in:
oxmox 2023-03-03 05:54:47 +01:00
parent a85d8bb821
commit 93b401420c

View file

@ -1,4 +1,4 @@
// Emacs style mode select -*- C++ -*-
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// $Id:$
@ -71,14 +71,14 @@ int mouseSensitivity; // has default
// Show messages has default, 0 = off, 1 = on
int showMessages;
// Blocky mode, has default, 0 = high, 1 = normal
int detailLevel;
int detailLevel;
int screenblocks; // has default
// temp for screenblocks (0-9)
int screenSize;
int screenSize;
// Maximum volume of a sound effect.
// Internal default is max out of 0-15.
@ -88,20 +88,20 @@ int sfxVolume = 15;
int musicVolume = 15;
// -1 = no quicksave slot picked!
int quickSaveSlot;
int quickSaveSlot;
// 1 = message to be printed
int messageToPrint;
// ...and here is the message string!
const char* messageString;
const char* messageString;
// message x & y
int messx;
int messx;
int messy;
int messageLastMenuActive;
// timed message = no input from user
boolean messageNeedsInput;
boolean messageNeedsInput;
void (*messageRoutine)(int response);
@ -117,11 +117,11 @@ char gammamsg[5][26] =
};
// we are going to be entering a savegame string
int saveStringEnter;
int saveStringEnter;
int saveSlot; // which slot to save in
int saveCharIndex; // which char we're editing
// old save description before edit
char saveOldString[SAVESTRINGSIZE];
char saveOldString[SAVESTRINGSIZE];
boolean inhelpscreens;
boolean menuactive;
@ -142,16 +142,16 @@ typedef struct
{
// 0 = no cursor here, 1 = ok, 2 = arrows ok
short status;
char name[10];
// choice = menu item #.
// if status = 2,
// choice=0:leftarrow,1:rightarrow
void (*routine)(int choice);
// hotkey in menu
char alphaKey;
char alphaKey;
} menuitem_t;
@ -176,7 +176,7 @@ short whichSkull; // which skull to draw
char skullName[2][/*8*/9] = {"M_SKULL1","M_SKULL2"};
// current menudef
menu_t* currentMenu;
menu_t* currentMenu;
//
// PROTOTYPES
@ -514,7 +514,7 @@ void M_ReadSaveStrings(void)
FILE* handle;
int i;
char name[256];
for (i = 0;i < load_end;i++)
{
if (M_CheckParm("-cdrom"))
@ -542,7 +542,7 @@ void M_ReadSaveStrings(void)
void M_DrawLoad(void)
{
int i;
V_DrawPatchDirect (72,28,0,W_CacheLumpName("M_LOADG",PU_CACHE));
for (i = 0;i < load_end; i++)
{
@ -559,9 +559,9 @@ void M_DrawLoad(void)
void M_DrawSaveLoadBorder(int x,int y)
{
int i;
V_DrawPatchDirect (x-8,y+7,0,W_CacheLumpName("M_LSLEFT",PU_CACHE));
for (i = 0;i < 24;i++)
{
V_DrawPatchDirect (x,y+7,0,W_CacheLumpName("M_LSCNTR",PU_CACHE));
@ -579,7 +579,7 @@ void M_DrawSaveLoadBorder(int x,int y)
void M_LoadSelect(int choice)
{
char name[256];
if (M_CheckParm("-cdrom"))
sprintf(name,"c:\\doomdata\\"SAVEGAMENAME"%d.dsg",choice);
else
@ -600,7 +600,7 @@ void M_LoadGame (int choice)
M_StartMessage(LOADNET,NULL,false);
return;
}
M_SetupNextMenu(&LoadDef);
M_ReadSaveStrings();
}
@ -612,14 +612,14 @@ void M_LoadGame (int choice)
void M_DrawSave(void)
{
int i;
V_DrawPatchDirect (72,28,0,W_CacheLumpName("M_SAVEG",PU_CACHE));
for (i = 0;i < load_end; i++)
{
M_DrawSaveLoadBorder(LoadDef.x,LoadDef.y+LINEHEIGHT*i);
M_WriteText(LoadDef.x,LoadDef.y+LINEHEIGHT*i,savegamestrings[i]);
}
if (saveStringEnter)
{
i = M_StringWidth(savegamestrings[saveSlot]);
@ -647,7 +647,7 @@ void M_SaveSelect(int choice)
{
// we are going to be intercepting all chars
saveStringEnter = 1;
saveSlot = choice;
strcpy(saveOldString,savegamestrings[choice]);
if (!strcmp(savegamestrings[choice],EMPTYSTRING))
@ -667,10 +667,10 @@ void M_SaveGame (int choice)
M_StartMessage(SAVEDEAD,NULL,false);
return;
}
if (gamestate != GS_LEVEL)
return;
M_SetupNextMenu(&SaveDef);
M_ReadSaveStrings();
}
@ -701,7 +701,7 @@ void M_QuickSave(void)
if (gamestate != GS_LEVEL)
return;
if (quickSaveSlot < 0)
{
M_StartControlPanel();
@ -736,7 +736,7 @@ void M_QuickLoad(void)
M_StartMessage(QLOADNET,NULL,false);
return;
}
if (quickSaveSlot < 0)
{
M_StartMessage(QSAVESPOT,NULL,false);
@ -832,7 +832,7 @@ void M_SfxVol(int choice)
sfxVolume++;
break;
}
S_SetSfxVolume(sfxVolume*8);
}
@ -849,7 +849,7 @@ void M_MusicVol(int choice)
musicVolume++;
break;
}
S_SetMusicVolume(musicVolume*8);
}
@ -885,7 +885,7 @@ void M_NewGame(int choice)
M_StartMessage(NEWGAME,NULL,false);
return;
}
if ( gamemode == commercial )
M_SetupNextMenu(&NewDef);
else
@ -907,7 +907,7 @@ void M_VerifyNightmare(int ch)
{
if (ch != 'y')
return;
G_DeferedInitNew(sk_nightmare,epi+1,1);
M_ClearMenus ();
}
@ -919,7 +919,7 @@ void M_ChooseSkill(int choice)
M_StartMessage(NIGHTMARE,M_VerifyNightmare,true);
return;
}
G_DeferedInitNew(choice,epi+1,1);
M_ClearMenus ();
}
@ -942,7 +942,7 @@ void M_Episode(int choice)
"M_Episode: 4th episode requires UltimateDOOM\n");
choice = 0;
}
epi = choice;
M_SetupNextMenu(&NewDef);
}
@ -959,7 +959,7 @@ char msgNames[2][9] = {"M_MSGOFF","M_MSGON"};
void M_DrawOptions(void)
{
V_DrawPatchDirect (108,15,0,W_CacheLumpName("M_OPTTTL",PU_CACHE));
V_DrawPatchDirect (OptionsDef.x + 175,OptionsDef.y+LINEHEIGHT*detail,0,
W_CacheLumpName(detailNames[detailLevel],PU_CACHE));
@ -968,7 +968,7 @@ void M_DrawOptions(void)
M_DrawThermo(OptionsDef.x,OptionsDef.y+LINEHEIGHT*(mousesens+1),
10,mouseSensitivity);
M_DrawThermo(OptionsDef.x,OptionsDef.y+LINEHEIGHT*(scrnsize+1),
9,screenSize);
}
@ -991,7 +991,7 @@ void M_ChangeMessages(int choice)
(void)choice;
showMessages = 1 - showMessages;
if (!showMessages)
players[consoleplayer].message = MSGOFF;
else
@ -1008,7 +1008,7 @@ void M_EndGameResponse(int ch)
{
if (ch != 'y')
return;
currentMenu->lastOn = itemOn;
M_ClearMenus ();
D_StartTitle ();
@ -1023,13 +1023,13 @@ void M_EndGame(int choice)
S_StartSound(NULL,sfx_oof);
return;
}
if (netgame)
{
M_StartMessage(NETEND,NULL,false);
return;
}
M_StartMessage(ENDGAME,M_EndGameResponse,true);
}
@ -1120,7 +1120,7 @@ void M_QuitDOOM(int choice)
sprintf(endstring,"%s\n\n"DOSY, endmsg[0] );
else
sprintf(endstring,"%s\n\n"DOSY, endmsg[gametic%NUM_QUITMESSAGES]);
M_StartMessage(endstring,M_QuitResponse,true);
}
@ -1181,7 +1181,7 @@ void M_SizeDisplay(int choice)
}
break;
}
R_SetViewSize (screenblocks, detailLevel);
}
@ -1270,7 +1270,7 @@ int M_StringWidth(const char* string)
size_t i;
int w = 0;
int c;
for (i = 0;i < strlen(string);i++)
{
c = toupper(string[i]) - HU_FONTSTART;
@ -1279,7 +1279,7 @@ int M_StringWidth(const char* string)
else
w += SHORT (hu_font[c]->width);
}
return w;
}
@ -1293,12 +1293,12 @@ int M_StringHeight(const char* string)
size_t i;
int h;
int height = SHORT(hu_font[0]->height);
h = height;
for (i = 0;i < strlen(string);i++)
if (string[i] == '\n')
h += height;
return h;
}
@ -1317,12 +1317,12 @@ M_WriteText
int c;
int cx;
int cy;
ch = string;
cx = x;
cy = y;
while(1)
{
c = *ch++;
@ -1334,14 +1334,14 @@ M_WriteText
cy += 12;
continue;
}
c = toupper(c) - HU_FONTSTART;
if (c < 0 || c>= HU_FONTSIZE)
{
cx += 4;
continue;
}
w = SHORT (hu_font[c]->width);
if (cx+w > SCREENWIDTH)
break;
@ -1369,9 +1369,9 @@ boolean M_Responder (event_t* ev)
static int lasty = 0;
static int mousex = 0;
static int lastx = 0;
ch = -1;
if (ev->type == ev_joystick && joywait < I_GetTime())
{
if (ev->data3 == -1)
@ -1384,7 +1384,7 @@ boolean M_Responder (event_t* ev)
ch = KEY_DOWNARROW;
joywait = I_GetTime() + 5;
}
if (ev->data2 == -1)
{
ch = KEY_LEFTARROW;
@ -1395,7 +1395,7 @@ boolean M_Responder (event_t* ev)
ch = KEY_RIGHTARROW;
joywait = I_GetTime() + 2;
}
if (ev->data1&1)
{
ch = KEY_ENTER;
@ -1424,7 +1424,7 @@ boolean M_Responder (event_t* ev)
mousewait = I_GetTime() + 5;
mousey = lasty += 30;
}
mousex += ev->data2;
if (mousex < lastx-30)
{
@ -1438,13 +1438,13 @@ boolean M_Responder (event_t* ev)
mousewait = I_GetTime() + 5;
mousex = lastx += 30;
}
if (ev->data1&1)
{
ch = KEY_ENTER;
mousewait = I_GetTime() + 15;
}
if (ev->data1&2)
{
ch = KEY_BACKSPACE;
@ -1457,11 +1457,11 @@ boolean M_Responder (event_t* ev)
ch = ev->data1;
}
}
if (ch == -1)
return false;
// Save Game string input
if (saveStringEnter)
{
@ -1474,18 +1474,18 @@ boolean M_Responder (event_t* ev)
savegamestrings[saveSlot][saveCharIndex] = 0;
}
break;
case KEY_ESCAPE:
saveStringEnter = 0;
strcpy(&savegamestrings[saveSlot][0],saveOldString);
break;
case KEY_ENTER:
saveStringEnter = 0;
if (savegamestrings[saveSlot][0])
M_DoSave(saveSlot);
break;
default:
ch = toupper(ch);
if (ch != 32)
@ -1503,49 +1503,53 @@ boolean M_Responder (event_t* ev)
}
return true;
}
// Take care of any messages that need input
if (messageToPrint)
{
if (messageNeedsInput == true &&
!(ch == ' ' || ch == 'n' || ch == 'y' || ch == KEY_ESCAPE))
return false;
menuactive = messageLastMenuActive;
messageToPrint = 0;
if (messageRoutine)
messageRoutine(ch);
menuactive = false;
S_StartSound(NULL,sfx_swtchx);
return true;
}
#if 0
if (devparm && ch == KEY_F1)
{
G_ScreenShot ();
return true;
}
#endif
// F-Keys
if (!menuactive)
switch(ch)
{
#if 0
case KEY_MINUS: // Screen size down
if (automapactive || chat_on)
return false;
M_SizeDisplay(0);
S_StartSound(NULL,sfx_stnmov);
return true;
case KEY_EQUALS: // Screen size up
if (automapactive || chat_on)
return false;
M_SizeDisplay(1);
S_StartSound(NULL,sfx_stnmov);
return true;
#endif
case KEY_F1: // Help key
M_StartControlPanel ();
@ -1553,60 +1557,62 @@ boolean M_Responder (event_t* ev)
currentMenu = &ReadDef2;
else
currentMenu = &ReadDef1;
itemOn = 0;
S_StartSound(NULL,sfx_swtchn);
return true;
#if 0
case KEY_F2: // Save
M_StartControlPanel();
S_StartSound(NULL,sfx_swtchn);
M_SaveGame(0);
return true;
case KEY_F3: // Load
M_StartControlPanel();
S_StartSound(NULL,sfx_swtchn);
M_LoadGame(0);
return true;
#endif
case KEY_F4: // Sound Volume
M_StartControlPanel ();
currentMenu = &SoundDef;
itemOn = sfx_vol;
S_StartSound(NULL,sfx_swtchn);
return true;
case KEY_F5: // Detail toggle
M_ChangeDetail(0);
S_StartSound(NULL,sfx_swtchn);
return true;
case KEY_F6: // Quicksave
S_StartSound(NULL,sfx_swtchn);
M_QuickSave();
return true;
case KEY_F7: // End game
S_StartSound(NULL,sfx_swtchn);
M_EndGame(0);
return true;
case KEY_F8: // Toggle messages
M_ChangeMessages(0);
S_StartSound(NULL,sfx_swtchn);
return true;
case KEY_F9: // Quickload
S_StartSound(NULL,sfx_swtchn);
M_QuickLoad();
return true;
case KEY_F10: // Quit DOOM
S_StartSound(NULL,sfx_swtchn);
M_QuitDOOM(0);
return true;
case KEY_F11: // gamma toggle
usegamma++;
if (usegamma > 4)
@ -1614,10 +1620,10 @@ boolean M_Responder (event_t* ev)
players[consoleplayer].message = gammamsg[usegamma];
I_SetPalette (W_CacheLumpName ("PLAYPAL",PU_CACHE));
return true;
}
// Pop-up menu?
if (!menuactive)
{
@ -1630,7 +1636,7 @@ boolean M_Responder (event_t* ev)
return false;
}
// Keys usable within menu
switch (ch)
{
@ -1643,7 +1649,7 @@ boolean M_Responder (event_t* ev)
S_StartSound(NULL,sfx_pstop);
} while(currentMenu->menuitems[itemOn].status==-1);
return true;
case KEY_UPARROW:
do
{
@ -1662,7 +1668,7 @@ boolean M_Responder (event_t* ev)
currentMenu->menuitems[itemOn].routine(0);
}
return true;
case KEY_RIGHTARROW:
if (currentMenu->menuitems[itemOn].routine &&
currentMenu->menuitems[itemOn].status == 2)
@ -1689,13 +1695,13 @@ boolean M_Responder (event_t* ev)
}
}
return true;
case KEY_ESCAPE:
currentMenu->lastOn = itemOn;
M_ClearMenus ();
S_StartSound(NULL,sfx_swtchx);
return true;
case KEY_BACKSPACE:
currentMenu->lastOn = itemOn;
if (currentMenu->prevMenu)
@ -1705,7 +1711,7 @@ boolean M_Responder (event_t* ev)
S_StartSound(NULL,sfx_swtchn);
}
return true;
default:
for (i = itemOn+1;i < currentMenu->numitems;i++)
if (currentMenu->menuitems[i].alphaKey == ch)
@ -1722,7 +1728,7 @@ boolean M_Responder (event_t* ev)
return true;
}
break;
}
return false;
@ -1738,7 +1744,7 @@ void M_StartControlPanel (void)
// intro might call this repeatedly
if (menuactive)
return;
I_GrabMouse(false);
menuactive = 1;
@ -1763,7 +1769,7 @@ void M_Drawer (void)
inhelpscreens = false;
// Horiz. & Vertically center string and print it.
if (messageToPrint)
{
@ -1779,13 +1785,13 @@ void M_Drawer (void)
start += i+1;
break;
}
if (i == strlen(messageString+start))
{
strcpy(string,messageString+start);
start += i;
}
x = 160 - M_StringWidth(string)/2;
M_WriteText(x,y,string);
y += SHORT(hu_font[0]->height);
@ -1798,7 +1804,7 @@ void M_Drawer (void)
if (currentMenu->routine)
currentMenu->routine(); // call Draw routine
// DRAW MENU
x = currentMenu->x;
y = currentMenu->y;
@ -1812,7 +1818,7 @@ void M_Drawer (void)
y += LINEHEIGHT;
}
// DRAW SKULL
V_DrawPatchDirect(x + SKULLXOFF,currentMenu->y - 5 + itemOn*LINEHEIGHT, 0,
W_CacheLumpName(skullName[whichSkull],PU_CACHE));
@ -1877,7 +1883,7 @@ void M_Init (void)
// Here we could catch other version dependencies,
// like HELP1/2, and four episodes.
switch ( gamemode )
{
case commercial:
@ -1905,6 +1911,5 @@ void M_Init (void)
default:
break;
}
}
}