}
+static int save_state_wrapper(HSQUIRRELVM vm)
+{
+ (void) vm;
+
+ try {
+ Scripting::save_state();
+
+ return 0;
+
+ } catch(std::exception& e) {
+ sq_throwerror(vm, e.what());
+ return SQ_ERROR;
+ } catch(...) {
+ sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
+ return SQ_ERROR;
+ }
+
+}
+
static int add_key_wrapper(HSQUIRRELVM vm)
{
int arg0;
throw SquirrelError(v, "Couldn't register function 'import'");
}
+ sq_pushstring(v, "save_state", -1);
+ sq_newclosure(v, &save_state_wrapper, 0);
+ if(SQ_FAILED(sq_createslot(v, -3))) {
+ throw SquirrelError(v, "Couldn't register function 'save_state'");
+ }
+
sq_pushstring(v, "add_key", -1);
sq_newclosure(v, &add_key_wrapper, 0);
if(SQ_FAILED(sq_createslot(v, -3))) {