/* ----------------------------------------------------------------------------- GSFramework Copyright 2001-2013 Emmanuel Julien. All Rights Reserved. ----------------------------------------------------------------------------- */ #include "script/script_vm.h" #include "filesystem/filesystem.h" #include "platform.h" using namespace GS; using namespace GS::Script; //------------------------------------------------------------------------------ bool IVM::CompileFile(const char *uri, const Object *context) { Array data; if (!Platform::Get().io->FileLoad(uri, data)) return false; return Compile(data, data.GetCount(), context, uri); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void IVM::SetDebugInterface(IDebug *i, bool) { debug_interface = i; } void IVM::Kill(const char *reason) { if (debug_interface) debug_interface->OnFatalError(reason); state = StateDead; } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ IVM::IVM() : state(StateOk) {} IVM::~IVM() {} //------------------------------------------------------------------------------