mirror of
https://github.com/rrika/cdcEngineDXHR.git
synced 2024-11-27 07:20:22 +00:00
32 lines
618 B
C++
32 lines
618 B
C++
#include "ScriptObject.h"
|
|
#include "ScriptType.h"
|
|
|
|
namespace cdc {
|
|
|
|
ScriptObject::ScriptObject(ScriptType *scriptType) :
|
|
scriptType(scriptType),
|
|
m_instance(nullptr)
|
|
{
|
|
// TODO
|
|
m_instance = (uint8_t*) new char;
|
|
m_instance[0] = 0;
|
|
}
|
|
|
|
Function *ScriptObject::GetFunction(int32_t state, int32_t vtIndex) {
|
|
return scriptType->GetVFunction(state, vtIndex);
|
|
}
|
|
|
|
void ScriptObject::CallFunction(Function *func, int32_t numArgs, DataValue *args, void *retVal) {
|
|
if (!func || !m_instance)
|
|
return;
|
|
|
|
if (func->flags & Function::Flags::NATIVE) {
|
|
func->nativeFunc(this, numArgs, args, retVal);
|
|
return;
|
|
}
|
|
|
|
// TODO
|
|
}
|
|
|
|
}
|