Title screen cheat "devmode".

Access the benefits of -debug, console devmode, and a complete gamedata.dat (all secrets unlocked) all in one go.
Moved "#if 0" and "#if 1" to "#ifdef DEVMODE" so the existance of this cheat and MD5 validation and all that can be toggled in one place too.

git-svn-id: https://code.orospakr.ca/svn/srb2/trunk@8998 6de4a73c-47e2-0310-b8c1-93d6ecd3f8cd
This commit is contained in:
JTE 2015-01-22 19:02:38 +00:00 committed by Alam Ed Arias
parent 9b0e09877e
commit 092134ad0c
3 changed files with 43 additions and 4 deletions

View File

@ -943,9 +943,9 @@ void D_SRB2Main(void)
#endif
#if defined (_WIN32_WCE) //|| defined (_DEBUG) || defined (GP2X)
devparm = !M_CheckParm("-nodebug");
devparm = M_CheckParm("-nodebug") == 0;
#else
devparm = M_CheckParm("-debug");
devparm = M_CheckParm("-debug") != 0;
#endif
// for dedicated server
@ -1118,7 +1118,7 @@ void D_SRB2Main(void)
#endif
D_CleanFile();
#if 1 // md5s last updated 12/14/14
#ifndef DEVMODE // md5s last updated 12/14/14
// Check MD5s of autoloaded files
W_VerifyFileMD5(0, ASSET_HASH_SRB2_SRB); // srb2.srb/srb2.wad

View File

@ -138,7 +138,8 @@
extern FILE *logstream;
#endif
#if 0
//#define DEVMODE // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
#ifdef DEVMODE
#define VERSION 0 // Game version
#define SUBVERSION 0 // more precise version number
#define VERSIONSTRING "Trunk"

View File

@ -91,6 +91,33 @@ static UINT8 cheatf_warp(void)
return 1;
}
#ifdef DEVMODE
static UINT8 cheatf_devmode(void)
{
UINT8 i;
if (modifiedgame)
return 0;
if (menuactive && currentMenu != &MainDef)
return 0; // Only on the main menu!
S_StartSound(0, sfx_itemup);
// Just unlock all the things and turn on -debug and console devmode.
G_SetGameModified(false);
for (i = 0; i < MAXUNLOCKABLES; i++)
unlockables[i].unlocked = true;
devparm = TRUE;
cv_debug |= 0x8000;
// Refresh secrets menu existing.
M_ClearMenus(true);
M_StartControlPanel();
return 1;
}
#endif
static cheatseq_t cheat_ultimate = {
0, cheatf_ultimate,
{ SCRAMBLE('u'), SCRAMBLE('l'), SCRAMBLE('t'), SCRAMBLE('i'), SCRAMBLE('m'), SCRAMBLE('a'), SCRAMBLE('t'), SCRAMBLE('e'), 0xff }
@ -115,6 +142,14 @@ static cheatseq_t cheat_warp_joy = {
SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW),
SCRAMBLE(KEY_ENTER), 0xff }
};
#ifdef DEVMODE
static cheatseq_t cheat_devmode = {
0, cheatf_devmode,
{ SCRAMBLE('d'), SCRAMBLE('e'), SCRAMBLE('v'), SCRAMBLE('m'), SCRAMBLE('o'), SCRAMBLE('d'), SCRAMBLE('e'), 0xff }
};
#endif
// ==========================================================================
// CHEAT SEQUENCE PACKAGE
// ==========================================================================
@ -221,6 +256,9 @@ boolean cht_Responder(event_t *ev)
ret += cht_CheckCheat(&cheat_ultimate_joy, (char)ch);
ret += cht_CheckCheat(&cheat_warp, (char)ch);
ret += cht_CheckCheat(&cheat_warp_joy, (char)ch);
#ifdef DEVMODE
ret += cht_CheckCheat(&cheat_devmode, (char)ch);
#endif
return (ret != 0);
}