2 * WARNING: This file is automatically generated from:
3 * 'src/scripting/wrapper.interface.hpp'
13 #include "squirrel_error.hpp"
14 #include "wrapper.interface.hpp"
21 static SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger )
23 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (ptr);
28 static SQInteger DisplayEffect_fade_out_wrapper(HSQUIRRELVM vm)
31 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
32 sq_throwerror(vm, _SC("'fade_out' called without instance"));
35 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
37 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
38 sq_throwerror(vm, _SC("Argument 1 not a float"));
43 _this->fade_out(static_cast<float> (arg0));
47 } catch(std::exception& e) {
48 sq_throwerror(vm, e.what());
51 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
57 static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm)
60 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
61 sq_throwerror(vm, _SC("'fade_in' called without instance"));
64 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
66 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
67 sq_throwerror(vm, _SC("Argument 1 not a float"));
72 _this->fade_in(static_cast<float> (arg0));
76 } catch(std::exception& e) {
77 sq_throwerror(vm, e.what());
80 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
86 static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm)
89 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
90 sq_throwerror(vm, _SC("'set_black' called without instance"));
93 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
95 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
96 sq_throwerror(vm, _SC("Argument 1 not a bool"));
101 _this->set_black(arg0 == SQTrue);
105 } catch(std::exception& e) {
106 sq_throwerror(vm, e.what());
109 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_black'"));
115 static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm)
118 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
119 sq_throwerror(vm, _SC("'is_black' called without instance"));
122 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
125 bool return_value = _this->is_black();
127 sq_pushbool(vm, return_value);
130 } catch(std::exception& e) {
131 sq_throwerror(vm, e.what());
134 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_black'"));
140 static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm)
143 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
144 sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance"));
147 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
149 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
150 sq_throwerror(vm, _SC("Argument 1 not a float"));
155 _this->sixteen_to_nine(static_cast<float> (arg0));
159 } catch(std::exception& e) {
160 sq_throwerror(vm, e.what());
163 sq_throwerror(vm, _SC("Unexpected exception while executing function 'sixteen_to_nine'"));
169 static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm)
172 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
173 sq_throwerror(vm, _SC("'four_to_three' called without instance"));
176 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
178 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
179 sq_throwerror(vm, _SC("Argument 1 not a float"));
184 _this->four_to_three(static_cast<float> (arg0));
188 } catch(std::exception& e) {
189 sq_throwerror(vm, e.what());
192 sq_throwerror(vm, _SC("Unexpected exception while executing function 'four_to_three'"));
198 static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger )
200 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
205 static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm)
208 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
209 sq_throwerror(vm, _SC("'shake' called without instance"));
212 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
214 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
215 sq_throwerror(vm, _SC("Argument 1 not a float"));
219 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
220 sq_throwerror(vm, _SC("Argument 2 not a float"));
224 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
225 sq_throwerror(vm, _SC("Argument 3 not a float"));
230 _this->shake(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
234 } catch(std::exception& e) {
235 sq_throwerror(vm, e.what());
238 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'"));
244 static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm)
247 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
248 sq_throwerror(vm, _SC("'set_pos' called without instance"));
251 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
253 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
254 sq_throwerror(vm, _SC("Argument 1 not a float"));
258 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
259 sq_throwerror(vm, _SC("Argument 2 not a float"));
264 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
268 } catch(std::exception& e) {
269 sq_throwerror(vm, e.what());
272 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
278 static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm)
281 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
282 sq_throwerror(vm, _SC("'set_mode' called without instance"));
285 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
287 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
288 sq_throwerror(vm, _SC("Argument 1 not a string"));
293 _this->set_mode(arg0);
297 } catch(std::exception& e) {
298 sq_throwerror(vm, e.what());
301 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_mode'"));
307 static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm)
310 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
311 sq_throwerror(vm, _SC("'scroll_to' called without instance"));
314 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
316 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
317 sq_throwerror(vm, _SC("Argument 1 not a float"));
321 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
322 sq_throwerror(vm, _SC("Argument 2 not a float"));
326 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
327 sq_throwerror(vm, _SC("Argument 3 not a float"));
332 _this->scroll_to(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
336 } catch(std::exception& e) {
337 sq_throwerror(vm, e.what());
340 sq_throwerror(vm, _SC("Unexpected exception while executing function 'scroll_to'"));
346 static SQInteger Level_release_hook(SQUserPointer ptr, SQInteger )
348 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
353 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
356 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
357 sq_throwerror(vm, _SC("'finish' called without instance"));
360 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
362 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
363 sq_throwerror(vm, _SC("Argument 1 not a bool"));
368 _this->finish(arg0 == SQTrue);
372 } catch(std::exception& e) {
373 sq_throwerror(vm, e.what());
376 sq_throwerror(vm, _SC("Unexpected exception while executing function 'finish'"));
382 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
385 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
386 sq_throwerror(vm, _SC("'spawn' called without instance"));
389 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
391 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
392 sq_throwerror(vm, _SC("Argument 1 not a string"));
396 if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
397 sq_throwerror(vm, _SC("Argument 2 not a string"));
402 _this->spawn(arg0, arg1);
406 } catch(std::exception& e) {
407 sq_throwerror(vm, e.what());
410 sq_throwerror(vm, _SC("Unexpected exception while executing function 'spawn'"));
416 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
419 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
420 sq_throwerror(vm, _SC("'flip_vertically' called without instance"));
423 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
426 _this->flip_vertically();
430 } catch(std::exception& e) {
431 sq_throwerror(vm, e.what());
434 sq_throwerror(vm, _SC("Unexpected exception while executing function 'flip_vertically'"));
440 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
443 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
444 sq_throwerror(vm, _SC("'toggle_pause' called without instance"));
447 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
450 _this->toggle_pause();
454 } catch(std::exception& e) {
455 sq_throwerror(vm, e.what());
458 sq_throwerror(vm, _SC("Unexpected exception while executing function 'toggle_pause'"));
464 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
466 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
471 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
474 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
475 sq_throwerror(vm, _SC("'set_action' called without instance"));
478 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
480 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
481 sq_throwerror(vm, _SC("Argument 1 not a string"));
486 _this->set_action(arg0);
490 } catch(std::exception& e) {
491 sq_throwerror(vm, e.what());
494 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
500 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
503 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
504 sq_throwerror(vm, _SC("'get_action' called without instance"));
507 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
510 std::string return_value = _this->get_action();
512 sq_pushstring(vm, return_value.c_str(), return_value.size());
515 } catch(std::exception& e) {
516 sq_throwerror(vm, e.what());
519 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
525 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
528 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
529 sq_throwerror(vm, _SC("'move' called without instance"));
532 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
534 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
535 sq_throwerror(vm, _SC("Argument 1 not a float"));
539 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
540 sq_throwerror(vm, _SC("Argument 2 not a float"));
545 _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
549 } catch(std::exception& e) {
550 sq_throwerror(vm, e.what());
553 sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
559 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
562 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
563 sq_throwerror(vm, _SC("'set_pos' called without instance"));
566 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
568 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
569 sq_throwerror(vm, _SC("Argument 1 not a float"));
573 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
574 sq_throwerror(vm, _SC("Argument 2 not a float"));
579 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
583 } catch(std::exception& e) {
584 sq_throwerror(vm, e.what());
587 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
593 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
596 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
597 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
600 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
603 float return_value = _this->get_pos_x();
605 sq_pushfloat(vm, return_value);
608 } catch(std::exception& e) {
609 sq_throwerror(vm, e.what());
612 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
618 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
621 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
622 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
625 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
628 float return_value = _this->get_pos_y();
630 sq_pushfloat(vm, return_value);
633 } catch(std::exception& e) {
634 sq_throwerror(vm, e.what());
637 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
643 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
646 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
647 sq_throwerror(vm, _SC("'set_velocity' called without instance"));
650 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
652 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
653 sq_throwerror(vm, _SC("Argument 1 not a float"));
657 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
658 sq_throwerror(vm, _SC("Argument 2 not a float"));
663 _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
667 } catch(std::exception& e) {
668 sq_throwerror(vm, e.what());
671 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
677 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
680 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
681 sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
684 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
687 float return_value = _this->get_velocity_x();
689 sq_pushfloat(vm, return_value);
692 } catch(std::exception& e) {
693 sq_throwerror(vm, e.what());
696 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
702 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
705 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
706 sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
709 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
712 float return_value = _this->get_velocity_y();
714 sq_pushfloat(vm, return_value);
717 } catch(std::exception& e) {
718 sq_throwerror(vm, e.what());
721 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
727 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
730 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
731 sq_throwerror(vm, _SC("'set_visible' called without instance"));
734 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
736 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
737 sq_throwerror(vm, _SC("Argument 1 not a bool"));
742 _this->set_visible(arg0 == SQTrue);
746 } catch(std::exception& e) {
747 sq_throwerror(vm, e.what());
750 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
756 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
759 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
760 sq_throwerror(vm, _SC("'is_visible' called without instance"));
763 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
766 bool return_value = _this->is_visible();
768 sq_pushbool(vm, return_value);
771 } catch(std::exception& e) {
772 sq_throwerror(vm, e.what());
775 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
781 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
784 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
785 sq_throwerror(vm, _SC("'get_name' called without instance"));
788 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
791 std::string return_value = _this->get_name();
793 sq_pushstring(vm, return_value.c_str(), return_value.size());
796 } catch(std::exception& e) {
797 sq_throwerror(vm, e.what());
800 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
806 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
808 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
813 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
816 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
817 sq_throwerror(vm, _SC("'set_text' called without instance"));
820 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
822 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
823 sq_throwerror(vm, _SC("Argument 1 not a string"));
828 _this->set_text(arg0);
832 } catch(std::exception& e) {
833 sq_throwerror(vm, e.what());
836 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
842 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
845 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
846 sq_throwerror(vm, _SC("'set_font' called without instance"));
849 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
851 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
852 sq_throwerror(vm, _SC("Argument 1 not a string"));
857 _this->set_font(arg0);
861 } catch(std::exception& e) {
862 sq_throwerror(vm, e.what());
865 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
871 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
874 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
875 sq_throwerror(vm, _SC("'fade_in' called without instance"));
878 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
880 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
881 sq_throwerror(vm, _SC("Argument 1 not a float"));
886 _this->fade_in(static_cast<float> (arg0));
890 } catch(std::exception& e) {
891 sq_throwerror(vm, e.what());
894 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
900 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
903 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
904 sq_throwerror(vm, _SC("'fade_out' called without instance"));
907 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
909 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
910 sq_throwerror(vm, _SC("Argument 1 not a float"));
915 _this->fade_out(static_cast<float> (arg0));
919 } catch(std::exception& e) {
920 sq_throwerror(vm, e.what());
923 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
929 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
932 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
933 sq_throwerror(vm, _SC("'set_visible' called without instance"));
936 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
938 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
939 sq_throwerror(vm, _SC("Argument 1 not a bool"));
944 _this->set_visible(arg0 == SQTrue);
948 } catch(std::exception& e) {
949 sq_throwerror(vm, e.what());
952 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
958 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
961 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
962 sq_throwerror(vm, _SC("'set_centered' called without instance"));
965 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
967 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
968 sq_throwerror(vm, _SC("Argument 1 not a bool"));
973 _this->set_centered(arg0 == SQTrue);
977 } catch(std::exception& e) {
978 sq_throwerror(vm, e.what());
981 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
987 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
989 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
994 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
997 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
998 sq_throwerror(vm, _SC("'add_bonus' called without instance"));
1001 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1003 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1004 sq_throwerror(vm, _SC("Argument 1 not a string"));
1009 _this->add_bonus(arg0);
1013 } catch(std::exception& e) {
1014 sq_throwerror(vm, e.what());
1017 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1023 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
1026 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1027 sq_throwerror(vm, _SC("'add_coins' called without instance"));
1030 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1032 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1033 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1038 _this->add_coins(static_cast<int> (arg0));
1042 } catch(std::exception& e) {
1043 sq_throwerror(vm, e.what());
1046 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1052 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1055 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1056 sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1059 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1062 _this->make_invincible();
1066 } catch(std::exception& e) {
1067 sq_throwerror(vm, e.what());
1070 sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1076 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1079 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1080 sq_throwerror(vm, _SC("'deactivate' called without instance"));
1083 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1086 _this->deactivate();
1090 } catch(std::exception& e) {
1091 sq_throwerror(vm, e.what());
1094 sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1100 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1103 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1104 sq_throwerror(vm, _SC("'activate' called without instance"));
1107 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1114 } catch(std::exception& e) {
1115 sq_throwerror(vm, e.what());
1118 sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1124 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1127 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1128 sq_throwerror(vm, _SC("'walk' called without instance"));
1131 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1133 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1134 sq_throwerror(vm, _SC("Argument 1 not a float"));
1139 _this->walk(static_cast<float> (arg0));
1143 } catch(std::exception& e) {
1144 sq_throwerror(vm, e.what());
1147 sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1153 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1156 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1157 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1160 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1162 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1163 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1168 _this->set_visible(arg0 == SQTrue);
1172 } catch(std::exception& e) {
1173 sq_throwerror(vm, e.what());
1176 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1182 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1185 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1186 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1189 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1192 bool return_value = _this->get_visible();
1194 sq_pushbool(vm, return_value);
1197 } catch(std::exception& e) {
1198 sq_throwerror(vm, e.what());
1201 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1207 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1210 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1211 sq_throwerror(vm, _SC("'kill' called without instance"));
1214 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1216 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1217 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1222 _this->kill(arg0 == SQTrue);
1226 } catch(std::exception& e) {
1227 sq_throwerror(vm, e.what());
1230 sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1236 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1239 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1240 sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1243 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1245 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1246 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1251 _this->set_ghost_mode(arg0 == SQTrue);
1255 } catch(std::exception& e) {
1256 sq_throwerror(vm, e.what());
1259 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1265 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1268 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1269 sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1272 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1275 bool return_value = _this->get_ghost_mode();
1277 sq_pushbool(vm, return_value);
1280 } catch(std::exception& e) {
1281 sq_throwerror(vm, e.what());
1284 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1290 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1292 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1297 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1300 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1301 sq_throwerror(vm, _SC("Argument 1 not a string"));
1306 Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1307 if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1308 sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1311 sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1315 } catch(std::exception& e) {
1316 sq_throwerror(vm, e.what());
1319 sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1325 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1328 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1329 sq_throwerror(vm, _SC("'set_layer' called without instance"));
1332 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1334 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1335 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1340 _this->set_layer(static_cast<int> (arg0));
1344 } catch(std::exception& e) {
1345 sq_throwerror(vm, e.what());
1348 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1354 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1357 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1358 sq_throwerror(vm, _SC("'get_layer' called without instance"));
1361 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1364 int return_value = _this->get_layer();
1366 sq_pushinteger(vm, return_value);
1369 } catch(std::exception& e) {
1370 sq_throwerror(vm, e.what());
1373 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1379 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1382 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1383 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1386 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1388 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1389 sq_throwerror(vm, _SC("Argument 1 not a float"));
1393 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1394 sq_throwerror(vm, _SC("Argument 2 not a float"));
1399 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1403 } catch(std::exception& e) {
1404 sq_throwerror(vm, e.what());
1407 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1413 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1416 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1417 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1420 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1423 float return_value = _this->get_pos_x();
1425 sq_pushfloat(vm, return_value);
1428 } catch(std::exception& e) {
1429 sq_throwerror(vm, e.what());
1432 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1438 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1441 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1442 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1445 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1448 float return_value = _this->get_pos_y();
1450 sq_pushfloat(vm, return_value);
1453 } catch(std::exception& e) {
1454 sq_throwerror(vm, e.what());
1457 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1463 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1466 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1467 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1470 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1472 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1473 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1478 _this->set_anchor_point(static_cast<int> (arg0));
1482 } catch(std::exception& e) {
1483 sq_throwerror(vm, e.what());
1486 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1492 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1495 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1496 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1499 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1502 int return_value = _this->get_anchor_point();
1504 sq_pushinteger(vm, return_value);
1507 } catch(std::exception& e) {
1508 sq_throwerror(vm, e.what());
1511 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1517 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1520 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1521 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1524 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1526 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1527 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1532 _this->set_visible(arg0 == SQTrue);
1536 } catch(std::exception& e) {
1537 sq_throwerror(vm, e.what());
1540 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1546 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1549 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1550 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1553 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1556 bool return_value = _this->get_visible();
1558 sq_pushbool(vm, return_value);
1561 } catch(std::exception& e) {
1562 sq_throwerror(vm, e.what());
1565 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1571 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
1574 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1575 sq_throwerror(vm, _SC("'set_action' called without instance"));
1578 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1580 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1581 sq_throwerror(vm, _SC("Argument 1 not a string"));
1586 _this->set_action(arg0);
1590 } catch(std::exception& e) {
1591 sq_throwerror(vm, e.what());
1594 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1600 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
1603 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1604 sq_throwerror(vm, _SC("'get_action' called without instance"));
1607 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1610 std::string return_value = _this->get_action();
1612 sq_pushstring(vm, return_value.c_str(), return_value.size());
1615 } catch(std::exception& e) {
1616 sq_throwerror(vm, e.what());
1619 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1625 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1627 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
1632 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1635 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1636 sq_throwerror(vm, _SC("'goto_node' called without instance"));
1639 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1641 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1642 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1647 _this->goto_node(static_cast<int> (arg0));
1651 } catch(std::exception& e) {
1652 sq_throwerror(vm, e.what());
1655 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1661 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1664 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1665 sq_throwerror(vm, _SC("'start_moving' called without instance"));
1668 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1671 _this->start_moving();
1675 } catch(std::exception& e) {
1676 sq_throwerror(vm, e.what());
1679 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
1685 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1688 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1689 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1692 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1695 _this->stop_moving();
1699 } catch(std::exception& e) {
1700 sq_throwerror(vm, e.what());
1703 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1709 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
1711 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (ptr);
1716 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
1719 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1720 sq_throwerror(vm, _SC("'get_burning' called without instance"));
1723 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1726 bool return_value = _this->get_burning();
1728 sq_pushbool(vm, return_value);
1731 } catch(std::exception& e) {
1732 sq_throwerror(vm, e.what());
1735 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
1741 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
1744 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1745 sq_throwerror(vm, _SC("'set_burning' called without instance"));
1748 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1750 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1751 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1756 _this->set_burning(arg0 == SQTrue);
1760 } catch(std::exception& e) {
1761 sq_throwerror(vm, e.what());
1764 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_burning'"));
1770 static SQInteger display_wrapper(HSQUIRRELVM vm)
1772 return Scripting::display(vm);
1775 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
1777 HSQUIRRELVM arg0 = vm;
1780 Scripting::print_stacktrace(arg0);
1784 } catch(std::exception& e) {
1785 sq_throwerror(vm, e.what());
1788 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
1794 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
1796 return Scripting::get_current_thread(vm);
1799 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
1802 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1803 sq_throwerror(vm, _SC("Argument 1 not a string"));
1808 Scripting::display_text_file(arg0);
1812 } catch(std::exception& e) {
1813 sq_throwerror(vm, e.what());
1816 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
1822 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
1825 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1826 sq_throwerror(vm, _SC("Argument 1 not a string"));
1831 Scripting::load_worldmap(arg0);
1835 } catch(std::exception& e) {
1836 sq_throwerror(vm, e.what());
1839 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
1845 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
1848 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1849 sq_throwerror(vm, _SC("Argument 1 not a string"));
1854 Scripting::load_level(arg0);
1858 } catch(std::exception& e) {
1859 sq_throwerror(vm, e.what());
1862 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
1868 static SQInteger wait_wrapper(HSQUIRRELVM vm)
1870 HSQUIRRELVM arg0 = vm;
1872 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
1873 sq_throwerror(vm, _SC("Argument 1 not a float"));
1878 Scripting::wait(arg0, static_cast<float> (arg1));
1880 return sq_suspendvm(vm);
1882 } catch(std::exception& e) {
1883 sq_throwerror(vm, e.what());
1886 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
1892 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
1894 HSQUIRRELVM arg0 = vm;
1897 Scripting::wait_for_screenswitch(arg0);
1899 return sq_suspendvm(vm);
1901 } catch(std::exception& e) {
1902 sq_throwerror(vm, e.what());
1905 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
1911 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
1916 Scripting::exit_screen();
1920 } catch(std::exception& e) {
1921 sq_throwerror(vm, e.what());
1924 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
1930 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
1933 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1934 sq_throwerror(vm, _SC("Argument 1 not a float"));
1939 Scripting::fadeout_screen(static_cast<float> (arg0));
1943 } catch(std::exception& e) {
1944 sq_throwerror(vm, e.what());
1947 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
1953 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
1956 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1957 sq_throwerror(vm, _SC("Argument 1 not a float"));
1961 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1962 sq_throwerror(vm, _SC("Argument 2 not a float"));
1966 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
1967 sq_throwerror(vm, _SC("Argument 3 not a float"));
1972 Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
1976 } catch(std::exception& e) {
1977 sq_throwerror(vm, e.what());
1980 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
1986 static SQInteger translate_wrapper(HSQUIRRELVM vm)
1989 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1990 sq_throwerror(vm, _SC("Argument 1 not a string"));
1995 std::string return_value = Scripting::translate(arg0);
1997 sq_pushstring(vm, return_value.c_str(), return_value.size());
2000 } catch(std::exception& e) {
2001 sq_throwerror(vm, e.what());
2004 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
2010 static SQInteger import_wrapper(HSQUIRRELVM vm)
2012 HSQUIRRELVM arg0 = vm;
2014 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
2015 sq_throwerror(vm, _SC("Argument 1 not a string"));
2020 Scripting::import(arg0, arg1);
2024 } catch(std::exception& e) {
2025 sq_throwerror(vm, e.what());
2028 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
2034 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
2039 Scripting::save_state();
2043 } catch(std::exception& e) {
2044 sq_throwerror(vm, e.what());
2047 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
2053 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
2056 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2057 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2062 Scripting::debug_collrects(arg0 == SQTrue);
2066 } catch(std::exception& e) {
2067 sq_throwerror(vm, e.what());
2070 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
2076 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
2079 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2080 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2085 Scripting::debug_show_fps(arg0 == SQTrue);
2089 } catch(std::exception& e) {
2090 sq_throwerror(vm, e.what());
2093 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
2099 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
2102 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2103 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2108 Scripting::debug_draw_solids_only(arg0 == SQTrue);
2112 } catch(std::exception& e) {
2113 sq_throwerror(vm, e.what());
2116 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
2122 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
2125 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2126 sq_throwerror(vm, _SC("Argument 1 not a string"));
2131 Scripting::play_music(arg0);
2135 } catch(std::exception& e) {
2136 sq_throwerror(vm, e.what());
2139 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
2145 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
2148 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2149 sq_throwerror(vm, _SC("Argument 1 not a string"));
2154 Scripting::play_sound(arg0);
2158 } catch(std::exception& e) {
2159 sq_throwerror(vm, e.what());
2162 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
2168 static SQInteger grease_wrapper(HSQUIRRELVM vm)
2173 Scripting::grease();
2177 } catch(std::exception& e) {
2178 sq_throwerror(vm, e.what());
2181 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
2187 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
2192 Scripting::invincible();
2196 } catch(std::exception& e) {
2197 sq_throwerror(vm, e.what());
2200 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
2206 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
2215 } catch(std::exception& e) {
2216 sq_throwerror(vm, e.what());
2219 sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
2225 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
2230 Scripting::mortal();
2234 } catch(std::exception& e) {
2235 sq_throwerror(vm, e.what());
2238 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
2244 static SQInteger restart_wrapper(HSQUIRRELVM vm)
2249 Scripting::restart();
2253 } catch(std::exception& e) {
2254 sq_throwerror(vm, e.what());
2257 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
2263 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
2268 Scripting::whereami();
2272 } catch(std::exception& e) {
2273 sq_throwerror(vm, e.what());
2276 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
2282 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
2287 Scripting::gotoend();
2291 } catch(std::exception& e) {
2292 sq_throwerror(vm, e.what());
2295 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
2301 static SQInteger camera_wrapper(HSQUIRRELVM vm)
2306 Scripting::camera();
2310 } catch(std::exception& e) {
2311 sq_throwerror(vm, e.what());
2314 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
2320 static SQInteger quit_wrapper(HSQUIRRELVM vm)
2329 } catch(std::exception& e) {
2330 sq_throwerror(vm, e.what());
2333 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
2339 static SQInteger rand_wrapper(HSQUIRRELVM vm)
2343 int return_value = Scripting::rand();
2345 sq_pushinteger(vm, return_value);
2348 } catch(std::exception& e) {
2349 sq_throwerror(vm, e.what());
2352 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
2358 } // end of namespace Wrapper
2360 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
2362 using namespace Wrapper;
2364 sq_pushroottable(v);
2365 sq_pushstring(v, "DisplayEffect", -1);
2366 if(SQ_FAILED(sq_get(v, -2))) {
2367 std::ostringstream msg;
2368 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
2369 throw SquirrelError(v, msg.str());
2372 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2373 std::ostringstream msg;
2374 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
2375 throw SquirrelError(v, msg.str());
2377 sq_remove(v, -2); // remove object name
2379 if(setup_releasehook) {
2380 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
2383 sq_remove(v, -2); // remove root table
2386 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
2388 using namespace Wrapper;
2390 sq_pushroottable(v);
2391 sq_pushstring(v, "Camera", -1);
2392 if(SQ_FAILED(sq_get(v, -2))) {
2393 std::ostringstream msg;
2394 msg << "Couldn't resolved squirrel type 'Camera'";
2395 throw SquirrelError(v, msg.str());
2398 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2399 std::ostringstream msg;
2400 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
2401 throw SquirrelError(v, msg.str());
2403 sq_remove(v, -2); // remove object name
2405 if(setup_releasehook) {
2406 sq_setreleasehook(v, -1, Camera_release_hook);
2409 sq_remove(v, -2); // remove root table
2412 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
2414 using namespace Wrapper;
2416 sq_pushroottable(v);
2417 sq_pushstring(v, "Level", -1);
2418 if(SQ_FAILED(sq_get(v, -2))) {
2419 std::ostringstream msg;
2420 msg << "Couldn't resolved squirrel type 'Level'";
2421 throw SquirrelError(v, msg.str());
2424 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2425 std::ostringstream msg;
2426 msg << "Couldn't setup squirrel instance for object of type 'Level'";
2427 throw SquirrelError(v, msg.str());
2429 sq_remove(v, -2); // remove object name
2431 if(setup_releasehook) {
2432 sq_setreleasehook(v, -1, Level_release_hook);
2435 sq_remove(v, -2); // remove root table
2438 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
2440 using namespace Wrapper;
2442 sq_pushroottable(v);
2443 sq_pushstring(v, "ScriptedObject", -1);
2444 if(SQ_FAILED(sq_get(v, -2))) {
2445 std::ostringstream msg;
2446 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
2447 throw SquirrelError(v, msg.str());
2450 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2451 std::ostringstream msg;
2452 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
2453 throw SquirrelError(v, msg.str());
2455 sq_remove(v, -2); // remove object name
2457 if(setup_releasehook) {
2458 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
2461 sq_remove(v, -2); // remove root table
2464 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
2466 using namespace Wrapper;
2468 sq_pushroottable(v);
2469 sq_pushstring(v, "Text", -1);
2470 if(SQ_FAILED(sq_get(v, -2))) {
2471 std::ostringstream msg;
2472 msg << "Couldn't resolved squirrel type 'Text'";
2473 throw SquirrelError(v, msg.str());
2476 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2477 std::ostringstream msg;
2478 msg << "Couldn't setup squirrel instance for object of type 'Text'";
2479 throw SquirrelError(v, msg.str());
2481 sq_remove(v, -2); // remove object name
2483 if(setup_releasehook) {
2484 sq_setreleasehook(v, -1, Text_release_hook);
2487 sq_remove(v, -2); // remove root table
2490 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
2492 using namespace Wrapper;
2494 sq_pushroottable(v);
2495 sq_pushstring(v, "Player", -1);
2496 if(SQ_FAILED(sq_get(v, -2))) {
2497 std::ostringstream msg;
2498 msg << "Couldn't resolved squirrel type 'Player'";
2499 throw SquirrelError(v, msg.str());
2502 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2503 std::ostringstream msg;
2504 msg << "Couldn't setup squirrel instance for object of type 'Player'";
2505 throw SquirrelError(v, msg.str());
2507 sq_remove(v, -2); // remove object name
2509 if(setup_releasehook) {
2510 sq_setreleasehook(v, -1, Player_release_hook);
2513 sq_remove(v, -2); // remove root table
2516 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
2518 using namespace Wrapper;
2520 sq_pushroottable(v);
2521 sq_pushstring(v, "FloatingImage", -1);
2522 if(SQ_FAILED(sq_get(v, -2))) {
2523 std::ostringstream msg;
2524 msg << "Couldn't resolved squirrel type 'FloatingImage'";
2525 throw SquirrelError(v, msg.str());
2528 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2529 std::ostringstream msg;
2530 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
2531 throw SquirrelError(v, msg.str());
2533 sq_remove(v, -2); // remove object name
2535 if(setup_releasehook) {
2536 sq_setreleasehook(v, -1, FloatingImage_release_hook);
2539 sq_remove(v, -2); // remove root table
2542 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
2544 using namespace Wrapper;
2546 sq_pushroottable(v);
2547 sq_pushstring(v, "Platform", -1);
2548 if(SQ_FAILED(sq_get(v, -2))) {
2549 std::ostringstream msg;
2550 msg << "Couldn't resolved squirrel type 'Platform'";
2551 throw SquirrelError(v, msg.str());
2554 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2555 std::ostringstream msg;
2556 msg << "Couldn't setup squirrel instance for object of type 'Platform'";
2557 throw SquirrelError(v, msg.str());
2559 sq_remove(v, -2); // remove object name
2561 if(setup_releasehook) {
2562 sq_setreleasehook(v, -1, Platform_release_hook);
2565 sq_remove(v, -2); // remove root table
2568 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
2570 using namespace Wrapper;
2572 sq_pushroottable(v);
2573 sq_pushstring(v, "Candle", -1);
2574 if(SQ_FAILED(sq_get(v, -2))) {
2575 std::ostringstream msg;
2576 msg << "Couldn't resolved squirrel type 'Candle'";
2577 throw SquirrelError(v, msg.str());
2580 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2581 std::ostringstream msg;
2582 msg << "Couldn't setup squirrel instance for object of type 'Candle'";
2583 throw SquirrelError(v, msg.str());
2585 sq_remove(v, -2); // remove object name
2587 if(setup_releasehook) {
2588 sq_setreleasehook(v, -1, Candle_release_hook);
2591 sq_remove(v, -2); // remove root table
2594 void register_supertux_wrapper(HSQUIRRELVM v)
2596 using namespace Wrapper;
2598 sq_pushstring(v, "ANCHOR_TOP", -1);
2599 sq_pushinteger(v, 16);
2600 if(SQ_FAILED(sq_createslot(v, -3))) {
2601 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
2604 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
2605 sq_pushinteger(v, 32);
2606 if(SQ_FAILED(sq_createslot(v, -3))) {
2607 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
2610 sq_pushstring(v, "ANCHOR_LEFT", -1);
2611 sq_pushinteger(v, 1);
2612 if(SQ_FAILED(sq_createslot(v, -3))) {
2613 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
2616 sq_pushstring(v, "ANCHOR_RIGHT", -1);
2617 sq_pushinteger(v, 2);
2618 if(SQ_FAILED(sq_createslot(v, -3))) {
2619 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
2622 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
2623 sq_pushinteger(v, 0);
2624 if(SQ_FAILED(sq_createslot(v, -3))) {
2625 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
2628 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
2629 sq_pushinteger(v, 17);
2630 if(SQ_FAILED(sq_createslot(v, -3))) {
2631 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
2634 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
2635 sq_pushinteger(v, 18);
2636 if(SQ_FAILED(sq_createslot(v, -3))) {
2637 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
2640 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
2641 sq_pushinteger(v, 33);
2642 if(SQ_FAILED(sq_createslot(v, -3))) {
2643 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
2646 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
2647 sq_pushinteger(v, 34);
2648 if(SQ_FAILED(sq_createslot(v, -3))) {
2649 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
2652 sq_pushstring(v, "display", -1);
2653 sq_newclosure(v, &display_wrapper, 0);
2654 if(SQ_FAILED(sq_createslot(v, -3))) {
2655 throw SquirrelError(v, "Couldn't register function 'display'");
2658 sq_pushstring(v, "print_stacktrace", -1);
2659 sq_newclosure(v, &print_stacktrace_wrapper, 0);
2660 if(SQ_FAILED(sq_createslot(v, -3))) {
2661 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
2664 sq_pushstring(v, "get_current_thread", -1);
2665 sq_newclosure(v, &get_current_thread_wrapper, 0);
2666 if(SQ_FAILED(sq_createslot(v, -3))) {
2667 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
2670 sq_pushstring(v, "display_text_file", -1);
2671 sq_newclosure(v, &display_text_file_wrapper, 0);
2672 if(SQ_FAILED(sq_createslot(v, -3))) {
2673 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
2676 sq_pushstring(v, "load_worldmap", -1);
2677 sq_newclosure(v, &load_worldmap_wrapper, 0);
2678 if(SQ_FAILED(sq_createslot(v, -3))) {
2679 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
2682 sq_pushstring(v, "load_level", -1);
2683 sq_newclosure(v, &load_level_wrapper, 0);
2684 if(SQ_FAILED(sq_createslot(v, -3))) {
2685 throw SquirrelError(v, "Couldn't register function 'load_level'");
2688 sq_pushstring(v, "wait", -1);
2689 sq_newclosure(v, &wait_wrapper, 0);
2690 if(SQ_FAILED(sq_createslot(v, -3))) {
2691 throw SquirrelError(v, "Couldn't register function 'wait'");
2694 sq_pushstring(v, "wait_for_screenswitch", -1);
2695 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
2696 if(SQ_FAILED(sq_createslot(v, -3))) {
2697 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
2700 sq_pushstring(v, "exit_screen", -1);
2701 sq_newclosure(v, &exit_screen_wrapper, 0);
2702 if(SQ_FAILED(sq_createslot(v, -3))) {
2703 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
2706 sq_pushstring(v, "fadeout_screen", -1);
2707 sq_newclosure(v, &fadeout_screen_wrapper, 0);
2708 if(SQ_FAILED(sq_createslot(v, -3))) {
2709 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
2712 sq_pushstring(v, "shrink_screen", -1);
2713 sq_newclosure(v, &shrink_screen_wrapper, 0);
2714 if(SQ_FAILED(sq_createslot(v, -3))) {
2715 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
2718 sq_pushstring(v, "translate", -1);
2719 sq_newclosure(v, &translate_wrapper, 0);
2720 if(SQ_FAILED(sq_createslot(v, -3))) {
2721 throw SquirrelError(v, "Couldn't register function 'translate'");
2724 sq_pushstring(v, "import", -1);
2725 sq_newclosure(v, &import_wrapper, 0);
2726 if(SQ_FAILED(sq_createslot(v, -3))) {
2727 throw SquirrelError(v, "Couldn't register function 'import'");
2730 sq_pushstring(v, "save_state", -1);
2731 sq_newclosure(v, &save_state_wrapper, 0);
2732 if(SQ_FAILED(sq_createslot(v, -3))) {
2733 throw SquirrelError(v, "Couldn't register function 'save_state'");
2736 sq_pushstring(v, "debug_collrects", -1);
2737 sq_newclosure(v, &debug_collrects_wrapper, 0);
2738 if(SQ_FAILED(sq_createslot(v, -3))) {
2739 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
2742 sq_pushstring(v, "debug_show_fps", -1);
2743 sq_newclosure(v, &debug_show_fps_wrapper, 0);
2744 if(SQ_FAILED(sq_createslot(v, -3))) {
2745 throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
2748 sq_pushstring(v, "debug_draw_solids_only", -1);
2749 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
2750 if(SQ_FAILED(sq_createslot(v, -3))) {
2751 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
2754 sq_pushstring(v, "play_music", -1);
2755 sq_newclosure(v, &play_music_wrapper, 0);
2756 if(SQ_FAILED(sq_createslot(v, -3))) {
2757 throw SquirrelError(v, "Couldn't register function 'play_music'");
2760 sq_pushstring(v, "play_sound", -1);
2761 sq_newclosure(v, &play_sound_wrapper, 0);
2762 if(SQ_FAILED(sq_createslot(v, -3))) {
2763 throw SquirrelError(v, "Couldn't register function 'play_sound'");
2766 sq_pushstring(v, "grease", -1);
2767 sq_newclosure(v, &grease_wrapper, 0);
2768 if(SQ_FAILED(sq_createslot(v, -3))) {
2769 throw SquirrelError(v, "Couldn't register function 'grease'");
2772 sq_pushstring(v, "invincible", -1);
2773 sq_newclosure(v, &invincible_wrapper, 0);
2774 if(SQ_FAILED(sq_createslot(v, -3))) {
2775 throw SquirrelError(v, "Couldn't register function 'invincible'");
2778 sq_pushstring(v, "ghost", -1);
2779 sq_newclosure(v, &ghost_wrapper, 0);
2780 if(SQ_FAILED(sq_createslot(v, -3))) {
2781 throw SquirrelError(v, "Couldn't register function 'ghost'");
2784 sq_pushstring(v, "mortal", -1);
2785 sq_newclosure(v, &mortal_wrapper, 0);
2786 if(SQ_FAILED(sq_createslot(v, -3))) {
2787 throw SquirrelError(v, "Couldn't register function 'mortal'");
2790 sq_pushstring(v, "restart", -1);
2791 sq_newclosure(v, &restart_wrapper, 0);
2792 if(SQ_FAILED(sq_createslot(v, -3))) {
2793 throw SquirrelError(v, "Couldn't register function 'restart'");
2796 sq_pushstring(v, "whereami", -1);
2797 sq_newclosure(v, &whereami_wrapper, 0);
2798 if(SQ_FAILED(sq_createslot(v, -3))) {
2799 throw SquirrelError(v, "Couldn't register function 'whereami'");
2802 sq_pushstring(v, "gotoend", -1);
2803 sq_newclosure(v, &gotoend_wrapper, 0);
2804 if(SQ_FAILED(sq_createslot(v, -3))) {
2805 throw SquirrelError(v, "Couldn't register function 'gotoend'");
2808 sq_pushstring(v, "camera", -1);
2809 sq_newclosure(v, &camera_wrapper, 0);
2810 if(SQ_FAILED(sq_createslot(v, -3))) {
2811 throw SquirrelError(v, "Couldn't register function 'camera'");
2814 sq_pushstring(v, "quit", -1);
2815 sq_newclosure(v, &quit_wrapper, 0);
2816 if(SQ_FAILED(sq_createslot(v, -3))) {
2817 throw SquirrelError(v, "Couldn't register function 'quit'");
2820 sq_pushstring(v, "rand", -1);
2821 sq_newclosure(v, &rand_wrapper, 0);
2822 if(SQ_FAILED(sq_createslot(v, -3))) {
2823 throw SquirrelError(v, "Couldn't register function 'rand'");
2826 // Register class DisplayEffect
2827 sq_pushstring(v, "DisplayEffect", -1);
2828 if(sq_newclass(v, SQFalse) < 0) {
2829 std::ostringstream msg;
2830 msg << "Couldn't create new class 'DisplayEffect'";
2831 throw SquirrelError(v, msg.str());
2833 sq_pushstring(v, "fade_out", -1);
2834 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
2835 if(SQ_FAILED(sq_createslot(v, -3))) {
2836 throw SquirrelError(v, "Couldn't register function 'fade_out'");
2839 sq_pushstring(v, "fade_in", -1);
2840 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
2841 if(SQ_FAILED(sq_createslot(v, -3))) {
2842 throw SquirrelError(v, "Couldn't register function 'fade_in'");
2845 sq_pushstring(v, "set_black", -1);
2846 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
2847 if(SQ_FAILED(sq_createslot(v, -3))) {
2848 throw SquirrelError(v, "Couldn't register function 'set_black'");
2851 sq_pushstring(v, "is_black", -1);
2852 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
2853 if(SQ_FAILED(sq_createslot(v, -3))) {
2854 throw SquirrelError(v, "Couldn't register function 'is_black'");
2857 sq_pushstring(v, "sixteen_to_nine", -1);
2858 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
2859 if(SQ_FAILED(sq_createslot(v, -3))) {
2860 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
2863 sq_pushstring(v, "four_to_three", -1);
2864 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
2865 if(SQ_FAILED(sq_createslot(v, -3))) {
2866 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
2869 if(SQ_FAILED(sq_createslot(v, -3))) {
2870 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
2873 // Register class Camera
2874 sq_pushstring(v, "Camera", -1);
2875 if(sq_newclass(v, SQFalse) < 0) {
2876 std::ostringstream msg;
2877 msg << "Couldn't create new class 'Camera'";
2878 throw SquirrelError(v, msg.str());
2880 sq_pushstring(v, "shake", -1);
2881 sq_newclosure(v, &Camera_shake_wrapper, 0);
2882 if(SQ_FAILED(sq_createslot(v, -3))) {
2883 throw SquirrelError(v, "Couldn't register function 'shake'");
2886 sq_pushstring(v, "set_pos", -1);
2887 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
2888 if(SQ_FAILED(sq_createslot(v, -3))) {
2889 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2892 sq_pushstring(v, "set_mode", -1);
2893 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
2894 if(SQ_FAILED(sq_createslot(v, -3))) {
2895 throw SquirrelError(v, "Couldn't register function 'set_mode'");
2898 sq_pushstring(v, "scroll_to", -1);
2899 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
2900 if(SQ_FAILED(sq_createslot(v, -3))) {
2901 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
2904 if(SQ_FAILED(sq_createslot(v, -3))) {
2905 throw SquirrelError(v, "Couldn't register class 'Camera'");
2908 // Register class Level
2909 sq_pushstring(v, "Level", -1);
2910 if(sq_newclass(v, SQFalse) < 0) {
2911 std::ostringstream msg;
2912 msg << "Couldn't create new class 'Level'";
2913 throw SquirrelError(v, msg.str());
2915 sq_pushstring(v, "finish", -1);
2916 sq_newclosure(v, &Level_finish_wrapper, 0);
2917 if(SQ_FAILED(sq_createslot(v, -3))) {
2918 throw SquirrelError(v, "Couldn't register function 'finish'");
2921 sq_pushstring(v, "spawn", -1);
2922 sq_newclosure(v, &Level_spawn_wrapper, 0);
2923 if(SQ_FAILED(sq_createslot(v, -3))) {
2924 throw SquirrelError(v, "Couldn't register function 'spawn'");
2927 sq_pushstring(v, "flip_vertically", -1);
2928 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
2929 if(SQ_FAILED(sq_createslot(v, -3))) {
2930 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
2933 sq_pushstring(v, "toggle_pause", -1);
2934 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
2935 if(SQ_FAILED(sq_createslot(v, -3))) {
2936 throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
2939 if(SQ_FAILED(sq_createslot(v, -3))) {
2940 throw SquirrelError(v, "Couldn't register class 'Level'");
2943 // Register class ScriptedObject
2944 sq_pushstring(v, "ScriptedObject", -1);
2945 if(sq_newclass(v, SQFalse) < 0) {
2946 std::ostringstream msg;
2947 msg << "Couldn't create new class 'ScriptedObject'";
2948 throw SquirrelError(v, msg.str());
2950 sq_pushstring(v, "set_action", -1);
2951 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
2952 if(SQ_FAILED(sq_createslot(v, -3))) {
2953 throw SquirrelError(v, "Couldn't register function 'set_action'");
2956 sq_pushstring(v, "get_action", -1);
2957 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
2958 if(SQ_FAILED(sq_createslot(v, -3))) {
2959 throw SquirrelError(v, "Couldn't register function 'get_action'");
2962 sq_pushstring(v, "move", -1);
2963 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
2964 if(SQ_FAILED(sq_createslot(v, -3))) {
2965 throw SquirrelError(v, "Couldn't register function 'move'");
2968 sq_pushstring(v, "set_pos", -1);
2969 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
2970 if(SQ_FAILED(sq_createslot(v, -3))) {
2971 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2974 sq_pushstring(v, "get_pos_x", -1);
2975 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
2976 if(SQ_FAILED(sq_createslot(v, -3))) {
2977 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
2980 sq_pushstring(v, "get_pos_y", -1);
2981 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
2982 if(SQ_FAILED(sq_createslot(v, -3))) {
2983 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
2986 sq_pushstring(v, "set_velocity", -1);
2987 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
2988 if(SQ_FAILED(sq_createslot(v, -3))) {
2989 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
2992 sq_pushstring(v, "get_velocity_x", -1);
2993 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
2994 if(SQ_FAILED(sq_createslot(v, -3))) {
2995 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
2998 sq_pushstring(v, "get_velocity_y", -1);
2999 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
3000 if(SQ_FAILED(sq_createslot(v, -3))) {
3001 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
3004 sq_pushstring(v, "set_visible", -1);
3005 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
3006 if(SQ_FAILED(sq_createslot(v, -3))) {
3007 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3010 sq_pushstring(v, "is_visible", -1);
3011 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
3012 if(SQ_FAILED(sq_createslot(v, -3))) {
3013 throw SquirrelError(v, "Couldn't register function 'is_visible'");
3016 sq_pushstring(v, "get_name", -1);
3017 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
3018 if(SQ_FAILED(sq_createslot(v, -3))) {
3019 throw SquirrelError(v, "Couldn't register function 'get_name'");
3022 if(SQ_FAILED(sq_createslot(v, -3))) {
3023 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
3026 // Register class Text
3027 sq_pushstring(v, "Text", -1);
3028 if(sq_newclass(v, SQFalse) < 0) {
3029 std::ostringstream msg;
3030 msg << "Couldn't create new class 'Text'";
3031 throw SquirrelError(v, msg.str());
3033 sq_pushstring(v, "set_text", -1);
3034 sq_newclosure(v, &Text_set_text_wrapper, 0);
3035 if(SQ_FAILED(sq_createslot(v, -3))) {
3036 throw SquirrelError(v, "Couldn't register function 'set_text'");
3039 sq_pushstring(v, "set_font", -1);
3040 sq_newclosure(v, &Text_set_font_wrapper, 0);
3041 if(SQ_FAILED(sq_createslot(v, -3))) {
3042 throw SquirrelError(v, "Couldn't register function 'set_font'");
3045 sq_pushstring(v, "fade_in", -1);
3046 sq_newclosure(v, &Text_fade_in_wrapper, 0);
3047 if(SQ_FAILED(sq_createslot(v, -3))) {
3048 throw SquirrelError(v, "Couldn't register function 'fade_in'");
3051 sq_pushstring(v, "fade_out", -1);
3052 sq_newclosure(v, &Text_fade_out_wrapper, 0);
3053 if(SQ_FAILED(sq_createslot(v, -3))) {
3054 throw SquirrelError(v, "Couldn't register function 'fade_out'");
3057 sq_pushstring(v, "set_visible", -1);
3058 sq_newclosure(v, &Text_set_visible_wrapper, 0);
3059 if(SQ_FAILED(sq_createslot(v, -3))) {
3060 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3063 sq_pushstring(v, "set_centered", -1);
3064 sq_newclosure(v, &Text_set_centered_wrapper, 0);
3065 if(SQ_FAILED(sq_createslot(v, -3))) {
3066 throw SquirrelError(v, "Couldn't register function 'set_centered'");
3069 if(SQ_FAILED(sq_createslot(v, -3))) {
3070 throw SquirrelError(v, "Couldn't register class 'Text'");
3073 // Register class Player
3074 sq_pushstring(v, "Player", -1);
3075 if(sq_newclass(v, SQFalse) < 0) {
3076 std::ostringstream msg;
3077 msg << "Couldn't create new class 'Player'";
3078 throw SquirrelError(v, msg.str());
3080 sq_pushstring(v, "add_bonus", -1);
3081 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
3082 if(SQ_FAILED(sq_createslot(v, -3))) {
3083 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
3086 sq_pushstring(v, "add_coins", -1);
3087 sq_newclosure(v, &Player_add_coins_wrapper, 0);
3088 if(SQ_FAILED(sq_createslot(v, -3))) {
3089 throw SquirrelError(v, "Couldn't register function 'add_coins'");
3092 sq_pushstring(v, "make_invincible", -1);
3093 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
3094 if(SQ_FAILED(sq_createslot(v, -3))) {
3095 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
3098 sq_pushstring(v, "deactivate", -1);
3099 sq_newclosure(v, &Player_deactivate_wrapper, 0);
3100 if(SQ_FAILED(sq_createslot(v, -3))) {
3101 throw SquirrelError(v, "Couldn't register function 'deactivate'");
3104 sq_pushstring(v, "activate", -1);
3105 sq_newclosure(v, &Player_activate_wrapper, 0);
3106 if(SQ_FAILED(sq_createslot(v, -3))) {
3107 throw SquirrelError(v, "Couldn't register function 'activate'");
3110 sq_pushstring(v, "walk", -1);
3111 sq_newclosure(v, &Player_walk_wrapper, 0);
3112 if(SQ_FAILED(sq_createslot(v, -3))) {
3113 throw SquirrelError(v, "Couldn't register function 'walk'");
3116 sq_pushstring(v, "set_visible", -1);
3117 sq_newclosure(v, &Player_set_visible_wrapper, 0);
3118 if(SQ_FAILED(sq_createslot(v, -3))) {
3119 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3122 sq_pushstring(v, "get_visible", -1);
3123 sq_newclosure(v, &Player_get_visible_wrapper, 0);
3124 if(SQ_FAILED(sq_createslot(v, -3))) {
3125 throw SquirrelError(v, "Couldn't register function 'get_visible'");
3128 sq_pushstring(v, "kill", -1);
3129 sq_newclosure(v, &Player_kill_wrapper, 0);
3130 if(SQ_FAILED(sq_createslot(v, -3))) {
3131 throw SquirrelError(v, "Couldn't register function 'kill'");
3134 sq_pushstring(v, "set_ghost_mode", -1);
3135 sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
3136 if(SQ_FAILED(sq_createslot(v, -3))) {
3137 throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
3140 sq_pushstring(v, "get_ghost_mode", -1);
3141 sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
3142 if(SQ_FAILED(sq_createslot(v, -3))) {
3143 throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
3146 if(SQ_FAILED(sq_createslot(v, -3))) {
3147 throw SquirrelError(v, "Couldn't register class 'Player'");
3150 // Register class FloatingImage
3151 sq_pushstring(v, "FloatingImage", -1);
3152 if(sq_newclass(v, SQFalse) < 0) {
3153 std::ostringstream msg;
3154 msg << "Couldn't create new class 'FloatingImage'";
3155 throw SquirrelError(v, msg.str());
3157 sq_pushstring(v, "constructor", -1);
3158 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
3159 if(SQ_FAILED(sq_createslot(v, -3))) {
3160 throw SquirrelError(v, "Couldn't register function 'constructor'");
3163 sq_pushstring(v, "set_layer", -1);
3164 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
3165 if(SQ_FAILED(sq_createslot(v, -3))) {
3166 throw SquirrelError(v, "Couldn't register function 'set_layer'");
3169 sq_pushstring(v, "get_layer", -1);
3170 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
3171 if(SQ_FAILED(sq_createslot(v, -3))) {
3172 throw SquirrelError(v, "Couldn't register function 'get_layer'");
3175 sq_pushstring(v, "set_pos", -1);
3176 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
3177 if(SQ_FAILED(sq_createslot(v, -3))) {
3178 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3181 sq_pushstring(v, "get_pos_x", -1);
3182 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
3183 if(SQ_FAILED(sq_createslot(v, -3))) {
3184 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3187 sq_pushstring(v, "get_pos_y", -1);
3188 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
3189 if(SQ_FAILED(sq_createslot(v, -3))) {
3190 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3193 sq_pushstring(v, "set_anchor_point", -1);
3194 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
3195 if(SQ_FAILED(sq_createslot(v, -3))) {
3196 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
3199 sq_pushstring(v, "get_anchor_point", -1);
3200 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
3201 if(SQ_FAILED(sq_createslot(v, -3))) {
3202 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
3205 sq_pushstring(v, "set_visible", -1);
3206 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
3207 if(SQ_FAILED(sq_createslot(v, -3))) {
3208 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3211 sq_pushstring(v, "get_visible", -1);
3212 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
3213 if(SQ_FAILED(sq_createslot(v, -3))) {
3214 throw SquirrelError(v, "Couldn't register function 'get_visible'");
3217 sq_pushstring(v, "set_action", -1);
3218 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
3219 if(SQ_FAILED(sq_createslot(v, -3))) {
3220 throw SquirrelError(v, "Couldn't register function 'set_action'");
3223 sq_pushstring(v, "get_action", -1);
3224 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
3225 if(SQ_FAILED(sq_createslot(v, -3))) {
3226 throw SquirrelError(v, "Couldn't register function 'get_action'");
3229 if(SQ_FAILED(sq_createslot(v, -3))) {
3230 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
3233 // Register class Platform
3234 sq_pushstring(v, "Platform", -1);
3235 if(sq_newclass(v, SQFalse) < 0) {
3236 std::ostringstream msg;
3237 msg << "Couldn't create new class 'Platform'";
3238 throw SquirrelError(v, msg.str());
3240 sq_pushstring(v, "goto_node", -1);
3241 sq_newclosure(v, &Platform_goto_node_wrapper, 0);
3242 if(SQ_FAILED(sq_createslot(v, -3))) {
3243 throw SquirrelError(v, "Couldn't register function 'goto_node'");
3246 sq_pushstring(v, "start_moving", -1);
3247 sq_newclosure(v, &Platform_start_moving_wrapper, 0);
3248 if(SQ_FAILED(sq_createslot(v, -3))) {
3249 throw SquirrelError(v, "Couldn't register function 'start_moving'");
3252 sq_pushstring(v, "stop_moving", -1);
3253 sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
3254 if(SQ_FAILED(sq_createslot(v, -3))) {
3255 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
3258 if(SQ_FAILED(sq_createslot(v, -3))) {
3259 throw SquirrelError(v, "Couldn't register class 'Platform'");
3262 // Register class Candle
3263 sq_pushstring(v, "Candle", -1);
3264 if(sq_newclass(v, SQFalse) < 0) {
3265 std::ostringstream msg;
3266 msg << "Couldn't create new class 'Candle'";
3267 throw SquirrelError(v, msg.str());
3269 sq_pushstring(v, "get_burning", -1);
3270 sq_newclosure(v, &Candle_get_burning_wrapper, 0);
3271 if(SQ_FAILED(sq_createslot(v, -3))) {
3272 throw SquirrelError(v, "Couldn't register function 'get_burning'");
3275 sq_pushstring(v, "set_burning", -1);
3276 sq_newclosure(v, &Candle_set_burning_wrapper, 0);
3277 if(SQ_FAILED(sq_createslot(v, -3))) {
3278 throw SquirrelError(v, "Couldn't register function 'set_burning'");
3281 if(SQ_FAILED(sq_createslot(v, -3))) {
3282 throw SquirrelError(v, "Couldn't register class 'Candle'");
3287 } // end of namespace Scripting