Merge remote-tracking branch 'origin/devmode-online'

This commit is contained in:
James R 2022-09-30 15:54:33 -07:00
commit 1bfccebbe6
19 changed files with 156 additions and 98 deletions

View file

@ -454,7 +454,7 @@ boolean AM_Responder(event_t *ev)
{ {
INT32 rc = false; INT32 rc = false;
if (devparm || cv_debug) // only automap in Debug Tails 01-19-2001 if (devparm || cht_debug) // only automap in Debug Tails 01-19-2001
{ {
if (!automapactive) if (!automapactive)
{ {
@ -625,7 +625,7 @@ static inline void AM_doFollowPlayer(void)
*/ */
void AM_Ticker(void) void AM_Ticker(void)
{ {
if (!cv_debug) if (!cht_debug)
AM_Stop(); AM_Stop();
if (dedicated || !automapactive) if (dedicated || !automapactive)

View file

@ -1899,7 +1899,7 @@ void CV_CheatsChanged(void)
CV_SetCVar(cvar, cvar->defaultvalue, false); CV_SetCVar(cvar, cvar->defaultvalue, false);
// Reset any other cheat command effects here, as well. // Reset any other cheat command effects here, as well.
cv_debug = 0; cht_debug = 0;
P_ResetPlayerCheats(); P_ResetPlayerCheats();
} }

View file

@ -1521,12 +1521,12 @@ void CONS_Alert(alerttype_t level, const char *fmt, ...)
CONS_Printf("%s", txt); CONS_Printf("%s", txt);
} }
void CONS_Debug(INT32 debugflags, const char *fmt, ...) void CONS_Debug(UINT32 debugflags, const char *fmt, ...)
{ {
va_list argptr; va_list argptr;
static char *txt = NULL; static char *txt = NULL;
if ((cv_debug & debugflags) != debugflags) if ((cht_debug & debugflags) != debugflags)
return; return;
if (txt == NULL) if (txt == NULL)

View file

@ -266,7 +266,7 @@ void SendNetXCmdForPlayer(UINT8 playerid, netxcmd_t id, const void *param, size_
{ {
if (localtextcmd[playerid][0]+2+nparam > MAXTEXTCMD) if (localtextcmd[playerid][0]+2+nparam > MAXTEXTCMD)
{ {
// for future reference: if (cv_debug) != debug disabled. // for future reference: if (cht_debug) != debug disabled.
CONS_Alert(CONS_ERROR, M_GetText("NetXCmd buffer full, cannot add netcmd %d! (size: %d, needed: %s)\n"), id, localtextcmd[playerid][0], sizeu1(nparam)); CONS_Alert(CONS_ERROR, M_GetText("NetXCmd buffer full, cannot add netcmd %d! (size: %d, needed: %s)\n"), id, localtextcmd[playerid][0], sizeu1(nparam));
return; return;
} }

View file

@ -962,7 +962,7 @@ void D_StartTitle(void)
splitscreen = 0; splitscreen = 0;
SplitScreen_OnChange(); SplitScreen_OnChange();
cv_debug = 0; cht_debug = 0;
emeralds = 0; emeralds = 0;
memset(&luabanks, 0, sizeof(luabanks)); memset(&luabanks, 0, sizeof(luabanks));
lastmaploaded = 0; lastmaploaded = 0;

View file

@ -326,8 +326,6 @@ consvar_t cv_splitdevice = CVAR_INIT ("splitdevice", "Off", CV_SAVE, CV_OnOff, N
consvar_t cv_skipmapcheck = CVAR_INIT ("skipmapcheck", "Off", CV_SAVE, CV_OnOff, NULL); consvar_t cv_skipmapcheck = CVAR_INIT ("skipmapcheck", "Off", CV_SAVE, CV_OnOff, NULL);
INT32 cv_debug;
consvar_t cv_usemouse = CVAR_INIT ("use_mouse", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse); consvar_t cv_usemouse = CVAR_INIT ("use_mouse", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse);
consvar_t cv_usejoystick[MAXSPLITSCREENPLAYERS] = { consvar_t cv_usejoystick[MAXSPLITSCREENPLAYERS] = {
@ -2066,6 +2064,10 @@ void D_Cheat(INT32 playernum, INT32 cheat, ...)
COPY(WRITEFIXED, fixed_t); COPY(WRITEFIXED, fixed_t);
COPY(WRITEFIXED, fixed_t); COPY(WRITEFIXED, fixed_t);
break; break;
case CHEAT_DEVMODE:
COPY(WRITEUINT32, UINT32);
break;
} }
#undef COPY #undef COPY
@ -2909,7 +2911,7 @@ static void Command_Map_f(void)
newresetplayers = false; // if not forcing and gametypes is the same newresetplayers = false; // if not forcing and gametypes is the same
// don't use a gametype the map doesn't support // don't use a gametype the map doesn't support
if (cv_debug || option_force || cv_skipmapcheck.value) if (cht_debug || option_force || cv_skipmapcheck.value)
{ {
fromlevelselect = false; // The player wants us to trek on anyway. Do so. fromlevelselect = false; // The player wants us to trek on anyway. Do so.
} }
@ -5670,6 +5672,13 @@ static void Got_Cheat(UINT8 **cp, INT32 playernum)
break; break;
} }
case CHEAT_DEVMODE: {
UINT32 flags = READUINT32(*cp);
cht_debug = flags;
CV_CheaterWarning(targetPlayer, va("devmode %x", flags));
break;
}
case NUMBER_OF_CHEATS: case NUMBER_OF_CHEATS:
break; break;
} }
@ -5730,7 +5739,7 @@ void Command_ExitGame_f(void)
splitscreen = 0; splitscreen = 0;
SplitScreen_OnChange(); SplitScreen_OnChange();
cv_debug = 0; cht_debug = 0;
emeralds = 0; emeralds = 0;
memset(&luabanks, 0, sizeof(luabanks)); memset(&luabanks, 0, sizeof(luabanks));

View file

@ -480,7 +480,7 @@ typedef enum
void CONS_Printf(const char *fmt, ...) FUNCPRINTF; void CONS_Printf(const char *fmt, ...) FUNCPRINTF;
void CONS_Alert(alerttype_t level, const char *fmt, ...) FUNCDEBUG; void CONS_Alert(alerttype_t level, const char *fmt, ...) FUNCDEBUG;
void CONS_Debug(INT32 debugflags, const char *fmt, ...) FUNCDEBUG; void CONS_Debug(UINT32 debugflags, const char *fmt, ...) FUNCDEBUG;
// For help debugging functions. // For help debugging functions.
#define POTENTIALLYUNUSED CONS_Alert(CONS_WARNING, "(%s:%d) Unused code appears to be used.\n", __FILE__, __LINE__) #define POTENTIALLYUNUSED CONS_Alert(CONS_WARNING, "(%s:%d) Unused code appears to be used.\n", __FILE__, __LINE__)
@ -517,23 +517,35 @@ char *sizeu5(size_t num);
extern int VERSION; extern int VERSION;
extern int SUBVERSION; extern int SUBVERSION;
extern boolean devparm; // development mode (-debug) extern boolean devparm; // development mode (-debug)
// d_netcmd.c
extern INT32 cv_debug;
#define DBG_BASIC 0x0001 // m_cheat.c
#define DBG_DETAILED 0x0002 extern UINT32 cht_debug;
#define DBG_PLAYER 0x0004
#define DBG_RENDER 0x0008 typedef enum
#define DBG_NIGHTSBASIC 0x0010 {
#define DBG_NIGHTS 0x0020 DBG_NONE = 0x00000000,
#define DBG_POLYOBJ 0x0040 DBG_BASIC = 0x00000001,
#define DBG_GAMELOGIC 0x0080 DBG_DETAILED = 0x00000002,
#define DBG_NETPLAY 0x0100 DBG_PLAYER = 0x00000004,
#define DBG_MEMORY 0x0200 DBG_RENDER = 0x00000008,
#define DBG_SETUP 0x0400 //DBG_NIGHTSBASIC = 0x00000010, // free
#define DBG_LUA 0x0800 //DBG_NIGHTS = 0x00000020, // free
#define DBG_RANDOMIZER 0x1000 DBG_POLYOBJ = 0x00000040,
#define DBG_VIEWMORPH 0x2000 DBG_GAMELOGIC = 0x00000080,
DBG_NETPLAY = 0x00000100,
DBG_MEMORY = 0x00000200,
DBG_SETUP = 0x00000400,
DBG_LUA = 0x00000800,
DBG_RNG = 0x00001000,
} debugFlags_t;
struct debugFlagNames_s
{
const char *str;
debugFlags_t flag;
};
extern struct debugFlagNames_s const debug_flag_names[];
// ======================= // =======================
// Misc stuff for later... // Misc stuff for later...

View file

@ -866,7 +866,7 @@ boolean F_CreditResponder(event_t *event)
return false; return false;
} }
/*if (!(timesBeaten) && !(netgame || multiplayer) && !cv_debug) /*if (!(timesBeaten) && !(netgame || multiplayer) && !cht_debug)
return false;*/ return false;*/
if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_BACKSPACE) if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_BACKSPACE)

View file

@ -4589,7 +4589,7 @@ void G_SaveGame(UINT32 slot, INT16 mapnum)
gameaction = ga_nothing; gameaction = ga_nothing;
if (cv_debug && saved) if (cht_debug && saved)
CONS_Printf(M_GetText("Game saved.\n")); CONS_Printf(M_GetText("Game saved.\n"));
else if (!saved) else if (!saved)
CONS_Alert(CONS_ERROR, M_GetText("Error while writing to %s for save slot %u, base: %s\n"), backup, slot, (marathonmode ? liveeventbackup : savegamename)); CONS_Alert(CONS_ERROR, M_GetText("Error while writing to %s for save slot %u, base: %s\n"), backup, slot, (marathonmode ? liveeventbackup : savegamename));
@ -4691,7 +4691,7 @@ void G_SaveGameOver(UINT32 slot, boolean modifylives)
} }
cleanup: cleanup:
if (cv_debug && saved) if (cht_debug && saved)
CONS_Printf(M_GetText("Game saved.\n")); CONS_Printf(M_GetText("Game saved.\n"));
else if (!saved) else if (!saved)
CONS_Alert(CONS_ERROR, M_GetText("Error while writing to %s for save slot %u, base: %s\n"), backup, slot, (marathonmode ? liveeventbackup : savegamename)); CONS_Alert(CONS_ERROR, M_GetText("Error while writing to %s for save slot %u, base: %s\n"), backup, slot, (marathonmode ? liveeventbackup : savegamename));

View file

@ -2016,7 +2016,7 @@ void M_QuitResponse(INT32 ch)
if (ch == MA_YES) if (ch == MA_YES)
{ {
if (!(netgame || cv_debug)) if (!(netgame || cht_debug))
{ {
mrand = M_RandomKey(sizeof(quitsounds) / sizeof(INT32)); mrand = M_RandomKey(sizeof(quitsounds) / sizeof(INT32));
if (quitsounds[mrand]) if (quitsounds[mrand])
@ -3577,7 +3577,7 @@ void M_LevelSelectHandler(INT32 choice)
strncpy(connectedservername, cv_servername.string, MAXSERVERNAME); strncpy(connectedservername, cv_servername.string, MAXSERVERNAME);
// Still need to reset devmode // Still need to reset devmode
cv_debug = 0; cht_debug = 0;
if (demo.playback) if (demo.playback)
G_StopDemo(); G_StopDemo();
@ -3686,7 +3686,7 @@ void M_StartTimeAttack(INT32 choice)
} }
// Still need to reset devmode // Still need to reset devmode
cv_debug = 0; cht_debug = 0;
emeralds = 0; emeralds = 0;
if (demo.playback) if (demo.playback)

View file

@ -51,7 +51,7 @@ static UINT8 lib_searchBlockmap_Objects(lua_State *L, INT32 x, INT32 y, mobj_t *
LUA_PushUserdata(L, thing, META_MOBJ); LUA_PushUserdata(L, thing, META_MOBJ);
LUA_PushUserdata(L, mobj, META_MOBJ); LUA_PushUserdata(L, mobj, META_MOBJ);
if (lua_pcall(gL, 2, 1, 0)) { if (lua_pcall(gL, 2, 1, 0)) {
if (!blockfuncerror || cv_debug & DBG_LUA) if (!blockfuncerror || cht_debug & DBG_LUA)
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
lua_pop(gL, 1); lua_pop(gL, 1);
blockfuncerror = true; blockfuncerror = true;
@ -112,7 +112,7 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
LUA_PushUserdata(L, thing, META_MOBJ); LUA_PushUserdata(L, thing, META_MOBJ);
LUA_PushUserdata(L, po->lines[i], META_LINE); LUA_PushUserdata(L, po->lines[i], META_LINE);
if (lua_pcall(gL, 2, 1, 0)) { if (lua_pcall(gL, 2, 1, 0)) {
if (!blockfuncerror || cv_debug & DBG_LUA) if (!blockfuncerror || cht_debug & DBG_LUA)
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
lua_pop(gL, 1); lua_pop(gL, 1);
blockfuncerror = true; blockfuncerror = true;
@ -149,7 +149,7 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
LUA_PushUserdata(L, thing, META_MOBJ); LUA_PushUserdata(L, thing, META_MOBJ);
LUA_PushUserdata(L, ld, META_LINE); LUA_PushUserdata(L, ld, META_LINE);
if (lua_pcall(gL, 2, 1, 0)) { if (lua_pcall(gL, 2, 1, 0)) {
if (!blockfuncerror || cv_debug & DBG_LUA) if (!blockfuncerror || cht_debug & DBG_LUA)
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
lua_pop(gL, 1); lua_pop(gL, 1);
blockfuncerror = true; blockfuncerror = true;
@ -195,7 +195,7 @@ static UINT8 lib_searchBlockmap_PolyObjs(lua_State *L, INT32 x, INT32 y, mobj_t
LUA_PushUserdata(L, thing, META_MOBJ); LUA_PushUserdata(L, thing, META_MOBJ);
LUA_PushUserdata(L, po, META_POLYOBJ); LUA_PushUserdata(L, po, META_POLYOBJ);
if (lua_pcall(gL, 2, 1, 0)) { if (lua_pcall(gL, 2, 1, 0)) {
if (!blockfuncerror || cv_debug & DBG_LUA) if (!blockfuncerror || cht_debug & DBG_LUA)
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
lua_pop(gL, 1); lua_pop(gL, 1);
blockfuncerror = true; blockfuncerror = true;

View file

@ -411,7 +411,7 @@ static int call_single_hook_no_copy(Hook_State *hook)
else else
{ {
/* print the error message once */ /* print the error message once */
if (cv_debug & DBG_LUA || !in_bit_array(hooksErrored, hook->id)) if (cht_debug & DBG_LUA || !in_bit_array(hooksErrored, hook->id))
{ {
CONS_Alert(CONS_WARNING, "%s\n", lua_tostring(gL, -1)); CONS_Alert(CONS_WARNING, "%s\n", lua_tostring(gL, -1));
set_bit_array(hooksErrored, hook->id); set_bit_array(hooksErrored, hook->id);

View file

@ -38,6 +38,8 @@
#include "lua_script.h" #include "lua_script.h"
#include "lua_hook.h" #include "lua_hook.h"
#include "fastcmp.h"
// //
// CHEAT SEQUENCE PACKAGE // CHEAT SEQUENCE PACKAGE
// //
@ -111,7 +113,7 @@ static UINT8 cheatf_devmode(void)
for (i = 0; i < MAXUNLOCKABLES; i++) for (i = 0; i < MAXUNLOCKABLES; i++)
unlockables[i].unlocked = true; unlockables[i].unlocked = true;
devparm = true; devparm = true;
cv_debug |= 0x8000; cht_debug |= 0x8000;
// Refresh secrets menu existing. // Refresh secrets menu existing.
M_ClearMenus(true); M_ClearMenus(true);
@ -665,24 +667,81 @@ void Command_Resetemeralds_f(void)
} }
*/ */
//
// Devmode
//
UINT32 cht_debug;
struct debugFlagNames_s const debug_flag_names[] =
{
{"None", DBG_NONE},
{"Basic", DBG_BASIC},
{"Detailed", DBG_DETAILED},
{"Player", DBG_PLAYER},
{"Render", DBG_RENDER},
{"Renderer", DBG_RENDER}, // alt name
{"Polyobj", DBG_POLYOBJ},
{"GameLogic", DBG_GAMELOGIC},
{"Game", DBG_GAMELOGIC}, // alt name
{"Netplay", DBG_NETPLAY},
{"Memory", DBG_MEMORY},
{"Setup", DBG_SETUP},
{"Lua", DBG_LUA},
{"RNG", DBG_RNG},
{"Randomizer", DBG_RNG}, // alt name
{NULL, 0}
};
void Command_Devmode_f(void) void Command_Devmode_f(void)
{ {
size_t argc = 0;
REQUIRE_CHEATS; REQUIRE_CHEATS;
REQUIRE_SINGLEPLAYER; // TODO: make multiplayer compatible
if (COM_Argc() > 1) argc = COM_Argc();
if (argc > 1)
{ {
const char *arg = COM_Argv(1); UINT32 flags = 0;
size_t i;
if (arg[0] && arg[0] == '0' && for (i = 1; i < argc; i++)
arg[1] && arg[1] == 'x') // Use hexadecimal! {
cv_debug = axtoi(arg+2); const char *arg = COM_Argv(i);
else size_t j;
cv_debug = atoi(arg);
// Try it as a string
for (j = 0; debug_flag_names[j].str; j++)
{
if (stricmp(arg, debug_flag_names[j].str) == 0)
{
break;
}
}
if (debug_flag_names[j].str)
{
flags |= debug_flag_names[j].flag;
continue;
}
// Try it as a number
if (arg[0] && arg[0] == '0' &&
arg[1] && arg[1] == 'x') // Use hexadecimal!
{
flags |= axtoi(arg+2);
}
else
{
flags |= atoi(arg);
}
}
D_Cheat(consoleplayer, CHEAT_DEVMODE, flags);
} }
else else
{ {
CONS_Printf(M_GetText("devmode <flags>: enable debugging tools and info, prepend with 0x to use hexadecimal\n")); CONS_Printf(M_GetText("devmode <flags>: Enable debugging info. Prepend with 0x to use hexadecimal\n"));
return; return;
} }
} }

View file

@ -29,10 +29,14 @@ typedef enum {
CHEAT_FLIP, CHEAT_FLIP,
CHEAT_HURT, CHEAT_HURT,
CHEAT_RELATIVE_TELEPORT, CHEAT_RELATIVE_TELEPORT,
CHEAT_DEVMODE,
NUMBER_OF_CHEATS NUMBER_OF_CHEATS
} cheat_t; } cheat_t;
//
// Cheat sequences
//
boolean cht_Responder(event_t *ev); boolean cht_Responder(event_t *ev);
void cht_Init(void); void cht_Init(void);

View file

@ -8216,7 +8216,7 @@ void A_OrbitNights(mobj_t* actor)
if (!actor->target) if (!actor->target)
{ {
if (cv_debug && !(actor->target && actor->target->player)) if (cht_debug && !(actor->target && actor->target->player))
CONS_Printf("ERROR: Powerup has no target!\n"); CONS_Printf("ERROR: Powerup has no target!\n");
return; return;
} }
@ -8286,7 +8286,7 @@ void A_SetObjectState(mobj_t *actor)
if ((!locvar2 && !actor->target) || (locvar2 && !actor->tracer)) if ((!locvar2 && !actor->target) || (locvar2 && !actor->tracer))
{ {
if (cv_debug) if (cht_debug)
CONS_Printf("A_SetObjectState: No target to change state!\n"); CONS_Printf("A_SetObjectState: No target to change state!\n");
return; return;
} }
@ -8377,7 +8377,7 @@ void A_KnockBack(mobj_t *actor)
if (!target) if (!target)
{ {
if(cv_debug) if(cht_debug)
CONS_Printf("A_KnockBack: No target!\n"); CONS_Printf("A_KnockBack: No target!\n");
return; return;
} }
@ -8441,7 +8441,7 @@ void A_RingDrain(mobj_t *actor)
if (!actor->target || !actor->target->player) if (!actor->target || !actor->target->player)
{ {
if(cv_debug) if(cht_debug)
CONS_Printf("A_RingDrain: No player targeted!\n"); CONS_Printf("A_RingDrain: No player targeted!\n");
return; return;
} }
@ -8645,7 +8645,7 @@ void A_Custom3DRotate(mobj_t *actor)
if (hspeed==0 && vspeed==0) if (hspeed==0 && vspeed==0)
{ {
if (cv_debug) if (cht_debug)
CONS_Printf("Error: A_Custom3DRotate: Object has no speed.\n"); CONS_Printf("Error: A_Custom3DRotate: Object has no speed.\n");
return; return;
} }
@ -9080,7 +9080,7 @@ void A_SetCustomValue(mobj_t *actor)
if (LUA_CallAction(A_SETCUSTOMVALUE, actor)) if (LUA_CallAction(A_SETCUSTOMVALUE, actor))
return; return;
if (cv_debug) if (cht_debug)
CONS_Printf("Init custom value is %d\n", actor->cusval); CONS_Printf("Init custom value is %d\n", actor->cusval);
if (locvar1 == 0 && locvar2 == 4) if (locvar1 == 0 && locvar2 == 4)
@ -9100,7 +9100,7 @@ void A_SetCustomValue(mobj_t *actor)
else // replace else // replace
actor->cusval = locvar1; actor->cusval = locvar1;
if(cv_debug) if(cht_debug)
CONS_Printf("New custom value is %d\n", actor->cusval); CONS_Printf("New custom value is %d\n", actor->cusval);
} }
@ -9467,7 +9467,7 @@ void A_SetScale(mobj_t *actor)
if (locvar1 <= 0) if (locvar1 <= 0)
{ {
if(cv_debug) if(cht_debug)
CONS_Printf("A_SetScale: Valid scale not specified!\n"); CONS_Printf("A_SetScale: Valid scale not specified!\n");
return; return;
} }
@ -9481,7 +9481,7 @@ void A_SetScale(mobj_t *actor)
if (!target) if (!target)
{ {
if(cv_debug) if(cht_debug)
CONS_Printf("A_SetScale: No target!\n"); CONS_Printf("A_SetScale: No target!\n");
return; return;
} }
@ -9522,7 +9522,7 @@ void A_RemoteDamage(mobj_t *actor)
if (!target) if (!target)
{ {
if(cv_debug) if(cht_debug)
CONS_Printf("A_RemoteDamage: No target!\n"); CONS_Printf("A_RemoteDamage: No target!\n");
return; return;
} }
@ -13149,7 +13149,7 @@ void A_ItemPop(mobj_t *actor)
if (!(actor->target && actor->target->player)) if (!(actor->target && actor->target->player))
{ {
if (cv_debug && !(actor->target && actor->target->player)) if (cht_debug && !(actor->target && actor->target->player))
CONS_Printf("ERROR: Powerup has no target!\n"); CONS_Printf("ERROR: Powerup has no target!\n");
return; return;
} }

View file

@ -4586,7 +4586,7 @@ mobj_t *P_GetClosestAxis(mobj_t *source)
} }
if (closestaxis == NULL) if (closestaxis == NULL)
CONS_Debug(DBG_NIGHTS, "ERROR: No axis points found!\n"); CONS_Alert(CONS_ERROR, "No axis points found!\n");
return closestaxis; return closestaxis;
} }
@ -4658,7 +4658,7 @@ void P_SpawnHoopOfSomething(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT
if (!axis) if (!axis)
{ {
CONS_Debug(DBG_NIGHTS, "You forgot to put axis points in the map!\n"); CONS_Alert(CONS_WARNING, "You forgot to put axis points in the map!\n");
return; return;
} }

View file

@ -4614,6 +4614,8 @@ static void P_NetArchiveMisc(boolean resending)
WRITEINT16(save_p, task->timer); WRITEINT16(save_p, task->timer);
WRITESTRING(save_p, task->command); WRITESTRING(save_p, task->command);
} }
WRITEUINT32(save_p, cht_debug);
} }
static inline boolean P_NetUnArchiveMisc(boolean reloading) static inline boolean P_NetUnArchiveMisc(boolean reloading)
@ -4777,6 +4779,8 @@ static inline boolean P_NetUnArchiveMisc(boolean reloading)
Schedule_Add(basetime, timer, command); Schedule_Add(basetime, timer, command);
} }
cht_debug = READUINT32(save_p);
return true; return true;
} }

