- moved the VM types into their own file and only include it where really needed.
This commit is contained in:
parent
3e47f00ba0
commit
6599e2c425
111 changed files with 4283 additions and 4147 deletions
|
|
@ -55,7 +55,7 @@
|
|||
#include "r_utility.h"
|
||||
#include "menu/menu.h"
|
||||
#include "textures/textures.h"
|
||||
#include "virtual.h"
|
||||
#include "vm.h"
|
||||
#include "events.h"
|
||||
|
||||
//
|
||||
|
|
@ -182,7 +182,7 @@ bool DMenu::CallResponder(event_t *ev)
|
|||
VMValue params[] = { (DObject*)this, &e };
|
||||
int retval;
|
||||
VMReturn ret(&retval);
|
||||
GlobalVMStack.Call(func, params, 2, &ret, 1, nullptr);
|
||||
VMCall(func, params, 2, &ret, 1);
|
||||
return !!retval;
|
||||
}
|
||||
}
|
||||
|
|
@ -194,7 +194,7 @@ bool DMenu::CallResponder(event_t *ev)
|
|||
VMValue params[] = { (DObject*)this, &e };
|
||||
int retval;
|
||||
VMReturn ret(&retval);
|
||||
GlobalVMStack.Call(func, params, 2, &ret, 1, nullptr);
|
||||
VMCall(func, params, 2, &ret, 1);
|
||||
return !!retval;
|
||||
}
|
||||
}
|
||||
|
|
@ -214,7 +214,7 @@ bool DMenu::CallMenuEvent(int mkey, bool fromcontroller)
|
|||
VMValue params[] = { (DObject*)this, mkey, fromcontroller };
|
||||
int retval;
|
||||
VMReturn ret(&retval);
|
||||
GlobalVMStack.Call(func, params, 3, &ret, 1, nullptr);
|
||||
VMCall(func, params, 3, &ret, 1);
|
||||
return !!retval;
|
||||
}
|
||||
else return false;
|
||||
|
|
@ -246,7 +246,7 @@ void DMenu::Close ()
|
|||
IFVIRTUALPTR(CurrentMenu, DMenu, OnReturn)
|
||||
{
|
||||
VMValue params[] = { CurrentMenu };
|
||||
GlobalVMStack.Call(func, params, 1, nullptr, 0, nullptr);
|
||||
VMCall(func, params, 1, nullptr, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -274,7 +274,7 @@ void DMenu::CallTicker()
|
|||
IFVIRTUAL(DMenu, Ticker)
|
||||
{
|
||||
VMValue params[] = { (DObject*)this };
|
||||
GlobalVMStack.Call(func, params, 1, nullptr, 0, nullptr);
|
||||
VMCall(func, params, 1, nullptr, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ void DMenu::CallDrawer()
|
|||
IFVIRTUAL(DMenu, Drawer)
|
||||
{
|
||||
VMValue params[] = { (DObject*)this };
|
||||
GlobalVMStack.Call(func, params, 1, nullptr, 0, nullptr);
|
||||
VMCall(func, params, 1, nullptr, 0);
|
||||
screen->ClearClipRect(); // make sure the scripts don't leave a valid clipping rect behind.
|
||||
}
|
||||
}
|
||||
|
|
@ -296,7 +296,7 @@ bool DMenu::TranslateKeyboardEvents()
|
|||
VMValue params[] = { (DObject*)this };
|
||||
int retval;
|
||||
VMReturn ret(&retval);
|
||||
GlobalVMStack.Call(func, params, countof(params), &ret, 1, nullptr);
|
||||
VMCall(func, params, countof(params), &ret, 1);
|
||||
return !!retval;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -472,7 +472,7 @@ void M_SetMenu(FName menu, int param)
|
|||
IFVIRTUALPTRNAME(newmenu, "ListMenu", Init)
|
||||
{
|
||||
VMValue params[3] = { newmenu, CurrentMenu, ld };
|
||||
GlobalVMStack.Call(func, params, 3, nullptr, 0);
|
||||
VMCall(func, params, 3, nullptr, 0);
|
||||
}
|
||||
M_ActivateMenu(newmenu);
|
||||
}
|
||||
|
|
@ -488,7 +488,7 @@ void M_SetMenu(FName menu, int param)
|
|||
IFVIRTUALPTRNAME(newmenu, "OptionMenu", Init)
|
||||
{
|
||||
VMValue params[3] = { newmenu, CurrentMenu, ld };
|
||||
GlobalVMStack.Call(func, params, 3, nullptr, 0);
|
||||
VMCall(func, params, 3, nullptr, 0);
|
||||
}
|
||||
M_ActivateMenu(newmenu);
|
||||
}
|
||||
|
|
@ -506,7 +506,7 @@ void M_SetMenu(FName menu, int param)
|
|||
IFVIRTUALPTRNAME(newmenu, "GenericMenu", Init)
|
||||
{
|
||||
VMValue params[3] = { newmenu, CurrentMenu };
|
||||
GlobalVMStack.Call(func, params, 2, nullptr, 0);
|
||||
VMCall(func, params, 2, nullptr, 0);
|
||||
}
|
||||
M_ActivateMenu(newmenu);
|
||||
return;
|
||||
|
|
@ -1058,7 +1058,7 @@ CCMD(undocolorpic)
|
|||
IFVIRTUALPTR(CurrentMenu, DMenu, ResetColor)
|
||||
{
|
||||
VMValue params[] = { (DObject*)CurrentMenu };
|
||||
GlobalVMStack.Call(func, params, countof(params), nullptr, 0, nullptr);
|
||||
VMCall(func, params, countof(params), nullptr, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1128,7 +1128,7 @@ DMenuItemBase * CreateOptionMenuItemStaticText(const char *name, bool v)
|
|||
FString namestr = name;
|
||||
VMValue params[] = { p, &namestr, v };
|
||||
auto f = dyn_cast<PFunction>(c->FindSymbol("Init", false));
|
||||
GlobalVMStack.Call(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
VMCall(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
return (DMenuItemBase*)p;
|
||||
}
|
||||
|
||||
|
|
@ -1139,7 +1139,7 @@ DMenuItemBase * CreateOptionMenuItemJoyConfigMenu(const char *label, IJoystickCo
|
|||
FString namestr = label;
|
||||
VMValue params[] = { p, &namestr, joy };
|
||||
auto f = dyn_cast<PFunction>(c->FindSymbol("Init", false));
|
||||
GlobalVMStack.Call(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
VMCall(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
return (DMenuItemBase*)p;
|
||||
}
|
||||
|
||||
|
|
@ -1150,7 +1150,7 @@ DMenuItemBase * CreateOptionMenuItemSubmenu(const char *label, FName cmd, int ce
|
|||
FString namestr = label;
|
||||
VMValue params[] = { p, &namestr, cmd.GetIndex(), center };
|
||||
auto f = dyn_cast<PFunction>(c->FindSymbol("Init", false));
|
||||
GlobalVMStack.Call(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
VMCall(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
return (DMenuItemBase*)p;
|
||||
}
|
||||
|
||||
|
|
@ -1161,7 +1161,7 @@ DMenuItemBase * CreateOptionMenuItemControl(const char *label, FName cmd, FKeyBi
|
|||
FString namestr = label;
|
||||
VMValue params[] = { p, &namestr, cmd.GetIndex(), bindings };
|
||||
auto f = dyn_cast<PFunction>(c->FindSymbol("Init", false));
|
||||
GlobalVMStack.Call(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
VMCall(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
return (DMenuItemBase*)p;
|
||||
}
|
||||
|
||||
|
|
@ -1172,7 +1172,7 @@ DMenuItemBase * CreateListMenuItemPatch(double x, double y, int height, int hotk
|
|||
FString keystr = FString(char(hotkey));
|
||||
VMValue params[] = { p, x, y, height, tex.GetIndex(), &keystr, command.GetIndex(), param };
|
||||
auto f = dyn_cast<PFunction>(c->FindSymbol("InitDirect", false));
|
||||
GlobalVMStack.Call(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
VMCall(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
return (DMenuItemBase*)p;
|
||||
}
|
||||
|
||||
|
|
@ -1184,7 +1184,7 @@ DMenuItemBase * CreateListMenuItemText(double x, double y, int height, int hotke
|
|||
FString textstr = text;
|
||||
VMValue params[] = { p, x, y, height, &keystr, &textstr, font, int(color1.d), int(color2.d), command.GetIndex(), param };
|
||||
auto f = dyn_cast<PFunction>(c->FindSymbol("InitDirect", false));
|
||||
GlobalVMStack.Call(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
VMCall(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
return (DMenuItemBase*)p;
|
||||
}
|
||||
|
||||
|
|
@ -1195,7 +1195,7 @@ bool DMenuItemBase::Activate()
|
|||
VMValue params[] = { (DObject*)this };
|
||||
int retval;
|
||||
VMReturn ret(&retval);
|
||||
GlobalVMStack.Call(func, params, countof(params), &ret, 1, nullptr);
|
||||
VMCall(func, params, countof(params), &ret, 1);
|
||||
return !!retval;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -1209,7 +1209,7 @@ bool DMenuItemBase::SetString(int i, const char *s)
|
|||
VMValue params[] = { (DObject*)this, i, &namestr };
|
||||
int retval;
|
||||
VMReturn ret(&retval);
|
||||
GlobalVMStack.Call(func, params, countof(params), &ret, 1, nullptr);
|
||||
VMCall(func, params, countof(params), &ret, 1);
|
||||
return !!retval;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -1223,7 +1223,7 @@ bool DMenuItemBase::GetString(int i, char *s, int len)
|
|||
int retval;
|
||||
FString retstr;
|
||||
VMReturn ret[2]; ret[0].IntAt(&retval); ret[1].StringAt(&retstr);
|
||||
GlobalVMStack.Call(func, params, countof(params), ret, 2, nullptr);
|
||||
VMCall(func, params, countof(params), ret, 2);
|
||||
strncpy(s, retstr, len);
|
||||
return !!retval;
|
||||
}
|
||||
|
|
@ -1238,7 +1238,7 @@ bool DMenuItemBase::SetValue(int i, int value)
|
|||
VMValue params[] = { (DObject*)this, i, value };
|
||||
int retval;
|
||||
VMReturn ret(&retval);
|
||||
GlobalVMStack.Call(func, params, countof(params), &ret, 1, nullptr);
|
||||
VMCall(func, params, countof(params), &ret, 1);
|
||||
return !!retval;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -1251,7 +1251,7 @@ bool DMenuItemBase::GetValue(int i, int *pvalue)
|
|||
VMValue params[] = { (DObject*)this, i };
|
||||
int retval[2];
|
||||
VMReturn ret[2]; ret[0].IntAt(&retval[0]); ret[1].IntAt(&retval[1]);
|
||||
GlobalVMStack.Call(func, params, countof(params), ret, 2, nullptr);
|
||||
VMCall(func, params, countof(params), ret, 2);
|
||||
*pvalue = retval[1];
|
||||
return !!retval[0];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue