- added multiple message levels for 'developer' CVAR so that the important stuff won't get drowned in pointless notification spam that's of no use to anyone.

- made 'developer' CVAR persist across launches and added some menu entries for it.
- added checks for 'developer' to ACS's CheckInventory function.
This commit is contained in:
Christoph Oelckers 2016-08-28 09:55:04 +02:00
commit e04055dbb2
38 changed files with 157 additions and 139 deletions

View file

@ -450,7 +450,7 @@ int FindStyle (const char *namestr)
{
if (!stricmp(StyleNames[i].Name, namestr)) return StyleNames[i].Num;
}
DPrintf("Unknown render style %s\n", namestr);
DPrintf(DMSG_ERROR, "Unknown render style %s\n", namestr);
return -1;
}
@ -861,7 +861,7 @@ static int PatchThing (int thingy)
}
else
{
DPrintf ("Thing %d\n", thingy);
DPrintf (DMSG_SPAMMY, "Thing %d\n", thingy);
if (thingy > 0)
{
type = InfoNames[thingy - 1];
@ -1086,7 +1086,7 @@ static int PatchThing (int thingy)
}
if (i == BitNames.Size())
{
DPrintf("Unknown bit mnemonic %s\n", strval);
DPrintf(DMSG_ERROR, "Unknown bit mnemonic %s\n", strval);
}
}
}
@ -1242,7 +1242,7 @@ static int PatchThing (int thingy)
else
info->renderflags &= ~RF_INVISIBLE;
}
DPrintf ("Bits: %d,%d (0x%08x,0x%08x)\n", info->flags.GetValue(), info->flags2.GetValue(),
DPrintf (DMSG_SPAMMY, "Bits: %d,%d (0x%08x,0x%08x)\n", info->flags.GetValue(), info->flags2.GetValue(),
info->flags.GetValue(), info->flags2.GetValue());
}
else if (stricmp (Line1, "ID #") == 0)
@ -1328,7 +1328,7 @@ static int PatchSound (int soundNum)
{
int result;
DPrintf ("Sound %d (no longer supported)\n", soundNum);
//DPrintf ("Sound %d (no longer supported)\n", soundNum);
/*
sfxinfo_t *info, dummy;
int offset = 0;
@ -1385,7 +1385,7 @@ static int PatchFrame (int frameNum)
info = FindState (frameNum);
if (info)
{
DPrintf ("Frame %d\n", frameNum);
DPrintf (DMSG_SPAMMY, "Frame %d\n", frameNum);
if (frameNum == 47)
{ // Use original tics for S_DSGUNFLASH1
tics = 5;
@ -1487,7 +1487,7 @@ static int PatchSprite (int sprNum)
if ((unsigned)sprNum < OrgSprNames.Size())
{
DPrintf ("Sprite %d\n", sprNum);
DPrintf (DMSG_SPAMMY, "Sprite %d\n", sprNum);
}
else
{
@ -1534,7 +1534,7 @@ static int PatchAmmo (int ammoNum)
if (ammoNum >= 0 && ammoNum < 4 && (unsigned)ammoNum <= AmmoNames.Size())
{
DPrintf ("Ammo %d.\n", ammoNum);
DPrintf (DMSG_SPAMMY, "Ammo %d.\n", ammoNum);
ammoType = AmmoNames[ammoNum];
if (ammoType != NULL)
{
@ -1617,7 +1617,7 @@ static int PatchWeapon (int weapNum)
if (type != NULL)
{
info = (AWeapon *)GetDefaultByType (type);
DPrintf ("Weapon %d\n", weapNum);
DPrintf (DMSG_SPAMMY, "Weapon %d\n", weapNum);
}
}
@ -1757,7 +1757,7 @@ static int PatchPointer (int ptrNum)
{
if (CodePConv[ptrNum] == indexnum) break;
}
DPrintf("Final ptrNum: %i\n", ptrNum);
DPrintf(DMSG_SPAMMY, "Final ptrNum: %i\n", ptrNum);
}
// End of hack.
@ -1765,7 +1765,7 @@ static int PatchPointer (int ptrNum)
// Better to just use the size of the array rather than a hardcoded value.
if (ptrNum >= 0 && (unsigned int) ptrNum < CodePConv.Size())
{
DPrintf ("Pointer %d\n", ptrNum);
DPrintf (DMSG_SPAMMY, "Pointer %d\n", ptrNum);
}
else
{
@ -1789,7 +1789,7 @@ static int PatchPointer (int ptrNum)
{
SetPointer(state, Actions[index], CodePConv[ptrNum]);
}
DPrintf("%s has a hacked state for pointer num %i with index %i\nLine1=%s, Line2=%s\n",
DPrintf(DMSG_SPAMMY, "%s has a hacked state for pointer num %i with index %i\nLine1=%s, Line2=%s\n",
state->StaticFindStateOwner(state)->TypeName.GetChars(), ptrNum, index, Line1, Line2);
}
else
@ -1806,7 +1806,7 @@ static int PatchCheats (int dummy)
{
int result;
DPrintf ("Cheats (support removed by request)\n");
DPrintf (DMSG_NOTIFY, "Dehacked cheats support removed by request\n");
while ((result = GetLine ()) == 1)
{
@ -1836,7 +1836,7 @@ static int PatchMisc (int dummy)
};
int result;
DPrintf ("Misc\n");
DPrintf (DMSG_SPAMMY, "Misc\n");
while ((result = GetLine()) == 1)
{
@ -2017,7 +2017,7 @@ static int PatchPars (int dummy)
level_info_t *info;
int result, par;
DPrintf ("[Pars]\n");
DPrintf (DMSG_SPAMMY, "[Pars]\n");
while ( (result = GetLine()) ) {
// Argh! .bex doesn't follow the same rules as .deh
@ -2058,7 +2058,7 @@ static int PatchPars (int dummy)
}
info->partime = par;
DPrintf ("Par for %s changed to %d\n", mapname, par);
DPrintf (DMSG_SPAMMY, "Par for %s changed to %d\n", mapname, par);
}
return result;
}
@ -2067,7 +2067,7 @@ static int PatchCodePtrs (int dummy)
{
int result;
DPrintf ("[CodePtr]\n");
DPrintf (DMSG_SPAMMY, "[CodePtr]\n");
while ((result = GetLine()) == 1)
{
@ -2132,7 +2132,7 @@ static int PatchMusic (int dummy)
{
int result;
DPrintf ("[Music]\n");
DPrintf (DMSG_SPAMMY, "[Music]\n");
while ((result = GetLine()) == 1)
{
@ -2142,7 +2142,7 @@ static int PatchMusic (int dummy)
keystring << "MUSIC_" << Line1;
GStrings.SetString (keystring, newname);
DPrintf ("Music %s set to:\n%s\n", keystring.GetChars(), newname);
DPrintf (DMSG_SPAMMY, "Music %s set to:\n%s\n", keystring.GetChars(), newname);
}
return result;
@ -2198,7 +2198,7 @@ static int PatchText (int oldSize)
goto donewithtext;
}
DPrintf ("Searching for text:\n%s\n", oldStr);
DPrintf (DMSG_SPAMMY, "Searching for text:\n%s\n", oldStr);
good = false;
// Search through sprite names; they are always 4 chars
@ -2264,7 +2264,7 @@ static int PatchText (int oldSize)
if (!good)
{
DPrintf (" (Unmatched)\n");
DPrintf (DMSG_SPAMMY, " (Unmatched)\n");
}
donewithtext:
@ -2284,7 +2284,7 @@ static int PatchStrings (int dummy)
{
int result;
DPrintf ("[Strings]\n");
DPrintf (DMSG_SPAMMY, "[Strings]\n");
while ((result = GetLine()) == 1)
{
@ -2310,7 +2310,7 @@ static int PatchStrings (int dummy)
const char *ll = Line1;
if (!stricmp(ll, "GOTREDSKULL")) ll = "GOTREDSKUL";
GStrings.SetString (ll, holdstring);
DPrintf ("%s set to:\n%s\n", Line1, holdstring.GetChars());
DPrintf (DMSG_SPAMMY, "%s set to:\n%s\n", Line1, holdstring.GetChars());
}
return result;
@ -2350,7 +2350,7 @@ static int DoInclude (int dummy)
else
{
data = Line2;
DPrintf ("Including %s\n", data);
DPrintf (DMSG_SPAMMY, "Including %s\n", data);
savepatchname = PatchName;
savepatchfile = PatchFile;
savepatchpt = PatchPt;
@ -2384,7 +2384,7 @@ static int DoInclude (int dummy)
delete[] path;
}
DPrintf ("Done with include\n");
DPrintf (DMSG_SPAMMY, "Done with include\n");
PatchName = savepatchname;
PatchFile = savepatchfile;
PatchPt = savepatchpt;
@ -2536,7 +2536,7 @@ static bool DoDehPatch()
}
else
{
DPrintf ("Patch does not have DeHackEd signature. Assuming .bex\n");
DPrintf (DMSG_WARNING, "Patch does not have DeHackEd signature. Assuming .bex\n");
dversion = 19;
pversion = 6;
PatchPt = PatchFile;
@ -3027,7 +3027,7 @@ void FinishDehPatch ()
subclass->Replacement = old_replacement;
}
DPrintf ("%s replaces %s\n", subclass->TypeName.GetChars(), type->TypeName.GetChars());
DPrintf (DMSG_NOTIFY, "%s replaces %s\n", subclass->TypeName.GetChars(), type->TypeName.GetChars());
}
// Now that all Dehacked patches have been processed, it's okay to free StateMap.