2 * WARNING: This file is automatically generated from:
3 * 'src/scripting/wrapper.interface.hpp'
13 #include "squirrel_error.hpp"
14 #include "wrapper.interface.hpp"
21 static SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger )
23 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (ptr);
28 static SQInteger DisplayEffect_fade_out_wrapper(HSQUIRRELVM vm)
31 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
32 sq_throwerror(vm, _SC("'fade_out' called without instance"));
35 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
37 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
38 sq_throwerror(vm, _SC("Argument 1 not a float"));
43 _this->fade_out(static_cast<float> (arg0));
47 } catch(std::exception& e) {
48 sq_throwerror(vm, e.what());
51 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
57 static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm)
60 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
61 sq_throwerror(vm, _SC("'fade_in' called without instance"));
64 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
66 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
67 sq_throwerror(vm, _SC("Argument 1 not a float"));
72 _this->fade_in(static_cast<float> (arg0));
76 } catch(std::exception& e) {
77 sq_throwerror(vm, e.what());
80 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
86 static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm)
89 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
90 sq_throwerror(vm, _SC("'set_black' called without instance"));
93 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
95 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
96 sq_throwerror(vm, _SC("Argument 1 not a bool"));
101 _this->set_black(arg0 == SQTrue);
105 } catch(std::exception& e) {
106 sq_throwerror(vm, e.what());
109 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_black'"));
115 static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm)
118 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
119 sq_throwerror(vm, _SC("'is_black' called without instance"));
122 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
125 bool return_value = _this->is_black();
127 sq_pushbool(vm, return_value);
130 } catch(std::exception& e) {
131 sq_throwerror(vm, e.what());
134 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_black'"));
140 static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm)
143 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
144 sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance"));
147 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
149 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
150 sq_throwerror(vm, _SC("Argument 1 not a float"));
155 _this->sixteen_to_nine(static_cast<float> (arg0));
159 } catch(std::exception& e) {
160 sq_throwerror(vm, e.what());
163 sq_throwerror(vm, _SC("Unexpected exception while executing function 'sixteen_to_nine'"));
169 static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm)
172 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
173 sq_throwerror(vm, _SC("'four_to_three' called without instance"));
176 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
178 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
179 sq_throwerror(vm, _SC("Argument 1 not a float"));
184 _this->four_to_three(static_cast<float> (arg0));
188 } catch(std::exception& e) {
189 sq_throwerror(vm, e.what());
192 sq_throwerror(vm, _SC("Unexpected exception while executing function 'four_to_three'"));
198 static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger )
200 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
205 static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm)
208 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
209 sq_throwerror(vm, _SC("'shake' called without instance"));
212 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
214 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
215 sq_throwerror(vm, _SC("Argument 1 not a float"));
219 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
220 sq_throwerror(vm, _SC("Argument 2 not a float"));
224 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
225 sq_throwerror(vm, _SC("Argument 3 not a float"));
230 _this->shake(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
234 } catch(std::exception& e) {
235 sq_throwerror(vm, e.what());
238 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'"));
244 static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm)
247 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
248 sq_throwerror(vm, _SC("'set_pos' called without instance"));
251 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
253 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
254 sq_throwerror(vm, _SC("Argument 1 not a float"));
258 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
259 sq_throwerror(vm, _SC("Argument 2 not a float"));
264 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
268 } catch(std::exception& e) {
269 sq_throwerror(vm, e.what());
272 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
278 static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm)
281 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
282 sq_throwerror(vm, _SC("'set_mode' called without instance"));
285 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
287 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
288 sq_throwerror(vm, _SC("Argument 1 not a string"));
293 _this->set_mode(arg0);
297 } catch(std::exception& e) {
298 sq_throwerror(vm, e.what());
301 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_mode'"));
307 static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm)
310 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
311 sq_throwerror(vm, _SC("'scroll_to' called without instance"));
314 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
316 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
317 sq_throwerror(vm, _SC("Argument 1 not a float"));
321 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
322 sq_throwerror(vm, _SC("Argument 2 not a float"));
326 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
327 sq_throwerror(vm, _SC("Argument 3 not a float"));
332 _this->scroll_to(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
336 } catch(std::exception& e) {
337 sq_throwerror(vm, e.what());
340 sq_throwerror(vm, _SC("Unexpected exception while executing function 'scroll_to'"));
346 static SQInteger Level_release_hook(SQUserPointer ptr, SQInteger )
348 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
353 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
356 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
357 sq_throwerror(vm, _SC("'finish' called without instance"));
360 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
362 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
363 sq_throwerror(vm, _SC("Argument 1 not a bool"));
368 _this->finish(arg0 == SQTrue);
372 } catch(std::exception& e) {
373 sq_throwerror(vm, e.what());
376 sq_throwerror(vm, _SC("Unexpected exception while executing function 'finish'"));
382 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
385 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
386 sq_throwerror(vm, _SC("'spawn' called without instance"));
389 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
391 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
392 sq_throwerror(vm, _SC("Argument 1 not a string"));
396 if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
397 sq_throwerror(vm, _SC("Argument 2 not a string"));
402 _this->spawn(arg0, arg1);
406 } catch(std::exception& e) {
407 sq_throwerror(vm, e.what());
410 sq_throwerror(vm, _SC("Unexpected exception while executing function 'spawn'"));
416 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
419 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
420 sq_throwerror(vm, _SC("'flip_vertically' called without instance"));
423 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
426 _this->flip_vertically();
430 } catch(std::exception& e) {
431 sq_throwerror(vm, e.what());
434 sq_throwerror(vm, _SC("Unexpected exception while executing function 'flip_vertically'"));
440 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
443 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
444 sq_throwerror(vm, _SC("'toggle_pause' called without instance"));
447 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
450 _this->toggle_pause();
454 } catch(std::exception& e) {
455 sq_throwerror(vm, e.what());
458 sq_throwerror(vm, _SC("Unexpected exception while executing function 'toggle_pause'"));
464 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
466 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
471 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
474 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
475 sq_throwerror(vm, _SC("'set_action' called without instance"));
478 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
480 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
481 sq_throwerror(vm, _SC("Argument 1 not a string"));
486 _this->set_action(arg0);
490 } catch(std::exception& e) {
491 sq_throwerror(vm, e.what());
494 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
500 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
503 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
504 sq_throwerror(vm, _SC("'get_action' called without instance"));
507 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
510 std::string return_value = _this->get_action();
512 sq_pushstring(vm, return_value.c_str(), return_value.size());
515 } catch(std::exception& e) {
516 sq_throwerror(vm, e.what());
519 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
525 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
528 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
529 sq_throwerror(vm, _SC("'move' called without instance"));
532 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
534 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
535 sq_throwerror(vm, _SC("Argument 1 not a float"));
539 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
540 sq_throwerror(vm, _SC("Argument 2 not a float"));
545 _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
549 } catch(std::exception& e) {
550 sq_throwerror(vm, e.what());
553 sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
559 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
562 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
563 sq_throwerror(vm, _SC("'set_pos' called without instance"));
566 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
568 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
569 sq_throwerror(vm, _SC("Argument 1 not a float"));
573 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
574 sq_throwerror(vm, _SC("Argument 2 not a float"));
579 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
583 } catch(std::exception& e) {
584 sq_throwerror(vm, e.what());
587 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
593 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
596 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
597 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
600 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
603 float return_value = _this->get_pos_x();
605 sq_pushfloat(vm, return_value);
608 } catch(std::exception& e) {
609 sq_throwerror(vm, e.what());
612 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
618 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
621 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
622 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
625 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
628 float return_value = _this->get_pos_y();
630 sq_pushfloat(vm, return_value);
633 } catch(std::exception& e) {
634 sq_throwerror(vm, e.what());
637 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
643 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
646 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
647 sq_throwerror(vm, _SC("'set_velocity' called without instance"));
650 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
652 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
653 sq_throwerror(vm, _SC("Argument 1 not a float"));
657 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
658 sq_throwerror(vm, _SC("Argument 2 not a float"));
663 _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
667 } catch(std::exception& e) {
668 sq_throwerror(vm, e.what());
671 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
677 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
680 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
681 sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
684 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
687 float return_value = _this->get_velocity_x();
689 sq_pushfloat(vm, return_value);
692 } catch(std::exception& e) {
693 sq_throwerror(vm, e.what());
696 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
702 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
705 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
706 sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
709 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
712 float return_value = _this->get_velocity_y();
714 sq_pushfloat(vm, return_value);
717 } catch(std::exception& e) {
718 sq_throwerror(vm, e.what());
721 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
727 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
730 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
731 sq_throwerror(vm, _SC("'set_visible' called without instance"));
734 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
736 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
737 sq_throwerror(vm, _SC("Argument 1 not a bool"));
742 _this->set_visible(arg0 == SQTrue);
746 } catch(std::exception& e) {
747 sq_throwerror(vm, e.what());
750 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
756 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
759 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
760 sq_throwerror(vm, _SC("'is_visible' called without instance"));
763 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
766 bool return_value = _this->is_visible();
768 sq_pushbool(vm, return_value);
771 } catch(std::exception& e) {
772 sq_throwerror(vm, e.what());
775 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
781 static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm)
784 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
785 sq_throwerror(vm, _SC("'set_solid' called without instance"));
788 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
790 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
791 sq_throwerror(vm, _SC("Argument 1 not a bool"));
796 _this->set_solid(arg0 == SQTrue);
800 } catch(std::exception& e) {
801 sq_throwerror(vm, e.what());
804 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_solid'"));
810 static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm)
813 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
814 sq_throwerror(vm, _SC("'is_solid' called without instance"));
817 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
820 bool return_value = _this->is_solid();
822 sq_pushbool(vm, return_value);
825 } catch(std::exception& e) {
826 sq_throwerror(vm, e.what());
829 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_solid'"));
835 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
838 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
839 sq_throwerror(vm, _SC("'get_name' called without instance"));
842 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
845 std::string return_value = _this->get_name();
847 sq_pushstring(vm, return_value.c_str(), return_value.size());
850 } catch(std::exception& e) {
851 sq_throwerror(vm, e.what());
854 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
860 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
862 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
867 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
870 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
871 sq_throwerror(vm, _SC("'set_text' called without instance"));
874 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
876 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
877 sq_throwerror(vm, _SC("Argument 1 not a string"));
882 _this->set_text(arg0);
886 } catch(std::exception& e) {
887 sq_throwerror(vm, e.what());
890 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
896 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
899 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
900 sq_throwerror(vm, _SC("'set_font' called without instance"));
903 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
905 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
906 sq_throwerror(vm, _SC("Argument 1 not a string"));
911 _this->set_font(arg0);
915 } catch(std::exception& e) {
916 sq_throwerror(vm, e.what());
919 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
925 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
928 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
929 sq_throwerror(vm, _SC("'fade_in' called without instance"));
932 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
934 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
935 sq_throwerror(vm, _SC("Argument 1 not a float"));
940 _this->fade_in(static_cast<float> (arg0));
944 } catch(std::exception& e) {
945 sq_throwerror(vm, e.what());
948 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
954 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
957 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
958 sq_throwerror(vm, _SC("'fade_out' called without instance"));
961 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
963 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
964 sq_throwerror(vm, _SC("Argument 1 not a float"));
969 _this->fade_out(static_cast<float> (arg0));
973 } catch(std::exception& e) {
974 sq_throwerror(vm, e.what());
977 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
983 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
986 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
987 sq_throwerror(vm, _SC("'set_visible' called without instance"));
990 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
992 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
993 sq_throwerror(vm, _SC("Argument 1 not a bool"));
998 _this->set_visible(arg0 == SQTrue);
1002 } catch(std::exception& e) {
1003 sq_throwerror(vm, e.what());
1006 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1012 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
1015 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1016 sq_throwerror(vm, _SC("'set_centered' called without instance"));
1019 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1021 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1022 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1027 _this->set_centered(arg0 == SQTrue);
1031 } catch(std::exception& e) {
1032 sq_throwerror(vm, e.what());
1035 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
1041 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
1043 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
1048 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
1051 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1052 sq_throwerror(vm, _SC("'add_bonus' called without instance"));
1055 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1057 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1058 sq_throwerror(vm, _SC("Argument 1 not a string"));
1063 _this->add_bonus(arg0);
1067 } catch(std::exception& e) {
1068 sq_throwerror(vm, e.what());
1071 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1077 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
1080 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1081 sq_throwerror(vm, _SC("'add_coins' called without instance"));
1084 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1086 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1087 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1092 _this->add_coins(static_cast<int> (arg0));
1096 } catch(std::exception& e) {
1097 sq_throwerror(vm, e.what());
1100 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1106 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1109 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1110 sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1113 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1116 _this->make_invincible();
1120 } catch(std::exception& e) {
1121 sq_throwerror(vm, e.what());
1124 sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1130 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1133 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1134 sq_throwerror(vm, _SC("'deactivate' called without instance"));
1137 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1140 _this->deactivate();
1144 } catch(std::exception& e) {
1145 sq_throwerror(vm, e.what());
1148 sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1154 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1157 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1158 sq_throwerror(vm, _SC("'activate' called without instance"));
1161 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1168 } catch(std::exception& e) {
1169 sq_throwerror(vm, e.what());
1172 sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1178 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1181 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1182 sq_throwerror(vm, _SC("'walk' called without instance"));
1185 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1187 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1188 sq_throwerror(vm, _SC("Argument 1 not a float"));
1193 _this->walk(static_cast<float> (arg0));
1197 } catch(std::exception& e) {
1198 sq_throwerror(vm, e.what());
1201 sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1207 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1210 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1211 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1214 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1216 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1217 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1222 _this->set_visible(arg0 == SQTrue);
1226 } catch(std::exception& e) {
1227 sq_throwerror(vm, e.what());
1230 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1236 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1239 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1240 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1243 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1246 bool return_value = _this->get_visible();
1248 sq_pushbool(vm, return_value);
1251 } catch(std::exception& e) {
1252 sq_throwerror(vm, e.what());
1255 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1261 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1264 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1265 sq_throwerror(vm, _SC("'kill' called without instance"));
1268 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1270 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1271 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1276 _this->kill(arg0 == SQTrue);
1280 } catch(std::exception& e) {
1281 sq_throwerror(vm, e.what());
1284 sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1290 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1293 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1294 sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1297 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1299 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1300 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1305 _this->set_ghost_mode(arg0 == SQTrue);
1309 } catch(std::exception& e) {
1310 sq_throwerror(vm, e.what());
1313 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1319 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1322 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1323 sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1326 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1329 bool return_value = _this->get_ghost_mode();
1331 sq_pushbool(vm, return_value);
1334 } catch(std::exception& e) {
1335 sq_throwerror(vm, e.what());
1338 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1344 static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm)
1347 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1348 sq_throwerror(vm, _SC("'do_cheer' called without instance"));
1351 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1358 } catch(std::exception& e) {
1359 sq_throwerror(vm, e.what());
1362 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'"));
1368 static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm)
1371 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1372 sq_throwerror(vm, _SC("'do_duck' called without instance"));
1375 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1382 } catch(std::exception& e) {
1383 sq_throwerror(vm, e.what());
1386 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'"));
1392 static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm)
1395 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1396 sq_throwerror(vm, _SC("'do_standup' called without instance"));
1399 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1402 _this->do_standup();
1406 } catch(std::exception& e) {
1407 sq_throwerror(vm, e.what());
1410 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'"));
1416 static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm)
1419 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1420 sq_throwerror(vm, _SC("'do_backflip' called without instance"));
1423 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1426 _this->do_backflip();
1430 } catch(std::exception& e) {
1431 sq_throwerror(vm, e.what());
1434 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'"));
1440 static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm)
1443 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1444 sq_throwerror(vm, _SC("'do_jump' called without instance"));
1447 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1449 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1450 sq_throwerror(vm, _SC("Argument 1 not a float"));
1455 _this->do_jump(static_cast<float> (arg0));
1459 } catch(std::exception& e) {
1460 sq_throwerror(vm, e.what());
1463 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_jump'"));
1469 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1471 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1476 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1479 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1480 sq_throwerror(vm, _SC("Argument 1 not a string"));
1485 Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1486 if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1487 sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1490 sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1494 } catch(std::exception& e) {
1495 sq_throwerror(vm, e.what());
1498 sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1504 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1507 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1508 sq_throwerror(vm, _SC("'set_layer' called without instance"));
1511 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1513 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1514 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1519 _this->set_layer(static_cast<int> (arg0));
1523 } catch(std::exception& e) {
1524 sq_throwerror(vm, e.what());
1527 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1533 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1536 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1537 sq_throwerror(vm, _SC("'get_layer' called without instance"));
1540 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1543 int return_value = _this->get_layer();
1545 sq_pushinteger(vm, return_value);
1548 } catch(std::exception& e) {
1549 sq_throwerror(vm, e.what());
1552 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1558 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1561 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1562 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1565 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1567 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1568 sq_throwerror(vm, _SC("Argument 1 not a float"));
1572 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1573 sq_throwerror(vm, _SC("Argument 2 not a float"));
1578 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1582 } catch(std::exception& e) {
1583 sq_throwerror(vm, e.what());
1586 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1592 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1595 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1596 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1599 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1602 float return_value = _this->get_pos_x();
1604 sq_pushfloat(vm, return_value);
1607 } catch(std::exception& e) {
1608 sq_throwerror(vm, e.what());
1611 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1617 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1620 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1621 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1624 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1627 float return_value = _this->get_pos_y();
1629 sq_pushfloat(vm, return_value);
1632 } catch(std::exception& e) {
1633 sq_throwerror(vm, e.what());
1636 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1642 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1645 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1646 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1649 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1651 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1652 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1657 _this->set_anchor_point(static_cast<int> (arg0));
1661 } catch(std::exception& e) {
1662 sq_throwerror(vm, e.what());
1665 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1671 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1674 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1675 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1678 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1681 int return_value = _this->get_anchor_point();
1683 sq_pushinteger(vm, return_value);
1686 } catch(std::exception& e) {
1687 sq_throwerror(vm, e.what());
1690 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1696 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1699 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1700 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1703 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1705 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1706 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1711 _this->set_visible(arg0 == SQTrue);
1715 } catch(std::exception& e) {
1716 sq_throwerror(vm, e.what());
1719 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1725 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1728 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1729 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1732 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1735 bool return_value = _this->get_visible();
1737 sq_pushbool(vm, return_value);
1740 } catch(std::exception& e) {
1741 sq_throwerror(vm, e.what());
1744 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1750 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
1753 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1754 sq_throwerror(vm, _SC("'set_action' called without instance"));
1757 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1759 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1760 sq_throwerror(vm, _SC("Argument 1 not a string"));
1765 _this->set_action(arg0);
1769 } catch(std::exception& e) {
1770 sq_throwerror(vm, e.what());
1773 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1779 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
1782 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1783 sq_throwerror(vm, _SC("'get_action' called without instance"));
1786 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1789 std::string return_value = _this->get_action();
1791 sq_pushstring(vm, return_value.c_str(), return_value.size());
1794 } catch(std::exception& e) {
1795 sq_throwerror(vm, e.what());
1798 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1804 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1806 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
1811 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1814 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1815 sq_throwerror(vm, _SC("'goto_node' called without instance"));
1818 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1820 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1821 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1826 _this->goto_node(static_cast<int> (arg0));
1830 } catch(std::exception& e) {
1831 sq_throwerror(vm, e.what());
1834 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1840 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1843 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1844 sq_throwerror(vm, _SC("'start_moving' called without instance"));
1847 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1850 _this->start_moving();
1854 } catch(std::exception& e) {
1855 sq_throwerror(vm, e.what());
1858 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
1864 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1867 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1868 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1871 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1874 _this->stop_moving();
1878 } catch(std::exception& e) {
1879 sq_throwerror(vm, e.what());
1882 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1888 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
1890 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (ptr);
1895 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
1898 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1899 sq_throwerror(vm, _SC("'get_burning' called without instance"));
1902 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1905 bool return_value = _this->get_burning();
1907 sq_pushbool(vm, return_value);
1910 } catch(std::exception& e) {
1911 sq_throwerror(vm, e.what());
1914 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
1920 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
1923 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1924 sq_throwerror(vm, _SC("'set_burning' called without instance"));
1927 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1929 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1930 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1935 _this->set_burning(arg0 == SQTrue);
1939 } catch(std::exception& e) {
1940 sq_throwerror(vm, e.what());
1943 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_burning'"));
1949 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
1951 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (ptr);
1956 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
1959 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1960 sq_throwerror(vm, _SC("'start' called without instance"));
1963 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
1970 } catch(std::exception& e) {
1971 sq_throwerror(vm, e.what());
1974 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
1980 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
1983 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1984 sq_throwerror(vm, _SC("'stop' called without instance"));
1987 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
1994 } catch(std::exception& e) {
1995 sq_throwerror(vm, e.what());
1998 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2004 static SQInteger AmbientSound_release_hook(SQUserPointer ptr, SQInteger )
2006 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (ptr);
2011 static SQInteger AmbientSound_set_pos_wrapper(HSQUIRRELVM vm)
2014 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2015 sq_throwerror(vm, _SC("'set_pos' called without instance"));
2018 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2020 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2021 sq_throwerror(vm, _SC("Argument 1 not a float"));
2025 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2026 sq_throwerror(vm, _SC("Argument 2 not a float"));
2031 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
2035 } catch(std::exception& e) {
2036 sq_throwerror(vm, e.what());
2039 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
2045 static SQInteger AmbientSound_get_pos_x_wrapper(HSQUIRRELVM vm)
2048 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2049 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
2052 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2055 float return_value = _this->get_pos_x();
2057 sq_pushfloat(vm, return_value);
2060 } catch(std::exception& e) {
2061 sq_throwerror(vm, e.what());
2064 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
2070 static SQInteger AmbientSound_get_pos_y_wrapper(HSQUIRRELVM vm)
2073 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2074 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
2077 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2080 float return_value = _this->get_pos_y();
2082 sq_pushfloat(vm, return_value);
2085 } catch(std::exception& e) {
2086 sq_throwerror(vm, e.what());
2089 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
2095 static SQInteger display_wrapper(HSQUIRRELVM vm)
2097 return Scripting::display(vm);
2100 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
2102 HSQUIRRELVM arg0 = vm;
2105 Scripting::print_stacktrace(arg0);
2109 } catch(std::exception& e) {
2110 sq_throwerror(vm, e.what());
2113 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
2119 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
2121 return Scripting::get_current_thread(vm);
2124 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
2127 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2128 sq_throwerror(vm, _SC("Argument 1 not a string"));
2133 Scripting::display_text_file(arg0);
2137 } catch(std::exception& e) {
2138 sq_throwerror(vm, e.what());
2141 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
2147 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
2150 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2151 sq_throwerror(vm, _SC("Argument 1 not a string"));
2156 Scripting::load_worldmap(arg0);
2160 } catch(std::exception& e) {
2161 sq_throwerror(vm, e.what());
2164 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
2170 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
2173 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2174 sq_throwerror(vm, _SC("Argument 1 not a string"));
2179 Scripting::load_level(arg0);
2183 } catch(std::exception& e) {
2184 sq_throwerror(vm, e.what());
2187 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
2193 static SQInteger wait_wrapper(HSQUIRRELVM vm)
2195 HSQUIRRELVM arg0 = vm;
2197 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
2198 sq_throwerror(vm, _SC("Argument 1 not a float"));
2203 Scripting::wait(arg0, static_cast<float> (arg1));
2205 return sq_suspendvm(vm);
2207 } catch(std::exception& e) {
2208 sq_throwerror(vm, e.what());
2211 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
2217 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
2219 HSQUIRRELVM arg0 = vm;
2222 Scripting::wait_for_screenswitch(arg0);
2224 return sq_suspendvm(vm);
2226 } catch(std::exception& e) {
2227 sq_throwerror(vm, e.what());
2230 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
2236 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
2241 Scripting::exit_screen();
2245 } catch(std::exception& e) {
2246 sq_throwerror(vm, e.what());
2249 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
2255 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
2258 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2259 sq_throwerror(vm, _SC("Argument 1 not a float"));
2264 Scripting::fadeout_screen(static_cast<float> (arg0));
2268 } catch(std::exception& e) {
2269 sq_throwerror(vm, e.what());
2272 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
2278 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
2281 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2282 sq_throwerror(vm, _SC("Argument 1 not a float"));
2286 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2287 sq_throwerror(vm, _SC("Argument 2 not a float"));
2291 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2292 sq_throwerror(vm, _SC("Argument 3 not a float"));
2297 Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2301 } catch(std::exception& e) {
2302 sq_throwerror(vm, e.what());
2305 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
2311 static SQInteger translate_wrapper(HSQUIRRELVM vm)
2314 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2315 sq_throwerror(vm, _SC("Argument 1 not a string"));
2320 std::string return_value = Scripting::translate(arg0);
2322 sq_pushstring(vm, return_value.c_str(), return_value.size());
2325 } catch(std::exception& e) {
2326 sq_throwerror(vm, e.what());
2329 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
2335 static SQInteger import_wrapper(HSQUIRRELVM vm)
2337 HSQUIRRELVM arg0 = vm;
2339 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
2340 sq_throwerror(vm, _SC("Argument 1 not a string"));
2345 Scripting::import(arg0, arg1);
2349 } catch(std::exception& e) {
2350 sq_throwerror(vm, e.what());
2353 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
2359 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
2364 Scripting::save_state();
2368 } catch(std::exception& e) {
2369 sq_throwerror(vm, e.what());
2372 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
2378 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
2381 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2382 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2387 Scripting::debug_collrects(arg0 == SQTrue);
2391 } catch(std::exception& e) {
2392 sq_throwerror(vm, e.what());
2395 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
2401 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
2404 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2405 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2410 Scripting::debug_show_fps(arg0 == SQTrue);
2414 } catch(std::exception& e) {
2415 sq_throwerror(vm, e.what());
2418 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
2424 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
2427 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2428 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2433 Scripting::debug_draw_solids_only(arg0 == SQTrue);
2437 } catch(std::exception& e) {
2438 sq_throwerror(vm, e.what());
2441 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
2447 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
2450 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2451 sq_throwerror(vm, _SC("Argument 1 not a string"));
2456 Scripting::play_music(arg0);
2460 } catch(std::exception& e) {
2461 sq_throwerror(vm, e.what());
2464 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
2470 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
2473 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2474 sq_throwerror(vm, _SC("Argument 1 not a string"));
2479 Scripting::play_sound(arg0);
2483 } catch(std::exception& e) {
2484 sq_throwerror(vm, e.what());
2487 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
2493 static SQInteger grease_wrapper(HSQUIRRELVM vm)
2498 Scripting::grease();
2502 } catch(std::exception& e) {
2503 sq_throwerror(vm, e.what());
2506 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
2512 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
2517 Scripting::invincible();
2521 } catch(std::exception& e) {
2522 sq_throwerror(vm, e.what());
2525 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
2531 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
2540 } catch(std::exception& e) {
2541 sq_throwerror(vm, e.what());
2544 sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
2550 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
2555 Scripting::mortal();
2559 } catch(std::exception& e) {
2560 sq_throwerror(vm, e.what());
2563 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
2569 static SQInteger restart_wrapper(HSQUIRRELVM vm)
2574 Scripting::restart();
2578 } catch(std::exception& e) {
2579 sq_throwerror(vm, e.what());
2582 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
2588 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
2593 Scripting::whereami();
2597 } catch(std::exception& e) {
2598 sq_throwerror(vm, e.what());
2601 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
2607 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
2612 Scripting::gotoend();
2616 } catch(std::exception& e) {
2617 sq_throwerror(vm, e.what());
2620 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
2626 static SQInteger camera_wrapper(HSQUIRRELVM vm)
2631 Scripting::camera();
2635 } catch(std::exception& e) {
2636 sq_throwerror(vm, e.what());
2639 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
2645 static SQInteger quit_wrapper(HSQUIRRELVM vm)
2654 } catch(std::exception& e) {
2655 sq_throwerror(vm, e.what());
2658 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
2664 static SQInteger rand_wrapper(HSQUIRRELVM vm)
2668 int return_value = Scripting::rand();
2670 sq_pushinteger(vm, return_value);
2673 } catch(std::exception& e) {
2674 sq_throwerror(vm, e.what());
2677 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
2683 } // end of namespace Wrapper
2685 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
2687 using namespace Wrapper;
2689 sq_pushroottable(v);
2690 sq_pushstring(v, "DisplayEffect", -1);
2691 if(SQ_FAILED(sq_get(v, -2))) {
2692 std::ostringstream msg;
2693 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
2694 throw SquirrelError(v, msg.str());
2697 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2698 std::ostringstream msg;
2699 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
2700 throw SquirrelError(v, msg.str());
2702 sq_remove(v, -2); // remove object name
2704 if(setup_releasehook) {
2705 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
2708 sq_remove(v, -2); // remove root table
2711 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
2713 using namespace Wrapper;
2715 sq_pushroottable(v);
2716 sq_pushstring(v, "Camera", -1);
2717 if(SQ_FAILED(sq_get(v, -2))) {
2718 std::ostringstream msg;
2719 msg << "Couldn't resolved squirrel type 'Camera'";
2720 throw SquirrelError(v, msg.str());
2723 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2724 std::ostringstream msg;
2725 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
2726 throw SquirrelError(v, msg.str());
2728 sq_remove(v, -2); // remove object name
2730 if(setup_releasehook) {
2731 sq_setreleasehook(v, -1, Camera_release_hook);
2734 sq_remove(v, -2); // remove root table
2737 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
2739 using namespace Wrapper;
2741 sq_pushroottable(v);
2742 sq_pushstring(v, "Level", -1);
2743 if(SQ_FAILED(sq_get(v, -2))) {
2744 std::ostringstream msg;
2745 msg << "Couldn't resolved squirrel type 'Level'";
2746 throw SquirrelError(v, msg.str());
2749 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2750 std::ostringstream msg;
2751 msg << "Couldn't setup squirrel instance for object of type 'Level'";
2752 throw SquirrelError(v, msg.str());
2754 sq_remove(v, -2); // remove object name
2756 if(setup_releasehook) {
2757 sq_setreleasehook(v, -1, Level_release_hook);
2760 sq_remove(v, -2); // remove root table
2763 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
2765 using namespace Wrapper;
2767 sq_pushroottable(v);
2768 sq_pushstring(v, "ScriptedObject", -1);
2769 if(SQ_FAILED(sq_get(v, -2))) {
2770 std::ostringstream msg;
2771 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
2772 throw SquirrelError(v, msg.str());
2775 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2776 std::ostringstream msg;
2777 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
2778 throw SquirrelError(v, msg.str());
2780 sq_remove(v, -2); // remove object name
2782 if(setup_releasehook) {
2783 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
2786 sq_remove(v, -2); // remove root table
2789 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
2791 using namespace Wrapper;
2793 sq_pushroottable(v);
2794 sq_pushstring(v, "Text", -1);
2795 if(SQ_FAILED(sq_get(v, -2))) {
2796 std::ostringstream msg;
2797 msg << "Couldn't resolved squirrel type 'Text'";
2798 throw SquirrelError(v, msg.str());
2801 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2802 std::ostringstream msg;
2803 msg << "Couldn't setup squirrel instance for object of type 'Text'";
2804 throw SquirrelError(v, msg.str());
2806 sq_remove(v, -2); // remove object name
2808 if(setup_releasehook) {
2809 sq_setreleasehook(v, -1, Text_release_hook);
2812 sq_remove(v, -2); // remove root table
2815 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
2817 using namespace Wrapper;
2819 sq_pushroottable(v);
2820 sq_pushstring(v, "Player", -1);
2821 if(SQ_FAILED(sq_get(v, -2))) {
2822 std::ostringstream msg;
2823 msg << "Couldn't resolved squirrel type 'Player'";
2824 throw SquirrelError(v, msg.str());
2827 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2828 std::ostringstream msg;
2829 msg << "Couldn't setup squirrel instance for object of type 'Player'";
2830 throw SquirrelError(v, msg.str());
2832 sq_remove(v, -2); // remove object name
2834 if(setup_releasehook) {
2835 sq_setreleasehook(v, -1, Player_release_hook);
2838 sq_remove(v, -2); // remove root table
2841 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
2843 using namespace Wrapper;
2845 sq_pushroottable(v);
2846 sq_pushstring(v, "FloatingImage", -1);
2847 if(SQ_FAILED(sq_get(v, -2))) {
2848 std::ostringstream msg;
2849 msg << "Couldn't resolved squirrel type 'FloatingImage'";
2850 throw SquirrelError(v, msg.str());
2853 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2854 std::ostringstream msg;
2855 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
2856 throw SquirrelError(v, msg.str());
2858 sq_remove(v, -2); // remove object name
2860 if(setup_releasehook) {
2861 sq_setreleasehook(v, -1, FloatingImage_release_hook);
2864 sq_remove(v, -2); // remove root table
2867 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
2869 using namespace Wrapper;
2871 sq_pushroottable(v);
2872 sq_pushstring(v, "Platform", -1);
2873 if(SQ_FAILED(sq_get(v, -2))) {
2874 std::ostringstream msg;
2875 msg << "Couldn't resolved squirrel type 'Platform'";
2876 throw SquirrelError(v, msg.str());
2879 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2880 std::ostringstream msg;
2881 msg << "Couldn't setup squirrel instance for object of type 'Platform'";
2882 throw SquirrelError(v, msg.str());
2884 sq_remove(v, -2); // remove object name
2886 if(setup_releasehook) {
2887 sq_setreleasehook(v, -1, Platform_release_hook);
2890 sq_remove(v, -2); // remove root table
2893 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
2895 using namespace Wrapper;
2897 sq_pushroottable(v);
2898 sq_pushstring(v, "Candle", -1);
2899 if(SQ_FAILED(sq_get(v, -2))) {
2900 std::ostringstream msg;
2901 msg << "Couldn't resolved squirrel type 'Candle'";
2902 throw SquirrelError(v, msg.str());
2905 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2906 std::ostringstream msg;
2907 msg << "Couldn't setup squirrel instance for object of type 'Candle'";
2908 throw SquirrelError(v, msg.str());
2910 sq_remove(v, -2); // remove object name
2912 if(setup_releasehook) {
2913 sq_setreleasehook(v, -1, Candle_release_hook);
2916 sq_remove(v, -2); // remove root table
2919 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
2921 using namespace Wrapper;
2923 sq_pushroottable(v);
2924 sq_pushstring(v, "Wind", -1);
2925 if(SQ_FAILED(sq_get(v, -2))) {
2926 std::ostringstream msg;
2927 msg << "Couldn't resolved squirrel type 'Wind'";
2928 throw SquirrelError(v, msg.str());
2931 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2932 std::ostringstream msg;
2933 msg << "Couldn't setup squirrel instance for object of type 'Wind'";
2934 throw SquirrelError(v, msg.str());
2936 sq_remove(v, -2); // remove object name
2938 if(setup_releasehook) {
2939 sq_setreleasehook(v, -1, Wind_release_hook);
2942 sq_remove(v, -2); // remove root table
2945 void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bool setup_releasehook)
2947 using namespace Wrapper;
2949 sq_pushroottable(v);
2950 sq_pushstring(v, "AmbientSound", -1);
2951 if(SQ_FAILED(sq_get(v, -2))) {
2952 std::ostringstream msg;
2953 msg << "Couldn't resolved squirrel type 'AmbientSound'";
2954 throw SquirrelError(v, msg.str());
2957 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2958 std::ostringstream msg;
2959 msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'";
2960 throw SquirrelError(v, msg.str());
2962 sq_remove(v, -2); // remove object name
2964 if(setup_releasehook) {
2965 sq_setreleasehook(v, -1, AmbientSound_release_hook);
2968 sq_remove(v, -2); // remove root table
2971 void register_supertux_wrapper(HSQUIRRELVM v)
2973 using namespace Wrapper;
2975 sq_pushstring(v, "ANCHOR_TOP", -1);
2976 sq_pushinteger(v, 16);
2977 if(SQ_FAILED(sq_createslot(v, -3))) {
2978 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
2981 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
2982 sq_pushinteger(v, 32);
2983 if(SQ_FAILED(sq_createslot(v, -3))) {
2984 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
2987 sq_pushstring(v, "ANCHOR_LEFT", -1);
2988 sq_pushinteger(v, 1);
2989 if(SQ_FAILED(sq_createslot(v, -3))) {
2990 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
2993 sq_pushstring(v, "ANCHOR_RIGHT", -1);
2994 sq_pushinteger(v, 2);
2995 if(SQ_FAILED(sq_createslot(v, -3))) {
2996 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
2999 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
3000 sq_pushinteger(v, 0);
3001 if(SQ_FAILED(sq_createslot(v, -3))) {
3002 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
3005 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
3006 sq_pushinteger(v, 17);
3007 if(SQ_FAILED(sq_createslot(v, -3))) {
3008 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
3011 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
3012 sq_pushinteger(v, 18);
3013 if(SQ_FAILED(sq_createslot(v, -3))) {
3014 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
3017 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
3018 sq_pushinteger(v, 33);
3019 if(SQ_FAILED(sq_createslot(v, -3))) {
3020 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
3023 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
3024 sq_pushinteger(v, 34);
3025 if(SQ_FAILED(sq_createslot(v, -3))) {
3026 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
3029 sq_pushstring(v, "display", -1);
3030 sq_newclosure(v, &display_wrapper, 0);
3031 if(SQ_FAILED(sq_createslot(v, -3))) {
3032 throw SquirrelError(v, "Couldn't register function 'display'");
3035 sq_pushstring(v, "print_stacktrace", -1);
3036 sq_newclosure(v, &print_stacktrace_wrapper, 0);
3037 if(SQ_FAILED(sq_createslot(v, -3))) {
3038 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
3041 sq_pushstring(v, "get_current_thread", -1);
3042 sq_newclosure(v, &get_current_thread_wrapper, 0);
3043 if(SQ_FAILED(sq_createslot(v, -3))) {
3044 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
3047 sq_pushstring(v, "display_text_file", -1);
3048 sq_newclosure(v, &display_text_file_wrapper, 0);
3049 if(SQ_FAILED(sq_createslot(v, -3))) {
3050 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
3053 sq_pushstring(v, "load_worldmap", -1);
3054 sq_newclosure(v, &load_worldmap_wrapper, 0);
3055 if(SQ_FAILED(sq_createslot(v, -3))) {
3056 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
3059 sq_pushstring(v, "load_level", -1);
3060 sq_newclosure(v, &load_level_wrapper, 0);
3061 if(SQ_FAILED(sq_createslot(v, -3))) {
3062 throw SquirrelError(v, "Couldn't register function 'load_level'");
3065 sq_pushstring(v, "wait", -1);
3066 sq_newclosure(v, &wait_wrapper, 0);
3067 if(SQ_FAILED(sq_createslot(v, -3))) {
3068 throw SquirrelError(v, "Couldn't register function 'wait'");
3071 sq_pushstring(v, "wait_for_screenswitch", -1);
3072 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
3073 if(SQ_FAILED(sq_createslot(v, -3))) {
3074 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
3077 sq_pushstring(v, "exit_screen", -1);
3078 sq_newclosure(v, &exit_screen_wrapper, 0);
3079 if(SQ_FAILED(sq_createslot(v, -3))) {
3080 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
3083 sq_pushstring(v, "fadeout_screen", -1);
3084 sq_newclosure(v, &fadeout_screen_wrapper, 0);
3085 if(SQ_FAILED(sq_createslot(v, -3))) {
3086 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
3089 sq_pushstring(v, "shrink_screen", -1);
3090 sq_newclosure(v, &shrink_screen_wrapper, 0);
3091 if(SQ_FAILED(sq_createslot(v, -3))) {
3092 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
3095 sq_pushstring(v, "translate", -1);
3096 sq_newclosure(v, &translate_wrapper, 0);
3097 if(SQ_FAILED(sq_createslot(v, -3))) {
3098 throw SquirrelError(v, "Couldn't register function 'translate'");
3101 sq_pushstring(v, "import", -1);
3102 sq_newclosure(v, &import_wrapper, 0);
3103 if(SQ_FAILED(sq_createslot(v, -3))) {
3104 throw SquirrelError(v, "Couldn't register function 'import'");
3107 sq_pushstring(v, "save_state", -1);
3108 sq_newclosure(v, &save_state_wrapper, 0);
3109 if(SQ_FAILED(sq_createslot(v, -3))) {
3110 throw SquirrelError(v, "Couldn't register function 'save_state'");
3113 sq_pushstring(v, "debug_collrects", -1);
3114 sq_newclosure(v, &debug_collrects_wrapper, 0);
3115 if(SQ_FAILED(sq_createslot(v, -3))) {
3116 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
3119 sq_pushstring(v, "debug_show_fps", -1);
3120 sq_newclosure(v, &debug_show_fps_wrapper, 0);
3121 if(SQ_FAILED(sq_createslot(v, -3))) {
3122 throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
3125 sq_pushstring(v, "debug_draw_solids_only", -1);
3126 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
3127 if(SQ_FAILED(sq_createslot(v, -3))) {
3128 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
3131 sq_pushstring(v, "play_music", -1);
3132 sq_newclosure(v, &play_music_wrapper, 0);
3133 if(SQ_FAILED(sq_createslot(v, -3))) {
3134 throw SquirrelError(v, "Couldn't register function 'play_music'");
3137 sq_pushstring(v, "play_sound", -1);
3138 sq_newclosure(v, &play_sound_wrapper, 0);
3139 if(SQ_FAILED(sq_createslot(v, -3))) {
3140 throw SquirrelError(v, "Couldn't register function 'play_sound'");
3143 sq_pushstring(v, "grease", -1);
3144 sq_newclosure(v, &grease_wrapper, 0);
3145 if(SQ_FAILED(sq_createslot(v, -3))) {
3146 throw SquirrelError(v, "Couldn't register function 'grease'");
3149 sq_pushstring(v, "invincible", -1);
3150 sq_newclosure(v, &invincible_wrapper, 0);
3151 if(SQ_FAILED(sq_createslot(v, -3))) {
3152 throw SquirrelError(v, "Couldn't register function 'invincible'");
3155 sq_pushstring(v, "ghost", -1);
3156 sq_newclosure(v, &ghost_wrapper, 0);
3157 if(SQ_FAILED(sq_createslot(v, -3))) {
3158 throw SquirrelError(v, "Couldn't register function 'ghost'");
3161 sq_pushstring(v, "mortal", -1);
3162 sq_newclosure(v, &mortal_wrapper, 0);
3163 if(SQ_FAILED(sq_createslot(v, -3))) {
3164 throw SquirrelError(v, "Couldn't register function 'mortal'");
3167 sq_pushstring(v, "restart", -1);
3168 sq_newclosure(v, &restart_wrapper, 0);
3169 if(SQ_FAILED(sq_createslot(v, -3))) {
3170 throw SquirrelError(v, "Couldn't register function 'restart'");
3173 sq_pushstring(v, "whereami", -1);
3174 sq_newclosure(v, &whereami_wrapper, 0);
3175 if(SQ_FAILED(sq_createslot(v, -3))) {
3176 throw SquirrelError(v, "Couldn't register function 'whereami'");
3179 sq_pushstring(v, "gotoend", -1);
3180 sq_newclosure(v, &gotoend_wrapper, 0);
3181 if(SQ_FAILED(sq_createslot(v, -3))) {
3182 throw SquirrelError(v, "Couldn't register function 'gotoend'");
3185 sq_pushstring(v, "camera", -1);
3186 sq_newclosure(v, &camera_wrapper, 0);
3187 if(SQ_FAILED(sq_createslot(v, -3))) {
3188 throw SquirrelError(v, "Couldn't register function 'camera'");
3191 sq_pushstring(v, "quit", -1);
3192 sq_newclosure(v, &quit_wrapper, 0);
3193 if(SQ_FAILED(sq_createslot(v, -3))) {
3194 throw SquirrelError(v, "Couldn't register function 'quit'");
3197 sq_pushstring(v, "rand", -1);
3198 sq_newclosure(v, &rand_wrapper, 0);
3199 if(SQ_FAILED(sq_createslot(v, -3))) {
3200 throw SquirrelError(v, "Couldn't register function 'rand'");
3203 // Register class DisplayEffect
3204 sq_pushstring(v, "DisplayEffect", -1);
3205 if(sq_newclass(v, SQFalse) < 0) {
3206 std::ostringstream msg;
3207 msg << "Couldn't create new class 'DisplayEffect'";
3208 throw SquirrelError(v, msg.str());
3210 sq_pushstring(v, "fade_out", -1);
3211 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
3212 if(SQ_FAILED(sq_createslot(v, -3))) {
3213 throw SquirrelError(v, "Couldn't register function 'fade_out'");
3216 sq_pushstring(v, "fade_in", -1);
3217 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
3218 if(SQ_FAILED(sq_createslot(v, -3))) {
3219 throw SquirrelError(v, "Couldn't register function 'fade_in'");
3222 sq_pushstring(v, "set_black", -1);
3223 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
3224 if(SQ_FAILED(sq_createslot(v, -3))) {
3225 throw SquirrelError(v, "Couldn't register function 'set_black'");
3228 sq_pushstring(v, "is_black", -1);
3229 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
3230 if(SQ_FAILED(sq_createslot(v, -3))) {
3231 throw SquirrelError(v, "Couldn't register function 'is_black'");
3234 sq_pushstring(v, "sixteen_to_nine", -1);
3235 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
3236 if(SQ_FAILED(sq_createslot(v, -3))) {
3237 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
3240 sq_pushstring(v, "four_to_three", -1);
3241 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
3242 if(SQ_FAILED(sq_createslot(v, -3))) {
3243 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
3246 if(SQ_FAILED(sq_createslot(v, -3))) {
3247 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
3250 // Register class Camera
3251 sq_pushstring(v, "Camera", -1);
3252 if(sq_newclass(v, SQFalse) < 0) {
3253 std::ostringstream msg;
3254 msg << "Couldn't create new class 'Camera'";
3255 throw SquirrelError(v, msg.str());
3257 sq_pushstring(v, "shake", -1);
3258 sq_newclosure(v, &Camera_shake_wrapper, 0);
3259 if(SQ_FAILED(sq_createslot(v, -3))) {
3260 throw SquirrelError(v, "Couldn't register function 'shake'");
3263 sq_pushstring(v, "set_pos", -1);
3264 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
3265 if(SQ_FAILED(sq_createslot(v, -3))) {
3266 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3269 sq_pushstring(v, "set_mode", -1);
3270 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
3271 if(SQ_FAILED(sq_createslot(v, -3))) {
3272 throw SquirrelError(v, "Couldn't register function 'set_mode'");
3275 sq_pushstring(v, "scroll_to", -1);
3276 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
3277 if(SQ_FAILED(sq_createslot(v, -3))) {
3278 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
3281 if(SQ_FAILED(sq_createslot(v, -3))) {
3282 throw SquirrelError(v, "Couldn't register class 'Camera'");
3285 // Register class Level
3286 sq_pushstring(v, "Level", -1);
3287 if(sq_newclass(v, SQFalse) < 0) {
3288 std::ostringstream msg;
3289 msg << "Couldn't create new class 'Level'";
3290 throw SquirrelError(v, msg.str());
3292 sq_pushstring(v, "finish", -1);
3293 sq_newclosure(v, &Level_finish_wrapper, 0);
3294 if(SQ_FAILED(sq_createslot(v, -3))) {
3295 throw SquirrelError(v, "Couldn't register function 'finish'");
3298 sq_pushstring(v, "spawn", -1);
3299 sq_newclosure(v, &Level_spawn_wrapper, 0);
3300 if(SQ_FAILED(sq_createslot(v, -3))) {
3301 throw SquirrelError(v, "Couldn't register function 'spawn'");
3304 sq_pushstring(v, "flip_vertically", -1);
3305 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
3306 if(SQ_FAILED(sq_createslot(v, -3))) {
3307 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
3310 sq_pushstring(v, "toggle_pause", -1);
3311 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
3312 if(SQ_FAILED(sq_createslot(v, -3))) {
3313 throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
3316 if(SQ_FAILED(sq_createslot(v, -3))) {
3317 throw SquirrelError(v, "Couldn't register class 'Level'");
3320 // Register class ScriptedObject
3321 sq_pushstring(v, "ScriptedObject", -1);
3322 if(sq_newclass(v, SQFalse) < 0) {
3323 std::ostringstream msg;
3324 msg << "Couldn't create new class 'ScriptedObject'";
3325 throw SquirrelError(v, msg.str());
3327 sq_pushstring(v, "set_action", -1);
3328 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
3329 if(SQ_FAILED(sq_createslot(v, -3))) {
3330 throw SquirrelError(v, "Couldn't register function 'set_action'");
3333 sq_pushstring(v, "get_action", -1);
3334 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
3335 if(SQ_FAILED(sq_createslot(v, -3))) {
3336 throw SquirrelError(v, "Couldn't register function 'get_action'");
3339 sq_pushstring(v, "move", -1);
3340 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
3341 if(SQ_FAILED(sq_createslot(v, -3))) {
3342 throw SquirrelError(v, "Couldn't register function 'move'");
3345 sq_pushstring(v, "set_pos", -1);
3346 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
3347 if(SQ_FAILED(sq_createslot(v, -3))) {
3348 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3351 sq_pushstring(v, "get_pos_x", -1);
3352 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
3353 if(SQ_FAILED(sq_createslot(v, -3))) {
3354 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3357 sq_pushstring(v, "get_pos_y", -1);
3358 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
3359 if(SQ_FAILED(sq_createslot(v, -3))) {
3360 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3363 sq_pushstring(v, "set_velocity", -1);
3364 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
3365 if(SQ_FAILED(sq_createslot(v, -3))) {
3366 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
3369 sq_pushstring(v, "get_velocity_x", -1);
3370 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
3371 if(SQ_FAILED(sq_createslot(v, -3))) {
3372 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
3375 sq_pushstring(v, "get_velocity_y", -1);
3376 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
3377 if(SQ_FAILED(sq_createslot(v, -3))) {
3378 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
3381 sq_pushstring(v, "set_visible", -1);
3382 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
3383 if(SQ_FAILED(sq_createslot(v, -3))) {
3384 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3387 sq_pushstring(v, "is_visible", -1);
3388 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
3389 if(SQ_FAILED(sq_createslot(v, -3))) {
3390 throw SquirrelError(v, "Couldn't register function 'is_visible'");
3393 sq_pushstring(v, "set_solid", -1);
3394 sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
3395 if(SQ_FAILED(sq_createslot(v, -3))) {
3396 throw SquirrelError(v, "Couldn't register function 'set_solid'");
3399 sq_pushstring(v, "is_solid", -1);
3400 sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
3401 if(SQ_FAILED(sq_createslot(v, -3))) {
3402 throw SquirrelError(v, "Couldn't register function 'is_solid'");
3405 sq_pushstring(v, "get_name", -1);
3406 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
3407 if(SQ_FAILED(sq_createslot(v, -3))) {
3408 throw SquirrelError(v, "Couldn't register function 'get_name'");
3411 if(SQ_FAILED(sq_createslot(v, -3))) {
3412 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
3415 // Register class Text
3416 sq_pushstring(v, "Text", -1);
3417 if(sq_newclass(v, SQFalse) < 0) {
3418 std::ostringstream msg;
3419 msg << "Couldn't create new class 'Text'";
3420 throw SquirrelError(v, msg.str());
3422 sq_pushstring(v, "set_text", -1);
3423 sq_newclosure(v, &Text_set_text_wrapper, 0);
3424 if(SQ_FAILED(sq_createslot(v, -3))) {
3425 throw SquirrelError(v, "Couldn't register function 'set_text'");
3428 sq_pushstring(v, "set_font", -1);
3429 sq_newclosure(v, &Text_set_font_wrapper, 0);
3430 if(SQ_FAILED(sq_createslot(v, -3))) {
3431 throw SquirrelError(v, "Couldn't register function 'set_font'");
3434 sq_pushstring(v, "fade_in", -1);
3435 sq_newclosure(v, &Text_fade_in_wrapper, 0);
3436 if(SQ_FAILED(sq_createslot(v, -3))) {
3437 throw SquirrelError(v, "Couldn't register function 'fade_in'");
3440 sq_pushstring(v, "fade_out", -1);
3441 sq_newclosure(v, &Text_fade_out_wrapper, 0);
3442 if(SQ_FAILED(sq_createslot(v, -3))) {
3443 throw SquirrelError(v, "Couldn't register function 'fade_out'");
3446 sq_pushstring(v, "set_visible", -1);
3447 sq_newclosure(v, &Text_set_visible_wrapper, 0);
3448 if(SQ_FAILED(sq_createslot(v, -3))) {
3449 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3452 sq_pushstring(v, "set_centered", -1);
3453 sq_newclosure(v, &Text_set_centered_wrapper, 0);
3454 if(SQ_FAILED(sq_createslot(v, -3))) {
3455 throw SquirrelError(v, "Couldn't register function 'set_centered'");
3458 if(SQ_FAILED(sq_createslot(v, -3))) {
3459 throw SquirrelError(v, "Couldn't register class 'Text'");
3462 // Register class Player
3463 sq_pushstring(v, "Player", -1);
3464 if(sq_newclass(v, SQFalse) < 0) {
3465 std::ostringstream msg;
3466 msg << "Couldn't create new class 'Player'";
3467 throw SquirrelError(v, msg.str());
3469 sq_pushstring(v, "add_bonus", -1);
3470 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
3471 if(SQ_FAILED(sq_createslot(v, -3))) {
3472 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
3475 sq_pushstring(v, "add_coins", -1);
3476 sq_newclosure(v, &Player_add_coins_wrapper, 0);
3477 if(SQ_FAILED(sq_createslot(v, -3))) {
3478 throw SquirrelError(v, "Couldn't register function 'add_coins'");
3481 sq_pushstring(v, "make_invincible", -1);
3482 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
3483 if(SQ_FAILED(sq_createslot(v, -3))) {
3484 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
3487 sq_pushstring(v, "deactivate", -1);
3488 sq_newclosure(v, &Player_deactivate_wrapper, 0);
3489 if(SQ_FAILED(sq_createslot(v, -3))) {
3490 throw SquirrelError(v, "Couldn't register function 'deactivate'");
3493 sq_pushstring(v, "activate", -1);
3494 sq_newclosure(v, &Player_activate_wrapper, 0);
3495 if(SQ_FAILED(sq_createslot(v, -3))) {
3496 throw SquirrelError(v, "Couldn't register function 'activate'");
3499 sq_pushstring(v, "walk", -1);
3500 sq_newclosure(v, &Player_walk_wrapper, 0);
3501 if(SQ_FAILED(sq_createslot(v, -3))) {
3502 throw SquirrelError(v, "Couldn't register function 'walk'");
3505 sq_pushstring(v, "set_visible", -1);
3506 sq_newclosure(v, &Player_set_visible_wrapper, 0);
3507 if(SQ_FAILED(sq_createslot(v, -3))) {
3508 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3511 sq_pushstring(v, "get_visible", -1);
3512 sq_newclosure(v, &Player_get_visible_wrapper, 0);
3513 if(SQ_FAILED(sq_createslot(v, -3))) {
3514 throw SquirrelError(v, "Couldn't register function 'get_visible'");
3517 sq_pushstring(v, "kill", -1);
3518 sq_newclosure(v, &Player_kill_wrapper, 0);
3519 if(SQ_FAILED(sq_createslot(v, -3))) {
3520 throw SquirrelError(v, "Couldn't register function 'kill'");
3523 sq_pushstring(v, "set_ghost_mode", -1);
3524 sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
3525 if(SQ_FAILED(sq_createslot(v, -3))) {
3526 throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
3529 sq_pushstring(v, "get_ghost_mode", -1);
3530 sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
3531 if(SQ_FAILED(sq_createslot(v, -3))) {
3532 throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
3535 sq_pushstring(v, "do_cheer", -1);
3536 sq_newclosure(v, &Player_do_cheer_wrapper, 0);
3537 if(SQ_FAILED(sq_createslot(v, -3))) {
3538 throw SquirrelError(v, "Couldn't register function 'do_cheer'");
3541 sq_pushstring(v, "do_duck", -1);
3542 sq_newclosure(v, &Player_do_duck_wrapper, 0);
3543 if(SQ_FAILED(sq_createslot(v, -3))) {
3544 throw SquirrelError(v, "Couldn't register function 'do_duck'");
3547 sq_pushstring(v, "do_standup", -1);
3548 sq_newclosure(v, &Player_do_standup_wrapper, 0);
3549 if(SQ_FAILED(sq_createslot(v, -3))) {
3550 throw SquirrelError(v, "Couldn't register function 'do_standup'");
3553 sq_pushstring(v, "do_backflip", -1);
3554 sq_newclosure(v, &Player_do_backflip_wrapper, 0);
3555 if(SQ_FAILED(sq_createslot(v, -3))) {
3556 throw SquirrelError(v, "Couldn't register function 'do_backflip'");
3559 sq_pushstring(v, "do_jump", -1);
3560 sq_newclosure(v, &Player_do_jump_wrapper, 0);
3561 if(SQ_FAILED(sq_createslot(v, -3))) {
3562 throw SquirrelError(v, "Couldn't register function 'do_jump'");
3565 if(SQ_FAILED(sq_createslot(v, -3))) {
3566 throw SquirrelError(v, "Couldn't register class 'Player'");
3569 // Register class FloatingImage
3570 sq_pushstring(v, "FloatingImage", -1);
3571 if(sq_newclass(v, SQFalse) < 0) {
3572 std::ostringstream msg;
3573 msg << "Couldn't create new class 'FloatingImage'";
3574 throw SquirrelError(v, msg.str());
3576 sq_pushstring(v, "constructor", -1);
3577 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
3578 if(SQ_FAILED(sq_createslot(v, -3))) {
3579 throw SquirrelError(v, "Couldn't register function 'constructor'");
3582 sq_pushstring(v, "set_layer", -1);
3583 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
3584 if(SQ_FAILED(sq_createslot(v, -3))) {
3585 throw SquirrelError(v, "Couldn't register function 'set_layer'");
3588 sq_pushstring(v, "get_layer", -1);
3589 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
3590 if(SQ_FAILED(sq_createslot(v, -3))) {
3591 throw SquirrelError(v, "Couldn't register function 'get_layer'");
3594 sq_pushstring(v, "set_pos", -1);
3595 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
3596 if(SQ_FAILED(sq_createslot(v, -3))) {
3597 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3600 sq_pushstring(v, "get_pos_x", -1);
3601 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
3602 if(SQ_FAILED(sq_createslot(v, -3))) {
3603 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3606 sq_pushstring(v, "get_pos_y", -1);
3607 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
3608 if(SQ_FAILED(sq_createslot(v, -3))) {
3609 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3612 sq_pushstring(v, "set_anchor_point", -1);
3613 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
3614 if(SQ_FAILED(sq_createslot(v, -3))) {
3615 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
3618 sq_pushstring(v, "get_anchor_point", -1);
3619 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
3620 if(SQ_FAILED(sq_createslot(v, -3))) {
3621 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
3624 sq_pushstring(v, "set_visible", -1);
3625 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
3626 if(SQ_FAILED(sq_createslot(v, -3))) {
3627 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3630 sq_pushstring(v, "get_visible", -1);
3631 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
3632 if(SQ_FAILED(sq_createslot(v, -3))) {
3633 throw SquirrelError(v, "Couldn't register function 'get_visible'");
3636 sq_pushstring(v, "set_action", -1);
3637 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
3638 if(SQ_FAILED(sq_createslot(v, -3))) {
3639 throw SquirrelError(v, "Couldn't register function 'set_action'");
3642 sq_pushstring(v, "get_action", -1);
3643 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
3644 if(SQ_FAILED(sq_createslot(v, -3))) {
3645 throw SquirrelError(v, "Couldn't register function 'get_action'");
3648 if(SQ_FAILED(sq_createslot(v, -3))) {
3649 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
3652 // Register class Platform
3653 sq_pushstring(v, "Platform", -1);
3654 if(sq_newclass(v, SQFalse) < 0) {
3655 std::ostringstream msg;
3656 msg << "Couldn't create new class 'Platform'";
3657 throw SquirrelError(v, msg.str());
3659 sq_pushstring(v, "goto_node", -1);
3660 sq_newclosure(v, &Platform_goto_node_wrapper, 0);
3661 if(SQ_FAILED(sq_createslot(v, -3))) {
3662 throw SquirrelError(v, "Couldn't register function 'goto_node'");
3665 sq_pushstring(v, "start_moving", -1);
3666 sq_newclosure(v, &Platform_start_moving_wrapper, 0);
3667 if(SQ_FAILED(sq_createslot(v, -3))) {
3668 throw SquirrelError(v, "Couldn't register function 'start_moving'");
3671 sq_pushstring(v, "stop_moving", -1);
3672 sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
3673 if(SQ_FAILED(sq_createslot(v, -3))) {
3674 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
3677 if(SQ_FAILED(sq_createslot(v, -3))) {
3678 throw SquirrelError(v, "Couldn't register class 'Platform'");
3681 // Register class Candle
3682 sq_pushstring(v, "Candle", -1);
3683 if(sq_newclass(v, SQFalse) < 0) {
3684 std::ostringstream msg;
3685 msg << "Couldn't create new class 'Candle'";
3686 throw SquirrelError(v, msg.str());
3688 sq_pushstring(v, "get_burning", -1);
3689 sq_newclosure(v, &Candle_get_burning_wrapper, 0);
3690 if(SQ_FAILED(sq_createslot(v, -3))) {
3691 throw SquirrelError(v, "Couldn't register function 'get_burning'");
3694 sq_pushstring(v, "set_burning", -1);
3695 sq_newclosure(v, &Candle_set_burning_wrapper, 0);
3696 if(SQ_FAILED(sq_createslot(v, -3))) {
3697 throw SquirrelError(v, "Couldn't register function 'set_burning'");
3700 if(SQ_FAILED(sq_createslot(v, -3))) {
3701 throw SquirrelError(v, "Couldn't register class 'Candle'");
3704 // Register class Wind
3705 sq_pushstring(v, "Wind", -1);
3706 if(sq_newclass(v, SQFalse) < 0) {
3707 std::ostringstream msg;
3708 msg << "Couldn't create new class 'Wind'";
3709 throw SquirrelError(v, msg.str());
3711 sq_pushstring(v, "start", -1);
3712 sq_newclosure(v, &Wind_start_wrapper, 0);
3713 if(SQ_FAILED(sq_createslot(v, -3))) {
3714 throw SquirrelError(v, "Couldn't register function 'start'");
3717 sq_pushstring(v, "stop", -1);
3718 sq_newclosure(v, &Wind_stop_wrapper, 0);
3719 if(SQ_FAILED(sq_createslot(v, -3))) {
3720 throw SquirrelError(v, "Couldn't register function 'stop'");
3723 if(SQ_FAILED(sq_createslot(v, -3))) {
3724 throw SquirrelError(v, "Couldn't register class 'Wind'");
3727 // Register class AmbientSound
3728 sq_pushstring(v, "AmbientSound", -1);
3729 if(sq_newclass(v, SQFalse) < 0) {
3730 std::ostringstream msg;
3731 msg << "Couldn't create new class 'AmbientSound'";
3732 throw SquirrelError(v, msg.str());
3734 sq_pushstring(v, "set_pos", -1);
3735 sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
3736 if(SQ_FAILED(sq_createslot(v, -3))) {
3737 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3740 sq_pushstring(v, "get_pos_x", -1);
3741 sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
3742 if(SQ_FAILED(sq_createslot(v, -3))) {
3743 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3746 sq_pushstring(v, "get_pos_y", -1);
3747 sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
3748 if(SQ_FAILED(sq_createslot(v, -3))) {
3749 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3752 if(SQ_FAILED(sq_createslot(v, -3))) {
3753 throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
3758 } // end of namespace Scripting