- Added NULL checks to all places where class names are passed as DECORATE
parameters. - All DECORATE parameters are passed as expressions now. This change allows for compile time checks of all class names being used in DECORATE so many incorrect definitions may output warnings now. - Changed DECORATE sound and color parameters to use expressions. - Changed: S_StopChannel now resets the actor's sound flags. The previous bug made me think that delaying this until FMod calls the end of sound callback may simply be too late. SVN r1276 (trunk)
This commit is contained in:
parent
4c6b7f6752
commit
d753d41752
23 changed files with 1467 additions and 967 deletions
|
|
@ -21,6 +21,7 @@
|
|||
#include "cmdlib.h"
|
||||
#include "m_misc.h"
|
||||
#include "templates.h"
|
||||
#include "doomstat.h"
|
||||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
||||
|
|
@ -1023,3 +1024,91 @@ void FScanner::CheckOpen()
|
|||
I_FatalError ("SC_ call before SC_Open().");
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// a class that remembers a parser position
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FScriptPosition::FScriptPosition(const FScriptPosition &other)
|
||||
{
|
||||
FileName = other.FileName;
|
||||
ScriptLine = other.ScriptLine;
|
||||
}
|
||||
|
||||
FScriptPosition::FScriptPosition(FString fname, int line)
|
||||
{
|
||||
FileName = fname;
|
||||
ScriptLine = line;
|
||||
}
|
||||
|
||||
FScriptPosition::FScriptPosition(FScanner &sc)
|
||||
{
|
||||
FileName = sc.ScriptName;
|
||||
ScriptLine = sc.GetMessageLine();
|
||||
}
|
||||
|
||||
FScriptPosition &FScriptPosition::operator=(const FScriptPosition &other)
|
||||
{
|
||||
FileName = other.FileName;
|
||||
ScriptLine = other.ScriptLine;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FScriptPosition::Message
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void STACK_ARGS FScriptPosition::Message (int severity, const char *message, ...) const
|
||||
{
|
||||
FString composed;
|
||||
|
||||
if ((severity == MSG_DEBUG || severity == MSG_DEBUGLOG) && !developer) return;
|
||||
|
||||
if (message == NULL)
|
||||
{
|
||||
composed = "Bad syntax.";
|
||||
}
|
||||
else
|
||||
{
|
||||
va_list arglist;
|
||||
va_start (arglist, message);
|
||||
composed.VFormat (message, arglist);
|
||||
va_end (arglist);
|
||||
}
|
||||
const char *type = "";
|
||||
int level = PRINT_HIGH;
|
||||
|
||||
switch (severity)
|
||||
{
|
||||
default:
|
||||
return;
|
||||
|
||||
case MSG_WARNING:
|
||||
type = "warning";
|
||||
break;
|
||||
|
||||
case MSG_ERROR:
|
||||
type = "error";
|
||||
break;
|
||||
|
||||
case MSG_DEBUG:
|
||||
type = "message";
|
||||
break;
|
||||
|
||||
case MSG_DEBUGLOG:
|
||||
case MSG_LOG:
|
||||
type = "message";
|
||||
level = PRINT_LOG;
|
||||
break;
|
||||
|
||||
case MSG_FATAL:
|
||||
I_Error ("Script error, \"%s\" line %d:\n%s\n",
|
||||
FileName.GetChars(), ScriptLine, composed.GetChars());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue