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 Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1197 Scripting::Player* _this;
1198 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1199 sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1203 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1204 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1209 _this->set_ghost_mode(arg0 == SQTrue);
1213 } catch(std::exception& e) {
1214 sq_throwerror(vm, e.what());
1217 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1223 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1225 Scripting::Player* _this;
1226 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1227 sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1232 bool return_value = _this->get_ghost_mode();
1234 sq_pushbool(vm, return_value);
1237 } catch(std::exception& e) {
1238 sq_throwerror(vm, e.what());
1241 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1247 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1249 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1254 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1257 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1258 sq_throwerror(vm, _SC("Argument 1 not a string"));
1263 Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1264 if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1265 sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1268 sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1272 } catch(std::exception& e) {
1273 sq_throwerror(vm, e.what());
1276 sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1282 static SQInteger FloatingImage_set_layer_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_layer' called without instance"));
1290 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1291 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1296 _this->set_layer(static_cast<int> (arg0));
1300 } catch(std::exception& e) {
1301 sq_throwerror(vm, e.what());
1304 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1310 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1312 Scripting::FloatingImage* _this;
1313 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1314 sq_throwerror(vm, _SC("'get_layer' called without instance"));
1319 int return_value = _this->get_layer();
1321 sq_pushinteger(vm, return_value);
1324 } catch(std::exception& e) {
1325 sq_throwerror(vm, e.what());
1328 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1334 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1336 Scripting::FloatingImage* _this;
1337 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1338 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1342 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1343 sq_throwerror(vm, _SC("Argument 1 not a float"));
1347 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1348 sq_throwerror(vm, _SC("Argument 2 not a float"));
1353 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1357 } catch(std::exception& e) {
1358 sq_throwerror(vm, e.what());
1361 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1367 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1369 Scripting::FloatingImage* _this;
1370 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1371 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1376 float return_value = _this->get_pos_x();
1378 sq_pushfloat(vm, return_value);
1381 } catch(std::exception& e) {
1382 sq_throwerror(vm, e.what());
1385 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1391 static SQInteger FloatingImage_get_pos_y_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_pos_y' called without instance"));
1400 float return_value = _this->get_pos_y();
1402 sq_pushfloat(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_pos_y'"));
1415 static SQInteger FloatingImage_set_anchor_point_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_anchor_point' called without instance"));
1423 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1424 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1429 _this->set_anchor_point(static_cast<int> (arg0));
1433 } catch(std::exception& e) {
1434 sq_throwerror(vm, e.what());
1437 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1443 static SQInteger FloatingImage_get_anchor_point_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_anchor_point' called without instance"));
1452 int return_value = _this->get_anchor_point();
1454 sq_pushinteger(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_anchor_point'"));
1467 static SQInteger FloatingImage_set_visible_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_visible' called without instance"));
1475 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1476 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1481 _this->set_visible(arg0 == SQTrue);
1485 } catch(std::exception& e) {
1486 sq_throwerror(vm, e.what());
1489 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1495 static SQInteger FloatingImage_get_visible_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_visible' called without instance"));
1504 bool return_value = _this->get_visible();
1506 sq_pushbool(vm, return_value);
1509 } catch(std::exception& e) {
1510 sq_throwerror(vm, e.what());
1513 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1519 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
1521 Scripting::FloatingImage* _this;
1522 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1523 sq_throwerror(vm, _SC("'set_action' called without instance"));
1527 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1528 sq_throwerror(vm, _SC("Argument 1 not a string"));
1533 _this->set_action(arg0);
1537 } catch(std::exception& e) {
1538 sq_throwerror(vm, e.what());
1541 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1547 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
1549 Scripting::FloatingImage* _this;
1550 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1551 sq_throwerror(vm, _SC("'get_action' called without instance"));
1556 std::string return_value = _this->get_action();
1558 sq_pushstring(vm, return_value.c_str(), return_value.size());
1561 } catch(std::exception& e) {
1562 sq_throwerror(vm, e.what());
1565 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1571 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1573 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
1578 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1580 Scripting::Platform* _this;
1581 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1582 sq_throwerror(vm, _SC("'goto_node' called without instance"));
1586 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1587 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1592 _this->goto_node(static_cast<int> (arg0));
1596 } catch(std::exception& e) {
1597 sq_throwerror(vm, e.what());
1600 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1606 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1608 Scripting::Platform* _this;
1609 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1610 sq_throwerror(vm, _SC("'start_moving' called without instance"));
1615 _this->start_moving();
1619 } catch(std::exception& e) {
1620 sq_throwerror(vm, e.what());
1623 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
1629 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1631 Scripting::Platform* _this;
1632 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1633 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1638 _this->stop_moving();
1642 } catch(std::exception& e) {
1643 sq_throwerror(vm, e.what());
1646 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1652 static SQInteger display_wrapper(HSQUIRRELVM vm)
1654 return Scripting::display(vm);
1657 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
1659 HSQUIRRELVM arg0 = vm;
1662 Scripting::print_stacktrace(arg0);
1666 } catch(std::exception& e) {
1667 sq_throwerror(vm, e.what());
1670 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
1676 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
1678 return Scripting::get_current_thread(vm);
1681 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
1684 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1685 sq_throwerror(vm, _SC("Argument 1 not a string"));
1690 Scripting::display_text_file(arg0);
1694 } catch(std::exception& e) {
1695 sq_throwerror(vm, e.what());
1698 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
1704 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
1707 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1708 sq_throwerror(vm, _SC("Argument 1 not a string"));
1713 Scripting::load_worldmap(arg0);
1717 } catch(std::exception& e) {
1718 sq_throwerror(vm, e.what());
1721 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
1727 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
1730 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1731 sq_throwerror(vm, _SC("Argument 1 not a string"));
1736 Scripting::load_level(arg0);
1740 } catch(std::exception& e) {
1741 sq_throwerror(vm, e.what());
1744 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
1750 static SQInteger wait_wrapper(HSQUIRRELVM vm)
1752 HSQUIRRELVM arg0 = vm;
1754 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
1755 sq_throwerror(vm, _SC("Argument 1 not a float"));
1760 Scripting::wait(arg0, static_cast<float> (arg1));
1762 return sq_suspendvm(vm);
1764 } catch(std::exception& e) {
1765 sq_throwerror(vm, e.what());
1768 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
1774 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
1776 HSQUIRRELVM arg0 = vm;
1779 Scripting::wait_for_screenswitch(arg0);
1781 return sq_suspendvm(vm);
1783 } catch(std::exception& e) {
1784 sq_throwerror(vm, e.what());
1787 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
1793 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
1798 Scripting::exit_screen();
1802 } catch(std::exception& e) {
1803 sq_throwerror(vm, e.what());
1806 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
1812 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
1815 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1816 sq_throwerror(vm, _SC("Argument 1 not a float"));
1821 Scripting::fadeout_screen(static_cast<float> (arg0));
1825 } catch(std::exception& e) {
1826 sq_throwerror(vm, e.what());
1829 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
1835 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
1838 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1839 sq_throwerror(vm, _SC("Argument 1 not a float"));
1843 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1844 sq_throwerror(vm, _SC("Argument 2 not a float"));
1848 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
1849 sq_throwerror(vm, _SC("Argument 3 not a float"));
1854 Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
1858 } catch(std::exception& e) {
1859 sq_throwerror(vm, e.what());
1862 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
1868 static SQInteger translate_wrapper(HSQUIRRELVM vm)
1871 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1872 sq_throwerror(vm, _SC("Argument 1 not a string"));
1877 std::string return_value = Scripting::translate(arg0);
1879 sq_pushstring(vm, return_value.c_str(), return_value.size());
1882 } catch(std::exception& e) {
1883 sq_throwerror(vm, e.what());
1886 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
1892 static SQInteger import_wrapper(HSQUIRRELVM vm)
1894 HSQUIRRELVM arg0 = vm;
1896 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
1897 sq_throwerror(vm, _SC("Argument 1 not a string"));
1902 Scripting::import(arg0, arg1);
1906 } catch(std::exception& e) {
1907 sq_throwerror(vm, e.what());
1910 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
1916 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
1921 Scripting::save_state();
1925 } catch(std::exception& e) {
1926 sq_throwerror(vm, e.what());
1929 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
1935 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
1938 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1939 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1944 Scripting::debug_collrects(arg0 == SQTrue);
1948 } catch(std::exception& e) {
1949 sq_throwerror(vm, e.what());
1952 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
1958 static SQInteger debug_draw_fps_wrapper(HSQUIRRELVM vm)
1961 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1962 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1967 Scripting::debug_draw_fps(arg0 == SQTrue);
1971 } catch(std::exception& e) {
1972 sq_throwerror(vm, e.what());
1975 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_fps'"));
1981 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
1984 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1985 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1990 Scripting::debug_draw_solids_only(arg0 == SQTrue);
1994 } catch(std::exception& e) {
1995 sq_throwerror(vm, e.what());
1998 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
2004 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
2007 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2008 sq_throwerror(vm, _SC("Argument 1 not a string"));
2013 Scripting::play_music(arg0);
2017 } catch(std::exception& e) {
2018 sq_throwerror(vm, e.what());
2021 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
2027 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
2030 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2031 sq_throwerror(vm, _SC("Argument 1 not a string"));
2036 Scripting::play_sound(arg0);
2040 } catch(std::exception& e) {
2041 sq_throwerror(vm, e.what());
2044 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
2050 static SQInteger grease_wrapper(HSQUIRRELVM vm)
2055 Scripting::grease();
2059 } catch(std::exception& e) {
2060 sq_throwerror(vm, e.what());
2063 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
2069 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
2074 Scripting::invincible();
2078 } catch(std::exception& e) {
2079 sq_throwerror(vm, e.what());
2082 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
2088 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
2097 } catch(std::exception& e) {
2098 sq_throwerror(vm, e.what());
2101 sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
2107 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
2112 Scripting::mortal();
2116 } catch(std::exception& e) {
2117 sq_throwerror(vm, e.what());
2120 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
2126 static SQInteger restart_wrapper(HSQUIRRELVM vm)
2131 Scripting::restart();
2135 } catch(std::exception& e) {
2136 sq_throwerror(vm, e.what());
2139 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
2145 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
2150 Scripting::whereami();
2154 } catch(std::exception& e) {
2155 sq_throwerror(vm, e.what());
2158 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
2164 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
2169 Scripting::gotoend();
2173 } catch(std::exception& e) {
2174 sq_throwerror(vm, e.what());
2177 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
2183 static SQInteger camera_wrapper(HSQUIRRELVM vm)
2188 Scripting::camera();
2192 } catch(std::exception& e) {
2193 sq_throwerror(vm, e.what());
2196 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
2202 static SQInteger quit_wrapper(HSQUIRRELVM vm)
2211 } catch(std::exception& e) {
2212 sq_throwerror(vm, e.what());
2215 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
2221 static SQInteger rand_wrapper(HSQUIRRELVM vm)
2225 int return_value = Scripting::rand();
2227 sq_pushinteger(vm, return_value);
2230 } catch(std::exception& e) {
2231 sq_throwerror(vm, e.what());
2234 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
2240 } // end of namespace Wrapper
2242 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
2244 using namespace Wrapper;
2246 sq_pushroottable(v);
2247 sq_pushstring(v, "DisplayEffect", -1);
2248 if(SQ_FAILED(sq_get(v, -2))) {
2249 std::ostringstream msg;
2250 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
2251 throw SquirrelError(v, msg.str());
2254 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2255 std::ostringstream msg;
2256 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
2257 throw SquirrelError(v, msg.str());
2259 sq_remove(v, -2); // remove object name
2261 if(setup_releasehook) {
2262 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
2265 sq_remove(v, -2); // remove root table
2268 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
2270 using namespace Wrapper;
2272 sq_pushroottable(v);
2273 sq_pushstring(v, "Camera", -1);
2274 if(SQ_FAILED(sq_get(v, -2))) {
2275 std::ostringstream msg;
2276 msg << "Couldn't resolved squirrel type 'Camera'";
2277 throw SquirrelError(v, msg.str());
2280 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2281 std::ostringstream msg;
2282 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
2283 throw SquirrelError(v, msg.str());
2285 sq_remove(v, -2); // remove object name
2287 if(setup_releasehook) {
2288 sq_setreleasehook(v, -1, Camera_release_hook);
2291 sq_remove(v, -2); // remove root table
2294 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
2296 using namespace Wrapper;
2298 sq_pushroottable(v);
2299 sq_pushstring(v, "Level", -1);
2300 if(SQ_FAILED(sq_get(v, -2))) {
2301 std::ostringstream msg;
2302 msg << "Couldn't resolved squirrel type 'Level'";
2303 throw SquirrelError(v, msg.str());
2306 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2307 std::ostringstream msg;
2308 msg << "Couldn't setup squirrel instance for object of type 'Level'";
2309 throw SquirrelError(v, msg.str());
2311 sq_remove(v, -2); // remove object name
2313 if(setup_releasehook) {
2314 sq_setreleasehook(v, -1, Level_release_hook);
2317 sq_remove(v, -2); // remove root table
2320 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
2322 using namespace Wrapper;
2324 sq_pushroottable(v);
2325 sq_pushstring(v, "ScriptedObject", -1);
2326 if(SQ_FAILED(sq_get(v, -2))) {
2327 std::ostringstream msg;
2328 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
2329 throw SquirrelError(v, msg.str());
2332 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2333 std::ostringstream msg;
2334 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
2335 throw SquirrelError(v, msg.str());
2337 sq_remove(v, -2); // remove object name
2339 if(setup_releasehook) {
2340 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
2343 sq_remove(v, -2); // remove root table
2346 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
2348 using namespace Wrapper;
2350 sq_pushroottable(v);
2351 sq_pushstring(v, "Text", -1);
2352 if(SQ_FAILED(sq_get(v, -2))) {
2353 std::ostringstream msg;
2354 msg << "Couldn't resolved squirrel type 'Text'";
2355 throw SquirrelError(v, msg.str());
2358 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2359 std::ostringstream msg;
2360 msg << "Couldn't setup squirrel instance for object of type 'Text'";
2361 throw SquirrelError(v, msg.str());
2363 sq_remove(v, -2); // remove object name
2365 if(setup_releasehook) {
2366 sq_setreleasehook(v, -1, Text_release_hook);
2369 sq_remove(v, -2); // remove root table
2372 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
2374 using namespace Wrapper;
2376 sq_pushroottable(v);
2377 sq_pushstring(v, "Player", -1);
2378 if(SQ_FAILED(sq_get(v, -2))) {
2379 std::ostringstream msg;
2380 msg << "Couldn't resolved squirrel type 'Player'";
2381 throw SquirrelError(v, msg.str());
2384 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2385 std::ostringstream msg;
2386 msg << "Couldn't setup squirrel instance for object of type 'Player'";
2387 throw SquirrelError(v, msg.str());
2389 sq_remove(v, -2); // remove object name
2391 if(setup_releasehook) {
2392 sq_setreleasehook(v, -1, Player_release_hook);
2395 sq_remove(v, -2); // remove root table
2398 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
2400 using namespace Wrapper;
2402 sq_pushroottable(v);
2403 sq_pushstring(v, "FloatingImage", -1);
2404 if(SQ_FAILED(sq_get(v, -2))) {
2405 std::ostringstream msg;
2406 msg << "Couldn't resolved squirrel type 'FloatingImage'";
2407 throw SquirrelError(v, msg.str());
2410 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2411 std::ostringstream msg;
2412 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
2413 throw SquirrelError(v, msg.str());
2415 sq_remove(v, -2); // remove object name
2417 if(setup_releasehook) {
2418 sq_setreleasehook(v, -1, FloatingImage_release_hook);
2421 sq_remove(v, -2); // remove root table
2424 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
2426 using namespace Wrapper;
2428 sq_pushroottable(v);
2429 sq_pushstring(v, "Platform", -1);
2430 if(SQ_FAILED(sq_get(v, -2))) {
2431 std::ostringstream msg;
2432 msg << "Couldn't resolved squirrel type 'Platform'";
2433 throw SquirrelError(v, msg.str());
2436 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2437 std::ostringstream msg;
2438 msg << "Couldn't setup squirrel instance for object of type 'Platform'";
2439 throw SquirrelError(v, msg.str());
2441 sq_remove(v, -2); // remove object name
2443 if(setup_releasehook) {
2444 sq_setreleasehook(v, -1, Platform_release_hook);
2447 sq_remove(v, -2); // remove root table
2450 void register_supertux_wrapper(HSQUIRRELVM v)
2452 using namespace Wrapper;
2454 sq_pushstring(v, "ANCHOR_TOP", -1);
2455 sq_pushinteger(v, 16);
2456 if(SQ_FAILED(sq_createslot(v, -3))) {
2457 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
2460 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
2461 sq_pushinteger(v, 32);
2462 if(SQ_FAILED(sq_createslot(v, -3))) {
2463 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
2466 sq_pushstring(v, "ANCHOR_LEFT", -1);
2467 sq_pushinteger(v, 1);
2468 if(SQ_FAILED(sq_createslot(v, -3))) {
2469 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
2472 sq_pushstring(v, "ANCHOR_RIGHT", -1);
2473 sq_pushinteger(v, 2);
2474 if(SQ_FAILED(sq_createslot(v, -3))) {
2475 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
2478 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
2479 sq_pushinteger(v, 0);
2480 if(SQ_FAILED(sq_createslot(v, -3))) {
2481 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
2484 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
2485 sq_pushinteger(v, 17);
2486 if(SQ_FAILED(sq_createslot(v, -3))) {
2487 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
2490 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
2491 sq_pushinteger(v, 18);
2492 if(SQ_FAILED(sq_createslot(v, -3))) {
2493 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
2496 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
2497 sq_pushinteger(v, 33);
2498 if(SQ_FAILED(sq_createslot(v, -3))) {
2499 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
2502 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
2503 sq_pushinteger(v, 34);
2504 if(SQ_FAILED(sq_createslot(v, -3))) {
2505 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
2508 sq_pushstring(v, "display", -1);
2509 sq_newclosure(v, &display_wrapper, 0);
2510 if(SQ_FAILED(sq_createslot(v, -3))) {
2511 throw SquirrelError(v, "Couldn't register function 'display'");
2514 sq_pushstring(v, "print_stacktrace", -1);
2515 sq_newclosure(v, &print_stacktrace_wrapper, 0);
2516 if(SQ_FAILED(sq_createslot(v, -3))) {
2517 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
2520 sq_pushstring(v, "get_current_thread", -1);
2521 sq_newclosure(v, &get_current_thread_wrapper, 0);
2522 if(SQ_FAILED(sq_createslot(v, -3))) {
2523 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
2526 sq_pushstring(v, "display_text_file", -1);
2527 sq_newclosure(v, &display_text_file_wrapper, 0);
2528 if(SQ_FAILED(sq_createslot(v, -3))) {
2529 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
2532 sq_pushstring(v, "load_worldmap", -1);
2533 sq_newclosure(v, &load_worldmap_wrapper, 0);
2534 if(SQ_FAILED(sq_createslot(v, -3))) {
2535 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
2538 sq_pushstring(v, "load_level", -1);
2539 sq_newclosure(v, &load_level_wrapper, 0);
2540 if(SQ_FAILED(sq_createslot(v, -3))) {
2541 throw SquirrelError(v, "Couldn't register function 'load_level'");
2544 sq_pushstring(v, "wait", -1);
2545 sq_newclosure(v, &wait_wrapper, 0);
2546 if(SQ_FAILED(sq_createslot(v, -3))) {
2547 throw SquirrelError(v, "Couldn't register function 'wait'");
2550 sq_pushstring(v, "wait_for_screenswitch", -1);
2551 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
2552 if(SQ_FAILED(sq_createslot(v, -3))) {
2553 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
2556 sq_pushstring(v, "exit_screen", -1);
2557 sq_newclosure(v, &exit_screen_wrapper, 0);
2558 if(SQ_FAILED(sq_createslot(v, -3))) {
2559 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
2562 sq_pushstring(v, "fadeout_screen", -1);
2563 sq_newclosure(v, &fadeout_screen_wrapper, 0);
2564 if(SQ_FAILED(sq_createslot(v, -3))) {
2565 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
2568 sq_pushstring(v, "shrink_screen", -1);
2569 sq_newclosure(v, &shrink_screen_wrapper, 0);
2570 if(SQ_FAILED(sq_createslot(v, -3))) {
2571 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
2574 sq_pushstring(v, "translate", -1);
2575 sq_newclosure(v, &translate_wrapper, 0);
2576 if(SQ_FAILED(sq_createslot(v, -3))) {
2577 throw SquirrelError(v, "Couldn't register function 'translate'");
2580 sq_pushstring(v, "import", -1);
2581 sq_newclosure(v, &import_wrapper, 0);
2582 if(SQ_FAILED(sq_createslot(v, -3))) {
2583 throw SquirrelError(v, "Couldn't register function 'import'");
2586 sq_pushstring(v, "save_state", -1);
2587 sq_newclosure(v, &save_state_wrapper, 0);
2588 if(SQ_FAILED(sq_createslot(v, -3))) {
2589 throw SquirrelError(v, "Couldn't register function 'save_state'");
2592 sq_pushstring(v, "debug_collrects", -1);
2593 sq_newclosure(v, &debug_collrects_wrapper, 0);
2594 if(SQ_FAILED(sq_createslot(v, -3))) {
2595 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
2598 sq_pushstring(v, "debug_draw_fps", -1);
2599 sq_newclosure(v, &debug_draw_fps_wrapper, 0);
2600 if(SQ_FAILED(sq_createslot(v, -3))) {
2601 throw SquirrelError(v, "Couldn't register function 'debug_draw_fps'");
2604 sq_pushstring(v, "debug_draw_solids_only", -1);
2605 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
2606 if(SQ_FAILED(sq_createslot(v, -3))) {
2607 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
2610 sq_pushstring(v, "play_music", -1);
2611 sq_newclosure(v, &play_music_wrapper, 0);
2612 if(SQ_FAILED(sq_createslot(v, -3))) {
2613 throw SquirrelError(v, "Couldn't register function 'play_music'");
2616 sq_pushstring(v, "play_sound", -1);
2617 sq_newclosure(v, &play_sound_wrapper, 0);
2618 if(SQ_FAILED(sq_createslot(v, -3))) {
2619 throw SquirrelError(v, "Couldn't register function 'play_sound'");
2622 sq_pushstring(v, "grease", -1);
2623 sq_newclosure(v, &grease_wrapper, 0);
2624 if(SQ_FAILED(sq_createslot(v, -3))) {
2625 throw SquirrelError(v, "Couldn't register function 'grease'");
2628 sq_pushstring(v, "invincible", -1);
2629 sq_newclosure(v, &invincible_wrapper, 0);
2630 if(SQ_FAILED(sq_createslot(v, -3))) {
2631 throw SquirrelError(v, "Couldn't register function 'invincible'");
2634 sq_pushstring(v, "ghost", -1);
2635 sq_newclosure(v, &ghost_wrapper, 0);
2636 if(SQ_FAILED(sq_createslot(v, -3))) {
2637 throw SquirrelError(v, "Couldn't register function 'ghost'");
2640 sq_pushstring(v, "mortal", -1);
2641 sq_newclosure(v, &mortal_wrapper, 0);
2642 if(SQ_FAILED(sq_createslot(v, -3))) {
2643 throw SquirrelError(v, "Couldn't register function 'mortal'");
2646 sq_pushstring(v, "restart", -1);
2647 sq_newclosure(v, &restart_wrapper, 0);
2648 if(SQ_FAILED(sq_createslot(v, -3))) {
2649 throw SquirrelError(v, "Couldn't register function 'restart'");
2652 sq_pushstring(v, "whereami", -1);
2653 sq_newclosure(v, &whereami_wrapper, 0);
2654 if(SQ_FAILED(sq_createslot(v, -3))) {
2655 throw SquirrelError(v, "Couldn't register function 'whereami'");
2658 sq_pushstring(v, "gotoend", -1);
2659 sq_newclosure(v, &gotoend_wrapper, 0);
2660 if(SQ_FAILED(sq_createslot(v, -3))) {
2661 throw SquirrelError(v, "Couldn't register function 'gotoend'");
2664 sq_pushstring(v, "camera", -1);
2665 sq_newclosure(v, &camera_wrapper, 0);
2666 if(SQ_FAILED(sq_createslot(v, -3))) {
2667 throw SquirrelError(v, "Couldn't register function 'camera'");
2670 sq_pushstring(v, "quit", -1);
2671 sq_newclosure(v, &quit_wrapper, 0);
2672 if(SQ_FAILED(sq_createslot(v, -3))) {
2673 throw SquirrelError(v, "Couldn't register function 'quit'");
2676 sq_pushstring(v, "rand", -1);
2677 sq_newclosure(v, &rand_wrapper, 0);
2678 if(SQ_FAILED(sq_createslot(v, -3))) {
2679 throw SquirrelError(v, "Couldn't register function 'rand'");
2682 // Register class DisplayEffect
2683 sq_pushstring(v, "DisplayEffect", -1);
2684 if(sq_newclass(v, SQFalse) < 0) {
2685 std::ostringstream msg;
2686 msg << "Couldn't create new class 'DisplayEffect'";
2687 throw SquirrelError(v, msg.str());
2689 sq_pushstring(v, "fade_out", -1);
2690 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
2691 if(SQ_FAILED(sq_createslot(v, -3))) {
2692 throw SquirrelError(v, "Couldn't register function 'fade_out'");
2695 sq_pushstring(v, "fade_in", -1);
2696 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
2697 if(SQ_FAILED(sq_createslot(v, -3))) {
2698 throw SquirrelError(v, "Couldn't register function 'fade_in'");
2701 sq_pushstring(v, "set_black", -1);
2702 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
2703 if(SQ_FAILED(sq_createslot(v, -3))) {
2704 throw SquirrelError(v, "Couldn't register function 'set_black'");
2707 sq_pushstring(v, "is_black", -1);
2708 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
2709 if(SQ_FAILED(sq_createslot(v, -3))) {
2710 throw SquirrelError(v, "Couldn't register function 'is_black'");
2713 sq_pushstring(v, "sixteen_to_nine", -1);
2714 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
2715 if(SQ_FAILED(sq_createslot(v, -3))) {
2716 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
2719 sq_pushstring(v, "four_to_three", -1);
2720 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
2721 if(SQ_FAILED(sq_createslot(v, -3))) {
2722 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
2725 if(SQ_FAILED(sq_createslot(v, -3))) {
2726 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
2729 // Register class Camera
2730 sq_pushstring(v, "Camera", -1);
2731 if(sq_newclass(v, SQFalse) < 0) {
2732 std::ostringstream msg;
2733 msg << "Couldn't create new class 'Camera'";
2734 throw SquirrelError(v, msg.str());
2736 sq_pushstring(v, "shake", -1);
2737 sq_newclosure(v, &Camera_shake_wrapper, 0);
2738 if(SQ_FAILED(sq_createslot(v, -3))) {
2739 throw SquirrelError(v, "Couldn't register function 'shake'");
2742 sq_pushstring(v, "set_pos", -1);
2743 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
2744 if(SQ_FAILED(sq_createslot(v, -3))) {
2745 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2748 sq_pushstring(v, "set_mode", -1);
2749 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
2750 if(SQ_FAILED(sq_createslot(v, -3))) {
2751 throw SquirrelError(v, "Couldn't register function 'set_mode'");
2754 sq_pushstring(v, "scroll_to", -1);
2755 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
2756 if(SQ_FAILED(sq_createslot(v, -3))) {
2757 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
2760 if(SQ_FAILED(sq_createslot(v, -3))) {
2761 throw SquirrelError(v, "Couldn't register class 'Camera'");
2764 // Register class Level
2765 sq_pushstring(v, "Level", -1);
2766 if(sq_newclass(v, SQFalse) < 0) {
2767 std::ostringstream msg;
2768 msg << "Couldn't create new class 'Level'";
2769 throw SquirrelError(v, msg.str());
2771 sq_pushstring(v, "finish", -1);
2772 sq_newclosure(v, &Level_finish_wrapper, 0);
2773 if(SQ_FAILED(sq_createslot(v, -3))) {
2774 throw SquirrelError(v, "Couldn't register function 'finish'");
2777 sq_pushstring(v, "spawn", -1);
2778 sq_newclosure(v, &Level_spawn_wrapper, 0);
2779 if(SQ_FAILED(sq_createslot(v, -3))) {
2780 throw SquirrelError(v, "Couldn't register function 'spawn'");
2783 sq_pushstring(v, "flip_vertically", -1);
2784 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
2785 if(SQ_FAILED(sq_createslot(v, -3))) {
2786 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
2789 sq_pushstring(v, "toggle_pause", -1);
2790 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
2791 if(SQ_FAILED(sq_createslot(v, -3))) {
2792 throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
2795 if(SQ_FAILED(sq_createslot(v, -3))) {
2796 throw SquirrelError(v, "Couldn't register class 'Level'");
2799 // Register class ScriptedObject
2800 sq_pushstring(v, "ScriptedObject", -1);
2801 if(sq_newclass(v, SQFalse) < 0) {
2802 std::ostringstream msg;
2803 msg << "Couldn't create new class 'ScriptedObject'";
2804 throw SquirrelError(v, msg.str());
2806 sq_pushstring(v, "set_action", -1);
2807 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
2808 if(SQ_FAILED(sq_createslot(v, -3))) {
2809 throw SquirrelError(v, "Couldn't register function 'set_action'");
2812 sq_pushstring(v, "get_action", -1);
2813 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
2814 if(SQ_FAILED(sq_createslot(v, -3))) {
2815 throw SquirrelError(v, "Couldn't register function 'get_action'");
2818 sq_pushstring(v, "move", -1);
2819 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
2820 if(SQ_FAILED(sq_createslot(v, -3))) {
2821 throw SquirrelError(v, "Couldn't register function 'move'");
2824 sq_pushstring(v, "set_pos", -1);
2825 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
2826 if(SQ_FAILED(sq_createslot(v, -3))) {
2827 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2830 sq_pushstring(v, "get_pos_x", -1);
2831 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
2832 if(SQ_FAILED(sq_createslot(v, -3))) {
2833 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
2836 sq_pushstring(v, "get_pos_y", -1);
2837 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
2838 if(SQ_FAILED(sq_createslot(v, -3))) {
2839 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
2842 sq_pushstring(v, "set_velocity", -1);
2843 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
2844 if(SQ_FAILED(sq_createslot(v, -3))) {
2845 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
2848 sq_pushstring(v, "get_velocity_x", -1);
2849 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
2850 if(SQ_FAILED(sq_createslot(v, -3))) {
2851 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
2854 sq_pushstring(v, "get_velocity_y", -1);
2855 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
2856 if(SQ_FAILED(sq_createslot(v, -3))) {
2857 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
2860 sq_pushstring(v, "set_visible", -1);
2861 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
2862 if(SQ_FAILED(sq_createslot(v, -3))) {
2863 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2866 sq_pushstring(v, "is_visible", -1);
2867 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
2868 if(SQ_FAILED(sq_createslot(v, -3))) {
2869 throw SquirrelError(v, "Couldn't register function 'is_visible'");
2872 sq_pushstring(v, "get_name", -1);
2873 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
2874 if(SQ_FAILED(sq_createslot(v, -3))) {
2875 throw SquirrelError(v, "Couldn't register function 'get_name'");
2878 if(SQ_FAILED(sq_createslot(v, -3))) {
2879 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
2882 // Register class Text
2883 sq_pushstring(v, "Text", -1);
2884 if(sq_newclass(v, SQFalse) < 0) {
2885 std::ostringstream msg;
2886 msg << "Couldn't create new class 'Text'";
2887 throw SquirrelError(v, msg.str());
2889 sq_pushstring(v, "set_text", -1);
2890 sq_newclosure(v, &Text_set_text_wrapper, 0);
2891 if(SQ_FAILED(sq_createslot(v, -3))) {
2892 throw SquirrelError(v, "Couldn't register function 'set_text'");
2895 sq_pushstring(v, "set_font", -1);
2896 sq_newclosure(v, &Text_set_font_wrapper, 0);
2897 if(SQ_FAILED(sq_createslot(v, -3))) {
2898 throw SquirrelError(v, "Couldn't register function 'set_font'");
2901 sq_pushstring(v, "fade_in", -1);
2902 sq_newclosure(v, &Text_fade_in_wrapper, 0);
2903 if(SQ_FAILED(sq_createslot(v, -3))) {
2904 throw SquirrelError(v, "Couldn't register function 'fade_in'");
2907 sq_pushstring(v, "fade_out", -1);
2908 sq_newclosure(v, &Text_fade_out_wrapper, 0);
2909 if(SQ_FAILED(sq_createslot(v, -3))) {
2910 throw SquirrelError(v, "Couldn't register function 'fade_out'");
2913 sq_pushstring(v, "set_visible", -1);
2914 sq_newclosure(v, &Text_set_visible_wrapper, 0);
2915 if(SQ_FAILED(sq_createslot(v, -3))) {
2916 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2919 sq_pushstring(v, "set_centered", -1);
2920 sq_newclosure(v, &Text_set_centered_wrapper, 0);
2921 if(SQ_FAILED(sq_createslot(v, -3))) {
2922 throw SquirrelError(v, "Couldn't register function 'set_centered'");
2925 if(SQ_FAILED(sq_createslot(v, -3))) {
2926 throw SquirrelError(v, "Couldn't register class 'Text'");
2929 // Register class Player
2930 sq_pushstring(v, "Player", -1);
2931 if(sq_newclass(v, SQFalse) < 0) {
2932 std::ostringstream msg;
2933 msg << "Couldn't create new class 'Player'";
2934 throw SquirrelError(v, msg.str());
2936 sq_pushstring(v, "add_bonus", -1);
2937 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
2938 if(SQ_FAILED(sq_createslot(v, -3))) {
2939 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
2942 sq_pushstring(v, "add_coins", -1);
2943 sq_newclosure(v, &Player_add_coins_wrapper, 0);
2944 if(SQ_FAILED(sq_createslot(v, -3))) {
2945 throw SquirrelError(v, "Couldn't register function 'add_coins'");
2948 sq_pushstring(v, "make_invincible", -1);
2949 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
2950 if(SQ_FAILED(sq_createslot(v, -3))) {
2951 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
2954 sq_pushstring(v, "deactivate", -1);
2955 sq_newclosure(v, &Player_deactivate_wrapper, 0);
2956 if(SQ_FAILED(sq_createslot(v, -3))) {
2957 throw SquirrelError(v, "Couldn't register function 'deactivate'");
2960 sq_pushstring(v, "activate", -1);
2961 sq_newclosure(v, &Player_activate_wrapper, 0);
2962 if(SQ_FAILED(sq_createslot(v, -3))) {
2963 throw SquirrelError(v, "Couldn't register function 'activate'");
2966 sq_pushstring(v, "walk", -1);
2967 sq_newclosure(v, &Player_walk_wrapper, 0);
2968 if(SQ_FAILED(sq_createslot(v, -3))) {
2969 throw SquirrelError(v, "Couldn't register function 'walk'");
2972 sq_pushstring(v, "set_visible", -1);
2973 sq_newclosure(v, &Player_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, &Player_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, "kill", -1);
2985 sq_newclosure(v, &Player_kill_wrapper, 0);
2986 if(SQ_FAILED(sq_createslot(v, -3))) {
2987 throw SquirrelError(v, "Couldn't register function 'kill'");
2990 sq_pushstring(v, "set_ghost_mode", -1);
2991 sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
2992 if(SQ_FAILED(sq_createslot(v, -3))) {
2993 throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
2996 sq_pushstring(v, "get_ghost_mode", -1);
2997 sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
2998 if(SQ_FAILED(sq_createslot(v, -3))) {
2999 throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
3002 if(SQ_FAILED(sq_createslot(v, -3))) {
3003 throw SquirrelError(v, "Couldn't register class 'Player'");
3006 // Register class FloatingImage
3007 sq_pushstring(v, "FloatingImage", -1);
3008 if(sq_newclass(v, SQFalse) < 0) {
3009 std::ostringstream msg;
3010 msg << "Couldn't create new class 'FloatingImage'";
3011 throw SquirrelError(v, msg.str());
3013 sq_pushstring(v, "constructor", -1);
3014 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
3015 if(SQ_FAILED(sq_createslot(v, -3))) {
3016 throw SquirrelError(v, "Couldn't register function 'constructor'");
3019 sq_pushstring(v, "set_layer", -1);
3020 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
3021 if(SQ_FAILED(sq_createslot(v, -3))) {
3022 throw SquirrelError(v, "Couldn't register function 'set_layer'");
3025 sq_pushstring(v, "get_layer", -1);
3026 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
3027 if(SQ_FAILED(sq_createslot(v, -3))) {
3028 throw SquirrelError(v, "Couldn't register function 'get_layer'");
3031 sq_pushstring(v, "set_pos", -1);
3032 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
3033 if(SQ_FAILED(sq_createslot(v, -3))) {
3034 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3037 sq_pushstring(v, "get_pos_x", -1);
3038 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
3039 if(SQ_FAILED(sq_createslot(v, -3))) {
3040 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3043 sq_pushstring(v, "get_pos_y", -1);
3044 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
3045 if(SQ_FAILED(sq_createslot(v, -3))) {
3046 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3049 sq_pushstring(v, "set_anchor_point", -1);
3050 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
3051 if(SQ_FAILED(sq_createslot(v, -3))) {
3052 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
3055 sq_pushstring(v, "get_anchor_point", -1);
3056 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
3057 if(SQ_FAILED(sq_createslot(v, -3))) {
3058 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
3061 sq_pushstring(v, "set_visible", -1);
3062 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
3063 if(SQ_FAILED(sq_createslot(v, -3))) {
3064 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3067 sq_pushstring(v, "get_visible", -1);
3068 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
3069 if(SQ_FAILED(sq_createslot(v, -3))) {
3070 throw SquirrelError(v, "Couldn't register function 'get_visible'");
3073 sq_pushstring(v, "set_action", -1);
3074 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
3075 if(SQ_FAILED(sq_createslot(v, -3))) {
3076 throw SquirrelError(v, "Couldn't register function 'set_action'");
3079 sq_pushstring(v, "get_action", -1);
3080 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
3081 if(SQ_FAILED(sq_createslot(v, -3))) {
3082 throw SquirrelError(v, "Couldn't register function 'get_action'");
3085 if(SQ_FAILED(sq_createslot(v, -3))) {
3086 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
3089 // Register class Platform
3090 sq_pushstring(v, "Platform", -1);
3091 if(sq_newclass(v, SQFalse) < 0) {
3092 std::ostringstream msg;
3093 msg << "Couldn't create new class 'Platform'";
3094 throw SquirrelError(v, msg.str());
3096 sq_pushstring(v, "goto_node", -1);
3097 sq_newclosure(v, &Platform_goto_node_wrapper, 0);
3098 if(SQ_FAILED(sq_createslot(v, -3))) {
3099 throw SquirrelError(v, "Couldn't register function 'goto_node'");
3102 sq_pushstring(v, "start_moving", -1);
3103 sq_newclosure(v, &Platform_start_moving_wrapper, 0);
3104 if(SQ_FAILED(sq_createslot(v, -3))) {
3105 throw SquirrelError(v, "Couldn't register function 'start_moving'");
3108 sq_pushstring(v, "stop_moving", -1);
3109 sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
3110 if(SQ_FAILED(sq_createslot(v, -3))) {
3111 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
3114 if(SQ_FAILED(sq_createslot(v, -3))) {
3115 throw SquirrelError(v, "Couldn't register class 'Platform'");
3120 } // end of namespace Scripting