remove "DECORATE" from error string

* print warning count as well
* allow treating warnings as errors
This commit is contained in:
Ricardo Luís Vaz Silva 2024-12-13 16:36:00 -03:00
parent 325817afdf
commit e82c7d2428
2 changed files with 22 additions and 1 deletions

View file

@ -40,6 +40,7 @@
#include "filesystem.h"
CVAR(Bool, strictdecorate, false, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
CVAR(Bool, warningstoerrors, false, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
EXTERN_CVAR(Bool, vm_jit)
EXTERN_CVAR(Bool, vm_jit_aot)

View file

@ -65,6 +65,7 @@ static TMap<FState *, FScriptPosition> StateSourceLines;
static FScriptPosition unknownstatesource("unknown file", 0);
EXTERN_CVAR(Bool, strictdecorate);
EXTERN_CVAR(Bool, warningstoerrors);
//==========================================================================
//
@ -464,8 +465,27 @@ void LoadActors()
if (FScriptPosition::ErrorCounter > 0)
{
I_Error("%d errors while parsing DECORATE scripts", FScriptPosition::ErrorCounter);
if (FScriptPosition::WarnCounter > 0)
{
I_Error("%d errors, %d warnings while parsing scripts", FScriptPosition::ErrorCounter, FScriptPosition::WarnCounter);
}
else
{
I_Error("%d errors while parsing scripts", FScriptPosition::ErrorCounter);
}
}
else if (FScriptPosition::WarnCounter > 0)
{
if(warningstoerrors)
{
I_Error("%d warnings while parsing scripts\n", FScriptPosition::WarnCounter);
}
else
{
Printf(TEXTCOLOR_ORANGE "%d warnings while parsing scripts\n", FScriptPosition::WarnCounter);
}
}
FScriptPosition::ResetErrorCounter();
// AllActorClasses hasn'T been set up yet.
for (int i = PClass::AllClasses.Size() - 1; i >= 0; i--)