-static SQInteger Level_release_hook(SQUserPointer ptr, SQInteger )
-{
- Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
- delete _this;
- return 0;
-}
-
-static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
-{
- SQUserPointer data;
- if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
- sq_throwerror(vm, _SC("'finish' called without instance"));
- return SQ_ERROR;
- }
- Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
- SQBool arg0;
- if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
- sq_throwerror(vm, _SC("Argument 1 not a bool"));
- return SQ_ERROR;
- }
-
- try {
- _this->finish(arg0 == SQTrue);
-
- return 0;
-
- } catch(std::exception& e) {
- sq_throwerror(vm, e.what());
- return SQ_ERROR;
- } catch(...) {
- sq_throwerror(vm, _SC("Unexpected exception while executing function 'finish'"));
- return SQ_ERROR;
- }
-
-}
-
-static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
-{
- SQUserPointer data;
- if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
- sq_throwerror(vm, _SC("'spawn' called without instance"));
- return SQ_ERROR;
- }
- Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
- const SQChar* arg0;
- if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
- sq_throwerror(vm, _SC("Argument 1 not a string"));
- return SQ_ERROR;
- }
- const SQChar* arg1;
- if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
- sq_throwerror(vm, _SC("Argument 2 not a string"));
- return SQ_ERROR;
- }
-
- try {
- _this->spawn(arg0, arg1);
-
- return 0;
-
- } catch(std::exception& e) {
- sq_throwerror(vm, e.what());
- return SQ_ERROR;
- } catch(...) {
- sq_throwerror(vm, _SC("Unexpected exception while executing function 'spawn'"));
- return SQ_ERROR;
- }
-
-}
-
-static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
-{
- SQUserPointer data;
- if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
- sq_throwerror(vm, _SC("'flip_vertically' called without instance"));
- return SQ_ERROR;
- }
- Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
-
- try {
- _this->flip_vertically();
-
- return 0;
-
- } catch(std::exception& e) {
- sq_throwerror(vm, e.what());
- return SQ_ERROR;
- } catch(...) {
- sq_throwerror(vm, _SC("Unexpected exception while executing function 'flip_vertically'"));
- return SQ_ERROR;
- }
-
-}
-
-static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
-{
- SQUserPointer data;
- if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
- sq_throwerror(vm, _SC("'toggle_pause' called without instance"));
- return SQ_ERROR;
- }
- Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
-
- try {
- _this->toggle_pause();
-
- return 0;
-
- } catch(std::exception& e) {
- sq_throwerror(vm, e.what());
- return SQ_ERROR;
- } catch(...) {
- sq_throwerror(vm, _SC("Unexpected exception while executing function 'toggle_pause'"));
- return SQ_ERROR;
- }
-
-}
-
-static SQInteger Level_edit_wrapper(HSQUIRRELVM vm)
-{
- SQUserPointer data;
- if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
- sq_throwerror(vm, _SC("'edit' called without instance"));
- return SQ_ERROR;
- }
- Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
- SQBool arg0;
- if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
- sq_throwerror(vm, _SC("Argument 1 not a bool"));
- return SQ_ERROR;
- }
-
- try {
- _this->edit(arg0 == SQTrue);
-
- return 0;
-
- } catch(std::exception& e) {
- sq_throwerror(vm, e.what());
- return SQ_ERROR;
- } catch(...) {
- sq_throwerror(vm, _SC("Unexpected exception while executing function 'edit'"));
- return SQ_ERROR;
- }
-
-}
-