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)
30 Scripting::DisplayEffect* _this;
31 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
32 sq_throwerror(vm, _SC("'fade_out' called without instance"));
36 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
37 sq_throwerror(vm, _SC("Argument 1 not a float"));
42 _this->fade_out(static_cast<float> (arg0));
46 } catch(std::exception& e) {
47 sq_throwerror(vm, e.what());
50 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
56 static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm)
58 Scripting::DisplayEffect* _this;
59 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
60 sq_throwerror(vm, _SC("'fade_in' called without instance"));
64 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
65 sq_throwerror(vm, _SC("Argument 1 not a float"));
70 _this->fade_in(static_cast<float> (arg0));
74 } catch(std::exception& e) {
75 sq_throwerror(vm, e.what());
78 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
84 static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm)
86 Scripting::DisplayEffect* _this;
87 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
88 sq_throwerror(vm, _SC("'set_black' called without instance"));
92 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
93 sq_throwerror(vm, _SC("Argument 1 not a bool"));
98 _this->set_black(arg0 == SQTrue);
102 } catch(std::exception& e) {
103 sq_throwerror(vm, e.what());
106 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_black'"));
112 static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm)
114 Scripting::DisplayEffect* _this;
115 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
116 sq_throwerror(vm, _SC("'is_black' called without instance"));
121 bool return_value = _this->is_black();
123 sq_pushbool(vm, return_value);
126 } catch(std::exception& e) {
127 sq_throwerror(vm, e.what());
130 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_black'"));
136 static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm)
138 Scripting::DisplayEffect* _this;
139 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
140 sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance"));
144 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
145 sq_throwerror(vm, _SC("Argument 1 not a float"));
150 _this->sixteen_to_nine(static_cast<float> (arg0));
154 } catch(std::exception& e) {
155 sq_throwerror(vm, e.what());
158 sq_throwerror(vm, _SC("Unexpected exception while executing function 'sixteen_to_nine'"));
164 static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm)
166 Scripting::DisplayEffect* _this;
167 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
168 sq_throwerror(vm, _SC("'four_to_three' called without instance"));
172 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
173 sq_throwerror(vm, _SC("Argument 1 not a float"));
178 _this->four_to_three(static_cast<float> (arg0));
182 } catch(std::exception& e) {
183 sq_throwerror(vm, e.what());
186 sq_throwerror(vm, _SC("Unexpected exception while executing function 'four_to_three'"));
192 static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger )
194 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
199 static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm)
201 Scripting::Camera* _this;
202 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
203 sq_throwerror(vm, _SC("'shake' called without instance"));
207 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
208 sq_throwerror(vm, _SC("Argument 1 not a float"));
212 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
213 sq_throwerror(vm, _SC("Argument 2 not a float"));
217 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
218 sq_throwerror(vm, _SC("Argument 3 not a float"));
223 _this->shake(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
227 } catch(std::exception& e) {
228 sq_throwerror(vm, e.what());
231 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'"));
237 static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm)
239 Scripting::Camera* _this;
240 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
241 sq_throwerror(vm, _SC("'set_pos' called without instance"));
245 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
246 sq_throwerror(vm, _SC("Argument 1 not a float"));
250 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
251 sq_throwerror(vm, _SC("Argument 2 not a float"));
256 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
260 } catch(std::exception& e) {
261 sq_throwerror(vm, e.what());
264 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
270 static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm)
272 Scripting::Camera* _this;
273 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
274 sq_throwerror(vm, _SC("'set_mode' called without instance"));
278 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
279 sq_throwerror(vm, _SC("Argument 1 not a string"));
284 _this->set_mode(arg0);
288 } catch(std::exception& e) {
289 sq_throwerror(vm, e.what());
292 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_mode'"));
298 static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm)
300 Scripting::Camera* _this;
301 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
302 sq_throwerror(vm, _SC("'scroll_to' called without instance"));
306 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
307 sq_throwerror(vm, _SC("Argument 1 not a float"));
311 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
312 sq_throwerror(vm, _SC("Argument 2 not a float"));
316 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
317 sq_throwerror(vm, _SC("Argument 3 not a float"));
322 _this->scroll_to(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
326 } catch(std::exception& e) {
327 sq_throwerror(vm, e.what());
330 sq_throwerror(vm, _SC("Unexpected exception while executing function 'scroll_to'"));
336 static SQInteger Level_release_hook(SQUserPointer ptr, SQInteger )
338 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
343 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
345 Scripting::Level* _this;
346 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
347 sq_throwerror(vm, _SC("'finish' called without instance"));
351 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
352 sq_throwerror(vm, _SC("Argument 1 not a bool"));
357 _this->finish(arg0 == SQTrue);
361 } catch(std::exception& e) {
362 sq_throwerror(vm, e.what());
365 sq_throwerror(vm, _SC("Unexpected exception while executing function 'finish'"));
371 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
373 Scripting::Level* _this;
374 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
375 sq_throwerror(vm, _SC("'spawn' called without instance"));
379 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
380 sq_throwerror(vm, _SC("Argument 1 not a string"));
384 if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
385 sq_throwerror(vm, _SC("Argument 2 not a string"));
390 _this->spawn(arg0, arg1);
394 } catch(std::exception& e) {
395 sq_throwerror(vm, e.what());
398 sq_throwerror(vm, _SC("Unexpected exception while executing function 'spawn'"));
404 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
406 Scripting::Level* _this;
407 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
408 sq_throwerror(vm, _SC("'flip_vertically' called without instance"));
413 _this->flip_vertically();
417 } catch(std::exception& e) {
418 sq_throwerror(vm, e.what());
421 sq_throwerror(vm, _SC("Unexpected exception while executing function 'flip_vertically'"));
427 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
429 Scripting::Level* _this;
430 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
431 sq_throwerror(vm, _SC("'toggle_pause' called without instance"));
436 _this->toggle_pause();
440 } catch(std::exception& e) {
441 sq_throwerror(vm, e.what());
444 sq_throwerror(vm, _SC("Unexpected exception while executing function 'toggle_pause'"));
450 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
452 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
457 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
459 Scripting::ScriptedObject* _this;
460 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
461 sq_throwerror(vm, _SC("'set_action' called without instance"));
465 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
466 sq_throwerror(vm, _SC("Argument 1 not a string"));
471 _this->set_action(arg0);
475 } catch(std::exception& e) {
476 sq_throwerror(vm, e.what());
479 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
485 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
487 Scripting::ScriptedObject* _this;
488 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
489 sq_throwerror(vm, _SC("'get_action' called without instance"));
494 std::string return_value = _this->get_action();
496 sq_pushstring(vm, return_value.c_str(), return_value.size());
499 } catch(std::exception& e) {
500 sq_throwerror(vm, e.what());
503 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
509 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
511 Scripting::ScriptedObject* _this;
512 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
513 sq_throwerror(vm, _SC("'move' called without instance"));
517 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
518 sq_throwerror(vm, _SC("Argument 1 not a float"));
522 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
523 sq_throwerror(vm, _SC("Argument 2 not a float"));
528 _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
532 } catch(std::exception& e) {
533 sq_throwerror(vm, e.what());
536 sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
542 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
544 Scripting::ScriptedObject* _this;
545 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
546 sq_throwerror(vm, _SC("'set_pos' called without instance"));
550 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
551 sq_throwerror(vm, _SC("Argument 1 not a float"));
555 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
556 sq_throwerror(vm, _SC("Argument 2 not a float"));
561 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
565 } catch(std::exception& e) {
566 sq_throwerror(vm, e.what());
569 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
575 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
577 Scripting::ScriptedObject* _this;
578 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
579 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
584 float return_value = _this->get_pos_x();
586 sq_pushfloat(vm, return_value);
589 } catch(std::exception& e) {
590 sq_throwerror(vm, e.what());
593 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
599 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
601 Scripting::ScriptedObject* _this;
602 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
603 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
608 float return_value = _this->get_pos_y();
610 sq_pushfloat(vm, return_value);
613 } catch(std::exception& e) {
614 sq_throwerror(vm, e.what());
617 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
623 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
625 Scripting::ScriptedObject* _this;
626 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
627 sq_throwerror(vm, _SC("'set_velocity' called without instance"));
631 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
632 sq_throwerror(vm, _SC("Argument 1 not a float"));
636 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
637 sq_throwerror(vm, _SC("Argument 2 not a float"));
642 _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
646 } catch(std::exception& e) {
647 sq_throwerror(vm, e.what());
650 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
656 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
658 Scripting::ScriptedObject* _this;
659 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
660 sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
665 float return_value = _this->get_velocity_x();
667 sq_pushfloat(vm, return_value);
670 } catch(std::exception& e) {
671 sq_throwerror(vm, e.what());
674 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
680 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
682 Scripting::ScriptedObject* _this;
683 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
684 sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
689 float return_value = _this->get_velocity_y();
691 sq_pushfloat(vm, return_value);
694 } catch(std::exception& e) {
695 sq_throwerror(vm, e.what());
698 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
704 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
706 Scripting::ScriptedObject* _this;
707 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
708 sq_throwerror(vm, _SC("'set_visible' called without instance"));
712 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
713 sq_throwerror(vm, _SC("Argument 1 not a bool"));
718 _this->set_visible(arg0 == SQTrue);
722 } catch(std::exception& e) {
723 sq_throwerror(vm, e.what());
726 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
732 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
734 Scripting::ScriptedObject* _this;
735 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
736 sq_throwerror(vm, _SC("'is_visible' called without instance"));
741 bool return_value = _this->is_visible();
743 sq_pushbool(vm, return_value);
746 } catch(std::exception& e) {
747 sq_throwerror(vm, e.what());
750 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
756 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
758 Scripting::ScriptedObject* _this;
759 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
760 sq_throwerror(vm, _SC("'get_name' called without instance"));
765 std::string return_value = _this->get_name();
767 sq_pushstring(vm, return_value.c_str(), return_value.size());
770 } catch(std::exception& e) {
771 sq_throwerror(vm, e.what());
774 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
780 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
782 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
787 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
789 Scripting::Text* _this;
790 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
791 sq_throwerror(vm, _SC("'set_text' called without instance"));
795 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
796 sq_throwerror(vm, _SC("Argument 1 not a string"));
801 _this->set_text(arg0);
805 } catch(std::exception& e) {
806 sq_throwerror(vm, e.what());
809 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
815 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
817 Scripting::Text* _this;
818 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
819 sq_throwerror(vm, _SC("'set_font' called without instance"));
823 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
824 sq_throwerror(vm, _SC("Argument 1 not a string"));
829 _this->set_font(arg0);
833 } catch(std::exception& e) {
834 sq_throwerror(vm, e.what());
837 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
843 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
845 Scripting::Text* _this;
846 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
847 sq_throwerror(vm, _SC("'fade_in' called without instance"));
851 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
852 sq_throwerror(vm, _SC("Argument 1 not a float"));
857 _this->fade_in(static_cast<float> (arg0));
861 } catch(std::exception& e) {
862 sq_throwerror(vm, e.what());
865 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
871 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
873 Scripting::Text* _this;
874 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
875 sq_throwerror(vm, _SC("'fade_out' called without instance"));
879 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
880 sq_throwerror(vm, _SC("Argument 1 not a float"));
885 _this->fade_out(static_cast<float> (arg0));
889 } catch(std::exception& e) {
890 sq_throwerror(vm, e.what());
893 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
899 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
901 Scripting::Text* _this;
902 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
903 sq_throwerror(vm, _SC("'set_visible' called without instance"));
907 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
908 sq_throwerror(vm, _SC("Argument 1 not a bool"));
913 _this->set_visible(arg0 == SQTrue);
917 } catch(std::exception& e) {
918 sq_throwerror(vm, e.what());
921 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
927 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
929 Scripting::Text* _this;
930 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
931 sq_throwerror(vm, _SC("'set_centered' called without instance"));
935 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
936 sq_throwerror(vm, _SC("Argument 1 not a bool"));
941 _this->set_centered(arg0 == SQTrue);
945 } catch(std::exception& e) {
946 sq_throwerror(vm, e.what());
949 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
955 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
957 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
962 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
964 Scripting::Player* _this;
965 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
966 sq_throwerror(vm, _SC("'add_bonus' called without instance"));
970 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
971 sq_throwerror(vm, _SC("Argument 1 not a string"));
976 _this->add_bonus(arg0);
980 } catch(std::exception& e) {
981 sq_throwerror(vm, e.what());
984 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
990 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
992 Scripting::Player* _this;
993 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
994 sq_throwerror(vm, _SC("'add_coins' called without instance"));
998 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
999 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1004 _this->add_coins(static_cast<int> (arg0));
1008 } catch(std::exception& e) {
1009 sq_throwerror(vm, e.what());
1012 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1018 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1020 Scripting::Player* _this;
1021 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1022 sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1027 _this->make_invincible();
1031 } catch(std::exception& e) {
1032 sq_throwerror(vm, e.what());
1035 sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1041 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1043 Scripting::Player* _this;
1044 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1045 sq_throwerror(vm, _SC("'deactivate' called without instance"));
1050 _this->deactivate();
1054 } catch(std::exception& e) {
1055 sq_throwerror(vm, e.what());
1058 sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1064 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1066 Scripting::Player* _this;
1067 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1068 sq_throwerror(vm, _SC("'activate' called without instance"));
1077 } catch(std::exception& e) {
1078 sq_throwerror(vm, e.what());
1081 sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1087 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1089 Scripting::Player* _this;
1090 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1091 sq_throwerror(vm, _SC("'walk' called without instance"));
1095 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1096 sq_throwerror(vm, _SC("Argument 1 not a float"));
1101 _this->walk(static_cast<float> (arg0));
1105 } catch(std::exception& e) {
1106 sq_throwerror(vm, e.what());
1109 sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1115 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1117 Scripting::Player* _this;
1118 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1119 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1123 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1124 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1129 _this->set_visible(arg0 == SQTrue);
1133 } catch(std::exception& e) {
1134 sq_throwerror(vm, e.what());
1137 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1143 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1145 Scripting::Player* _this;
1146 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1147 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1152 bool return_value = _this->get_visible();
1154 sq_pushbool(vm, return_value);
1157 } catch(std::exception& e) {
1158 sq_throwerror(vm, e.what());
1161 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1167 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1169 Scripting::Player* _this;
1170 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1171 sq_throwerror(vm, _SC("'kill' called without instance"));
1175 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1176 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1181 _this->kill(arg0 == SQTrue);
1185 } catch(std::exception& e) {
1186 sq_throwerror(vm, e.what());
1189 sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1195 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1197 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1202 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1205 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1206 sq_throwerror(vm, _SC("Argument 1 not a string"));
1211 Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1212 if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1213 sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1216 sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1220 } catch(std::exception& e) {
1221 sq_throwerror(vm, e.what());
1224 sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1230 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1232 Scripting::FloatingImage* _this;
1233 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1234 sq_throwerror(vm, _SC("'set_layer' called without instance"));
1238 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1239 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1244 _this->set_layer(static_cast<int> (arg0));
1248 } catch(std::exception& e) {
1249 sq_throwerror(vm, e.what());
1252 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1258 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1260 Scripting::FloatingImage* _this;
1261 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1262 sq_throwerror(vm, _SC("'get_layer' called without instance"));
1267 int return_value = _this->get_layer();
1269 sq_pushinteger(vm, return_value);
1272 } catch(std::exception& e) {
1273 sq_throwerror(vm, e.what());
1276 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1282 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1284 Scripting::FloatingImage* _this;
1285 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1286 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1290 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1291 sq_throwerror(vm, _SC("Argument 1 not a float"));
1295 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1296 sq_throwerror(vm, _SC("Argument 2 not a float"));
1301 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1305 } catch(std::exception& e) {
1306 sq_throwerror(vm, e.what());
1309 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1315 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1317 Scripting::FloatingImage* _this;
1318 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1319 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1324 float return_value = _this->get_pos_x();
1326 sq_pushfloat(vm, return_value);
1329 } catch(std::exception& e) {
1330 sq_throwerror(vm, e.what());
1333 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1339 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1341 Scripting::FloatingImage* _this;
1342 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1343 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1348 float return_value = _this->get_pos_y();
1350 sq_pushfloat(vm, return_value);
1353 } catch(std::exception& e) {
1354 sq_throwerror(vm, e.what());
1357 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1363 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1365 Scripting::FloatingImage* _this;
1366 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1367 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1371 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1372 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1377 _this->set_anchor_point(static_cast<int> (arg0));
1381 } catch(std::exception& e) {
1382 sq_throwerror(vm, e.what());
1385 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1391 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1393 Scripting::FloatingImage* _this;
1394 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1395 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1400 int return_value = _this->get_anchor_point();
1402 sq_pushinteger(vm, return_value);
1405 } catch(std::exception& e) {
1406 sq_throwerror(vm, e.what());
1409 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1415 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1417 Scripting::FloatingImage* _this;
1418 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1419 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1423 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1424 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1429 _this->set_visible(arg0 == SQTrue);
1433 } catch(std::exception& e) {
1434 sq_throwerror(vm, e.what());
1437 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1443 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1445 Scripting::FloatingImage* _this;
1446 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1447 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1452 bool return_value = _this->get_visible();
1454 sq_pushbool(vm, return_value);
1457 } catch(std::exception& e) {
1458 sq_throwerror(vm, e.what());
1461 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1467 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
1469 Scripting::FloatingImage* _this;
1470 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1471 sq_throwerror(vm, _SC("'set_action' called without instance"));
1475 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1476 sq_throwerror(vm, _SC("Argument 1 not a string"));
1481 _this->set_action(arg0);
1485 } catch(std::exception& e) {
1486 sq_throwerror(vm, e.what());
1489 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1495 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
1497 Scripting::FloatingImage* _this;
1498 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1499 sq_throwerror(vm, _SC("'get_action' called without instance"));
1504 std::string return_value = _this->get_action();
1506 sq_pushstring(vm, return_value.c_str(), return_value.size());
1509 } catch(std::exception& e) {
1510 sq_throwerror(vm, e.what());
1513 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1519 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1521 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
1526 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1528 Scripting::Platform* _this;
1529 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1530 sq_throwerror(vm, _SC("'goto_node' called without instance"));
1534 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1535 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1540 _this->goto_node(static_cast<int> (arg0));
1544 } catch(std::exception& e) {
1545 sq_throwerror(vm, e.what());
1548 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1554 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1556 Scripting::Platform* _this;
1557 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1558 sq_throwerror(vm, _SC("'start_moving' called without instance"));
1563 _this->start_moving();
1567 } catch(std::exception& e) {
1568 sq_throwerror(vm, e.what());
1571 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
1577 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1579 Scripting::Platform* _this;
1580 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1581 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1586 _this->stop_moving();
1590 } catch(std::exception& e) {
1591 sq_throwerror(vm, e.what());
1594 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1600 static SQInteger display_wrapper(HSQUIRRELVM vm)
1602 return Scripting::display(vm);
1605 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
1607 HSQUIRRELVM arg0 = vm;
1610 Scripting::print_stacktrace(arg0);
1614 } catch(std::exception& e) {
1615 sq_throwerror(vm, e.what());
1618 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
1624 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
1626 return Scripting::get_current_thread(vm);
1629 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
1632 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1633 sq_throwerror(vm, _SC("Argument 1 not a string"));
1638 Scripting::display_text_file(arg0);
1642 } catch(std::exception& e) {
1643 sq_throwerror(vm, e.what());
1646 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
1652 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
1655 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1656 sq_throwerror(vm, _SC("Argument 1 not a string"));
1661 Scripting::load_worldmap(arg0);
1665 } catch(std::exception& e) {
1666 sq_throwerror(vm, e.what());
1669 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
1675 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
1678 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1679 sq_throwerror(vm, _SC("Argument 1 not a string"));
1684 Scripting::load_level(arg0);
1688 } catch(std::exception& e) {
1689 sq_throwerror(vm, e.what());
1692 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
1698 static SQInteger wait_wrapper(HSQUIRRELVM vm)
1700 HSQUIRRELVM arg0 = vm;
1702 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
1703 sq_throwerror(vm, _SC("Argument 1 not a float"));
1708 Scripting::wait(arg0, static_cast<float> (arg1));
1710 return sq_suspendvm(vm);
1712 } catch(std::exception& e) {
1713 sq_throwerror(vm, e.what());
1716 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
1722 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
1724 HSQUIRRELVM arg0 = vm;
1727 Scripting::wait_for_screenswitch(arg0);
1729 return sq_suspendvm(vm);
1731 } catch(std::exception& e) {
1732 sq_throwerror(vm, e.what());
1735 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
1741 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
1746 Scripting::exit_screen();
1750 } catch(std::exception& e) {
1751 sq_throwerror(vm, e.what());
1754 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
1760 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
1763 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1764 sq_throwerror(vm, _SC("Argument 1 not a float"));
1769 Scripting::fadeout_screen(static_cast<float> (arg0));
1773 } catch(std::exception& e) {
1774 sq_throwerror(vm, e.what());
1777 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
1783 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
1786 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1787 sq_throwerror(vm, _SC("Argument 1 not a float"));
1791 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1792 sq_throwerror(vm, _SC("Argument 2 not a float"));
1796 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
1797 sq_throwerror(vm, _SC("Argument 3 not a float"));
1802 Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
1806 } catch(std::exception& e) {
1807 sq_throwerror(vm, e.what());
1810 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
1816 static SQInteger translate_wrapper(HSQUIRRELVM vm)
1819 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1820 sq_throwerror(vm, _SC("Argument 1 not a string"));
1825 std::string return_value = Scripting::translate(arg0);
1827 sq_pushstring(vm, return_value.c_str(), return_value.size());
1830 } catch(std::exception& e) {
1831 sq_throwerror(vm, e.what());
1834 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
1840 static SQInteger import_wrapper(HSQUIRRELVM vm)
1842 HSQUIRRELVM arg0 = vm;
1844 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
1845 sq_throwerror(vm, _SC("Argument 1 not a string"));
1850 Scripting::import(arg0, arg1);
1854 } catch(std::exception& e) {
1855 sq_throwerror(vm, e.what());
1858 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
1864 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
1869 Scripting::save_state();
1873 } catch(std::exception& e) {
1874 sq_throwerror(vm, e.what());
1877 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
1883 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
1886 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1887 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1892 Scripting::debug_collrects(arg0 == SQTrue);
1896 } catch(std::exception& e) {
1897 sq_throwerror(vm, e.what());
1900 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
1906 static SQInteger debug_draw_fps_wrapper(HSQUIRRELVM vm)
1909 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1910 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1915 Scripting::debug_draw_fps(arg0 == SQTrue);
1919 } catch(std::exception& e) {
1920 sq_throwerror(vm, e.what());
1923 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_fps'"));
1929 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
1932 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1933 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1938 Scripting::debug_draw_solids_only(arg0 == SQTrue);
1942 } catch(std::exception& e) {
1943 sq_throwerror(vm, e.what());
1946 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
1952 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
1955 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1956 sq_throwerror(vm, _SC("Argument 1 not a string"));
1961 Scripting::play_music(arg0);
1965 } catch(std::exception& e) {
1966 sq_throwerror(vm, e.what());
1969 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
1975 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
1978 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1979 sq_throwerror(vm, _SC("Argument 1 not a string"));
1984 Scripting::play_sound(arg0);
1988 } catch(std::exception& e) {
1989 sq_throwerror(vm, e.what());
1992 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
1998 static SQInteger grease_wrapper(HSQUIRRELVM vm)
2003 Scripting::grease();
2007 } catch(std::exception& e) {
2008 sq_throwerror(vm, e.what());
2011 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
2017 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
2022 Scripting::invincible();
2026 } catch(std::exception& e) {
2027 sq_throwerror(vm, e.what());
2030 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
2036 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
2041 Scripting::mortal();
2045 } catch(std::exception& e) {
2046 sq_throwerror(vm, e.what());
2049 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
2055 static SQInteger restart_wrapper(HSQUIRRELVM vm)
2060 Scripting::restart();
2064 } catch(std::exception& e) {
2065 sq_throwerror(vm, e.what());
2068 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
2074 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
2079 Scripting::whereami();
2083 } catch(std::exception& e) {
2084 sq_throwerror(vm, e.what());
2087 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
2093 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
2098 Scripting::gotoend();
2102 } catch(std::exception& e) {
2103 sq_throwerror(vm, e.what());
2106 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
2112 static SQInteger camera_wrapper(HSQUIRRELVM vm)
2117 Scripting::camera();
2121 } catch(std::exception& e) {
2122 sq_throwerror(vm, e.what());
2125 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
2131 static SQInteger quit_wrapper(HSQUIRRELVM vm)
2140 } catch(std::exception& e) {
2141 sq_throwerror(vm, e.what());
2144 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
2150 static SQInteger rand_wrapper(HSQUIRRELVM vm)
2154 int return_value = Scripting::rand();
2156 sq_pushinteger(vm, return_value);
2159 } catch(std::exception& e) {
2160 sq_throwerror(vm, e.what());
2163 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
2169 } // end of namespace Wrapper
2171 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
2173 using namespace Wrapper;
2175 sq_pushroottable(v);
2176 sq_pushstring(v, "DisplayEffect", -1);
2177 if(SQ_FAILED(sq_get(v, -2))) {
2178 std::ostringstream msg;
2179 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
2180 throw SquirrelError(v, msg.str());
2183 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2184 std::ostringstream msg;
2185 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
2186 throw SquirrelError(v, msg.str());
2188 sq_remove(v, -2); // remove object name
2190 if(setup_releasehook) {
2191 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
2194 sq_remove(v, -2); // remove root table
2197 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
2199 using namespace Wrapper;
2201 sq_pushroottable(v);
2202 sq_pushstring(v, "Camera", -1);
2203 if(SQ_FAILED(sq_get(v, -2))) {
2204 std::ostringstream msg;
2205 msg << "Couldn't resolved squirrel type 'Camera'";
2206 throw SquirrelError(v, msg.str());
2209 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2210 std::ostringstream msg;
2211 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
2212 throw SquirrelError(v, msg.str());
2214 sq_remove(v, -2); // remove object name
2216 if(setup_releasehook) {
2217 sq_setreleasehook(v, -1, Camera_release_hook);
2220 sq_remove(v, -2); // remove root table
2223 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
2225 using namespace Wrapper;
2227 sq_pushroottable(v);
2228 sq_pushstring(v, "Level", -1);
2229 if(SQ_FAILED(sq_get(v, -2))) {
2230 std::ostringstream msg;
2231 msg << "Couldn't resolved squirrel type 'Level'";
2232 throw SquirrelError(v, msg.str());
2235 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2236 std::ostringstream msg;
2237 msg << "Couldn't setup squirrel instance for object of type 'Level'";
2238 throw SquirrelError(v, msg.str());
2240 sq_remove(v, -2); // remove object name
2242 if(setup_releasehook) {
2243 sq_setreleasehook(v, -1, Level_release_hook);
2246 sq_remove(v, -2); // remove root table
2249 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
2251 using namespace Wrapper;
2253 sq_pushroottable(v);
2254 sq_pushstring(v, "ScriptedObject", -1);
2255 if(SQ_FAILED(sq_get(v, -2))) {
2256 std::ostringstream msg;
2257 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
2258 throw SquirrelError(v, msg.str());
2261 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2262 std::ostringstream msg;
2263 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
2264 throw SquirrelError(v, msg.str());
2266 sq_remove(v, -2); // remove object name
2268 if(setup_releasehook) {
2269 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
2272 sq_remove(v, -2); // remove root table
2275 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
2277 using namespace Wrapper;
2279 sq_pushroottable(v);
2280 sq_pushstring(v, "Text", -1);
2281 if(SQ_FAILED(sq_get(v, -2))) {
2282 std::ostringstream msg;
2283 msg << "Couldn't resolved squirrel type 'Text'";
2284 throw SquirrelError(v, msg.str());
2287 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2288 std::ostringstream msg;
2289 msg << "Couldn't setup squirrel instance for object of type 'Text'";
2290 throw SquirrelError(v, msg.str());
2292 sq_remove(v, -2); // remove object name
2294 if(setup_releasehook) {
2295 sq_setreleasehook(v, -1, Text_release_hook);
2298 sq_remove(v, -2); // remove root table
2301 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
2303 using namespace Wrapper;
2305 sq_pushroottable(v);
2306 sq_pushstring(v, "Player", -1);
2307 if(SQ_FAILED(sq_get(v, -2))) {
2308 std::ostringstream msg;
2309 msg << "Couldn't resolved squirrel type 'Player'";
2310 throw SquirrelError(v, msg.str());
2313 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2314 std::ostringstream msg;
2315 msg << "Couldn't setup squirrel instance for object of type 'Player'";
2316 throw SquirrelError(v, msg.str());
2318 sq_remove(v, -2); // remove object name
2320 if(setup_releasehook) {
2321 sq_setreleasehook(v, -1, Player_release_hook);
2324 sq_remove(v, -2); // remove root table
2327 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
2329 using namespace Wrapper;
2331 sq_pushroottable(v);
2332 sq_pushstring(v, "FloatingImage", -1);
2333 if(SQ_FAILED(sq_get(v, -2))) {
2334 std::ostringstream msg;
2335 msg << "Couldn't resolved squirrel type 'FloatingImage'";
2336 throw SquirrelError(v, msg.str());
2339 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2340 std::ostringstream msg;
2341 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
2342 throw SquirrelError(v, msg.str());
2344 sq_remove(v, -2); // remove object name
2346 if(setup_releasehook) {
2347 sq_setreleasehook(v, -1, FloatingImage_release_hook);
2350 sq_remove(v, -2); // remove root table
2353 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
2355 using namespace Wrapper;
2357 sq_pushroottable(v);
2358 sq_pushstring(v, "Platform", -1);
2359 if(SQ_FAILED(sq_get(v, -2))) {
2360 std::ostringstream msg;
2361 msg << "Couldn't resolved squirrel type 'Platform'";
2362 throw SquirrelError(v, msg.str());
2365 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2366 std::ostringstream msg;
2367 msg << "Couldn't setup squirrel instance for object of type 'Platform'";
2368 throw SquirrelError(v, msg.str());
2370 sq_remove(v, -2); // remove object name
2372 if(setup_releasehook) {
2373 sq_setreleasehook(v, -1, Platform_release_hook);
2376 sq_remove(v, -2); // remove root table
2379 void register_supertux_wrapper(HSQUIRRELVM v)
2381 using namespace Wrapper;
2383 sq_pushstring(v, "ANCHOR_TOP", -1);
2384 sq_pushinteger(v, 16);
2385 if(SQ_FAILED(sq_createslot(v, -3))) {
2386 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
2389 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
2390 sq_pushinteger(v, 32);
2391 if(SQ_FAILED(sq_createslot(v, -3))) {
2392 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
2395 sq_pushstring(v, "ANCHOR_LEFT", -1);
2396 sq_pushinteger(v, 1);
2397 if(SQ_FAILED(sq_createslot(v, -3))) {
2398 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
2401 sq_pushstring(v, "ANCHOR_RIGHT", -1);
2402 sq_pushinteger(v, 2);
2403 if(SQ_FAILED(sq_createslot(v, -3))) {
2404 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
2407 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
2408 sq_pushinteger(v, 0);
2409 if(SQ_FAILED(sq_createslot(v, -3))) {
2410 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
2413 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
2414 sq_pushinteger(v, 17);
2415 if(SQ_FAILED(sq_createslot(v, -3))) {
2416 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
2419 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
2420 sq_pushinteger(v, 18);
2421 if(SQ_FAILED(sq_createslot(v, -3))) {
2422 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
2425 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
2426 sq_pushinteger(v, 33);
2427 if(SQ_FAILED(sq_createslot(v, -3))) {
2428 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
2431 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
2432 sq_pushinteger(v, 34);
2433 if(SQ_FAILED(sq_createslot(v, -3))) {
2434 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
2437 sq_pushstring(v, "display", -1);
2438 sq_newclosure(v, &display_wrapper, 0);
2439 if(SQ_FAILED(sq_createslot(v, -3))) {
2440 throw SquirrelError(v, "Couldn't register function 'display'");
2443 sq_pushstring(v, "print_stacktrace", -1);
2444 sq_newclosure(v, &print_stacktrace_wrapper, 0);
2445 if(SQ_FAILED(sq_createslot(v, -3))) {
2446 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
2449 sq_pushstring(v, "get_current_thread", -1);
2450 sq_newclosure(v, &get_current_thread_wrapper, 0);
2451 if(SQ_FAILED(sq_createslot(v, -3))) {
2452 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
2455 sq_pushstring(v, "display_text_file", -1);
2456 sq_newclosure(v, &display_text_file_wrapper, 0);
2457 if(SQ_FAILED(sq_createslot(v, -3))) {
2458 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
2461 sq_pushstring(v, "load_worldmap", -1);
2462 sq_newclosure(v, &load_worldmap_wrapper, 0);
2463 if(SQ_FAILED(sq_createslot(v, -3))) {
2464 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
2467 sq_pushstring(v, "load_level", -1);
2468 sq_newclosure(v, &load_level_wrapper, 0);
2469 if(SQ_FAILED(sq_createslot(v, -3))) {
2470 throw SquirrelError(v, "Couldn't register function 'load_level'");
2473 sq_pushstring(v, "wait", -1);
2474 sq_newclosure(v, &wait_wrapper, 0);
2475 if(SQ_FAILED(sq_createslot(v, -3))) {
2476 throw SquirrelError(v, "Couldn't register function 'wait'");
2479 sq_pushstring(v, "wait_for_screenswitch", -1);
2480 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
2481 if(SQ_FAILED(sq_createslot(v, -3))) {
2482 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
2485 sq_pushstring(v, "exit_screen", -1);
2486 sq_newclosure(v, &exit_screen_wrapper, 0);
2487 if(SQ_FAILED(sq_createslot(v, -3))) {
2488 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
2491 sq_pushstring(v, "fadeout_screen", -1);
2492 sq_newclosure(v, &fadeout_screen_wrapper, 0);
2493 if(SQ_FAILED(sq_createslot(v, -3))) {
2494 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
2497 sq_pushstring(v, "shrink_screen", -1);
2498 sq_newclosure(v, &shrink_screen_wrapper, 0);
2499 if(SQ_FAILED(sq_createslot(v, -3))) {
2500 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
2503 sq_pushstring(v, "translate", -1);
2504 sq_newclosure(v, &translate_wrapper, 0);
2505 if(SQ_FAILED(sq_createslot(v, -3))) {
2506 throw SquirrelError(v, "Couldn't register function 'translate'");
2509 sq_pushstring(v, "import", -1);
2510 sq_newclosure(v, &import_wrapper, 0);
2511 if(SQ_FAILED(sq_createslot(v, -3))) {
2512 throw SquirrelError(v, "Couldn't register function 'import'");
2515 sq_pushstring(v, "save_state", -1);
2516 sq_newclosure(v, &save_state_wrapper, 0);
2517 if(SQ_FAILED(sq_createslot(v, -3))) {
2518 throw SquirrelError(v, "Couldn't register function 'save_state'");
2521 sq_pushstring(v, "debug_collrects", -1);
2522 sq_newclosure(v, &debug_collrects_wrapper, 0);
2523 if(SQ_FAILED(sq_createslot(v, -3))) {
2524 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
2527 sq_pushstring(v, "debug_draw_fps", -1);
2528 sq_newclosure(v, &debug_draw_fps_wrapper, 0);
2529 if(SQ_FAILED(sq_createslot(v, -3))) {
2530 throw SquirrelError(v, "Couldn't register function 'debug_draw_fps'");
2533 sq_pushstring(v, "debug_draw_solids_only", -1);
2534 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
2535 if(SQ_FAILED(sq_createslot(v, -3))) {
2536 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
2539 sq_pushstring(v, "play_music", -1);
2540 sq_newclosure(v, &play_music_wrapper, 0);
2541 if(SQ_FAILED(sq_createslot(v, -3))) {
2542 throw SquirrelError(v, "Couldn't register function 'play_music'");
2545 sq_pushstring(v, "play_sound", -1);
2546 sq_newclosure(v, &play_sound_wrapper, 0);
2547 if(SQ_FAILED(sq_createslot(v, -3))) {
2548 throw SquirrelError(v, "Couldn't register function 'play_sound'");
2551 sq_pushstring(v, "grease", -1);
2552 sq_newclosure(v, &grease_wrapper, 0);
2553 if(SQ_FAILED(sq_createslot(v, -3))) {
2554 throw SquirrelError(v, "Couldn't register function 'grease'");
2557 sq_pushstring(v, "invincible", -1);
2558 sq_newclosure(v, &invincible_wrapper, 0);
2559 if(SQ_FAILED(sq_createslot(v, -3))) {
2560 throw SquirrelError(v, "Couldn't register function 'invincible'");
2563 sq_pushstring(v, "mortal", -1);
2564 sq_newclosure(v, &mortal_wrapper, 0);
2565 if(SQ_FAILED(sq_createslot(v, -3))) {
2566 throw SquirrelError(v, "Couldn't register function 'mortal'");
2569 sq_pushstring(v, "restart", -1);
2570 sq_newclosure(v, &restart_wrapper, 0);
2571 if(SQ_FAILED(sq_createslot(v, -3))) {
2572 throw SquirrelError(v, "Couldn't register function 'restart'");
2575 sq_pushstring(v, "whereami", -1);
2576 sq_newclosure(v, &whereami_wrapper, 0);
2577 if(SQ_FAILED(sq_createslot(v, -3))) {
2578 throw SquirrelError(v, "Couldn't register function 'whereami'");
2581 sq_pushstring(v, "gotoend", -1);
2582 sq_newclosure(v, &gotoend_wrapper, 0);
2583 if(SQ_FAILED(sq_createslot(v, -3))) {
2584 throw SquirrelError(v, "Couldn't register function 'gotoend'");
2587 sq_pushstring(v, "camera", -1);
2588 sq_newclosure(v, &camera_wrapper, 0);
2589 if(SQ_FAILED(sq_createslot(v, -3))) {
2590 throw SquirrelError(v, "Couldn't register function 'camera'");
2593 sq_pushstring(v, "quit", -1);
2594 sq_newclosure(v, &quit_wrapper, 0);
2595 if(SQ_FAILED(sq_createslot(v, -3))) {
2596 throw SquirrelError(v, "Couldn't register function 'quit'");
2599 sq_pushstring(v, "rand", -1);
2600 sq_newclosure(v, &rand_wrapper, 0);
2601 if(SQ_FAILED(sq_createslot(v, -3))) {
2602 throw SquirrelError(v, "Couldn't register function 'rand'");
2605 // Register class DisplayEffect
2606 sq_pushstring(v, "DisplayEffect", -1);
2607 if(sq_newclass(v, SQFalse) < 0) {
2608 std::ostringstream msg;
2609 msg << "Couldn't create new class 'DisplayEffect'";
2610 throw SquirrelError(v, msg.str());
2612 sq_pushstring(v, "fade_out", -1);
2613 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
2614 if(SQ_FAILED(sq_createslot(v, -3))) {
2615 throw SquirrelError(v, "Couldn't register function 'fade_out'");
2618 sq_pushstring(v, "fade_in", -1);
2619 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
2620 if(SQ_FAILED(sq_createslot(v, -3))) {
2621 throw SquirrelError(v, "Couldn't register function 'fade_in'");
2624 sq_pushstring(v, "set_black", -1);
2625 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
2626 if(SQ_FAILED(sq_createslot(v, -3))) {
2627 throw SquirrelError(v, "Couldn't register function 'set_black'");
2630 sq_pushstring(v, "is_black", -1);
2631 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
2632 if(SQ_FAILED(sq_createslot(v, -3))) {
2633 throw SquirrelError(v, "Couldn't register function 'is_black'");
2636 sq_pushstring(v, "sixteen_to_nine", -1);
2637 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
2638 if(SQ_FAILED(sq_createslot(v, -3))) {
2639 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
2642 sq_pushstring(v, "four_to_three", -1);
2643 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
2644 if(SQ_FAILED(sq_createslot(v, -3))) {
2645 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
2648 if(SQ_FAILED(sq_createslot(v, -3))) {
2649 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
2652 // Register class Camera
2653 sq_pushstring(v, "Camera", -1);
2654 if(sq_newclass(v, SQFalse) < 0) {
2655 std::ostringstream msg;
2656 msg << "Couldn't create new class 'Camera'";
2657 throw SquirrelError(v, msg.str());
2659 sq_pushstring(v, "shake", -1);
2660 sq_newclosure(v, &Camera_shake_wrapper, 0);
2661 if(SQ_FAILED(sq_createslot(v, -3))) {
2662 throw SquirrelError(v, "Couldn't register function 'shake'");
2665 sq_pushstring(v, "set_pos", -1);
2666 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
2667 if(SQ_FAILED(sq_createslot(v, -3))) {
2668 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2671 sq_pushstring(v, "set_mode", -1);
2672 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
2673 if(SQ_FAILED(sq_createslot(v, -3))) {
2674 throw SquirrelError(v, "Couldn't register function 'set_mode'");
2677 sq_pushstring(v, "scroll_to", -1);
2678 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
2679 if(SQ_FAILED(sq_createslot(v, -3))) {
2680 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
2683 if(SQ_FAILED(sq_createslot(v, -3))) {
2684 throw SquirrelError(v, "Couldn't register class 'Camera'");
2687 // Register class Level
2688 sq_pushstring(v, "Level", -1);
2689 if(sq_newclass(v, SQFalse) < 0) {
2690 std::ostringstream msg;
2691 msg << "Couldn't create new class 'Level'";
2692 throw SquirrelError(v, msg.str());
2694 sq_pushstring(v, "finish", -1);
2695 sq_newclosure(v, &Level_finish_wrapper, 0);
2696 if(SQ_FAILED(sq_createslot(v, -3))) {
2697 throw SquirrelError(v, "Couldn't register function 'finish'");
2700 sq_pushstring(v, "spawn", -1);
2701 sq_newclosure(v, &Level_spawn_wrapper, 0);
2702 if(SQ_FAILED(sq_createslot(v, -3))) {
2703 throw SquirrelError(v, "Couldn't register function 'spawn'");
2706 sq_pushstring(v, "flip_vertically", -1);
2707 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
2708 if(SQ_FAILED(sq_createslot(v, -3))) {
2709 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
2712 sq_pushstring(v, "toggle_pause", -1);
2713 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
2714 if(SQ_FAILED(sq_createslot(v, -3))) {
2715 throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
2718 if(SQ_FAILED(sq_createslot(v, -3))) {
2719 throw SquirrelError(v, "Couldn't register class 'Level'");
2722 // Register class ScriptedObject
2723 sq_pushstring(v, "ScriptedObject", -1);
2724 if(sq_newclass(v, SQFalse) < 0) {
2725 std::ostringstream msg;
2726 msg << "Couldn't create new class 'ScriptedObject'";
2727 throw SquirrelError(v, msg.str());
2729 sq_pushstring(v, "set_action", -1);
2730 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
2731 if(SQ_FAILED(sq_createslot(v, -3))) {
2732 throw SquirrelError(v, "Couldn't register function 'set_action'");
2735 sq_pushstring(v, "get_action", -1);
2736 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
2737 if(SQ_FAILED(sq_createslot(v, -3))) {
2738 throw SquirrelError(v, "Couldn't register function 'get_action'");
2741 sq_pushstring(v, "move", -1);
2742 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
2743 if(SQ_FAILED(sq_createslot(v, -3))) {
2744 throw SquirrelError(v, "Couldn't register function 'move'");
2747 sq_pushstring(v, "set_pos", -1);
2748 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
2749 if(SQ_FAILED(sq_createslot(v, -3))) {
2750 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2753 sq_pushstring(v, "get_pos_x", -1);
2754 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
2755 if(SQ_FAILED(sq_createslot(v, -3))) {
2756 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
2759 sq_pushstring(v, "get_pos_y", -1);
2760 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
2761 if(SQ_FAILED(sq_createslot(v, -3))) {
2762 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
2765 sq_pushstring(v, "set_velocity", -1);
2766 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
2767 if(SQ_FAILED(sq_createslot(v, -3))) {
2768 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
2771 sq_pushstring(v, "get_velocity_x", -1);
2772 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
2773 if(SQ_FAILED(sq_createslot(v, -3))) {
2774 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
2777 sq_pushstring(v, "get_velocity_y", -1);
2778 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
2779 if(SQ_FAILED(sq_createslot(v, -3))) {
2780 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
2783 sq_pushstring(v, "set_visible", -1);
2784 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
2785 if(SQ_FAILED(sq_createslot(v, -3))) {
2786 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2789 sq_pushstring(v, "is_visible", -1);
2790 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
2791 if(SQ_FAILED(sq_createslot(v, -3))) {
2792 throw SquirrelError(v, "Couldn't register function 'is_visible'");
2795 sq_pushstring(v, "get_name", -1);
2796 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
2797 if(SQ_FAILED(sq_createslot(v, -3))) {
2798 throw SquirrelError(v, "Couldn't register function 'get_name'");
2801 if(SQ_FAILED(sq_createslot(v, -3))) {
2802 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
2805 // Register class Text
2806 sq_pushstring(v, "Text", -1);
2807 if(sq_newclass(v, SQFalse) < 0) {
2808 std::ostringstream msg;
2809 msg << "Couldn't create new class 'Text'";
2810 throw SquirrelError(v, msg.str());
2812 sq_pushstring(v, "set_text", -1);
2813 sq_newclosure(v, &Text_set_text_wrapper, 0);
2814 if(SQ_FAILED(sq_createslot(v, -3))) {
2815 throw SquirrelError(v, "Couldn't register function 'set_text'");
2818 sq_pushstring(v, "set_font", -1);
2819 sq_newclosure(v, &Text_set_font_wrapper, 0);
2820 if(SQ_FAILED(sq_createslot(v, -3))) {
2821 throw SquirrelError(v, "Couldn't register function 'set_font'");
2824 sq_pushstring(v, "fade_in", -1);
2825 sq_newclosure(v, &Text_fade_in_wrapper, 0);
2826 if(SQ_FAILED(sq_createslot(v, -3))) {
2827 throw SquirrelError(v, "Couldn't register function 'fade_in'");
2830 sq_pushstring(v, "fade_out", -1);
2831 sq_newclosure(v, &Text_fade_out_wrapper, 0);
2832 if(SQ_FAILED(sq_createslot(v, -3))) {
2833 throw SquirrelError(v, "Couldn't register function 'fade_out'");
2836 sq_pushstring(v, "set_visible", -1);
2837 sq_newclosure(v, &Text_set_visible_wrapper, 0);
2838 if(SQ_FAILED(sq_createslot(v, -3))) {
2839 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2842 sq_pushstring(v, "set_centered", -1);
2843 sq_newclosure(v, &Text_set_centered_wrapper, 0);
2844 if(SQ_FAILED(sq_createslot(v, -3))) {
2845 throw SquirrelError(v, "Couldn't register function 'set_centered'");
2848 if(SQ_FAILED(sq_createslot(v, -3))) {
2849 throw SquirrelError(v, "Couldn't register class 'Text'");
2852 // Register class Player
2853 sq_pushstring(v, "Player", -1);
2854 if(sq_newclass(v, SQFalse) < 0) {
2855 std::ostringstream msg;
2856 msg << "Couldn't create new class 'Player'";
2857 throw SquirrelError(v, msg.str());
2859 sq_pushstring(v, "add_bonus", -1);
2860 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
2861 if(SQ_FAILED(sq_createslot(v, -3))) {
2862 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
2865 sq_pushstring(v, "add_coins", -1);
2866 sq_newclosure(v, &Player_add_coins_wrapper, 0);
2867 if(SQ_FAILED(sq_createslot(v, -3))) {
2868 throw SquirrelError(v, "Couldn't register function 'add_coins'");
2871 sq_pushstring(v, "make_invincible", -1);
2872 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
2873 if(SQ_FAILED(sq_createslot(v, -3))) {
2874 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
2877 sq_pushstring(v, "deactivate", -1);
2878 sq_newclosure(v, &Player_deactivate_wrapper, 0);
2879 if(SQ_FAILED(sq_createslot(v, -3))) {
2880 throw SquirrelError(v, "Couldn't register function 'deactivate'");
2883 sq_pushstring(v, "activate", -1);
2884 sq_newclosure(v, &Player_activate_wrapper, 0);
2885 if(SQ_FAILED(sq_createslot(v, -3))) {
2886 throw SquirrelError(v, "Couldn't register function 'activate'");
2889 sq_pushstring(v, "walk", -1);
2890 sq_newclosure(v, &Player_walk_wrapper, 0);
2891 if(SQ_FAILED(sq_createslot(v, -3))) {
2892 throw SquirrelError(v, "Couldn't register function 'walk'");
2895 sq_pushstring(v, "set_visible", -1);
2896 sq_newclosure(v, &Player_set_visible_wrapper, 0);
2897 if(SQ_FAILED(sq_createslot(v, -3))) {
2898 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2901 sq_pushstring(v, "get_visible", -1);
2902 sq_newclosure(v, &Player_get_visible_wrapper, 0);
2903 if(SQ_FAILED(sq_createslot(v, -3))) {
2904 throw SquirrelError(v, "Couldn't register function 'get_visible'");
2907 sq_pushstring(v, "kill", -1);
2908 sq_newclosure(v, &Player_kill_wrapper, 0);
2909 if(SQ_FAILED(sq_createslot(v, -3))) {
2910 throw SquirrelError(v, "Couldn't register function 'kill'");
2913 if(SQ_FAILED(sq_createslot(v, -3))) {
2914 throw SquirrelError(v, "Couldn't register class 'Player'");
2917 // Register class FloatingImage
2918 sq_pushstring(v, "FloatingImage", -1);
2919 if(sq_newclass(v, SQFalse) < 0) {
2920 std::ostringstream msg;
2921 msg << "Couldn't create new class 'FloatingImage'";
2922 throw SquirrelError(v, msg.str());
2924 sq_pushstring(v, "constructor", -1);
2925 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
2926 if(SQ_FAILED(sq_createslot(v, -3))) {
2927 throw SquirrelError(v, "Couldn't register function 'constructor'");
2930 sq_pushstring(v, "set_layer", -1);
2931 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
2932 if(SQ_FAILED(sq_createslot(v, -3))) {
2933 throw SquirrelError(v, "Couldn't register function 'set_layer'");
2936 sq_pushstring(v, "get_layer", -1);
2937 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
2938 if(SQ_FAILED(sq_createslot(v, -3))) {
2939 throw SquirrelError(v, "Couldn't register function 'get_layer'");
2942 sq_pushstring(v, "set_pos", -1);
2943 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
2944 if(SQ_FAILED(sq_createslot(v, -3))) {
2945 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2948 sq_pushstring(v, "get_pos_x", -1);
2949 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
2950 if(SQ_FAILED(sq_createslot(v, -3))) {
2951 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
2954 sq_pushstring(v, "get_pos_y", -1);
2955 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
2956 if(SQ_FAILED(sq_createslot(v, -3))) {
2957 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
2960 sq_pushstring(v, "set_anchor_point", -1);
2961 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
2962 if(SQ_FAILED(sq_createslot(v, -3))) {
2963 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
2966 sq_pushstring(v, "get_anchor_point", -1);
2967 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
2968 if(SQ_FAILED(sq_createslot(v, -3))) {
2969 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
2972 sq_pushstring(v, "set_visible", -1);
2973 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
2974 if(SQ_FAILED(sq_createslot(v, -3))) {
2975 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2978 sq_pushstring(v, "get_visible", -1);
2979 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
2980 if(SQ_FAILED(sq_createslot(v, -3))) {
2981 throw SquirrelError(v, "Couldn't register function 'get_visible'");
2984 sq_pushstring(v, "set_action", -1);
2985 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
2986 if(SQ_FAILED(sq_createslot(v, -3))) {
2987 throw SquirrelError(v, "Couldn't register function 'set_action'");
2990 sq_pushstring(v, "get_action", -1);
2991 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
2992 if(SQ_FAILED(sq_createslot(v, -3))) {
2993 throw SquirrelError(v, "Couldn't register function 'get_action'");
2996 if(SQ_FAILED(sq_createslot(v, -3))) {
2997 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
3000 // Register class Platform
3001 sq_pushstring(v, "Platform", -1);
3002 if(sq_newclass(v, SQFalse) < 0) {
3003 std::ostringstream msg;
3004 msg << "Couldn't create new class 'Platform'";
3005 throw SquirrelError(v, msg.str());
3007 sq_pushstring(v, "goto_node", -1);
3008 sq_newclosure(v, &Platform_goto_node_wrapper, 0);
3009 if(SQ_FAILED(sq_createslot(v, -3))) {
3010 throw SquirrelError(v, "Couldn't register function 'goto_node'");
3013 sq_pushstring(v, "start_moving", -1);
3014 sq_newclosure(v, &Platform_start_moving_wrapper, 0);
3015 if(SQ_FAILED(sq_createslot(v, -3))) {
3016 throw SquirrelError(v, "Couldn't register function 'start_moving'");
3019 sq_pushstring(v, "stop_moving", -1);
3020 sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
3021 if(SQ_FAILED(sq_createslot(v, -3))) {
3022 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
3025 if(SQ_FAILED(sq_createslot(v, -3))) {
3026 throw SquirrelError(v, "Couldn't register class 'Platform'");
3031 } // end of namespace Scripting