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 int DisplayEffect_release_hook(SQUserPointer ptr, int )
23 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (ptr);
28 static int 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(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 int 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"));
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 int 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);
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 int 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 int 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(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 int 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(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 int Camera_release_hook(SQUserPointer ptr, int )
194 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
199 static int 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(arg0, arg1, 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 int 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(arg0, 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 int 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 int 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(arg0, arg1, 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 int Level_release_hook(SQUserPointer ptr, int )
338 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
343 static int 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"));
361 } catch(std::exception& e) {
362 sq_throwerror(vm, e.what());
365 sq_throwerror(vm, _SC("Unexpected exception while executing function 'finish'"));
371 static int 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 int 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 int ScriptedObject_release_hook(SQUserPointer ptr, int )
429 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
434 static int ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
436 Scripting::ScriptedObject* _this;
437 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
438 sq_throwerror(vm, _SC("'set_action' called without instance"));
442 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
443 sq_throwerror(vm, _SC("Argument 1 not a string"));
448 _this->set_action(arg0);
452 } catch(std::exception& e) {
453 sq_throwerror(vm, e.what());
456 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
462 static int ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
464 Scripting::ScriptedObject* _this;
465 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
466 sq_throwerror(vm, _SC("'get_action' called without instance"));
471 std::string return_value = _this->get_action();
473 sq_pushstring(vm, return_value.c_str(), return_value.size());
476 } catch(std::exception& e) {
477 sq_throwerror(vm, e.what());
480 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
486 static int ScriptedObject_move_wrapper(HSQUIRRELVM vm)
488 Scripting::ScriptedObject* _this;
489 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
490 sq_throwerror(vm, _SC("'move' called without instance"));
494 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
495 sq_throwerror(vm, _SC("Argument 1 not a float"));
499 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
500 sq_throwerror(vm, _SC("Argument 2 not a float"));
505 _this->move(arg0, arg1);
509 } catch(std::exception& e) {
510 sq_throwerror(vm, e.what());
513 sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
519 static int ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
521 Scripting::ScriptedObject* _this;
522 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
523 sq_throwerror(vm, _SC("'set_pos' called without instance"));
527 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
528 sq_throwerror(vm, _SC("Argument 1 not a float"));
532 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
533 sq_throwerror(vm, _SC("Argument 2 not a float"));
538 _this->set_pos(arg0, arg1);
542 } catch(std::exception& e) {
543 sq_throwerror(vm, e.what());
546 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
552 static int ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
554 Scripting::ScriptedObject* _this;
555 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
556 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
561 float return_value = _this->get_pos_x();
563 sq_pushfloat(vm, return_value);
566 } catch(std::exception& e) {
567 sq_throwerror(vm, e.what());
570 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
576 static int ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
578 Scripting::ScriptedObject* _this;
579 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
580 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
585 float return_value = _this->get_pos_y();
587 sq_pushfloat(vm, return_value);
590 } catch(std::exception& e) {
591 sq_throwerror(vm, e.what());
594 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
600 static int ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
602 Scripting::ScriptedObject* _this;
603 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
604 sq_throwerror(vm, _SC("'set_velocity' called without instance"));
608 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
609 sq_throwerror(vm, _SC("Argument 1 not a float"));
613 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
614 sq_throwerror(vm, _SC("Argument 2 not a float"));
619 _this->set_velocity(arg0, arg1);
623 } catch(std::exception& e) {
624 sq_throwerror(vm, e.what());
627 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
633 static int ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
635 Scripting::ScriptedObject* _this;
636 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
637 sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
642 float return_value = _this->get_velocity_x();
644 sq_pushfloat(vm, return_value);
647 } catch(std::exception& e) {
648 sq_throwerror(vm, e.what());
651 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
657 static int ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
659 Scripting::ScriptedObject* _this;
660 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
661 sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
666 float return_value = _this->get_velocity_y();
668 sq_pushfloat(vm, return_value);
671 } catch(std::exception& e) {
672 sq_throwerror(vm, e.what());
675 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
681 static int ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
683 Scripting::ScriptedObject* _this;
684 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
685 sq_throwerror(vm, _SC("'set_visible' called without instance"));
689 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
690 sq_throwerror(vm, _SC("Argument 1 not a bool"));
695 _this->set_visible(arg0);
699 } catch(std::exception& e) {
700 sq_throwerror(vm, e.what());
703 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
709 static int ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
711 Scripting::ScriptedObject* _this;
712 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
713 sq_throwerror(vm, _SC("'is_visible' called without instance"));
718 bool return_value = _this->is_visible();
720 sq_pushbool(vm, return_value);
723 } catch(std::exception& e) {
724 sq_throwerror(vm, e.what());
727 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
733 static int ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
735 Scripting::ScriptedObject* _this;
736 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
737 sq_throwerror(vm, _SC("'get_name' called without instance"));
742 std::string return_value = _this->get_name();
744 sq_pushstring(vm, return_value.c_str(), return_value.size());
747 } catch(std::exception& e) {
748 sq_throwerror(vm, e.what());
751 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
757 static int Sound_release_hook(SQUserPointer ptr, int )
759 Scripting::Sound* _this = reinterpret_cast<Scripting::Sound*> (ptr);
764 static int Sound_play_music_wrapper(HSQUIRRELVM vm)
766 Scripting::Sound* _this;
767 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
768 sq_throwerror(vm, _SC("'play_music' called without instance"));
772 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
773 sq_throwerror(vm, _SC("Argument 1 not a string"));
778 _this->play_music(arg0);
782 } catch(std::exception& e) {
783 sq_throwerror(vm, e.what());
786 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
792 static int Sound_play_wrapper(HSQUIRRELVM vm)
794 Scripting::Sound* _this;
795 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
796 sq_throwerror(vm, _SC("'play' called without instance"));
800 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
801 sq_throwerror(vm, _SC("Argument 1 not a string"));
810 } catch(std::exception& e) {
811 sq_throwerror(vm, e.what());
814 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play'"));
820 static int Text_release_hook(SQUserPointer ptr, int )
822 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
827 static int Text_set_text_wrapper(HSQUIRRELVM vm)
829 Scripting::Text* _this;
830 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
831 sq_throwerror(vm, _SC("'set_text' called without instance"));
835 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
836 sq_throwerror(vm, _SC("Argument 1 not a string"));
841 _this->set_text(arg0);
845 } catch(std::exception& e) {
846 sq_throwerror(vm, e.what());
849 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
855 static int Text_set_font_wrapper(HSQUIRRELVM vm)
857 Scripting::Text* _this;
858 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
859 sq_throwerror(vm, _SC("'set_font' called without instance"));
863 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
864 sq_throwerror(vm, _SC("Argument 1 not a string"));
869 _this->set_font(arg0);
873 } catch(std::exception& e) {
874 sq_throwerror(vm, e.what());
877 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
883 static int Text_fade_in_wrapper(HSQUIRRELVM vm)
885 Scripting::Text* _this;
886 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
887 sq_throwerror(vm, _SC("'fade_in' called without instance"));
891 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
892 sq_throwerror(vm, _SC("Argument 1 not a float"));
897 _this->fade_in(arg0);
901 } catch(std::exception& e) {
902 sq_throwerror(vm, e.what());
905 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
911 static int Text_fade_out_wrapper(HSQUIRRELVM vm)
913 Scripting::Text* _this;
914 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
915 sq_throwerror(vm, _SC("'fade_out' called without instance"));
919 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
920 sq_throwerror(vm, _SC("Argument 1 not a float"));
925 _this->fade_out(arg0);
929 } catch(std::exception& e) {
930 sq_throwerror(vm, e.what());
933 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
939 static int Text_set_visible_wrapper(HSQUIRRELVM vm)
941 Scripting::Text* _this;
942 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
943 sq_throwerror(vm, _SC("'set_visible' called without instance"));
947 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
948 sq_throwerror(vm, _SC("Argument 1 not a bool"));
953 _this->set_visible(arg0);
957 } catch(std::exception& e) {
958 sq_throwerror(vm, e.what());
961 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
967 static int Text_set_centered_wrapper(HSQUIRRELVM vm)
969 Scripting::Text* _this;
970 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
971 sq_throwerror(vm, _SC("'set_centered' called without instance"));
975 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
976 sq_throwerror(vm, _SC("Argument 1 not a bool"));
981 _this->set_centered(arg0);
985 } catch(std::exception& e) {
986 sq_throwerror(vm, e.what());
989 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
995 static int Player_release_hook(SQUserPointer ptr, int )
997 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
1002 static int Player_make_invincible_wrapper(HSQUIRRELVM vm)
1004 Scripting::Player* _this;
1005 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1006 sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1011 _this->make_invincible();
1015 } catch(std::exception& e) {
1016 sq_throwerror(vm, e.what());
1019 sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1025 static int Player_deactivate_wrapper(HSQUIRRELVM vm)
1027 Scripting::Player* _this;
1028 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1029 sq_throwerror(vm, _SC("'deactivate' called without instance"));
1034 _this->deactivate();
1038 } catch(std::exception& e) {
1039 sq_throwerror(vm, e.what());
1042 sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1048 static int Player_activate_wrapper(HSQUIRRELVM vm)
1050 Scripting::Player* _this;
1051 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1052 sq_throwerror(vm, _SC("'activate' called without instance"));
1061 } catch(std::exception& e) {
1062 sq_throwerror(vm, e.what());
1065 sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1071 static int Player_walk_wrapper(HSQUIRRELVM vm)
1073 Scripting::Player* _this;
1074 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1075 sq_throwerror(vm, _SC("'walk' called without instance"));
1079 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1080 sq_throwerror(vm, _SC("Argument 1 not a float"));
1089 } catch(std::exception& e) {
1090 sq_throwerror(vm, e.what());
1093 sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1099 static int Player_set_visible_wrapper(HSQUIRRELVM vm)
1101 Scripting::Player* _this;
1102 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1103 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1107 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1108 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1113 _this->set_visible(arg0);
1117 } catch(std::exception& e) {
1118 sq_throwerror(vm, e.what());
1121 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1127 static int Player_get_visible_wrapper(HSQUIRRELVM vm)
1129 Scripting::Player* _this;
1130 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1131 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1136 bool return_value = _this->get_visible();
1138 sq_pushbool(vm, return_value);
1141 } catch(std::exception& e) {
1142 sq_throwerror(vm, e.what());
1145 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1151 static int FloatingImage_release_hook(SQUserPointer ptr, int )
1153 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1158 static int FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1161 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1162 sq_throwerror(vm, _SC("Argument 1 not a string"));
1167 Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1168 if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1169 sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1172 sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1176 } catch(std::exception& e) {
1177 sq_throwerror(vm, e.what());
1180 sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1186 static int FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1188 Scripting::FloatingImage* _this;
1189 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1190 sq_throwerror(vm, _SC("'set_layer' called without instance"));
1194 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1195 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1200 _this->set_layer(arg0);
1204 } catch(std::exception& e) {
1205 sq_throwerror(vm, e.what());
1208 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1214 static int FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1216 Scripting::FloatingImage* _this;
1217 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1218 sq_throwerror(vm, _SC("'get_layer' called without instance"));
1223 int return_value = _this->get_layer();
1225 sq_pushinteger(vm, return_value);
1228 } catch(std::exception& e) {
1229 sq_throwerror(vm, e.what());
1232 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1238 static int FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1240 Scripting::FloatingImage* _this;
1241 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1242 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1246 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1247 sq_throwerror(vm, _SC("Argument 1 not a float"));
1251 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1252 sq_throwerror(vm, _SC("Argument 2 not a float"));
1257 _this->set_pos(arg0, arg1);
1261 } catch(std::exception& e) {
1262 sq_throwerror(vm, e.what());
1265 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1271 static int FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1273 Scripting::FloatingImage* _this;
1274 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1275 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1280 float return_value = _this->get_pos_x();
1282 sq_pushfloat(vm, return_value);
1285 } catch(std::exception& e) {
1286 sq_throwerror(vm, e.what());
1289 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1295 static int FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1297 Scripting::FloatingImage* _this;
1298 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1299 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1304 float return_value = _this->get_pos_y();
1306 sq_pushfloat(vm, return_value);
1309 } catch(std::exception& e) {
1310 sq_throwerror(vm, e.what());
1313 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1319 static int FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1321 Scripting::FloatingImage* _this;
1322 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1323 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1327 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1328 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1333 _this->set_anchor_point(arg0);
1337 } catch(std::exception& e) {
1338 sq_throwerror(vm, e.what());
1341 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1347 static int FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1349 Scripting::FloatingImage* _this;
1350 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1351 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1356 int return_value = _this->get_anchor_point();
1358 sq_pushinteger(vm, return_value);
1361 } catch(std::exception& e) {
1362 sq_throwerror(vm, e.what());
1365 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1371 static int FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1373 Scripting::FloatingImage* _this;
1374 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1375 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1379 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1380 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1385 _this->set_visible(arg0);
1389 } catch(std::exception& e) {
1390 sq_throwerror(vm, e.what());
1393 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1399 static int FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1401 Scripting::FloatingImage* _this;
1402 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1403 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1408 bool return_value = _this->get_visible();
1410 sq_pushbool(vm, return_value);
1413 } catch(std::exception& e) {
1414 sq_throwerror(vm, e.what());
1417 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1423 static int display_wrapper(HSQUIRRELVM vm)
1425 return Scripting::display(vm);
1428 static int display_text_file_wrapper(HSQUIRRELVM vm)
1431 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1432 sq_throwerror(vm, _SC("Argument 1 not a string"));
1437 Scripting::display_text_file(arg0);
1441 } catch(std::exception& e) {
1442 sq_throwerror(vm, e.what());
1445 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
1451 static int load_worldmap_wrapper(HSQUIRRELVM vm)
1454 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1455 sq_throwerror(vm, _SC("Argument 1 not a string"));
1460 Scripting::load_worldmap(arg0);
1464 } catch(std::exception& e) {
1465 sq_throwerror(vm, e.what());
1468 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
1474 static int load_level_wrapper(HSQUIRRELVM vm)
1477 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1478 sq_throwerror(vm, _SC("Argument 1 not a string"));
1483 Scripting::load_level(arg0);
1487 } catch(std::exception& e) {
1488 sq_throwerror(vm, e.what());
1491 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
1497 static int wait_wrapper(HSQUIRRELVM vm)
1499 HSQUIRRELVM arg0 = vm;
1501 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
1502 sq_throwerror(vm, _SC("Argument 1 not a float"));
1507 Scripting::wait(arg0, arg1);
1509 return sq_suspendvm(vm);
1511 } catch(std::exception& e) {
1512 sq_throwerror(vm, e.what());
1515 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
1521 static int wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
1523 HSQUIRRELVM arg0 = vm;
1526 Scripting::wait_for_screenswitch(arg0);
1528 return sq_suspendvm(vm);
1530 } catch(std::exception& e) {
1531 sq_throwerror(vm, e.what());
1534 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
1540 static int translate_wrapper(HSQUIRRELVM vm)
1543 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1544 sq_throwerror(vm, _SC("Argument 1 not a string"));
1549 std::string return_value = Scripting::translate(arg0);
1551 sq_pushstring(vm, return_value.c_str(), return_value.size());
1554 } catch(std::exception& e) {
1555 sq_throwerror(vm, e.what());
1558 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
1564 static int import_wrapper(HSQUIRRELVM vm)
1566 HSQUIRRELVM arg0 = vm;
1568 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
1569 sq_throwerror(vm, _SC("Argument 1 not a string"));
1574 Scripting::import(arg0, arg1);
1578 } catch(std::exception& e) {
1579 sq_throwerror(vm, e.what());
1582 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
1588 static int save_state_wrapper(HSQUIRRELVM vm)
1593 Scripting::save_state();
1597 } catch(std::exception& e) {
1598 sq_throwerror(vm, e.what());
1601 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
1607 static int add_key_wrapper(HSQUIRRELVM vm)
1610 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1611 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1616 Scripting::add_key(arg0);
1620 } catch(std::exception& e) {
1621 sq_throwerror(vm, e.what());
1624 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_key'"));
1630 } // end of namespace Wrapper
1632 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
1634 using namespace Wrapper;
1636 sq_pushroottable(v);
1637 sq_pushstring(v, "DisplayEffect", -1);
1638 if(SQ_FAILED(sq_get(v, -2))) {
1639 std::ostringstream msg;
1640 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
1641 throw SquirrelError(v, msg.str());
1644 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
1645 std::ostringstream msg;
1646 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
1647 throw SquirrelError(v, msg.str());
1649 sq_remove(v, -2); // remove object name
1651 if(setup_releasehook) {
1652 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
1655 sq_remove(v, -2); // remove root table
1658 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
1660 using namespace Wrapper;
1662 sq_pushroottable(v);
1663 sq_pushstring(v, "Camera", -1);
1664 if(SQ_FAILED(sq_get(v, -2))) {
1665 std::ostringstream msg;
1666 msg << "Couldn't resolved squirrel type 'Camera'";
1667 throw SquirrelError(v, msg.str());
1670 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
1671 std::ostringstream msg;
1672 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
1673 throw SquirrelError(v, msg.str());
1675 sq_remove(v, -2); // remove object name
1677 if(setup_releasehook) {
1678 sq_setreleasehook(v, -1, Camera_release_hook);
1681 sq_remove(v, -2); // remove root table
1684 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
1686 using namespace Wrapper;
1688 sq_pushroottable(v);
1689 sq_pushstring(v, "Level", -1);
1690 if(SQ_FAILED(sq_get(v, -2))) {
1691 std::ostringstream msg;
1692 msg << "Couldn't resolved squirrel type 'Level'";
1693 throw SquirrelError(v, msg.str());
1696 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
1697 std::ostringstream msg;
1698 msg << "Couldn't setup squirrel instance for object of type 'Level'";
1699 throw SquirrelError(v, msg.str());
1701 sq_remove(v, -2); // remove object name
1703 if(setup_releasehook) {
1704 sq_setreleasehook(v, -1, Level_release_hook);
1707 sq_remove(v, -2); // remove root table
1710 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
1712 using namespace Wrapper;
1714 sq_pushroottable(v);
1715 sq_pushstring(v, "ScriptedObject", -1);
1716 if(SQ_FAILED(sq_get(v, -2))) {
1717 std::ostringstream msg;
1718 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
1719 throw SquirrelError(v, msg.str());
1722 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
1723 std::ostringstream msg;
1724 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
1725 throw SquirrelError(v, msg.str());
1727 sq_remove(v, -2); // remove object name
1729 if(setup_releasehook) {
1730 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
1733 sq_remove(v, -2); // remove root table
1736 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Sound* object, bool setup_releasehook)
1738 using namespace Wrapper;
1740 sq_pushroottable(v);
1741 sq_pushstring(v, "Sound", -1);
1742 if(SQ_FAILED(sq_get(v, -2))) {
1743 std::ostringstream msg;
1744 msg << "Couldn't resolved squirrel type 'Sound'";
1745 throw SquirrelError(v, msg.str());
1748 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
1749 std::ostringstream msg;
1750 msg << "Couldn't setup squirrel instance for object of type 'Sound'";
1751 throw SquirrelError(v, msg.str());
1753 sq_remove(v, -2); // remove object name
1755 if(setup_releasehook) {
1756 sq_setreleasehook(v, -1, Sound_release_hook);
1759 sq_remove(v, -2); // remove root table
1762 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
1764 using namespace Wrapper;
1766 sq_pushroottable(v);
1767 sq_pushstring(v, "Text", -1);
1768 if(SQ_FAILED(sq_get(v, -2))) {
1769 std::ostringstream msg;
1770 msg << "Couldn't resolved squirrel type 'Text'";
1771 throw SquirrelError(v, msg.str());
1774 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
1775 std::ostringstream msg;
1776 msg << "Couldn't setup squirrel instance for object of type 'Text'";
1777 throw SquirrelError(v, msg.str());
1779 sq_remove(v, -2); // remove object name
1781 if(setup_releasehook) {
1782 sq_setreleasehook(v, -1, Text_release_hook);
1785 sq_remove(v, -2); // remove root table
1788 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
1790 using namespace Wrapper;
1792 sq_pushroottable(v);
1793 sq_pushstring(v, "Player", -1);
1794 if(SQ_FAILED(sq_get(v, -2))) {
1795 std::ostringstream msg;
1796 msg << "Couldn't resolved squirrel type 'Player'";
1797 throw SquirrelError(v, msg.str());
1800 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
1801 std::ostringstream msg;
1802 msg << "Couldn't setup squirrel instance for object of type 'Player'";
1803 throw SquirrelError(v, msg.str());
1805 sq_remove(v, -2); // remove object name
1807 if(setup_releasehook) {
1808 sq_setreleasehook(v, -1, Player_release_hook);
1811 sq_remove(v, -2); // remove root table
1814 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
1816 using namespace Wrapper;
1818 sq_pushroottable(v);
1819 sq_pushstring(v, "FloatingImage", -1);
1820 if(SQ_FAILED(sq_get(v, -2))) {
1821 std::ostringstream msg;
1822 msg << "Couldn't resolved squirrel type 'FloatingImage'";
1823 throw SquirrelError(v, msg.str());
1826 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
1827 std::ostringstream msg;
1828 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
1829 throw SquirrelError(v, msg.str());
1831 sq_remove(v, -2); // remove object name
1833 if(setup_releasehook) {
1834 sq_setreleasehook(v, -1, FloatingImage_release_hook);
1837 sq_remove(v, -2); // remove root table
1840 void register_supertux_wrapper(HSQUIRRELVM v)
1842 using namespace Wrapper;
1844 sq_pushstring(v, "KEY_BRASS", -1);
1845 sq_pushinteger(v, 1);
1846 if(SQ_FAILED(sq_createslot(v, -3))) {
1847 throw SquirrelError(v, "Couldn't register constant 'KEY_BRASS'");
1850 sq_pushstring(v, "KEY_IRON", -1);
1851 sq_pushinteger(v, 2);
1852 if(SQ_FAILED(sq_createslot(v, -3))) {
1853 throw SquirrelError(v, "Couldn't register constant 'KEY_IRON'");
1856 sq_pushstring(v, "KEY_BRONZE", -1);
1857 sq_pushinteger(v, 4);
1858 if(SQ_FAILED(sq_createslot(v, -3))) {
1859 throw SquirrelError(v, "Couldn't register constant 'KEY_BRONZE'");
1862 sq_pushstring(v, "KEY_SILVER", -1);
1863 sq_pushinteger(v, 8);
1864 if(SQ_FAILED(sq_createslot(v, -3))) {
1865 throw SquirrelError(v, "Couldn't register constant 'KEY_SILVER'");
1868 sq_pushstring(v, "KEY_GOLD", -1);
1869 sq_pushinteger(v, 16);
1870 if(SQ_FAILED(sq_createslot(v, -3))) {
1871 throw SquirrelError(v, "Couldn't register constant 'KEY_GOLD'");
1874 sq_pushstring(v, "ANCHOR_TOP", -1);
1875 sq_pushinteger(v, 16);
1876 if(SQ_FAILED(sq_createslot(v, -3))) {
1877 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
1880 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
1881 sq_pushinteger(v, 32);
1882 if(SQ_FAILED(sq_createslot(v, -3))) {
1883 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
1886 sq_pushstring(v, "ANCHOR_LEFT", -1);
1887 sq_pushinteger(v, 1);
1888 if(SQ_FAILED(sq_createslot(v, -3))) {
1889 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
1892 sq_pushstring(v, "ANCHOR_RIGHT", -1);
1893 sq_pushinteger(v, 2);
1894 if(SQ_FAILED(sq_createslot(v, -3))) {
1895 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
1898 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
1899 sq_pushinteger(v, 0);
1900 if(SQ_FAILED(sq_createslot(v, -3))) {
1901 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
1904 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
1905 sq_pushinteger(v, 17);
1906 if(SQ_FAILED(sq_createslot(v, -3))) {
1907 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
1910 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
1911 sq_pushinteger(v, 18);
1912 if(SQ_FAILED(sq_createslot(v, -3))) {
1913 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
1916 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
1917 sq_pushinteger(v, 33);
1918 if(SQ_FAILED(sq_createslot(v, -3))) {
1919 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
1922 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
1923 sq_pushinteger(v, 34);
1924 if(SQ_FAILED(sq_createslot(v, -3))) {
1925 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
1928 sq_pushstring(v, "display", -1);
1929 sq_newclosure(v, &display_wrapper, 0);
1930 if(SQ_FAILED(sq_createslot(v, -3))) {
1931 throw SquirrelError(v, "Couldn't register function 'display'");
1934 sq_pushstring(v, "display_text_file", -1);
1935 sq_newclosure(v, &display_text_file_wrapper, 0);
1936 if(SQ_FAILED(sq_createslot(v, -3))) {
1937 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
1940 sq_pushstring(v, "load_worldmap", -1);
1941 sq_newclosure(v, &load_worldmap_wrapper, 0);
1942 if(SQ_FAILED(sq_createslot(v, -3))) {
1943 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
1946 sq_pushstring(v, "load_level", -1);
1947 sq_newclosure(v, &load_level_wrapper, 0);
1948 if(SQ_FAILED(sq_createslot(v, -3))) {
1949 throw SquirrelError(v, "Couldn't register function 'load_level'");
1952 sq_pushstring(v, "wait", -1);
1953 sq_newclosure(v, &wait_wrapper, 0);
1954 if(SQ_FAILED(sq_createslot(v, -3))) {
1955 throw SquirrelError(v, "Couldn't register function 'wait'");
1958 sq_pushstring(v, "wait_for_screenswitch", -1);
1959 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
1960 if(SQ_FAILED(sq_createslot(v, -3))) {
1961 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
1964 sq_pushstring(v, "translate", -1);
1965 sq_newclosure(v, &translate_wrapper, 0);
1966 if(SQ_FAILED(sq_createslot(v, -3))) {
1967 throw SquirrelError(v, "Couldn't register function 'translate'");
1970 sq_pushstring(v, "import", -1);
1971 sq_newclosure(v, &import_wrapper, 0);
1972 if(SQ_FAILED(sq_createslot(v, -3))) {
1973 throw SquirrelError(v, "Couldn't register function 'import'");
1976 sq_pushstring(v, "save_state", -1);
1977 sq_newclosure(v, &save_state_wrapper, 0);
1978 if(SQ_FAILED(sq_createslot(v, -3))) {
1979 throw SquirrelError(v, "Couldn't register function 'save_state'");
1982 sq_pushstring(v, "add_key", -1);
1983 sq_newclosure(v, &add_key_wrapper, 0);
1984 if(SQ_FAILED(sq_createslot(v, -3))) {
1985 throw SquirrelError(v, "Couldn't register function 'add_key'");
1988 // Register class DisplayEffect
1989 sq_pushstring(v, "DisplayEffect", -1);
1990 if(sq_newclass(v, SQFalse) < 0) {
1991 std::ostringstream msg;
1992 msg << "Couldn't create new class 'DisplayEffect'";
1993 throw SquirrelError(v, msg.str());
1995 sq_pushstring(v, "fade_out", -1);
1996 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
1997 if(SQ_FAILED(sq_createslot(v, -3))) {
1998 throw SquirrelError(v, "Couldn't register function 'fade_out'");
2001 sq_pushstring(v, "fade_in", -1);
2002 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
2003 if(SQ_FAILED(sq_createslot(v, -3))) {
2004 throw SquirrelError(v, "Couldn't register function 'fade_in'");
2007 sq_pushstring(v, "set_black", -1);
2008 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
2009 if(SQ_FAILED(sq_createslot(v, -3))) {
2010 throw SquirrelError(v, "Couldn't register function 'set_black'");
2013 sq_pushstring(v, "is_black", -1);
2014 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
2015 if(SQ_FAILED(sq_createslot(v, -3))) {
2016 throw SquirrelError(v, "Couldn't register function 'is_black'");
2019 sq_pushstring(v, "sixteen_to_nine", -1);
2020 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
2021 if(SQ_FAILED(sq_createslot(v, -3))) {
2022 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
2025 sq_pushstring(v, "four_to_three", -1);
2026 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
2027 if(SQ_FAILED(sq_createslot(v, -3))) {
2028 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
2031 if(SQ_FAILED(sq_createslot(v, -3))) {
2032 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
2035 // Register class Camera
2036 sq_pushstring(v, "Camera", -1);
2037 if(sq_newclass(v, SQFalse) < 0) {
2038 std::ostringstream msg;
2039 msg << "Couldn't create new class 'Camera'";
2040 throw SquirrelError(v, msg.str());
2042 sq_pushstring(v, "shake", -1);
2043 sq_newclosure(v, &Camera_shake_wrapper, 0);
2044 if(SQ_FAILED(sq_createslot(v, -3))) {
2045 throw SquirrelError(v, "Couldn't register function 'shake'");
2048 sq_pushstring(v, "set_pos", -1);
2049 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
2050 if(SQ_FAILED(sq_createslot(v, -3))) {
2051 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2054 sq_pushstring(v, "set_mode", -1);
2055 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
2056 if(SQ_FAILED(sq_createslot(v, -3))) {
2057 throw SquirrelError(v, "Couldn't register function 'set_mode'");
2060 sq_pushstring(v, "scroll_to", -1);
2061 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
2062 if(SQ_FAILED(sq_createslot(v, -3))) {
2063 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
2066 if(SQ_FAILED(sq_createslot(v, -3))) {
2067 throw SquirrelError(v, "Couldn't register class 'Camera'");
2070 // Register class Level
2071 sq_pushstring(v, "Level", -1);
2072 if(sq_newclass(v, SQFalse) < 0) {
2073 std::ostringstream msg;
2074 msg << "Couldn't create new class 'Level'";
2075 throw SquirrelError(v, msg.str());
2077 sq_pushstring(v, "finish", -1);
2078 sq_newclosure(v, &Level_finish_wrapper, 0);
2079 if(SQ_FAILED(sq_createslot(v, -3))) {
2080 throw SquirrelError(v, "Couldn't register function 'finish'");
2083 sq_pushstring(v, "spawn", -1);
2084 sq_newclosure(v, &Level_spawn_wrapper, 0);
2085 if(SQ_FAILED(sq_createslot(v, -3))) {
2086 throw SquirrelError(v, "Couldn't register function 'spawn'");
2089 sq_pushstring(v, "flip_vertically", -1);
2090 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
2091 if(SQ_FAILED(sq_createslot(v, -3))) {
2092 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
2095 if(SQ_FAILED(sq_createslot(v, -3))) {
2096 throw SquirrelError(v, "Couldn't register class 'Level'");
2099 // Register class ScriptedObject
2100 sq_pushstring(v, "ScriptedObject", -1);
2101 if(sq_newclass(v, SQFalse) < 0) {
2102 std::ostringstream msg;
2103 msg << "Couldn't create new class 'ScriptedObject'";
2104 throw SquirrelError(v, msg.str());
2106 sq_pushstring(v, "set_action", -1);
2107 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
2108 if(SQ_FAILED(sq_createslot(v, -3))) {
2109 throw SquirrelError(v, "Couldn't register function 'set_action'");
2112 sq_pushstring(v, "get_action", -1);
2113 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
2114 if(SQ_FAILED(sq_createslot(v, -3))) {
2115 throw SquirrelError(v, "Couldn't register function 'get_action'");
2118 sq_pushstring(v, "move", -1);
2119 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
2120 if(SQ_FAILED(sq_createslot(v, -3))) {
2121 throw SquirrelError(v, "Couldn't register function 'move'");
2124 sq_pushstring(v, "set_pos", -1);
2125 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
2126 if(SQ_FAILED(sq_createslot(v, -3))) {
2127 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2130 sq_pushstring(v, "get_pos_x", -1);
2131 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
2132 if(SQ_FAILED(sq_createslot(v, -3))) {
2133 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
2136 sq_pushstring(v, "get_pos_y", -1);
2137 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
2138 if(SQ_FAILED(sq_createslot(v, -3))) {
2139 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
2142 sq_pushstring(v, "set_velocity", -1);
2143 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
2144 if(SQ_FAILED(sq_createslot(v, -3))) {
2145 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
2148 sq_pushstring(v, "get_velocity_x", -1);
2149 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
2150 if(SQ_FAILED(sq_createslot(v, -3))) {
2151 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
2154 sq_pushstring(v, "get_velocity_y", -1);
2155 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
2156 if(SQ_FAILED(sq_createslot(v, -3))) {
2157 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
2160 sq_pushstring(v, "set_visible", -1);
2161 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
2162 if(SQ_FAILED(sq_createslot(v, -3))) {
2163 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2166 sq_pushstring(v, "is_visible", -1);
2167 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
2168 if(SQ_FAILED(sq_createslot(v, -3))) {
2169 throw SquirrelError(v, "Couldn't register function 'is_visible'");
2172 sq_pushstring(v, "get_name", -1);
2173 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
2174 if(SQ_FAILED(sq_createslot(v, -3))) {
2175 throw SquirrelError(v, "Couldn't register function 'get_name'");
2178 if(SQ_FAILED(sq_createslot(v, -3))) {
2179 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
2182 // Register class Sound
2183 sq_pushstring(v, "Sound", -1);
2184 if(sq_newclass(v, SQFalse) < 0) {
2185 std::ostringstream msg;
2186 msg << "Couldn't create new class 'Sound'";
2187 throw SquirrelError(v, msg.str());
2189 sq_pushstring(v, "play_music", -1);
2190 sq_newclosure(v, &Sound_play_music_wrapper, 0);
2191 if(SQ_FAILED(sq_createslot(v, -3))) {
2192 throw SquirrelError(v, "Couldn't register function 'play_music'");
2195 sq_pushstring(v, "play", -1);
2196 sq_newclosure(v, &Sound_play_wrapper, 0);
2197 if(SQ_FAILED(sq_createslot(v, -3))) {
2198 throw SquirrelError(v, "Couldn't register function 'play'");
2201 if(SQ_FAILED(sq_createslot(v, -3))) {
2202 throw SquirrelError(v, "Couldn't register class 'Sound'");
2205 // Register class Text
2206 sq_pushstring(v, "Text", -1);
2207 if(sq_newclass(v, SQFalse) < 0) {
2208 std::ostringstream msg;
2209 msg << "Couldn't create new class 'Text'";
2210 throw SquirrelError(v, msg.str());
2212 sq_pushstring(v, "set_text", -1);
2213 sq_newclosure(v, &Text_set_text_wrapper, 0);
2214 if(SQ_FAILED(sq_createslot(v, -3))) {
2215 throw SquirrelError(v, "Couldn't register function 'set_text'");
2218 sq_pushstring(v, "set_font", -1);
2219 sq_newclosure(v, &Text_set_font_wrapper, 0);
2220 if(SQ_FAILED(sq_createslot(v, -3))) {
2221 throw SquirrelError(v, "Couldn't register function 'set_font'");
2224 sq_pushstring(v, "fade_in", -1);
2225 sq_newclosure(v, &Text_fade_in_wrapper, 0);
2226 if(SQ_FAILED(sq_createslot(v, -3))) {
2227 throw SquirrelError(v, "Couldn't register function 'fade_in'");
2230 sq_pushstring(v, "fade_out", -1);
2231 sq_newclosure(v, &Text_fade_out_wrapper, 0);
2232 if(SQ_FAILED(sq_createslot(v, -3))) {
2233 throw SquirrelError(v, "Couldn't register function 'fade_out'");
2236 sq_pushstring(v, "set_visible", -1);
2237 sq_newclosure(v, &Text_set_visible_wrapper, 0);
2238 if(SQ_FAILED(sq_createslot(v, -3))) {
2239 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2242 sq_pushstring(v, "set_centered", -1);
2243 sq_newclosure(v, &Text_set_centered_wrapper, 0);
2244 if(SQ_FAILED(sq_createslot(v, -3))) {
2245 throw SquirrelError(v, "Couldn't register function 'set_centered'");
2248 if(SQ_FAILED(sq_createslot(v, -3))) {
2249 throw SquirrelError(v, "Couldn't register class 'Text'");
2252 // Register class Player
2253 sq_pushstring(v, "Player", -1);
2254 if(sq_newclass(v, SQFalse) < 0) {
2255 std::ostringstream msg;
2256 msg << "Couldn't create new class 'Player'";
2257 throw SquirrelError(v, msg.str());
2259 sq_pushstring(v, "make_invincible", -1);
2260 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
2261 if(SQ_FAILED(sq_createslot(v, -3))) {
2262 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
2265 sq_pushstring(v, "deactivate", -1);
2266 sq_newclosure(v, &Player_deactivate_wrapper, 0);
2267 if(SQ_FAILED(sq_createslot(v, -3))) {
2268 throw SquirrelError(v, "Couldn't register function 'deactivate'");
2271 sq_pushstring(v, "activate", -1);
2272 sq_newclosure(v, &Player_activate_wrapper, 0);
2273 if(SQ_FAILED(sq_createslot(v, -3))) {
2274 throw SquirrelError(v, "Couldn't register function 'activate'");
2277 sq_pushstring(v, "walk", -1);
2278 sq_newclosure(v, &Player_walk_wrapper, 0);
2279 if(SQ_FAILED(sq_createslot(v, -3))) {
2280 throw SquirrelError(v, "Couldn't register function 'walk'");
2283 sq_pushstring(v, "set_visible", -1);
2284 sq_newclosure(v, &Player_set_visible_wrapper, 0);
2285 if(SQ_FAILED(sq_createslot(v, -3))) {
2286 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2289 sq_pushstring(v, "get_visible", -1);
2290 sq_newclosure(v, &Player_get_visible_wrapper, 0);
2291 if(SQ_FAILED(sq_createslot(v, -3))) {
2292 throw SquirrelError(v, "Couldn't register function 'get_visible'");
2295 if(SQ_FAILED(sq_createslot(v, -3))) {
2296 throw SquirrelError(v, "Couldn't register class 'Player'");
2299 // Register class FloatingImage
2300 sq_pushstring(v, "FloatingImage", -1);
2301 if(sq_newclass(v, SQFalse) < 0) {
2302 std::ostringstream msg;
2303 msg << "Couldn't create new class 'FloatingImage'";
2304 throw SquirrelError(v, msg.str());
2306 sq_pushstring(v, "constructor", -1);
2307 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
2308 if(SQ_FAILED(sq_createslot(v, -3))) {
2309 throw SquirrelError(v, "Couldn't register function 'constructor'");
2312 sq_pushstring(v, "set_layer", -1);
2313 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
2314 if(SQ_FAILED(sq_createslot(v, -3))) {
2315 throw SquirrelError(v, "Couldn't register function 'set_layer'");
2318 sq_pushstring(v, "get_layer", -1);
2319 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
2320 if(SQ_FAILED(sq_createslot(v, -3))) {
2321 throw SquirrelError(v, "Couldn't register function 'get_layer'");
2324 sq_pushstring(v, "set_pos", -1);
2325 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
2326 if(SQ_FAILED(sq_createslot(v, -3))) {
2327 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2330 sq_pushstring(v, "get_pos_x", -1);
2331 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
2332 if(SQ_FAILED(sq_createslot(v, -3))) {
2333 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
2336 sq_pushstring(v, "get_pos_y", -1);
2337 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
2338 if(SQ_FAILED(sq_createslot(v, -3))) {
2339 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
2342 sq_pushstring(v, "set_anchor_point", -1);
2343 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
2344 if(SQ_FAILED(sq_createslot(v, -3))) {
2345 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
2348 sq_pushstring(v, "get_anchor_point", -1);
2349 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
2350 if(SQ_FAILED(sq_createslot(v, -3))) {
2351 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
2354 sq_pushstring(v, "set_visible", -1);
2355 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
2356 if(SQ_FAILED(sq_createslot(v, -3))) {
2357 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2360 sq_pushstring(v, "get_visible", -1);
2361 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
2362 if(SQ_FAILED(sq_createslot(v, -3))) {
2363 throw SquirrelError(v, "Couldn't register function 'get_visible'");
2366 if(SQ_FAILED(sq_createslot(v, -3))) {
2367 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
2372 } // end of namespace Scripting