mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Merge branch 'debugmode-reborn' into 'next'
Make DEBUGMODE=1 builds (finally) compile, run and work in netgames See merge request STJr/SRB2!1405
This commit is contained in:
commit
dc9b2443ce
7 changed files with 92 additions and 86 deletions
|
|
@ -415,7 +415,7 @@ ifdef GCC48
|
||||||
else
|
else
|
||||||
CFLAGS+=-O0
|
CFLAGS+=-O0
|
||||||
endif
|
endif
|
||||||
CFLAGS+= -Wall -DPARANOIA -DRANGECHECK -DPACKETDROP -DMOBJCONSISTANCY
|
CFLAGS+= -Wall -DPARANOIA -DRANGECHECK -DPACKETDROP
|
||||||
else
|
else
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4480,6 +4480,8 @@ static INT16 Consistancy(void)
|
||||||
ret += P_GetRandSeed();
|
ret += P_GetRandSeed();
|
||||||
|
|
||||||
#ifdef MOBJCONSISTANCY
|
#ifdef MOBJCONSISTANCY
|
||||||
|
if (gamestate == GS_LEVEL)
|
||||||
|
{
|
||||||
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
||||||
{
|
{
|
||||||
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
||||||
|
|
@ -4546,6 +4548,7 @@ static INT16 Consistancy(void)
|
||||||
ret += mo->frame;
|
ret += mo->frame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DEBFILE(va("Consistancy = %u\n", (ret & 0xFFFF)));
|
DEBFILE(va("Consistancy = %u\n", (ret & 0xFFFF)));
|
||||||
|
|
|
||||||
|
|
@ -1072,7 +1072,7 @@ void D_SRB2Main(void)
|
||||||
G_LoadGameSettings();
|
G_LoadGameSettings();
|
||||||
|
|
||||||
// Test Dehacked lists
|
// Test Dehacked lists
|
||||||
DEH_Check();
|
DEH_TableCheck();
|
||||||
|
|
||||||
// Netgame URL special case: change working dir to EXE folder.
|
// Netgame URL special case: change working dir to EXE folder.
|
||||||
ChangeDirForUrlHandler();
|
ChangeDirForUrlHandler();
|
||||||
|
|
|
||||||
|
|
@ -5457,3 +5457,27 @@ struct int_const_s const INT_CONST[] = {
|
||||||
|
|
||||||
{NULL,0}
|
{NULL,0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// For this to work compile-time without being in this file,
|
||||||
|
// this function would need to check sizes at runtime, without sizeof
|
||||||
|
void DEH_TableCheck(void)
|
||||||
|
{
|
||||||
|
#if defined(_DEBUG) || defined(PARANOIA)
|
||||||
|
const size_t dehstates = sizeof(STATE_LIST)/sizeof(const char*);
|
||||||
|
const size_t dehmobjs = sizeof(MOBJTYPE_LIST)/sizeof(const char*);
|
||||||
|
const size_t dehpowers = sizeof(POWERS_LIST)/sizeof(const char*);
|
||||||
|
const size_t dehcolors = sizeof(COLOR_ENUMS)/sizeof(const char*);
|
||||||
|
|
||||||
|
if (dehstates != S_FIRSTFREESLOT)
|
||||||
|
I_Error("You forgot to update the Dehacked states list, you dolt!\n(%d states defined, versus %s in the Dehacked list)\n", S_FIRSTFREESLOT, sizeu1(dehstates));
|
||||||
|
|
||||||
|
if (dehmobjs != MT_FIRSTFREESLOT)
|
||||||
|
I_Error("You forgot to update the Dehacked mobjtype list, you dolt!\n(%d mobj types defined, versus %s in the Dehacked list)\n", MT_FIRSTFREESLOT, sizeu1(dehmobjs));
|
||||||
|
|
||||||
|
if (dehpowers != NUMPOWERS)
|
||||||
|
I_Error("You forgot to update the Dehacked powers list, you dolt!\n(%d powers defined, versus %s in the Dehacked list)\n", NUMPOWERS, sizeu1(dehpowers));
|
||||||
|
|
||||||
|
if (dehcolors != SKINCOLOR_FIRSTFREESLOT)
|
||||||
|
I_Error("You forgot to update the Dehacked colors list, you dolt!\n(%d colors defined, versus %s in the Dehacked list)\n", SKINCOLOR_FIRSTFREESLOT, sizeu1(dehcolors));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,4 +72,7 @@ extern const char *const MENUTYPES_LIST[];
|
||||||
|
|
||||||
extern struct int_const_s const INT_CONST[];
|
extern struct int_const_s const INT_CONST[];
|
||||||
|
|
||||||
|
// Moved to this file because it can't work compile-time otherwise
|
||||||
|
void DEH_TableCheck(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -645,25 +645,3 @@ void DEH_LoadDehackedLump(lumpnum_t lumpnum)
|
||||||
{
|
{
|
||||||
DEH_LoadDehackedLumpPwad(WADFILENUM(lumpnum),LUMPNUM(lumpnum), false);
|
DEH_LoadDehackedLumpPwad(WADFILENUM(lumpnum),LUMPNUM(lumpnum), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DEH_Check(void)
|
|
||||||
{
|
|
||||||
#if defined(_DEBUG) || defined(PARANOIA)
|
|
||||||
const size_t dehstates = sizeof(STATE_LIST)/sizeof(const char*);
|
|
||||||
const size_t dehmobjs = sizeof(MOBJTYPE_LIST)/sizeof(const char*);
|
|
||||||
const size_t dehpowers = sizeof(POWERS_LIST)/sizeof(const char*);
|
|
||||||
const size_t dehcolors = sizeof(COLOR_ENUMS)/sizeof(const char*);
|
|
||||||
|
|
||||||
if (dehstates != S_FIRSTFREESLOT)
|
|
||||||
I_Error("You forgot to update the Dehacked states list, you dolt!\n(%d states defined, versus %s in the Dehacked list)\n", S_FIRSTFREESLOT, sizeu1(dehstates));
|
|
||||||
|
|
||||||
if (dehmobjs != MT_FIRSTFREESLOT)
|
|
||||||
I_Error("You forgot to update the Dehacked mobjtype list, you dolt!\n(%d mobj types defined, versus %s in the Dehacked list)\n", MT_FIRSTFREESLOT, sizeu1(dehmobjs));
|
|
||||||
|
|
||||||
if (dehpowers != NUMPOWERS)
|
|
||||||
I_Error("You forgot to update the Dehacked powers list, you dolt!\n(%d powers defined, versus %s in the Dehacked list)\n", NUMPOWERS, sizeu1(dehpowers));
|
|
||||||
|
|
||||||
if (dehcolors != SKINCOLOR_FIRSTFREESLOT)
|
|
||||||
I_Error("You forgot to update the Dehacked colors list, you dolt!\n(%d colors defined, versus %s in the Dehacked list)\n", SKINCOLOR_FIRSTFREESLOT, sizeu1(dehcolors));
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,6 @@ typedef enum
|
||||||
void DEH_LoadDehackedLump(lumpnum_t lumpnum);
|
void DEH_LoadDehackedLump(lumpnum_t lumpnum);
|
||||||
void DEH_LoadDehackedLumpPwad(UINT16 wad, UINT16 lump, boolean mainfile);
|
void DEH_LoadDehackedLumpPwad(UINT16 wad, UINT16 lump, boolean mainfile);
|
||||||
|
|
||||||
void DEH_Check(void);
|
|
||||||
|
|
||||||
fixed_t get_number(const char *word);
|
fixed_t get_number(const char *word);
|
||||||
FUNCPRINTF void deh_warning(const char *first, ...);
|
FUNCPRINTF void deh_warning(const char *first, ...);
|
||||||
void deh_strlcpy(char *dst, const char *src, size_t size, const char *warntext);
|
void deh_strlcpy(char *dst, const char *src, size_t size, const char *warntext);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue