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_add_bonus_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("'add_bonus' called without instance"));
1010 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1011 sq_throwerror(vm, _SC("Argument 1 not a string"));
1016 _this->add_bonus(arg0);
1020 } catch(std::exception& e) {
1021 sq_throwerror(vm, e.what());
1024 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1030 static int Player_add_coins_wrapper(HSQUIRRELVM vm)
1032 Scripting::Player* _this;
1033 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1034 sq_throwerror(vm, _SC("'add_coins' called without instance"));
1038 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1039 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1044 _this->add_coins(arg0);
1048 } catch(std::exception& e) {
1049 sq_throwerror(vm, e.what());
1052 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1058 static int Player_make_invincible_wrapper(HSQUIRRELVM vm)
1060 Scripting::Player* _this;
1061 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1062 sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1067 _this->make_invincible();
1071 } catch(std::exception& e) {
1072 sq_throwerror(vm, e.what());
1075 sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1081 static int Player_deactivate_wrapper(HSQUIRRELVM vm)
1083 Scripting::Player* _this;
1084 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1085 sq_throwerror(vm, _SC("'deactivate' called without instance"));
1090 _this->deactivate();
1094 } catch(std::exception& e) {
1095 sq_throwerror(vm, e.what());
1098 sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1104 static int Player_activate_wrapper(HSQUIRRELVM vm)
1106 Scripting::Player* _this;
1107 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1108 sq_throwerror(vm, _SC("'activate' called without instance"));
1117 } catch(std::exception& e) {
1118 sq_throwerror(vm, e.what());
1121 sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1127 static int Player_walk_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("'walk' called without instance"));
1135 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1136 sq_throwerror(vm, _SC("Argument 1 not a float"));
1145 } catch(std::exception& e) {
1146 sq_throwerror(vm, e.what());
1149 sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1155 static int Player_set_visible_wrapper(HSQUIRRELVM vm)
1157 Scripting::Player* _this;
1158 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1159 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1163 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1164 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1169 _this->set_visible(arg0);
1173 } catch(std::exception& e) {
1174 sq_throwerror(vm, e.what());
1177 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1183 static int Player_get_visible_wrapper(HSQUIRRELVM vm)
1185 Scripting::Player* _this;
1186 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1187 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1192 bool return_value = _this->get_visible();
1194 sq_pushbool(vm, return_value);
1197 } catch(std::exception& e) {
1198 sq_throwerror(vm, e.what());
1201 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1207 static int FloatingImage_release_hook(SQUserPointer ptr, int )
1209 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1214 static int FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1217 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1218 sq_throwerror(vm, _SC("Argument 1 not a string"));
1223 Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1224 if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1225 sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1228 sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1232 } catch(std::exception& e) {
1233 sq_throwerror(vm, e.what());
1236 sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1242 static int FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1244 Scripting::FloatingImage* _this;
1245 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1246 sq_throwerror(vm, _SC("'set_layer' called without instance"));
1250 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1251 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1256 _this->set_layer(arg0);
1260 } catch(std::exception& e) {
1261 sq_throwerror(vm, e.what());
1264 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1270 static int FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1272 Scripting::FloatingImage* _this;
1273 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1274 sq_throwerror(vm, _SC("'get_layer' called without instance"));
1279 int return_value = _this->get_layer();
1281 sq_pushinteger(vm, return_value);
1284 } catch(std::exception& e) {
1285 sq_throwerror(vm, e.what());
1288 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1294 static int FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1296 Scripting::FloatingImage* _this;
1297 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1298 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1302 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1303 sq_throwerror(vm, _SC("Argument 1 not a float"));
1307 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1308 sq_throwerror(vm, _SC("Argument 2 not a float"));
1313 _this->set_pos(arg0, arg1);
1317 } catch(std::exception& e) {
1318 sq_throwerror(vm, e.what());
1321 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1327 static int FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1329 Scripting::FloatingImage* _this;
1330 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1331 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1336 float return_value = _this->get_pos_x();
1338 sq_pushfloat(vm, return_value);
1341 } catch(std::exception& e) {
1342 sq_throwerror(vm, e.what());
1345 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1351 static int FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1353 Scripting::FloatingImage* _this;
1354 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1355 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1360 float return_value = _this->get_pos_y();
1362 sq_pushfloat(vm, return_value);
1365 } catch(std::exception& e) {
1366 sq_throwerror(vm, e.what());
1369 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1375 static int FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1377 Scripting::FloatingImage* _this;
1378 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1379 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1383 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1384 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1389 _this->set_anchor_point(arg0);
1393 } catch(std::exception& e) {
1394 sq_throwerror(vm, e.what());
1397 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1403 static int FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1405 Scripting::FloatingImage* _this;
1406 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1407 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1412 int return_value = _this->get_anchor_point();
1414 sq_pushinteger(vm, return_value);
1417 } catch(std::exception& e) {
1418 sq_throwerror(vm, e.what());
1421 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1427 static int FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1429 Scripting::FloatingImage* _this;
1430 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1431 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1435 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1436 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1441 _this->set_visible(arg0);
1445 } catch(std::exception& e) {
1446 sq_throwerror(vm, e.what());
1449 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1455 static int FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1457 Scripting::FloatingImage* _this;
1458 if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1459 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1464 bool return_value = _this->get_visible();
1466 sq_pushbool(vm, return_value);
1469 } catch(std::exception& e) {
1470 sq_throwerror(vm, e.what());
1473 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1479 static int display_wrapper(HSQUIRRELVM vm)
1481 return Scripting::display(vm);
1484 static int display_text_file_wrapper(HSQUIRRELVM vm)
1487 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1488 sq_throwerror(vm, _SC("Argument 1 not a string"));
1493 Scripting::display_text_file(arg0);
1497 } catch(std::exception& e) {
1498 sq_throwerror(vm, e.what());
1501 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
1507 static int load_worldmap_wrapper(HSQUIRRELVM vm)
1510 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1511 sq_throwerror(vm, _SC("Argument 1 not a string"));
1516 Scripting::load_worldmap(arg0);
1520 } catch(std::exception& e) {
1521 sq_throwerror(vm, e.what());
1524 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
1530 static int load_level_wrapper(HSQUIRRELVM vm)
1533 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1534 sq_throwerror(vm, _SC("Argument 1 not a string"));
1539 Scripting::load_level(arg0);
1543 } catch(std::exception& e) {
1544 sq_throwerror(vm, e.what());
1547 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
1553 static int wait_wrapper(HSQUIRRELVM vm)
1555 HSQUIRRELVM arg0 = vm;
1557 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
1558 sq_throwerror(vm, _SC("Argument 1 not a float"));
1563 Scripting::wait(arg0, arg1);
1565 return sq_suspendvm(vm);
1567 } catch(std::exception& e) {
1568 sq_throwerror(vm, e.what());
1571 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
1577 static int wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
1579 HSQUIRRELVM arg0 = vm;
1582 Scripting::wait_for_screenswitch(arg0);
1584 return sq_suspendvm(vm);
1586 } catch(std::exception& e) {
1587 sq_throwerror(vm, e.what());
1590 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
1596 static int exit_screen_wrapper(HSQUIRRELVM vm)
1601 Scripting::exit_screen();
1605 } catch(std::exception& e) {
1606 sq_throwerror(vm, e.what());
1609 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
1615 static int translate_wrapper(HSQUIRRELVM vm)
1618 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1619 sq_throwerror(vm, _SC("Argument 1 not a string"));
1624 std::string return_value = Scripting::translate(arg0);
1626 sq_pushstring(vm, return_value.c_str(), return_value.size());
1629 } catch(std::exception& e) {
1630 sq_throwerror(vm, e.what());
1633 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
1639 static int import_wrapper(HSQUIRRELVM vm)
1641 HSQUIRRELVM arg0 = vm;
1643 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
1644 sq_throwerror(vm, _SC("Argument 1 not a string"));
1649 Scripting::import(arg0, arg1);
1653 } catch(std::exception& e) {
1654 sq_throwerror(vm, e.what());
1657 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
1663 static int save_state_wrapper(HSQUIRRELVM vm)
1668 Scripting::save_state();
1672 } catch(std::exception& e) {
1673 sq_throwerror(vm, e.what());
1676 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
1682 static int add_key_wrapper(HSQUIRRELVM vm)
1685 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1686 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1691 Scripting::add_key(arg0);
1695 } catch(std::exception& e) {
1696 sq_throwerror(vm, e.what());
1699 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_key'"));
1705 static int debug_collrects_wrapper(HSQUIRRELVM vm)
1708 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1709 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1714 Scripting::debug_collrects(arg0);
1718 } catch(std::exception& e) {
1719 sq_throwerror(vm, e.what());
1722 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
1728 static int debug_draw_fps_wrapper(HSQUIRRELVM vm)
1731 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1732 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1737 Scripting::debug_draw_fps(arg0);
1741 } catch(std::exception& e) {
1742 sq_throwerror(vm, e.what());
1745 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_fps'"));
1751 static int debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
1754 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1755 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1760 Scripting::debug_draw_solids_only(arg0);
1764 } catch(std::exception& e) {
1765 sq_throwerror(vm, e.what());
1768 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
1774 static int grease_wrapper(HSQUIRRELVM vm)
1779 Scripting::grease();
1783 } catch(std::exception& e) {
1784 sq_throwerror(vm, e.what());
1787 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
1793 static int invincible_wrapper(HSQUIRRELVM vm)
1798 Scripting::invincible();
1802 } catch(std::exception& e) {
1803 sq_throwerror(vm, e.what());
1806 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
1812 static int mortal_wrapper(HSQUIRRELVM vm)
1817 Scripting::mortal();
1821 } catch(std::exception& e) {
1822 sq_throwerror(vm, e.what());
1825 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
1831 static int shrink_wrapper(HSQUIRRELVM vm)
1836 Scripting::shrink();
1840 } catch(std::exception& e) {
1841 sq_throwerror(vm, e.what());
1844 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink'"));
1850 static int kill_wrapper(HSQUIRRELVM vm)
1859 } catch(std::exception& e) {
1860 sq_throwerror(vm, e.what());
1863 sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1869 static int restart_wrapper(HSQUIRRELVM vm)
1874 Scripting::restart();
1878 } catch(std::exception& e) {
1879 sq_throwerror(vm, e.what());
1882 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
1888 static int whereami_wrapper(HSQUIRRELVM vm)
1893 Scripting::whereami();
1897 } catch(std::exception& e) {
1898 sq_throwerror(vm, e.what());
1901 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
1907 static int gotoend_wrapper(HSQUIRRELVM vm)
1912 Scripting::gotoend();
1916 } catch(std::exception& e) {
1917 sq_throwerror(vm, e.what());
1920 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
1926 static int camera_wrapper(HSQUIRRELVM vm)
1931 Scripting::camera();
1935 } catch(std::exception& e) {
1936 sq_throwerror(vm, e.what());
1939 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
1945 static int quit_wrapper(HSQUIRRELVM vm)
1954 } catch(std::exception& e) {
1955 sq_throwerror(vm, e.what());
1958 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
1964 } // end of namespace Wrapper
1966 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
1968 using namespace Wrapper;
1970 sq_pushroottable(v);
1971 sq_pushstring(v, "DisplayEffect", -1);
1972 if(SQ_FAILED(sq_get(v, -2))) {
1973 std::ostringstream msg;
1974 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
1975 throw SquirrelError(v, msg.str());
1978 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
1979 std::ostringstream msg;
1980 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
1981 throw SquirrelError(v, msg.str());
1983 sq_remove(v, -2); // remove object name
1985 if(setup_releasehook) {
1986 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
1989 sq_remove(v, -2); // remove root table
1992 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
1994 using namespace Wrapper;
1996 sq_pushroottable(v);
1997 sq_pushstring(v, "Camera", -1);
1998 if(SQ_FAILED(sq_get(v, -2))) {
1999 std::ostringstream msg;
2000 msg << "Couldn't resolved squirrel type 'Camera'";
2001 throw SquirrelError(v, msg.str());
2004 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2005 std::ostringstream msg;
2006 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
2007 throw SquirrelError(v, msg.str());
2009 sq_remove(v, -2); // remove object name
2011 if(setup_releasehook) {
2012 sq_setreleasehook(v, -1, Camera_release_hook);
2015 sq_remove(v, -2); // remove root table
2018 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
2020 using namespace Wrapper;
2022 sq_pushroottable(v);
2023 sq_pushstring(v, "Level", -1);
2024 if(SQ_FAILED(sq_get(v, -2))) {
2025 std::ostringstream msg;
2026 msg << "Couldn't resolved squirrel type 'Level'";
2027 throw SquirrelError(v, msg.str());
2030 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2031 std::ostringstream msg;
2032 msg << "Couldn't setup squirrel instance for object of type 'Level'";
2033 throw SquirrelError(v, msg.str());
2035 sq_remove(v, -2); // remove object name
2037 if(setup_releasehook) {
2038 sq_setreleasehook(v, -1, Level_release_hook);
2041 sq_remove(v, -2); // remove root table
2044 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
2046 using namespace Wrapper;
2048 sq_pushroottable(v);
2049 sq_pushstring(v, "ScriptedObject", -1);
2050 if(SQ_FAILED(sq_get(v, -2))) {
2051 std::ostringstream msg;
2052 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
2053 throw SquirrelError(v, msg.str());
2056 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2057 std::ostringstream msg;
2058 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
2059 throw SquirrelError(v, msg.str());
2061 sq_remove(v, -2); // remove object name
2063 if(setup_releasehook) {
2064 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
2067 sq_remove(v, -2); // remove root table
2070 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Sound* object, bool setup_releasehook)
2072 using namespace Wrapper;
2074 sq_pushroottable(v);
2075 sq_pushstring(v, "Sound", -1);
2076 if(SQ_FAILED(sq_get(v, -2))) {
2077 std::ostringstream msg;
2078 msg << "Couldn't resolved squirrel type 'Sound'";
2079 throw SquirrelError(v, msg.str());
2082 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2083 std::ostringstream msg;
2084 msg << "Couldn't setup squirrel instance for object of type 'Sound'";
2085 throw SquirrelError(v, msg.str());
2087 sq_remove(v, -2); // remove object name
2089 if(setup_releasehook) {
2090 sq_setreleasehook(v, -1, Sound_release_hook);
2093 sq_remove(v, -2); // remove root table
2096 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
2098 using namespace Wrapper;
2100 sq_pushroottable(v);
2101 sq_pushstring(v, "Text", -1);
2102 if(SQ_FAILED(sq_get(v, -2))) {
2103 std::ostringstream msg;
2104 msg << "Couldn't resolved squirrel type 'Text'";
2105 throw SquirrelError(v, msg.str());
2108 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2109 std::ostringstream msg;
2110 msg << "Couldn't setup squirrel instance for object of type 'Text'";
2111 throw SquirrelError(v, msg.str());
2113 sq_remove(v, -2); // remove object name
2115 if(setup_releasehook) {
2116 sq_setreleasehook(v, -1, Text_release_hook);
2119 sq_remove(v, -2); // remove root table
2122 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
2124 using namespace Wrapper;
2126 sq_pushroottable(v);
2127 sq_pushstring(v, "Player", -1);
2128 if(SQ_FAILED(sq_get(v, -2))) {
2129 std::ostringstream msg;
2130 msg << "Couldn't resolved squirrel type 'Player'";
2131 throw SquirrelError(v, msg.str());
2134 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2135 std::ostringstream msg;
2136 msg << "Couldn't setup squirrel instance for object of type 'Player'";
2137 throw SquirrelError(v, msg.str());
2139 sq_remove(v, -2); // remove object name
2141 if(setup_releasehook) {
2142 sq_setreleasehook(v, -1, Player_release_hook);
2145 sq_remove(v, -2); // remove root table
2148 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
2150 using namespace Wrapper;
2152 sq_pushroottable(v);
2153 sq_pushstring(v, "FloatingImage", -1);
2154 if(SQ_FAILED(sq_get(v, -2))) {
2155 std::ostringstream msg;
2156 msg << "Couldn't resolved squirrel type 'FloatingImage'";
2157 throw SquirrelError(v, msg.str());
2160 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2161 std::ostringstream msg;
2162 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
2163 throw SquirrelError(v, msg.str());
2165 sq_remove(v, -2); // remove object name
2167 if(setup_releasehook) {
2168 sq_setreleasehook(v, -1, FloatingImage_release_hook);
2171 sq_remove(v, -2); // remove root table
2174 void register_supertux_wrapper(HSQUIRRELVM v)
2176 using namespace Wrapper;
2178 sq_pushstring(v, "KEY_BRASS", -1);
2179 sq_pushinteger(v, 1);
2180 if(SQ_FAILED(sq_createslot(v, -3))) {
2181 throw SquirrelError(v, "Couldn't register constant 'KEY_BRASS'");
2184 sq_pushstring(v, "KEY_IRON", -1);
2185 sq_pushinteger(v, 2);
2186 if(SQ_FAILED(sq_createslot(v, -3))) {
2187 throw SquirrelError(v, "Couldn't register constant 'KEY_IRON'");
2190 sq_pushstring(v, "KEY_BRONZE", -1);
2191 sq_pushinteger(v, 4);
2192 if(SQ_FAILED(sq_createslot(v, -3))) {
2193 throw SquirrelError(v, "Couldn't register constant 'KEY_BRONZE'");
2196 sq_pushstring(v, "KEY_SILVER", -1);
2197 sq_pushinteger(v, 8);
2198 if(SQ_FAILED(sq_createslot(v, -3))) {
2199 throw SquirrelError(v, "Couldn't register constant 'KEY_SILVER'");
2202 sq_pushstring(v, "KEY_GOLD", -1);
2203 sq_pushinteger(v, 16);
2204 if(SQ_FAILED(sq_createslot(v, -3))) {
2205 throw SquirrelError(v, "Couldn't register constant 'KEY_GOLD'");
2208 sq_pushstring(v, "ANCHOR_TOP", -1);
2209 sq_pushinteger(v, 16);
2210 if(SQ_FAILED(sq_createslot(v, -3))) {
2211 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
2214 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
2215 sq_pushinteger(v, 32);
2216 if(SQ_FAILED(sq_createslot(v, -3))) {
2217 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
2220 sq_pushstring(v, "ANCHOR_LEFT", -1);
2221 sq_pushinteger(v, 1);
2222 if(SQ_FAILED(sq_createslot(v, -3))) {
2223 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
2226 sq_pushstring(v, "ANCHOR_RIGHT", -1);
2227 sq_pushinteger(v, 2);
2228 if(SQ_FAILED(sq_createslot(v, -3))) {
2229 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
2232 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
2233 sq_pushinteger(v, 0);
2234 if(SQ_FAILED(sq_createslot(v, -3))) {
2235 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
2238 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
2239 sq_pushinteger(v, 17);
2240 if(SQ_FAILED(sq_createslot(v, -3))) {
2241 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
2244 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
2245 sq_pushinteger(v, 18);
2246 if(SQ_FAILED(sq_createslot(v, -3))) {
2247 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
2250 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
2251 sq_pushinteger(v, 33);
2252 if(SQ_FAILED(sq_createslot(v, -3))) {
2253 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
2256 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
2257 sq_pushinteger(v, 34);
2258 if(SQ_FAILED(sq_createslot(v, -3))) {
2259 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
2262 sq_pushstring(v, "display", -1);
2263 sq_newclosure(v, &display_wrapper, 0);
2264 if(SQ_FAILED(sq_createslot(v, -3))) {
2265 throw SquirrelError(v, "Couldn't register function 'display'");
2268 sq_pushstring(v, "display_text_file", -1);
2269 sq_newclosure(v, &display_text_file_wrapper, 0);
2270 if(SQ_FAILED(sq_createslot(v, -3))) {
2271 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
2274 sq_pushstring(v, "load_worldmap", -1);
2275 sq_newclosure(v, &load_worldmap_wrapper, 0);
2276 if(SQ_FAILED(sq_createslot(v, -3))) {
2277 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
2280 sq_pushstring(v, "load_level", -1);
2281 sq_newclosure(v, &load_level_wrapper, 0);
2282 if(SQ_FAILED(sq_createslot(v, -3))) {
2283 throw SquirrelError(v, "Couldn't register function 'load_level'");
2286 sq_pushstring(v, "wait", -1);
2287 sq_newclosure(v, &wait_wrapper, 0);
2288 if(SQ_FAILED(sq_createslot(v, -3))) {
2289 throw SquirrelError(v, "Couldn't register function 'wait'");
2292 sq_pushstring(v, "wait_for_screenswitch", -1);
2293 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
2294 if(SQ_FAILED(sq_createslot(v, -3))) {
2295 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
2298 sq_pushstring(v, "exit_screen", -1);
2299 sq_newclosure(v, &exit_screen_wrapper, 0);
2300 if(SQ_FAILED(sq_createslot(v, -3))) {
2301 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
2304 sq_pushstring(v, "translate", -1);
2305 sq_newclosure(v, &translate_wrapper, 0);
2306 if(SQ_FAILED(sq_createslot(v, -3))) {
2307 throw SquirrelError(v, "Couldn't register function 'translate'");
2310 sq_pushstring(v, "import", -1);
2311 sq_newclosure(v, &import_wrapper, 0);
2312 if(SQ_FAILED(sq_createslot(v, -3))) {
2313 throw SquirrelError(v, "Couldn't register function 'import'");
2316 sq_pushstring(v, "save_state", -1);
2317 sq_newclosure(v, &save_state_wrapper, 0);
2318 if(SQ_FAILED(sq_createslot(v, -3))) {
2319 throw SquirrelError(v, "Couldn't register function 'save_state'");
2322 sq_pushstring(v, "add_key", -1);
2323 sq_newclosure(v, &add_key_wrapper, 0);
2324 if(SQ_FAILED(sq_createslot(v, -3))) {
2325 throw SquirrelError(v, "Couldn't register function 'add_key'");
2328 sq_pushstring(v, "debug_collrects", -1);
2329 sq_newclosure(v, &debug_collrects_wrapper, 0);
2330 if(SQ_FAILED(sq_createslot(v, -3))) {
2331 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
2334 sq_pushstring(v, "debug_draw_fps", -1);
2335 sq_newclosure(v, &debug_draw_fps_wrapper, 0);
2336 if(SQ_FAILED(sq_createslot(v, -3))) {
2337 throw SquirrelError(v, "Couldn't register function 'debug_draw_fps'");
2340 sq_pushstring(v, "debug_draw_solids_only", -1);
2341 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
2342 if(SQ_FAILED(sq_createslot(v, -3))) {
2343 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
2346 sq_pushstring(v, "grease", -1);
2347 sq_newclosure(v, &grease_wrapper, 0);
2348 if(SQ_FAILED(sq_createslot(v, -3))) {
2349 throw SquirrelError(v, "Couldn't register function 'grease'");
2352 sq_pushstring(v, "invincible", -1);
2353 sq_newclosure(v, &invincible_wrapper, 0);
2354 if(SQ_FAILED(sq_createslot(v, -3))) {
2355 throw SquirrelError(v, "Couldn't register function 'invincible'");
2358 sq_pushstring(v, "mortal", -1);
2359 sq_newclosure(v, &mortal_wrapper, 0);
2360 if(SQ_FAILED(sq_createslot(v, -3))) {
2361 throw SquirrelError(v, "Couldn't register function 'mortal'");
2364 sq_pushstring(v, "shrink", -1);
2365 sq_newclosure(v, &shrink_wrapper, 0);
2366 if(SQ_FAILED(sq_createslot(v, -3))) {
2367 throw SquirrelError(v, "Couldn't register function 'shrink'");
2370 sq_pushstring(v, "kill", -1);
2371 sq_newclosure(v, &kill_wrapper, 0);
2372 if(SQ_FAILED(sq_createslot(v, -3))) {
2373 throw SquirrelError(v, "Couldn't register function 'kill'");
2376 sq_pushstring(v, "restart", -1);
2377 sq_newclosure(v, &restart_wrapper, 0);
2378 if(SQ_FAILED(sq_createslot(v, -3))) {
2379 throw SquirrelError(v, "Couldn't register function 'restart'");
2382 sq_pushstring(v, "whereami", -1);
2383 sq_newclosure(v, &whereami_wrapper, 0);
2384 if(SQ_FAILED(sq_createslot(v, -3))) {
2385 throw SquirrelError(v, "Couldn't register function 'whereami'");
2388 sq_pushstring(v, "gotoend", -1);
2389 sq_newclosure(v, &gotoend_wrapper, 0);
2390 if(SQ_FAILED(sq_createslot(v, -3))) {
2391 throw SquirrelError(v, "Couldn't register function 'gotoend'");
2394 sq_pushstring(v, "camera", -1);
2395 sq_newclosure(v, &camera_wrapper, 0);
2396 if(SQ_FAILED(sq_createslot(v, -3))) {
2397 throw SquirrelError(v, "Couldn't register function 'camera'");
2400 sq_pushstring(v, "quit", -1);
2401 sq_newclosure(v, &quit_wrapper, 0);
2402 if(SQ_FAILED(sq_createslot(v, -3))) {
2403 throw SquirrelError(v, "Couldn't register function 'quit'");
2406 // Register class DisplayEffect
2407 sq_pushstring(v, "DisplayEffect", -1);
2408 if(sq_newclass(v, SQFalse) < 0) {
2409 std::ostringstream msg;
2410 msg << "Couldn't create new class 'DisplayEffect'";
2411 throw SquirrelError(v, msg.str());
2413 sq_pushstring(v, "fade_out", -1);
2414 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
2415 if(SQ_FAILED(sq_createslot(v, -3))) {
2416 throw SquirrelError(v, "Couldn't register function 'fade_out'");
2419 sq_pushstring(v, "fade_in", -1);
2420 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
2421 if(SQ_FAILED(sq_createslot(v, -3))) {
2422 throw SquirrelError(v, "Couldn't register function 'fade_in'");
2425 sq_pushstring(v, "set_black", -1);
2426 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
2427 if(SQ_FAILED(sq_createslot(v, -3))) {
2428 throw SquirrelError(v, "Couldn't register function 'set_black'");
2431 sq_pushstring(v, "is_black", -1);
2432 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
2433 if(SQ_FAILED(sq_createslot(v, -3))) {
2434 throw SquirrelError(v, "Couldn't register function 'is_black'");
2437 sq_pushstring(v, "sixteen_to_nine", -1);
2438 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
2439 if(SQ_FAILED(sq_createslot(v, -3))) {
2440 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
2443 sq_pushstring(v, "four_to_three", -1);
2444 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
2445 if(SQ_FAILED(sq_createslot(v, -3))) {
2446 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
2449 if(SQ_FAILED(sq_createslot(v, -3))) {
2450 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
2453 // Register class Camera
2454 sq_pushstring(v, "Camera", -1);
2455 if(sq_newclass(v, SQFalse) < 0) {
2456 std::ostringstream msg;
2457 msg << "Couldn't create new class 'Camera'";
2458 throw SquirrelError(v, msg.str());
2460 sq_pushstring(v, "shake", -1);
2461 sq_newclosure(v, &Camera_shake_wrapper, 0);
2462 if(SQ_FAILED(sq_createslot(v, -3))) {
2463 throw SquirrelError(v, "Couldn't register function 'shake'");
2466 sq_pushstring(v, "set_pos", -1);
2467 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
2468 if(SQ_FAILED(sq_createslot(v, -3))) {
2469 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2472 sq_pushstring(v, "set_mode", -1);
2473 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
2474 if(SQ_FAILED(sq_createslot(v, -3))) {
2475 throw SquirrelError(v, "Couldn't register function 'set_mode'");
2478 sq_pushstring(v, "scroll_to", -1);
2479 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
2480 if(SQ_FAILED(sq_createslot(v, -3))) {
2481 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
2484 if(SQ_FAILED(sq_createslot(v, -3))) {
2485 throw SquirrelError(v, "Couldn't register class 'Camera'");
2488 // Register class Level
2489 sq_pushstring(v, "Level", -1);
2490 if(sq_newclass(v, SQFalse) < 0) {
2491 std::ostringstream msg;
2492 msg << "Couldn't create new class 'Level'";
2493 throw SquirrelError(v, msg.str());
2495 sq_pushstring(v, "finish", -1);
2496 sq_newclosure(v, &Level_finish_wrapper, 0);
2497 if(SQ_FAILED(sq_createslot(v, -3))) {
2498 throw SquirrelError(v, "Couldn't register function 'finish'");
2501 sq_pushstring(v, "spawn", -1);
2502 sq_newclosure(v, &Level_spawn_wrapper, 0);
2503 if(SQ_FAILED(sq_createslot(v, -3))) {
2504 throw SquirrelError(v, "Couldn't register function 'spawn'");
2507 sq_pushstring(v, "flip_vertically", -1);
2508 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
2509 if(SQ_FAILED(sq_createslot(v, -3))) {
2510 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
2513 if(SQ_FAILED(sq_createslot(v, -3))) {
2514 throw SquirrelError(v, "Couldn't register class 'Level'");
2517 // Register class ScriptedObject
2518 sq_pushstring(v, "ScriptedObject", -1);
2519 if(sq_newclass(v, SQFalse) < 0) {
2520 std::ostringstream msg;
2521 msg << "Couldn't create new class 'ScriptedObject'";
2522 throw SquirrelError(v, msg.str());
2524 sq_pushstring(v, "set_action", -1);
2525 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
2526 if(SQ_FAILED(sq_createslot(v, -3))) {
2527 throw SquirrelError(v, "Couldn't register function 'set_action'");
2530 sq_pushstring(v, "get_action", -1);
2531 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
2532 if(SQ_FAILED(sq_createslot(v, -3))) {
2533 throw SquirrelError(v, "Couldn't register function 'get_action'");
2536 sq_pushstring(v, "move", -1);
2537 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
2538 if(SQ_FAILED(sq_createslot(v, -3))) {
2539 throw SquirrelError(v, "Couldn't register function 'move'");
2542 sq_pushstring(v, "set_pos", -1);
2543 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
2544 if(SQ_FAILED(sq_createslot(v, -3))) {
2545 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2548 sq_pushstring(v, "get_pos_x", -1);
2549 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
2550 if(SQ_FAILED(sq_createslot(v, -3))) {
2551 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
2554 sq_pushstring(v, "get_pos_y", -1);
2555 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
2556 if(SQ_FAILED(sq_createslot(v, -3))) {
2557 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
2560 sq_pushstring(v, "set_velocity", -1);
2561 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
2562 if(SQ_FAILED(sq_createslot(v, -3))) {
2563 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
2566 sq_pushstring(v, "get_velocity_x", -1);
2567 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
2568 if(SQ_FAILED(sq_createslot(v, -3))) {
2569 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
2572 sq_pushstring(v, "get_velocity_y", -1);
2573 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
2574 if(SQ_FAILED(sq_createslot(v, -3))) {
2575 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
2578 sq_pushstring(v, "set_visible", -1);
2579 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
2580 if(SQ_FAILED(sq_createslot(v, -3))) {
2581 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2584 sq_pushstring(v, "is_visible", -1);
2585 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
2586 if(SQ_FAILED(sq_createslot(v, -3))) {
2587 throw SquirrelError(v, "Couldn't register function 'is_visible'");
2590 sq_pushstring(v, "get_name", -1);
2591 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
2592 if(SQ_FAILED(sq_createslot(v, -3))) {
2593 throw SquirrelError(v, "Couldn't register function 'get_name'");
2596 if(SQ_FAILED(sq_createslot(v, -3))) {
2597 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
2600 // Register class Sound
2601 sq_pushstring(v, "Sound", -1);
2602 if(sq_newclass(v, SQFalse) < 0) {
2603 std::ostringstream msg;
2604 msg << "Couldn't create new class 'Sound'";
2605 throw SquirrelError(v, msg.str());
2607 sq_pushstring(v, "play_music", -1);
2608 sq_newclosure(v, &Sound_play_music_wrapper, 0);
2609 if(SQ_FAILED(sq_createslot(v, -3))) {
2610 throw SquirrelError(v, "Couldn't register function 'play_music'");
2613 sq_pushstring(v, "play", -1);
2614 sq_newclosure(v, &Sound_play_wrapper, 0);
2615 if(SQ_FAILED(sq_createslot(v, -3))) {
2616 throw SquirrelError(v, "Couldn't register function 'play'");
2619 if(SQ_FAILED(sq_createslot(v, -3))) {
2620 throw SquirrelError(v, "Couldn't register class 'Sound'");
2623 // Register class Text
2624 sq_pushstring(v, "Text", -1);
2625 if(sq_newclass(v, SQFalse) < 0) {
2626 std::ostringstream msg;
2627 msg << "Couldn't create new class 'Text'";
2628 throw SquirrelError(v, msg.str());
2630 sq_pushstring(v, "set_text", -1);
2631 sq_newclosure(v, &Text_set_text_wrapper, 0);
2632 if(SQ_FAILED(sq_createslot(v, -3))) {
2633 throw SquirrelError(v, "Couldn't register function 'set_text'");
2636 sq_pushstring(v, "set_font", -1);
2637 sq_newclosure(v, &Text_set_font_wrapper, 0);
2638 if(SQ_FAILED(sq_createslot(v, -3))) {
2639 throw SquirrelError(v, "Couldn't register function 'set_font'");
2642 sq_pushstring(v, "fade_in", -1);
2643 sq_newclosure(v, &Text_fade_in_wrapper, 0);
2644 if(SQ_FAILED(sq_createslot(v, -3))) {
2645 throw SquirrelError(v, "Couldn't register function 'fade_in'");
2648 sq_pushstring(v, "fade_out", -1);
2649 sq_newclosure(v, &Text_fade_out_wrapper, 0);
2650 if(SQ_FAILED(sq_createslot(v, -3))) {
2651 throw SquirrelError(v, "Couldn't register function 'fade_out'");
2654 sq_pushstring(v, "set_visible", -1);
2655 sq_newclosure(v, &Text_set_visible_wrapper, 0);
2656 if(SQ_FAILED(sq_createslot(v, -3))) {
2657 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2660 sq_pushstring(v, "set_centered", -1);
2661 sq_newclosure(v, &Text_set_centered_wrapper, 0);
2662 if(SQ_FAILED(sq_createslot(v, -3))) {
2663 throw SquirrelError(v, "Couldn't register function 'set_centered'");
2666 if(SQ_FAILED(sq_createslot(v, -3))) {
2667 throw SquirrelError(v, "Couldn't register class 'Text'");
2670 // Register class Player
2671 sq_pushstring(v, "Player", -1);
2672 if(sq_newclass(v, SQFalse) < 0) {
2673 std::ostringstream msg;
2674 msg << "Couldn't create new class 'Player'";
2675 throw SquirrelError(v, msg.str());
2677 sq_pushstring(v, "add_bonus", -1);
2678 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
2679 if(SQ_FAILED(sq_createslot(v, -3))) {
2680 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
2683 sq_pushstring(v, "add_coins", -1);
2684 sq_newclosure(v, &Player_add_coins_wrapper, 0);
2685 if(SQ_FAILED(sq_createslot(v, -3))) {
2686 throw SquirrelError(v, "Couldn't register function 'add_coins'");
2689 sq_pushstring(v, "make_invincible", -1);
2690 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
2691 if(SQ_FAILED(sq_createslot(v, -3))) {
2692 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
2695 sq_pushstring(v, "deactivate", -1);
2696 sq_newclosure(v, &Player_deactivate_wrapper, 0);
2697 if(SQ_FAILED(sq_createslot(v, -3))) {
2698 throw SquirrelError(v, "Couldn't register function 'deactivate'");
2701 sq_pushstring(v, "activate", -1);
2702 sq_newclosure(v, &Player_activate_wrapper, 0);
2703 if(SQ_FAILED(sq_createslot(v, -3))) {
2704 throw SquirrelError(v, "Couldn't register function 'activate'");
2707 sq_pushstring(v, "walk", -1);
2708 sq_newclosure(v, &Player_walk_wrapper, 0);
2709 if(SQ_FAILED(sq_createslot(v, -3))) {
2710 throw SquirrelError(v, "Couldn't register function 'walk'");
2713 sq_pushstring(v, "set_visible", -1);
2714 sq_newclosure(v, &Player_set_visible_wrapper, 0);
2715 if(SQ_FAILED(sq_createslot(v, -3))) {
2716 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2719 sq_pushstring(v, "get_visible", -1);
2720 sq_newclosure(v, &Player_get_visible_wrapper, 0);
2721 if(SQ_FAILED(sq_createslot(v, -3))) {
2722 throw SquirrelError(v, "Couldn't register function 'get_visible'");
2725 if(SQ_FAILED(sq_createslot(v, -3))) {
2726 throw SquirrelError(v, "Couldn't register class 'Player'");
2729 // Register class FloatingImage
2730 sq_pushstring(v, "FloatingImage", -1);
2731 if(sq_newclass(v, SQFalse) < 0) {
2732 std::ostringstream msg;
2733 msg << "Couldn't create new class 'FloatingImage'";
2734 throw SquirrelError(v, msg.str());
2736 sq_pushstring(v, "constructor", -1);
2737 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
2738 if(SQ_FAILED(sq_createslot(v, -3))) {
2739 throw SquirrelError(v, "Couldn't register function 'constructor'");
2742 sq_pushstring(v, "set_layer", -1);
2743 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
2744 if(SQ_FAILED(sq_createslot(v, -3))) {
2745 throw SquirrelError(v, "Couldn't register function 'set_layer'");
2748 sq_pushstring(v, "get_layer", -1);
2749 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
2750 if(SQ_FAILED(sq_createslot(v, -3))) {
2751 throw SquirrelError(v, "Couldn't register function 'get_layer'");
2754 sq_pushstring(v, "set_pos", -1);
2755 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
2756 if(SQ_FAILED(sq_createslot(v, -3))) {
2757 throw SquirrelError(v, "Couldn't register function 'set_pos'");
2760 sq_pushstring(v, "get_pos_x", -1);
2761 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
2762 if(SQ_FAILED(sq_createslot(v, -3))) {
2763 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
2766 sq_pushstring(v, "get_pos_y", -1);
2767 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
2768 if(SQ_FAILED(sq_createslot(v, -3))) {
2769 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
2772 sq_pushstring(v, "set_anchor_point", -1);
2773 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
2774 if(SQ_FAILED(sq_createslot(v, -3))) {
2775 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
2778 sq_pushstring(v, "get_anchor_point", -1);
2779 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
2780 if(SQ_FAILED(sq_createslot(v, -3))) {
2781 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
2784 sq_pushstring(v, "set_visible", -1);
2785 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
2786 if(SQ_FAILED(sq_createslot(v, -3))) {
2787 throw SquirrelError(v, "Couldn't register function 'set_visible'");
2790 sq_pushstring(v, "get_visible", -1);
2791 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
2792 if(SQ_FAILED(sq_createslot(v, -3))) {
2793 throw SquirrelError(v, "Couldn't register function 'get_visible'");
2796 if(SQ_FAILED(sq_createslot(v, -3))) {
2797 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
2802 } // end of namespace Scripting