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, int )
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, int )
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, int )
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, int )
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, int )
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, int )
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, int )
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 display_wrapper(HSQUIRRELVM vm)
1521 return Scripting::display(vm);
1524 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
1526 HSQUIRRELVM arg0 = vm;
1529 Scripting::print_stacktrace(arg0);
1533 } catch(std::exception& e) {
1534 sq_throwerror(vm, e.what());
1537 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
1543 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
1545 return Scripting::get_current_thread(vm);
1548 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
1551 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1552 sq_throwerror(vm, _SC("Argument 1 not a string"));
1557 Scripting::display_text_file(arg0);
1561 } catch(std::exception& e) {
1562 sq_throwerror(vm, e.what());
1565 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
1571 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
1574 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1575 sq_throwerror(vm, _SC("Argument 1 not a string"));
1580 Scripting::load_worldmap(arg0);
1584 } catch(std::exception& e) {
1585 sq_throwerror(vm, e.what());
1588 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
1594 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
1597 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1598 sq_throwerror(vm, _SC("Argument 1 not a string"));
1603 Scripting::load_level(arg0);
1607 } catch(std::exception& e) {
1608 sq_throwerror(vm, e.what());
1611 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
1617 static SQInteger wait_wrapper(HSQUIRRELVM vm)
1619 HSQUIRRELVM arg0 = vm;
1621 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
1622 sq_throwerror(vm, _SC("Argument 1 not a float"));
1627 Scripting::wait(arg0, static_cast<float> (arg1));
1629 return sq_suspendvm(vm);
1631 } catch(std::exception& e) {
1632 sq_throwerror(vm, e.what());
1635 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
1641 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
1643 HSQUIRRELVM arg0 = vm;
1646 Scripting::wait_for_screenswitch(arg0);
1648 return sq_suspendvm(vm);
1650 } catch(std::exception& e) {
1651 sq_throwerror(vm, e.what());
1654 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
1660 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
1665 Scripting::exit_screen();
1669 } catch(std::exception& e) {
1670 sq_throwerror(vm, e.what());
1673 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
1679 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
1682 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1683 sq_throwerror(vm, _SC("Argument 1 not a float"));
1688 Scripting::fadeout_screen(static_cast<float> (arg0));
1692 } catch(std::exception& e) {
1693 sq_throwerror(vm, e.what());
1696 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
1702 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
1705 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1706 sq_throwerror(vm, _SC("Argument 1 not a float"));
1710 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1711 sq_throwerror(vm, _SC("Argument 2 not a float"));
1715 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
1716 sq_throwerror(vm, _SC("Argument 3 not a float"));
1721 Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
1725 } catch(std::exception& e) {
1726 sq_throwerror(vm, e.what());
1729 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
1735 static SQInteger translate_wrapper(HSQUIRRELVM vm)
1738 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1739 sq_throwerror(vm, _SC("Argument 1 not a string"));
1744 std::string return_value = Scripting::translate(arg0);
1746 sq_pushstring(vm, return_value.c_str(), return_value.size());
1749 } catch(std::exception& e) {
1750 sq_throwerror(vm, e.what());
1753 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
1759 static SQInteger import_wrapper(HSQUIRRELVM vm)
1761 HSQUIRRELVM arg0 = vm;
1763 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
1764 sq_throwerror(vm, _SC("Argument 1 not a string"));
1769 Scripting::import(arg0, arg1);
1773 } catch(std::exception& e) {
1774 sq_throwerror(vm, e.what());
1777 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
1783 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
1788 Scripting::save_state();
1792 } catch(std::exception& e) {
1793 sq_throwerror(vm, e.what());
1796 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
1802 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
1805 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1806 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1811 Scripting::debug_collrects(arg0 == SQTrue);
1815 } catch(std::exception& e) {
1816 sq_throwerror(vm, e.what());
1819 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
1825 static SQInteger debug_draw_fps_wrapper(HSQUIRRELVM vm)
1828 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1829 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1834 Scripting::debug_draw_fps(arg0 == SQTrue);
1838 } catch(std::exception& e) {
1839 sq_throwerror(vm, e.what());
1842 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_fps'"));
1848 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
1851 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1852 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1857 Scripting::debug_draw_solids_only(arg0 == SQTrue);
1861 } catch(std::exception& e) {
1862 sq_throwerror(vm, e.what());
1865 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
1871 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
1874 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1875 sq_throwerror(vm, _SC("Argument 1 not a string"));
1880 Scripting::play_music(arg0);
1884 } catch(std::exception& e) {
1885 sq_throwerror(vm, e.what());
1888 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
1894 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
1897 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1898 sq_throwerror(vm, _SC("Argument 1 not a string"));
1903 Scripting::play_sound(arg0);
1907 } catch(std::exception& e) {
1908 sq_throwerror(vm, e.what());
1911 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
1917 static SQInteger grease_wrapper(HSQUIRRELVM vm)
1922 Scripting::grease();
1926 } catch(std::exception& e) {
1927 sq_throwerror(vm, e.what());
1930 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
1936 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
1941 Scripting::invincible();
1945 } catch(std::exception& e) {
1946 sq_throwerror(vm, e.what());
1949 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
1955 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
1960 Scripting::mortal();
1964 } catch(std::exception& e) {
1965 sq_throwerror(vm, e.what());
1968 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
1974 static SQInteger restart_wrapper(HSQUIRRELVM vm)
1979 Scripting::restart();
1983 } catch(std::exception& e) {
1984 sq_throwerror(vm, e.what());
1987 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
1993 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
1998 Scripting::whereami();
2002 } catch(std::exception& e) {
2003 sq_throwerror(vm, e.what());
2006 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
2012 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
2017 Scripting::gotoend();
2021 } catch(std::exception& e) {
2022 sq_throwerror(vm, e.what());
2025 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
2031 static SQInteger camera_wrapper(HSQUIRRELVM vm)
2036 Scripting::camera();
2040 } catch(std::exception& e) {
2041 sq_throwerror(vm, e.what());
2044 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
2050 static SQInteger quit_wrapper(HSQUIRRELVM vm)
2059 } catch(std::exception& e) {
2060 sq_throwerror(vm, e.what());
2063 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
2069 static SQInteger rand_wrapper(HSQUIRRELVM vm)
2073 int return_value = Scripting::rand();
2075 sq_pushinteger(vm, return_value);
2078 } catch(std::exception& e) {
2079 sq_throwerror(vm, e.what());
2082 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
2088 } // end of namespace Wrapper
2090 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
2092 using namespace Wrapper;
2094 sq_pushroottable(v);
2095 sq_pushstring(v, "DisplayEffect", -1);
2096 if(SQ_FAILED(sq_get(v, -2))) {
2097 std::ostringstream msg;
2098 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
2099 throw SquirrelError(v, msg.str());
2102 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2103 std::ostringstream msg;
2104 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
2105 throw SquirrelError(v, msg.str());
2107 sq_remove(v, -2); // remove object name
2109 if(setup_releasehook) {
2110 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
2113 sq_remove(v, -2); // remove root table
2116 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
2118 using namespace Wrapper;
2120 sq_pushroottable(v);
2121 sq_pushstring(v, "Camera", -1);
2122 if(SQ_FAILED(sq_get(v, -2))) {
2123 std::ostringstream msg;
2124 msg << "Couldn't resolved squirrel type 'Camera'";
2125 throw SquirrelError(v, msg.str());
2128 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2129 std::ostringstream msg;
2130 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
2131 throw SquirrelError(v, msg.str());
2133 sq_remove(v, -2); // remove object name
2135 if(setup_releasehook) {
2136 sq_setreleasehook(v, -1, Camera_release_hook);
2139 sq_remove(v, -2); // remove root table
2142 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
2144 using namespace Wrapper;
2146 sq_pushroottable(v);
2147 sq_pushstring(v, "Level", -1);
2148 if(SQ_FAILED(sq_get(v, -2))) {
2149 std::ostringstream msg;
2150 msg << "Couldn't resolved squirrel type 'Level'";
2151 throw SquirrelError(v, msg.str());
2154 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2155 std::ostringstream msg;
2156 msg << "Couldn't setup squirrel instance for object of type 'Level'";
2157 throw SquirrelError(v, msg.str());
2159 sq_remove(v, -2); // remove object name
2161 if(setup_releasehook) {
2162 sq_setreleasehook(v, -1, Level_release_hook);
2165 sq_remove(v, -2); // remove root table
2168 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
2170 using namespace Wrapper;
2172 sq_pushroottable(v);
2173 sq_pushstring(v, "ScriptedObject", -1);
2174 if(SQ_FAILED(sq_get(v, -2))) {
2175 std::ostringstream msg;
2176 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
2177 throw SquirrelError(v, msg.str());
2180 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2181 std::ostringstream msg;
2182 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
2183 throw SquirrelError(v, msg.str());
2185 sq_remove(v, -2); // remove object name
2187 if(setup_releasehook) {
2188 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
2191 sq_remove(v, -2); // remove root table
2194 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
2196 using namespace Wrapper;
2198 sq_pushroottable(v);
2199 sq_pushstring(v, "Text", -1);
2200 if(SQ_FAILED(sq_get(v, -2))) {
2201 std::ostringstream msg;
2202 msg << "Couldn't resolved squirrel type 'Text'";
2203 throw SquirrelError(v, msg.str());
2206 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2207 std::ostringstream msg;
2208 msg << "Couldn't setup squirrel instance for object of type 'Text'";
2209 throw SquirrelError(v, msg.str());
2211 sq_remove(v, -2); // remove object name
2213 if(setup_releasehook) {
2214 sq_setreleasehook(v, -1, Text_release_hook);
2217 sq_remove(v, -2); // remove root table
2220 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
2222 using namespace Wrapper;
2224 sq_pushroottable(v);
2225 sq_pushstring(v, "Player", -1);
2226 if(SQ_FAILED(sq_get(v, -2))) {
2227 std::ostringstream msg;
2228 msg << "Couldn't resolved squirrel type 'Player'";
2229 throw SquirrelError(v, msg.str());
2232 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2233 std::ostringstream msg;
2234 msg << "Couldn't setup squirrel instance for object of type 'Player'";
2235 throw SquirrelError(v, msg.str());
2237 sq_remove(v, -2); // remove object name
2239 if(setup_releasehook) {
2240 sq_setreleasehook(v, -1, Player_release_hook);
2243 sq_remove(v, -2); // remove root table
2246 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
2248 using namespace Wrapper;
2250 sq_pushroottable(v);
2251 sq_pushstring(v, "FloatingImage", -1);
2252 if(SQ_FAILED(sq_get(v, -2))) {
2253 std::ostringstream msg;
2254 msg << "Couldn't resolved squirrel type 'FloatingImage'";
2255 throw SquirrelError(v, msg.str());
2258 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2259 std::ostringstream msg;
2260 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
2261 throw SquirrelError(v, msg.str());
2263 sq_remove(v, -2); // remove object name
2265 if(setup_releasehook) {
2266 sq_setreleasehook(v, -1, FloatingImage_release_hook);
2269 sq_remove(v, -2); // remove root table
2272 void register_supertux_wrapper(HSQUIRRELVM v)
2274 using namespace Wrapper;
2276 sq_pushstring(v, "ANCHOR_TOP", -1);
2277 sq_pushinteger(v, 16);
2278 if(SQ_FAILED(sq_createslot(v, -3))) {
2279 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
2282 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
2283 sq_pushinteger(v, 32);
2284 if(SQ_FAILED(sq_createslot(v, -3))) {
2285 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
2288 sq_pushstring(v, "ANCHOR_LEFT", -1);
2289 sq_pushinteger(v, 1);
2290 if(SQ_FAILED(sq_createslot(v, -3))) {
2291 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
2294 sq_pushstring(v, "ANCHOR_RIGHT", -1);
2295 sq_pushinteger(v, 2);
2296 if(SQ_FAILED(sq_createslot(v, -3))) {
2297 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
2300 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
2301 sq_pushinteger(v, 0);
2302 if(SQ_FAILED(sq_createslot(v, -3))) {
2303 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
2306 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
2307 sq_pushinteger(v, 17);
2308 if(SQ_FAILED(sq_createslot(v, -3))) {
2309 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
2312 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
2313 sq_pushinteger(v, 18);
2314 if(SQ_FAILED(sq_createslot(v, -3))) {
2315 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
2318 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
2319 sq_pushinteger(v, 33);
2320 if(SQ_FAILED(sq_createslot(v, -3))) {
2321 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
2324 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
2325 sq_pushinteger(v, 34);
2326 if(SQ_FAILED(sq_createslot(v, -3))) {
2327 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
2330 sq_pushstring(v, "display", -1);
2331 sq_newclosure(v, &display_wrapper, 0);
2332 if(SQ_FAILED(sq_createslot(v, -3))) {
2333 throw SquirrelError(v, "Couldn't register function 'display'");
2336 sq_pushstring(v, "print_stacktrace", -1);
2337 sq_newclosure(v, &print_stacktrace_wrapper, 0);
2338 if(SQ_FAILED(sq_createslot(v, -3))) {
2339 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
2342 sq_pushstring(v, "get_current_thread", -1);
2343 sq_newclosure(v, &get_current_thread_wrapper, 0);
2344 if(SQ_FAILED(sq_createslot(v, -3))) {
2345 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
2348 sq_pushstring(v, "display_text_file", -1);
2349 sq_newclosure(v, &display_text_file_wrapper, 0);
2350 if(SQ_FAILED(sq_createslot(v, -3))) {
2351 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
2354 sq_pushstring(v, "load_worldmap", -1);
2355 sq_newclosure(v, &load_worldmap_wrapper, 0);
2356 if(SQ_FAILED(sq_createslot(v, -3))) {
2357 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
2360 sq_pushstring(v, "load_level", -1);
2361 sq_newclosure(v, &load_level_wrapper, 0);
2362 if(SQ_FAILED(sq_createslot(v, -3))) {
2363 throw SquirrelError(v, "Couldn't register function 'load_level'");
2366 sq_pushstring(v, "wait", -1);
2367 sq_newclosure(v, &wait_wrapper, 0);
2368 if(SQ_FAILED(sq_createslot(v, -3))) {
2369 throw SquirrelError(v, "Couldn't register function 'wait'");
2372 sq_pushstring(v, "wait_for_screenswitch", -1);
2373 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
2374 if(SQ_FAILED(sq_createslot(v, -3))) {
2375 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
2378 sq_pushstring(v, "exit_screen", -1);
2379 sq_newclosure(v, &exit_screen_wrapper, 0);
2380 if(SQ_FAILED(sq_createslot(v, -3))) {
2381 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
2384 sq_pushstring(v, "fadeout_screen", -1);
2385 sq_newclosure(v, &fadeout_screen_wrapper, 0);
2386 if(SQ_FAILED(sq_createslot(v, -3))) {
2387 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
2390 sq_pushstring(v, "shrink_screen", -1);
2391 sq_newclosure(v, &shrink_screen_wrapper, 0);
2392 if(SQ_FAILED(sq_createslot(v, -3))) {
2393 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
2396 sq_pushstring(v, "translate", -1);
2397 sq_newclosure(v, &translate_wrapper, 0);
2398 if(SQ_FAILED(sq_createslot(v, -3))) {
2399 throw SquirrelError(v, "Couldn't register function 'translate'");
2402 sq_pushstring(v, "import", -1);
2403 sq_newclosure(v, &import_wrapper, 0);
2404 if(SQ_FAILED(sq_createslot(v, -3))) {
2405 throw SquirrelError(v, "Couldn't register function 'import'");
2408 sq_pushstring(v, "save_state", -1);
2409 sq_newclosure(v, &save_state_wrapper, 0);
2410 if(SQ_FAILED(sq_createslot(v, -3))) {
2411 throw SquirrelError(v, "Couldn't register function 'save_state'");
2414 sq_pushstring(v, "debug_collrects", -1);
2415 sq_newclosure(v, &debug_collrects_wrapper, 0);
2416 if(SQ_FAILED(sq_createslot(v, -3))) {
2417 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
2420 sq_pushstring(v, "debug_draw_fps", -1);
2421 sq_newclosure(v, &debug_draw_fps_wrapper, 0);
2422 if(SQ_FAILED(sq_createslot(v, -3))) {
2423 throw SquirrelError(v, "Couldn't register function 'debug_draw_fps'");
2426 sq_pushstring(v, "debug_draw_solids_only", -1);
2427 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
2428 if(SQ_FAILED(sq_createslot(v, -3))) {
2429 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
2432 sq_pushstring(v, "play_music", -1);
2433 sq_newclosure(v, &play_music_wrapper, 0);
2434 if(SQ_FAILED(sq_createslot(v, -3))) {
2435 throw SquirrelError(v, "Couldn't register function 'play_music'");
2438 sq_pushstring(v, "play_sound", -1);
2439 sq_newclosure(v, &play_sound_wrapper, 0);
2440 if(SQ_FAILED(sq_createslot(v, -3))) {
2441 throw SquirrelError(v, "Couldn't register function 'play_sound'");
2444 sq_pushstring(v, "grease", -1);
2445 sq_newclosure(v, &grease_wrapper, 0);
2446 if(SQ_FAILED(sq_createslot(v, -3))) {
2447 throw SquirrelError(v, "Couldn't register function 'grease'");
2450 sq_pushstring(v, "invincible", -1);
2451 sq_newclosure(v, &invincible_wrapper, 0);
2452 if(SQ_FAILED(sq_createslot(v, -3))) {
2453 throw SquirrelError(v, "Couldn't register function 'invincible'");
2456 sq_pushstring(v, "mortal", -1);
2457 sq_newclosure(v, &mortal_wrapper, 0);
2458 if(SQ_FAILED(sq_createslot(v, -3))) {
2459 throw SquirrelError(v, "Couldn't register function 'mortal'");
2462 sq_pushstring(v, "restart", -1);
2463 sq_newclosure(v, &restart_wrapper, 0);
2464 if(SQ_FAILED(sq_createslot(v, -3))) {
2465 throw SquirrelError(v, "Couldn't register function 'restart'");
2468 sq_pushstring(v, "whereami", -1);
2469 sq_newclosure(v, &whereami_wrapper, 0);
2470 if(SQ_FAILED(sq_createslot(v, -3))) {
2471 throw SquirrelError(v, "Couldn't register function 'whereami'");
2474 sq_pushstring(v, "gotoend", -1);
2475 sq_newclosure(v, &gotoend_wrapper, 0);
2476 if(SQ_FAILED(sq_createslot(v, -3))) {
2477 throw SquirrelError(v, "Couldn't register function 'gotoend'");
2480 sq_pushstring(v, "camera", -1);
2481 sq_newclosure(v, &camera_wrapper, 0);
2482 if(SQ_FAILED(sq_createslot(v, -3))) {
2483 throw SquirrelError(v, "Couldn't register function 'camera'");
2486 sq_pushstring(v, "quit", -1);
2487 sq_newclosure(v, &quit_wrapper, 0);
2488 if(SQ_FAILED(sq_createslot(v, -3))) {
2489 throw SquirrelError(v, "Couldn't register function 'quit'");
2492 sq_pushstring(v, "rand", -1);
2493 sq_newclosure(v, &rand_wrapper, 0);
2494 if(SQ_FAILED(sq_createslot(v, -3))) {
2495 throw SquirrelError(v, "Couldn't register function 'rand'");
2498 // Register class DisplayEffect
2499 sq_pushstring(v, "DisplayEffect", -1);
2500 if(sq_newclass(v, SQFalse) < 0) {
2501 std::ostringstream msg;
2502 msg << "Couldn't create new class 'DisplayEffect'";
2503 throw SquirrelError(v, msg.str());
2505 sq_pushstring(v, "fade_out", -1);
2506 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
2507 if(SQ_FAILED(sq_createslot(v, -3))) {
2508 throw SquirrelError(v, "Couldn't register function 'fade_out'");
2511 sq_pushstring(v, "fade_in", -1);
2512 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
2513 if(SQ_FAILED(sq_createslot(v, -3))) {
2514 throw SquirrelError(v, "Couldn't register function 'fade_in'");
2517 sq_pushstring(v, "set_black", -1);
2518 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
2519 if(SQ_FAILED(sq_createslot(v, -3))) {
2520 throw SquirrelError(v, "Couldn't register function 'set_black'");
2523 sq_pushstring(v, "is_black", -1);
2524 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
2525 if(SQ_FAILED(sq_createslot(v, -3))) {
2526 throw SquirrelError(v, "Couldn't register function 'is_black'");
2529 sq_pushstring(v, "sixteen_to_nine", -1);
2530 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
2531 if(SQ_FAILED(sq_createslot(v, -3))) {
2532 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
2535 sq_pushstring(v, "four_to_three", -1);
2536 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
2537 if(SQ_FAILED(sq_createslot(v, -3))) {
2538 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
2541 if(SQ_FAILED(sq_createslot(v, -3))) {
2542 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
2545 // Register class Camera
2546 sq_pushstring(v, "Camera", -1);
2547 if(sq_newclass(v, SQFalse) < 0) {
2548 std::ostringstream msg;
2549 msg << "Couldn't create new class 'Camera'";
2550 throw SquirrelError(v, msg.str());
2552 sq_pushstring(v, "shake", -1);
2553 sq_newclosure(v, &Camera_shake_wrapper, 0);
2554 if(SQ_FAILED(sq_createslot(v, -3))) {
2555 throw SquirrelError(v, "Couldn't register function 'shake'");
2558 sq_pushstring(v, "set_pos", -1);
2559 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
2560 if(SQ_FAILED(sq_createslot(v, -3))) {
2561 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2564 sq_pushstring(v, "set_mode", -1);
2565 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
2566 if(SQ_FAILED(sq_createslot(v, -3))) {
2567 throw SquirrelError(v, "Couldn't register function 'set_mode'");
2570 sq_pushstring(v, "scroll_to", -1);
2571 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
2572 if(SQ_FAILED(sq_createslot(v, -3))) {
2573 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
2576 if(SQ_FAILED(sq_createslot(v, -3))) {
2577 throw SquirrelError(v, "Couldn't register class 'Camera'");
2580 // Register class Level
2581 sq_pushstring(v, "Level", -1);
2582 if(sq_newclass(v, SQFalse) < 0) {
2583 std::ostringstream msg;
2584 msg << "Couldn't create new class 'Level'";
2585 throw SquirrelError(v, msg.str());
2587 sq_pushstring(v, "finish", -1);
2588 sq_newclosure(v, &Level_finish_wrapper, 0);
2589 if(SQ_FAILED(sq_createslot(v, -3))) {
2590 throw SquirrelError(v, "Couldn't register function 'finish'");
2593 sq_pushstring(v, "spawn", -1);
2594 sq_newclosure(v, &Level_spawn_wrapper, 0);
2595 if(SQ_FAILED(sq_createslot(v, -3))) {
2596 throw SquirrelError(v, "Couldn't register function 'spawn'");
2599 sq_pushstring(v, "flip_vertically", -1);
2600 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
2601 if(SQ_FAILED(sq_createslot(v, -3))) {
2602 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
2605 sq_pushstring(v, "toggle_pause", -1);
2606 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
2607 if(SQ_FAILED(sq_createslot(v, -3))) {
2608 throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
2611 if(SQ_FAILED(sq_createslot(v, -3))) {
2612 throw SquirrelError(v, "Couldn't register class 'Level'");
2615 // Register class ScriptedObject
2616 sq_pushstring(v, "ScriptedObject", -1);
2617 if(sq_newclass(v, SQFalse) < 0) {
2618 std::ostringstream msg;
2619 msg << "Couldn't create new class 'ScriptedObject'";
2620 throw SquirrelError(v, msg.str());
2622 sq_pushstring(v, "set_action", -1);
2623 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
2624 if(SQ_FAILED(sq_createslot(v, -3))) {
2625 throw SquirrelError(v, "Couldn't register function 'set_action'");
2628 sq_pushstring(v, "get_action", -1);
2629 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
2630 if(SQ_FAILED(sq_createslot(v, -3))) {
2631 throw SquirrelError(v, "Couldn't register function 'get_action'");
2634 sq_pushstring(v, "move", -1);
2635 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
2636 if(SQ_FAILED(sq_createslot(v, -3))) {
2637 throw SquirrelError(v, "Couldn't register function 'move'");
2640 sq_pushstring(v, "set_pos", -1);
2641 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
2642 if(SQ_FAILED(sq_createslot(v, -3))) {
2643 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2646 sq_pushstring(v, "get_pos_x", -1);
2647 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
2648 if(SQ_FAILED(sq_createslot(v, -3))) {
2649 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
2652 sq_pushstring(v, "get_pos_y", -1);
2653 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
2654 if(SQ_FAILED(sq_createslot(v, -3))) {
2655 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
2658 sq_pushstring(v, "set_velocity", -1);
2659 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
2660 if(SQ_FAILED(sq_createslot(v, -3))) {
2661 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
2664 sq_pushstring(v, "get_velocity_x", -1);
2665 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
2666 if(SQ_FAILED(sq_createslot(v, -3))) {
2667 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
2670 sq_pushstring(v, "get_velocity_y", -1);
2671 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
2672 if(SQ_FAILED(sq_createslot(v, -3))) {
2673 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
2676 sq_pushstring(v, "set_visible", -1);
2677 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
2678 if(SQ_FAILED(sq_createslot(v, -3))) {
2679 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2682 sq_pushstring(v, "is_visible", -1);
2683 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
2684 if(SQ_FAILED(sq_createslot(v, -3))) {
2685 throw SquirrelError(v, "Couldn't register function 'is_visible'");
2688 sq_pushstring(v, "get_name", -1);
2689 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
2690 if(SQ_FAILED(sq_createslot(v, -3))) {
2691 throw SquirrelError(v, "Couldn't register function 'get_name'");
2694 if(SQ_FAILED(sq_createslot(v, -3))) {
2695 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
2698 // Register class Text
2699 sq_pushstring(v, "Text", -1);
2700 if(sq_newclass(v, SQFalse) < 0) {
2701 std::ostringstream msg;
2702 msg << "Couldn't create new class 'Text'";
2703 throw SquirrelError(v, msg.str());
2705 sq_pushstring(v, "set_text", -1);
2706 sq_newclosure(v, &Text_set_text_wrapper, 0);
2707 if(SQ_FAILED(sq_createslot(v, -3))) {
2708 throw SquirrelError(v, "Couldn't register function 'set_text'");
2711 sq_pushstring(v, "set_font", -1);
2712 sq_newclosure(v, &Text_set_font_wrapper, 0);
2713 if(SQ_FAILED(sq_createslot(v, -3))) {
2714 throw SquirrelError(v, "Couldn't register function 'set_font'");
2717 sq_pushstring(v, "fade_in", -1);
2718 sq_newclosure(v, &Text_fade_in_wrapper, 0);
2719 if(SQ_FAILED(sq_createslot(v, -3))) {
2720 throw SquirrelError(v, "Couldn't register function 'fade_in'");
2723 sq_pushstring(v, "fade_out", -1);
2724 sq_newclosure(v, &Text_fade_out_wrapper, 0);
2725 if(SQ_FAILED(sq_createslot(v, -3))) {
2726 throw SquirrelError(v, "Couldn't register function 'fade_out'");
2729 sq_pushstring(v, "set_visible", -1);
2730 sq_newclosure(v, &Text_set_visible_wrapper, 0);
2731 if(SQ_FAILED(sq_createslot(v, -3))) {
2732 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2735 sq_pushstring(v, "set_centered", -1);
2736 sq_newclosure(v, &Text_set_centered_wrapper, 0);
2737 if(SQ_FAILED(sq_createslot(v, -3))) {
2738 throw SquirrelError(v, "Couldn't register function 'set_centered'");
2741 if(SQ_FAILED(sq_createslot(v, -3))) {
2742 throw SquirrelError(v, "Couldn't register class 'Text'");
2745 // Register class Player
2746 sq_pushstring(v, "Player", -1);
2747 if(sq_newclass(v, SQFalse) < 0) {
2748 std::ostringstream msg;
2749 msg << "Couldn't create new class 'Player'";
2750 throw SquirrelError(v, msg.str());
2752 sq_pushstring(v, "add_bonus", -1);
2753 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
2754 if(SQ_FAILED(sq_createslot(v, -3))) {
2755 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
2758 sq_pushstring(v, "add_coins", -1);
2759 sq_newclosure(v, &Player_add_coins_wrapper, 0);
2760 if(SQ_FAILED(sq_createslot(v, -3))) {
2761 throw SquirrelError(v, "Couldn't register function 'add_coins'");
2764 sq_pushstring(v, "make_invincible", -1);
2765 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
2766 if(SQ_FAILED(sq_createslot(v, -3))) {
2767 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
2770 sq_pushstring(v, "deactivate", -1);
2771 sq_newclosure(v, &Player_deactivate_wrapper, 0);
2772 if(SQ_FAILED(sq_createslot(v, -3))) {
2773 throw SquirrelError(v, "Couldn't register function 'deactivate'");
2776 sq_pushstring(v, "activate", -1);
2777 sq_newclosure(v, &Player_activate_wrapper, 0);
2778 if(SQ_FAILED(sq_createslot(v, -3))) {
2779 throw SquirrelError(v, "Couldn't register function 'activate'");
2782 sq_pushstring(v, "walk", -1);
2783 sq_newclosure(v, &Player_walk_wrapper, 0);
2784 if(SQ_FAILED(sq_createslot(v, -3))) {
2785 throw SquirrelError(v, "Couldn't register function 'walk'");
2788 sq_pushstring(v, "set_visible", -1);
2789 sq_newclosure(v, &Player_set_visible_wrapper, 0);
2790 if(SQ_FAILED(sq_createslot(v, -3))) {
2791 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2794 sq_pushstring(v, "get_visible", -1);
2795 sq_newclosure(v, &Player_get_visible_wrapper, 0);
2796 if(SQ_FAILED(sq_createslot(v, -3))) {
2797 throw SquirrelError(v, "Couldn't register function 'get_visible'");
2800 sq_pushstring(v, "kill", -1);
2801 sq_newclosure(v, &Player_kill_wrapper, 0);
2802 if(SQ_FAILED(sq_createslot(v, -3))) {
2803 throw SquirrelError(v, "Couldn't register function 'kill'");
2806 if(SQ_FAILED(sq_createslot(v, -3))) {
2807 throw SquirrelError(v, "Couldn't register class 'Player'");
2810 // Register class FloatingImage
2811 sq_pushstring(v, "FloatingImage", -1);
2812 if(sq_newclass(v, SQFalse) < 0) {
2813 std::ostringstream msg;
2814 msg << "Couldn't create new class 'FloatingImage'";
2815 throw SquirrelError(v, msg.str());
2817 sq_pushstring(v, "constructor", -1);
2818 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
2819 if(SQ_FAILED(sq_createslot(v, -3))) {
2820 throw SquirrelError(v, "Couldn't register function 'constructor'");
2823 sq_pushstring(v, "set_layer", -1);
2824 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
2825 if(SQ_FAILED(sq_createslot(v, -3))) {
2826 throw SquirrelError(v, "Couldn't register function 'set_layer'");
2829 sq_pushstring(v, "get_layer", -1);
2830 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
2831 if(SQ_FAILED(sq_createslot(v, -3))) {
2832 throw SquirrelError(v, "Couldn't register function 'get_layer'");
2835 sq_pushstring(v, "set_pos", -1);
2836 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
2837 if(SQ_FAILED(sq_createslot(v, -3))) {
2838 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2841 sq_pushstring(v, "get_pos_x", -1);
2842 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
2843 if(SQ_FAILED(sq_createslot(v, -3))) {
2844 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
2847 sq_pushstring(v, "get_pos_y", -1);
2848 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
2849 if(SQ_FAILED(sq_createslot(v, -3))) {
2850 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
2853 sq_pushstring(v, "set_anchor_point", -1);
2854 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
2855 if(SQ_FAILED(sq_createslot(v, -3))) {
2856 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
2859 sq_pushstring(v, "get_anchor_point", -1);
2860 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
2861 if(SQ_FAILED(sq_createslot(v, -3))) {
2862 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
2865 sq_pushstring(v, "set_visible", -1);
2866 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
2867 if(SQ_FAILED(sq_createslot(v, -3))) {
2868 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2871 sq_pushstring(v, "get_visible", -1);
2872 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
2873 if(SQ_FAILED(sq_createslot(v, -3))) {
2874 throw SquirrelError(v, "Couldn't register function 'get_visible'");
2877 sq_pushstring(v, "set_action", -1);
2878 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
2879 if(SQ_FAILED(sq_createslot(v, -3))) {
2880 throw SquirrelError(v, "Couldn't register function 'set_action'");
2883 sq_pushstring(v, "get_action", -1);
2884 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
2885 if(SQ_FAILED(sq_createslot(v, -3))) {
2886 throw SquirrelError(v, "Couldn't register function 'get_action'");
2889 if(SQ_FAILED(sq_createslot(v, -3))) {
2890 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
2895 } // end of namespace Scripting