View file

@ -915,39 +915,9 @@ void R_ApplyViewMorph(int s)
end = width * height; end = width * height;
#if 0 for (p = 0; p < end; p++)
if (cv_debug & DBG_VIEWMORPH)
{ {
UINT8 border = 32; tmpscr[p] = srcscr[viewmorph[s].scrmap[p]];
UINT8 grid = 160;
INT32 ws = vid.width / 4;
INT32 hs = vid.width * (vid.height / 4);
memcpy(tmpscr, srcscr, vid.width*vid.height);
for (p = 0; p < vid.width; p++)
{
tmpscr[viewmorph.scrmap[p]] = border;
tmpscr[viewmorph.scrmap[p + hs]] = grid;
tmpscr[viewmorph.scrmap[p + hs*2]] = grid;
tmpscr[viewmorph.scrmap[p + hs*3]] = grid;
tmpscr[viewmorph.scrmap[end - 1 - p]] = border;
}
for (p = vid.width; p < end; p += vid.width)
{
tmpscr[viewmorph.scrmap[p]] = border;
tmpscr[viewmorph.scrmap[p + ws]] = grid;
tmpscr[viewmorph.scrmap[p + ws*2]] = grid;
tmpscr[viewmorph.scrmap[p + ws*3]] = grid;
tmpscr[viewmorph.scrmap[end - 1 - p]] = border;
}
}
else
#endif
{
for (p = 0; p < end; p++)
{
tmpscr[p] = srcscr[viewmorph[s].scrmap[p]];
}
} }
VID_BlitLinearScreen(tmpscr, srcscr, VID_BlitLinearScreen(tmpscr, srcscr,

View file

@ -364,7 +364,7 @@ static void ST_drawDebugInfo(void)
if (!stplyr->mo) if (!stplyr->mo)
return; return;
if (cv_debug & DBG_BASIC) if (cht_debug & DBG_BASIC)
{ {
const fixed_t d = AngleFixed(stplyr->mo->angle); const fixed_t d = AngleFixed(stplyr->mo->angle);
V_DrawRightAlignedString(320, 168, V_MONOSPACE, va("X: %6d", stplyr->mo->x>>FRACBITS)); V_DrawRightAlignedString(320, 168, V_MONOSPACE, va("X: %6d", stplyr->mo->x>>FRACBITS));
@ -375,7 +375,7 @@ static void ST_drawDebugInfo(void)
height = 152; height = 152;
} }
if (cv_debug & DBG_DETAILED) if (cht_debug & DBG_DETAILED)
{ {
//V_DrawRightAlignedString(320, height - 104, V_MONOSPACE, va("SHIELD: %5x", stplyr->powers[pw_shield])); //V_DrawRightAlignedString(320, height - 104, V_MONOSPACE, va("SHIELD: %5x", stplyr->powers[pw_shield]));
V_DrawRightAlignedString(320, height - 96, V_MONOSPACE, va("SCALE: %5d%%", (stplyr->mo->scale*100)/FRACUNIT)); V_DrawRightAlignedString(320, height - 96, V_MONOSPACE, va("SCALE: %5d%%", (stplyr->mo->scale*100)/FRACUNIT));
@ -404,7 +404,7 @@ static void ST_drawDebugInfo(void)
height -= 120; height -= 120;
} }
if (cv_debug & DBG_RANDOMIZER) // randomizer testing if (cht_debug & DBG_RNG) // randomizer testing
{ {
// TODO: this only accounts for the undefined class, // TODO: this only accounts for the undefined class,
// which should be phased out as much as possible anyway. // which should be phased out as much as possible anyway.
@ -421,7 +421,7 @@ static void ST_drawDebugInfo(void)
height -= 32; height -= 32;
} }
if (cv_debug & DBG_MEMORY) if (cht_debug & DBG_MEMORY)
V_DrawRightAlignedString(320, height, V_MONOSPACE, va("Heap used: %7sKB", sizeu1(Z_TagsUsage(0, INT32_MAX)>>10))); V_DrawRightAlignedString(320, height, V_MONOSPACE, va("Heap used: %7sKB", sizeu1(Z_TagsUsage(0, INT32_MAX)>>10)));
} }