- moved the VM types into their own file and only include it where really needed.

This commit is contained in:
Christoph Oelckers 2017-04-13 01:12:04 +02:00
commit 6599e2c425
111 changed files with 4283 additions and 4147 deletions

View file

@ -87,6 +87,8 @@
#include "g_levellocals.h"
#include "actorinlines.h"
#include "stats.h"
#include "types.h"
#include "vm.h"
// P-codes for ACS scripts
enum
@ -5431,7 +5433,7 @@ static int ScriptCall(AActor *activator, unsigned argc, int32_t *args)
// The return value can be the same types as the parameter types, plus void
if (func->Proto->ReturnTypes.Size() == 0)
{
GlobalVMStack.Call(func, &params[0], params.Size(), nullptr, 0);
VMCall(func, &params[0], params.Size(), nullptr, 0);
}
else
{
@ -5439,7 +5441,7 @@ static int ScriptCall(AActor *activator, unsigned argc, int32_t *args)
if (rettype == TypeSInt32 || rettype == TypeBool || rettype == TypeColor || rettype == TypeName || rettype == TypeSound)
{
VMReturn ret(&retval);
GlobalVMStack.Call(func, &params[0], params.Size(), &ret, 1);
VMCall(func, &params[0], params.Size(), &ret, 1);
if (rettype == TypeName)
{
retval = GlobalACSStrings.AddString(FName(ENamedName(retval)));
@ -5453,20 +5455,20 @@ static int ScriptCall(AActor *activator, unsigned argc, int32_t *args)
{
double d;
VMReturn ret(&d);
GlobalVMStack.Call(func, &params[0], params.Size(), &ret, 1);
VMCall(func, &params[0], params.Size(), &ret, 1);
retval = DoubleToACS(d);
}
else if (rettype == TypeString)
{
FString d;
VMReturn ret(&d);
GlobalVMStack.Call(func, &params[0], params.Size(), &ret, 1);
VMCall(func, &params[0], params.Size(), &ret, 1);
retval = GlobalACSStrings.AddString(d);
}
else
{
// All other return values can not be handled so ignore them.
GlobalVMStack.Call(func, &params[0], params.Size(), nullptr, 0);
VMCall(func, &params[0], params.Size(), nullptr, 0);
}
}
}
@ -6910,7 +6912,7 @@ static void SetMarineWeapon(AActor *marine, int weapon)
if (smw)
{
VMValue params[2] = { marine, weapon };
GlobalVMStack.Call(smw, params, 2, nullptr, 0, nullptr);
VMCall(smw, params, 2, nullptr, 0);
}
}
@ -6921,7 +6923,7 @@ static void SetMarineSprite(AActor *marine, PClassActor *source)
if (sms)
{
VMValue params[2] = { marine, source };
GlobalVMStack.Call(sms, params, 2, nullptr, 0, nullptr);
VMCall(sms, params, 2, nullptr, 0);
}
}