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 bool return_value = _this->add_bonus(arg0);
1065 sq_pushbool(vm, return_value);
1068 } catch(std::exception& e) {
1069 sq_throwerror(vm, e.what());
1072 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1078 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
1081 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1082 sq_throwerror(vm, _SC("'add_coins' called without instance"));
1085 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1087 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1088 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1093 _this->add_coins(static_cast<int> (arg0));
1097 } catch(std::exception& e) {
1098 sq_throwerror(vm, e.what());
1101 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1107 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1110 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1111 sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1114 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1117 _this->make_invincible();
1121 } catch(std::exception& e) {
1122 sq_throwerror(vm, e.what());
1125 sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1131 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1134 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1135 sq_throwerror(vm, _SC("'deactivate' called without instance"));
1138 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1141 _this->deactivate();
1145 } catch(std::exception& e) {
1146 sq_throwerror(vm, e.what());
1149 sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1155 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1158 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1159 sq_throwerror(vm, _SC("'activate' called without instance"));
1162 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1169 } catch(std::exception& e) {
1170 sq_throwerror(vm, e.what());
1173 sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1179 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1182 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1183 sq_throwerror(vm, _SC("'walk' called without instance"));
1186 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1188 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1189 sq_throwerror(vm, _SC("Argument 1 not a float"));
1194 _this->walk(static_cast<float> (arg0));
1198 } catch(std::exception& e) {
1199 sq_throwerror(vm, e.what());
1202 sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1208 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1211 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1212 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1215 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1217 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1218 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1223 _this->set_visible(arg0 == SQTrue);
1227 } catch(std::exception& e) {
1228 sq_throwerror(vm, e.what());
1231 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1237 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1240 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1241 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1244 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1247 bool return_value = _this->get_visible();
1249 sq_pushbool(vm, return_value);
1252 } catch(std::exception& e) {
1253 sq_throwerror(vm, e.what());
1256 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1262 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1265 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1266 sq_throwerror(vm, _SC("'kill' called without instance"));
1269 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1271 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1272 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1277 _this->kill(arg0 == SQTrue);
1281 } catch(std::exception& e) {
1282 sq_throwerror(vm, e.what());
1285 sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1291 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1294 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1295 sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1298 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1300 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1301 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1306 _this->set_ghost_mode(arg0 == SQTrue);
1310 } catch(std::exception& e) {
1311 sq_throwerror(vm, e.what());
1314 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1320 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1323 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1324 sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1327 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1330 bool return_value = _this->get_ghost_mode();
1332 sq_pushbool(vm, return_value);
1335 } catch(std::exception& e) {
1336 sq_throwerror(vm, e.what());
1339 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1345 static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm)
1348 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1349 sq_throwerror(vm, _SC("'do_cheer' called without instance"));
1352 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1359 } catch(std::exception& e) {
1360 sq_throwerror(vm, e.what());
1363 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'"));
1369 static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm)
1372 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1373 sq_throwerror(vm, _SC("'do_duck' called without instance"));
1376 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1383 } catch(std::exception& e) {
1384 sq_throwerror(vm, e.what());
1387 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'"));
1393 static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm)
1396 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1397 sq_throwerror(vm, _SC("'do_standup' called without instance"));
1400 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1403 _this->do_standup();
1407 } catch(std::exception& e) {
1408 sq_throwerror(vm, e.what());
1411 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'"));
1417 static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm)
1420 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1421 sq_throwerror(vm, _SC("'do_backflip' called without instance"));
1424 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1427 _this->do_backflip();
1431 } catch(std::exception& e) {
1432 sq_throwerror(vm, e.what());
1435 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'"));
1441 static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm)
1444 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1445 sq_throwerror(vm, _SC("'do_jump' called without instance"));
1448 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1450 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1451 sq_throwerror(vm, _SC("Argument 1 not a float"));
1456 _this->do_jump(static_cast<float> (arg0));
1460 } catch(std::exception& e) {
1461 sq_throwerror(vm, e.what());
1464 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_jump'"));
1470 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1472 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1477 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1480 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1481 sq_throwerror(vm, _SC("Argument 1 not a string"));
1486 Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1487 if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1488 sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1491 sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1495 } catch(std::exception& e) {
1496 sq_throwerror(vm, e.what());
1499 sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1505 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1508 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1509 sq_throwerror(vm, _SC("'set_layer' called without instance"));
1512 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1514 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1515 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1520 _this->set_layer(static_cast<int> (arg0));
1524 } catch(std::exception& e) {
1525 sq_throwerror(vm, e.what());
1528 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1534 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1537 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1538 sq_throwerror(vm, _SC("'get_layer' called without instance"));
1541 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1544 int return_value = _this->get_layer();
1546 sq_pushinteger(vm, return_value);
1549 } catch(std::exception& e) {
1550 sq_throwerror(vm, e.what());
1553 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1559 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1562 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1563 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1566 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1568 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1569 sq_throwerror(vm, _SC("Argument 1 not a float"));
1573 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1574 sq_throwerror(vm, _SC("Argument 2 not a float"));
1579 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1583 } catch(std::exception& e) {
1584 sq_throwerror(vm, e.what());
1587 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1593 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1596 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1597 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1600 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1603 float return_value = _this->get_pos_x();
1605 sq_pushfloat(vm, return_value);
1608 } catch(std::exception& e) {
1609 sq_throwerror(vm, e.what());
1612 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1618 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1621 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1622 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1625 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1628 float return_value = _this->get_pos_y();
1630 sq_pushfloat(vm, return_value);
1633 } catch(std::exception& e) {
1634 sq_throwerror(vm, e.what());
1637 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1643 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1646 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1647 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1650 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1652 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1653 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1658 _this->set_anchor_point(static_cast<int> (arg0));
1662 } catch(std::exception& e) {
1663 sq_throwerror(vm, e.what());
1666 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1672 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1675 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1676 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1679 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1682 int return_value = _this->get_anchor_point();
1684 sq_pushinteger(vm, return_value);
1687 } catch(std::exception& e) {
1688 sq_throwerror(vm, e.what());
1691 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1697 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1700 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1701 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1704 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1706 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1707 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1712 _this->set_visible(arg0 == SQTrue);
1716 } catch(std::exception& e) {
1717 sq_throwerror(vm, e.what());
1720 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1726 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1729 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1730 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1733 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1736 bool return_value = _this->get_visible();
1738 sq_pushbool(vm, return_value);
1741 } catch(std::exception& e) {
1742 sq_throwerror(vm, e.what());
1745 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1751 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
1754 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1755 sq_throwerror(vm, _SC("'set_action' called without instance"));
1758 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1760 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1761 sq_throwerror(vm, _SC("Argument 1 not a string"));
1766 _this->set_action(arg0);
1770 } catch(std::exception& e) {
1771 sq_throwerror(vm, e.what());
1774 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1780 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
1783 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1784 sq_throwerror(vm, _SC("'get_action' called without instance"));
1787 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1790 std::string return_value = _this->get_action();
1792 sq_pushstring(vm, return_value.c_str(), return_value.size());
1795 } catch(std::exception& e) {
1796 sq_throwerror(vm, e.what());
1799 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1805 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1807 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
1812 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1815 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1816 sq_throwerror(vm, _SC("'goto_node' called without instance"));
1819 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1821 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1822 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1827 _this->goto_node(static_cast<int> (arg0));
1831 } catch(std::exception& e) {
1832 sq_throwerror(vm, e.what());
1835 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1841 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1844 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1845 sq_throwerror(vm, _SC("'start_moving' called without instance"));
1848 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1851 _this->start_moving();
1855 } catch(std::exception& e) {
1856 sq_throwerror(vm, e.what());
1859 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
1865 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1868 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1869 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1872 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1875 _this->stop_moving();
1879 } catch(std::exception& e) {
1880 sq_throwerror(vm, e.what());
1883 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1889 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
1891 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (ptr);
1896 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
1899 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1900 sq_throwerror(vm, _SC("'get_burning' called without instance"));
1903 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1906 bool return_value = _this->get_burning();
1908 sq_pushbool(vm, return_value);
1911 } catch(std::exception& e) {
1912 sq_throwerror(vm, e.what());
1915 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
1921 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
1924 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1925 sq_throwerror(vm, _SC("'set_burning' called without instance"));
1928 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1930 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1931 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1936 _this->set_burning(arg0 == SQTrue);
1940 } catch(std::exception& e) {
1941 sq_throwerror(vm, e.what());
1944 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_burning'"));
1950 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
1952 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (ptr);
1957 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
1960 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1961 sq_throwerror(vm, _SC("'start' called without instance"));
1964 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
1971 } catch(std::exception& e) {
1972 sq_throwerror(vm, e.what());
1975 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
1981 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
1984 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1985 sq_throwerror(vm, _SC("'stop' called without instance"));
1988 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
1995 } catch(std::exception& e) {
1996 sq_throwerror(vm, e.what());
1999 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2005 static SQInteger AmbientSound_release_hook(SQUserPointer ptr, SQInteger )
2007 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (ptr);
2012 static SQInteger AmbientSound_set_pos_wrapper(HSQUIRRELVM vm)
2015 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2016 sq_throwerror(vm, _SC("'set_pos' called without instance"));
2019 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2021 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2022 sq_throwerror(vm, _SC("Argument 1 not a float"));
2026 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2027 sq_throwerror(vm, _SC("Argument 2 not a float"));
2032 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
2036 } catch(std::exception& e) {
2037 sq_throwerror(vm, e.what());
2040 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
2046 static SQInteger AmbientSound_get_pos_x_wrapper(HSQUIRRELVM vm)
2049 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2050 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
2053 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2056 float return_value = _this->get_pos_x();
2058 sq_pushfloat(vm, return_value);
2061 } catch(std::exception& e) {
2062 sq_throwerror(vm, e.what());
2065 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
2071 static SQInteger AmbientSound_get_pos_y_wrapper(HSQUIRRELVM vm)
2074 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2075 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
2078 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2081 float return_value = _this->get_pos_y();
2083 sq_pushfloat(vm, return_value);
2086 } catch(std::exception& e) {
2087 sq_throwerror(vm, e.what());
2090 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
2096 static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger )
2098 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (ptr);
2103 static SQInteger Thunderstorm_start_wrapper(HSQUIRRELVM vm)
2106 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2107 sq_throwerror(vm, _SC("'start' called without instance"));
2110 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2117 } catch(std::exception& e) {
2118 sq_throwerror(vm, e.what());
2121 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2127 static SQInteger Thunderstorm_stop_wrapper(HSQUIRRELVM vm)
2130 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2131 sq_throwerror(vm, _SC("'stop' called without instance"));
2134 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2141 } catch(std::exception& e) {
2142 sq_throwerror(vm, e.what());
2145 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2151 static SQInteger Thunderstorm_thunder_wrapper(HSQUIRRELVM vm)
2154 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2155 sq_throwerror(vm, _SC("'thunder' called without instance"));
2158 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2165 } catch(std::exception& e) {
2166 sq_throwerror(vm, e.what());
2169 sq_throwerror(vm, _SC("Unexpected exception while executing function 'thunder'"));
2175 static SQInteger Thunderstorm_lightning_wrapper(HSQUIRRELVM vm)
2178 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2179 sq_throwerror(vm, _SC("'lightning' called without instance"));
2182 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2189 } catch(std::exception& e) {
2190 sq_throwerror(vm, e.what());
2193 sq_throwerror(vm, _SC("Unexpected exception while executing function 'lightning'"));
2199 static SQInteger Thunderstorm_flash_wrapper(HSQUIRRELVM vm)
2202 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2203 sq_throwerror(vm, _SC("'flash' called without instance"));
2206 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2213 } catch(std::exception& e) {
2214 sq_throwerror(vm, e.what());
2217 sq_throwerror(vm, _SC("Unexpected exception while executing function 'flash'"));
2223 static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm)
2226 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2227 sq_throwerror(vm, _SC("'electrify' called without instance"));
2230 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2237 } catch(std::exception& e) {
2238 sq_throwerror(vm, e.what());
2241 sq_throwerror(vm, _SC("Unexpected exception while executing function 'electrify'"));
2247 static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger )
2249 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (ptr);
2254 static SQInteger TileMap_goto_node_wrapper(HSQUIRRELVM vm)
2257 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2258 sq_throwerror(vm, _SC("'goto_node' called without instance"));
2261 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2263 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2264 sq_throwerror(vm, _SC("Argument 1 not an integer"));
2269 _this->goto_node(static_cast<int> (arg0));
2273 } catch(std::exception& e) {
2274 sq_throwerror(vm, e.what());
2277 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2283 static SQInteger TileMap_start_moving_wrapper(HSQUIRRELVM vm)
2286 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2287 sq_throwerror(vm, _SC("'start_moving' called without instance"));
2290 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2293 _this->start_moving();
2297 } catch(std::exception& e) {
2298 sq_throwerror(vm, e.what());
2301 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2307 static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm)
2310 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2311 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2314 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2317 _this->stop_moving();
2321 } catch(std::exception& e) {
2322 sq_throwerror(vm, e.what());
2325 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2331 static SQInteger display_wrapper(HSQUIRRELVM vm)
2333 return Scripting::display(vm);
2336 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
2338 HSQUIRRELVM arg0 = vm;
2341 Scripting::print_stacktrace(arg0);
2345 } catch(std::exception& e) {
2346 sq_throwerror(vm, e.what());
2349 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
2355 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
2357 return Scripting::get_current_thread(vm);
2360 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
2363 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2364 sq_throwerror(vm, _SC("Argument 1 not a string"));
2369 Scripting::display_text_file(arg0);
2373 } catch(std::exception& e) {
2374 sq_throwerror(vm, e.what());
2377 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
2383 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
2386 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2387 sq_throwerror(vm, _SC("Argument 1 not a string"));
2392 Scripting::load_worldmap(arg0);
2396 } catch(std::exception& e) {
2397 sq_throwerror(vm, e.what());
2400 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
2406 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
2409 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2410 sq_throwerror(vm, _SC("Argument 1 not a string"));
2415 Scripting::load_level(arg0);
2419 } catch(std::exception& e) {
2420 sq_throwerror(vm, e.what());
2423 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
2429 static SQInteger wait_wrapper(HSQUIRRELVM vm)
2431 HSQUIRRELVM arg0 = vm;
2433 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
2434 sq_throwerror(vm, _SC("Argument 1 not a float"));
2439 Scripting::wait(arg0, static_cast<float> (arg1));
2441 return sq_suspendvm(vm);
2443 } catch(std::exception& e) {
2444 sq_throwerror(vm, e.what());
2447 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
2453 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
2455 HSQUIRRELVM arg0 = vm;
2458 Scripting::wait_for_screenswitch(arg0);
2460 return sq_suspendvm(vm);
2462 } catch(std::exception& e) {
2463 sq_throwerror(vm, e.what());
2466 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
2472 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
2477 Scripting::exit_screen();
2481 } catch(std::exception& e) {
2482 sq_throwerror(vm, e.what());
2485 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
2491 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
2494 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2495 sq_throwerror(vm, _SC("Argument 1 not a float"));
2500 Scripting::fadeout_screen(static_cast<float> (arg0));
2504 } catch(std::exception& e) {
2505 sq_throwerror(vm, e.what());
2508 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
2514 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
2517 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2518 sq_throwerror(vm, _SC("Argument 1 not a float"));
2522 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2523 sq_throwerror(vm, _SC("Argument 2 not a float"));
2527 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2528 sq_throwerror(vm, _SC("Argument 3 not a float"));
2533 Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2537 } catch(std::exception& e) {
2538 sq_throwerror(vm, e.what());
2541 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
2547 static SQInteger translate_wrapper(HSQUIRRELVM vm)
2550 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2551 sq_throwerror(vm, _SC("Argument 1 not a string"));
2556 std::string return_value = Scripting::translate(arg0);
2558 sq_pushstring(vm, return_value.c_str(), return_value.size());
2561 } catch(std::exception& e) {
2562 sq_throwerror(vm, e.what());
2565 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
2571 static SQInteger import_wrapper(HSQUIRRELVM vm)
2573 HSQUIRRELVM arg0 = vm;
2575 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
2576 sq_throwerror(vm, _SC("Argument 1 not a string"));
2581 Scripting::import(arg0, arg1);
2585 } catch(std::exception& e) {
2586 sq_throwerror(vm, e.what());
2589 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
2595 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
2600 Scripting::save_state();
2604 } catch(std::exception& e) {
2605 sq_throwerror(vm, e.what());
2608 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
2614 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
2617 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2618 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2623 Scripting::debug_collrects(arg0 == SQTrue);
2627 } catch(std::exception& e) {
2628 sq_throwerror(vm, e.what());
2631 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
2637 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
2640 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2641 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2646 Scripting::debug_show_fps(arg0 == SQTrue);
2650 } catch(std::exception& e) {
2651 sq_throwerror(vm, e.what());
2654 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
2660 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
2663 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2664 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2669 Scripting::debug_draw_solids_only(arg0 == SQTrue);
2673 } catch(std::exception& e) {
2674 sq_throwerror(vm, e.what());
2677 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
2683 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
2686 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2687 sq_throwerror(vm, _SC("Argument 1 not a string"));
2692 Scripting::play_music(arg0);
2696 } catch(std::exception& e) {
2697 sq_throwerror(vm, e.what());
2700 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
2706 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
2709 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2710 sq_throwerror(vm, _SC("Argument 1 not a string"));
2715 Scripting::play_sound(arg0);
2719 } catch(std::exception& e) {
2720 sq_throwerror(vm, e.what());
2723 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
2729 static SQInteger grease_wrapper(HSQUIRRELVM vm)
2734 Scripting::grease();
2738 } catch(std::exception& e) {
2739 sq_throwerror(vm, e.what());
2742 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
2748 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
2753 Scripting::invincible();
2757 } catch(std::exception& e) {
2758 sq_throwerror(vm, e.what());
2761 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
2767 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
2776 } catch(std::exception& e) {
2777 sq_throwerror(vm, e.what());
2780 sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
2786 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
2791 Scripting::mortal();
2795 } catch(std::exception& e) {
2796 sq_throwerror(vm, e.what());
2799 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
2805 static SQInteger restart_wrapper(HSQUIRRELVM vm)
2810 Scripting::restart();
2814 } catch(std::exception& e) {
2815 sq_throwerror(vm, e.what());
2818 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
2824 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
2829 Scripting::whereami();
2833 } catch(std::exception& e) {
2834 sq_throwerror(vm, e.what());
2837 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
2843 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
2848 Scripting::gotoend();
2852 } catch(std::exception& e) {
2853 sq_throwerror(vm, e.what());
2856 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
2862 static SQInteger camera_wrapper(HSQUIRRELVM vm)
2867 Scripting::camera();
2871 } catch(std::exception& e) {
2872 sq_throwerror(vm, e.what());
2875 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
2881 static SQInteger quit_wrapper(HSQUIRRELVM vm)
2890 } catch(std::exception& e) {
2891 sq_throwerror(vm, e.what());
2894 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
2900 static SQInteger rand_wrapper(HSQUIRRELVM vm)
2904 int return_value = Scripting::rand();
2906 sq_pushinteger(vm, return_value);
2909 } catch(std::exception& e) {
2910 sq_throwerror(vm, e.what());
2913 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
2919 } // end of namespace Wrapper
2921 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
2923 using namespace Wrapper;
2925 sq_pushroottable(v);
2926 sq_pushstring(v, "DisplayEffect", -1);
2927 if(SQ_FAILED(sq_get(v, -2))) {
2928 std::ostringstream msg;
2929 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
2930 throw SquirrelError(v, msg.str());
2933 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2934 std::ostringstream msg;
2935 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
2936 throw SquirrelError(v, msg.str());
2938 sq_remove(v, -2); // remove object name
2940 if(setup_releasehook) {
2941 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
2944 sq_remove(v, -2); // remove root table
2947 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
2949 using namespace Wrapper;
2951 sq_pushroottable(v);
2952 sq_pushstring(v, "Camera", -1);
2953 if(SQ_FAILED(sq_get(v, -2))) {
2954 std::ostringstream msg;
2955 msg << "Couldn't resolved squirrel type 'Camera'";
2956 throw SquirrelError(v, msg.str());
2959 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2960 std::ostringstream msg;
2961 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
2962 throw SquirrelError(v, msg.str());
2964 sq_remove(v, -2); // remove object name
2966 if(setup_releasehook) {
2967 sq_setreleasehook(v, -1, Camera_release_hook);
2970 sq_remove(v, -2); // remove root table
2973 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
2975 using namespace Wrapper;
2977 sq_pushroottable(v);
2978 sq_pushstring(v, "Level", -1);
2979 if(SQ_FAILED(sq_get(v, -2))) {
2980 std::ostringstream msg;
2981 msg << "Couldn't resolved squirrel type 'Level'";
2982 throw SquirrelError(v, msg.str());
2985 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2986 std::ostringstream msg;
2987 msg << "Couldn't setup squirrel instance for object of type 'Level'";
2988 throw SquirrelError(v, msg.str());
2990 sq_remove(v, -2); // remove object name
2992 if(setup_releasehook) {
2993 sq_setreleasehook(v, -1, Level_release_hook);
2996 sq_remove(v, -2); // remove root table
2999 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
3001 using namespace Wrapper;
3003 sq_pushroottable(v);
3004 sq_pushstring(v, "ScriptedObject", -1);
3005 if(SQ_FAILED(sq_get(v, -2))) {
3006 std::ostringstream msg;
3007 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
3008 throw SquirrelError(v, msg.str());
3011 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3012 std::ostringstream msg;
3013 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
3014 throw SquirrelError(v, msg.str());
3016 sq_remove(v, -2); // remove object name
3018 if(setup_releasehook) {
3019 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
3022 sq_remove(v, -2); // remove root table
3025 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
3027 using namespace Wrapper;
3029 sq_pushroottable(v);
3030 sq_pushstring(v, "Text", -1);
3031 if(SQ_FAILED(sq_get(v, -2))) {
3032 std::ostringstream msg;
3033 msg << "Couldn't resolved squirrel type 'Text'";
3034 throw SquirrelError(v, msg.str());
3037 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3038 std::ostringstream msg;
3039 msg << "Couldn't setup squirrel instance for object of type 'Text'";
3040 throw SquirrelError(v, msg.str());
3042 sq_remove(v, -2); // remove object name
3044 if(setup_releasehook) {
3045 sq_setreleasehook(v, -1, Text_release_hook);
3048 sq_remove(v, -2); // remove root table
3051 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
3053 using namespace Wrapper;
3055 sq_pushroottable(v);
3056 sq_pushstring(v, "Player", -1);
3057 if(SQ_FAILED(sq_get(v, -2))) {
3058 std::ostringstream msg;
3059 msg << "Couldn't resolved squirrel type 'Player'";
3060 throw SquirrelError(v, msg.str());
3063 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3064 std::ostringstream msg;
3065 msg << "Couldn't setup squirrel instance for object of type 'Player'";
3066 throw SquirrelError(v, msg.str());
3068 sq_remove(v, -2); // remove object name
3070 if(setup_releasehook) {
3071 sq_setreleasehook(v, -1, Player_release_hook);
3074 sq_remove(v, -2); // remove root table
3077 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
3079 using namespace Wrapper;
3081 sq_pushroottable(v);
3082 sq_pushstring(v, "FloatingImage", -1);
3083 if(SQ_FAILED(sq_get(v, -2))) {
3084 std::ostringstream msg;
3085 msg << "Couldn't resolved squirrel type 'FloatingImage'";
3086 throw SquirrelError(v, msg.str());
3089 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3090 std::ostringstream msg;
3091 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
3092 throw SquirrelError(v, msg.str());
3094 sq_remove(v, -2); // remove object name
3096 if(setup_releasehook) {
3097 sq_setreleasehook(v, -1, FloatingImage_release_hook);
3100 sq_remove(v, -2); // remove root table
3103 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
3105 using namespace Wrapper;
3107 sq_pushroottable(v);
3108 sq_pushstring(v, "Platform", -1);
3109 if(SQ_FAILED(sq_get(v, -2))) {
3110 std::ostringstream msg;
3111 msg << "Couldn't resolved squirrel type 'Platform'";
3112 throw SquirrelError(v, msg.str());
3115 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3116 std::ostringstream msg;
3117 msg << "Couldn't setup squirrel instance for object of type 'Platform'";
3118 throw SquirrelError(v, msg.str());
3120 sq_remove(v, -2); // remove object name
3122 if(setup_releasehook) {
3123 sq_setreleasehook(v, -1, Platform_release_hook);
3126 sq_remove(v, -2); // remove root table
3129 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
3131 using namespace Wrapper;
3133 sq_pushroottable(v);
3134 sq_pushstring(v, "Candle", -1);
3135 if(SQ_FAILED(sq_get(v, -2))) {
3136 std::ostringstream msg;
3137 msg << "Couldn't resolved squirrel type 'Candle'";
3138 throw SquirrelError(v, msg.str());
3141 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3142 std::ostringstream msg;
3143 msg << "Couldn't setup squirrel instance for object of type 'Candle'";
3144 throw SquirrelError(v, msg.str());
3146 sq_remove(v, -2); // remove object name
3148 if(setup_releasehook) {
3149 sq_setreleasehook(v, -1, Candle_release_hook);
3152 sq_remove(v, -2); // remove root table
3155 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
3157 using namespace Wrapper;
3159 sq_pushroottable(v);
3160 sq_pushstring(v, "Wind", -1);
3161 if(SQ_FAILED(sq_get(v, -2))) {
3162 std::ostringstream msg;
3163 msg << "Couldn't resolved squirrel type 'Wind'";
3164 throw SquirrelError(v, msg.str());
3167 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3168 std::ostringstream msg;
3169 msg << "Couldn't setup squirrel instance for object of type 'Wind'";
3170 throw SquirrelError(v, msg.str());
3172 sq_remove(v, -2); // remove object name
3174 if(setup_releasehook) {
3175 sq_setreleasehook(v, -1, Wind_release_hook);
3178 sq_remove(v, -2); // remove root table
3181 void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bool setup_releasehook)
3183 using namespace Wrapper;
3185 sq_pushroottable(v);
3186 sq_pushstring(v, "AmbientSound", -1);
3187 if(SQ_FAILED(sq_get(v, -2))) {
3188 std::ostringstream msg;
3189 msg << "Couldn't resolved squirrel type 'AmbientSound'";
3190 throw SquirrelError(v, msg.str());
3193 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3194 std::ostringstream msg;
3195 msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'";
3196 throw SquirrelError(v, msg.str());
3198 sq_remove(v, -2); // remove object name
3200 if(setup_releasehook) {
3201 sq_setreleasehook(v, -1, AmbientSound_release_hook);
3204 sq_remove(v, -2); // remove root table
3207 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Thunderstorm* object, bool setup_releasehook)
3209 using namespace Wrapper;
3211 sq_pushroottable(v);
3212 sq_pushstring(v, "Thunderstorm", -1);
3213 if(SQ_FAILED(sq_get(v, -2))) {
3214 std::ostringstream msg;
3215 msg << "Couldn't resolved squirrel type 'Thunderstorm'";
3216 throw SquirrelError(v, msg.str());
3219 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3220 std::ostringstream msg;
3221 msg << "Couldn't setup squirrel instance for object of type 'Thunderstorm'";
3222 throw SquirrelError(v, msg.str());
3224 sq_remove(v, -2); // remove object name
3226 if(setup_releasehook) {
3227 sq_setreleasehook(v, -1, Thunderstorm_release_hook);
3230 sq_remove(v, -2); // remove root table
3233 void create_squirrel_instance(HSQUIRRELVM v, Scripting::TileMap* object, bool setup_releasehook)
3235 using namespace Wrapper;
3237 sq_pushroottable(v);
3238 sq_pushstring(v, "TileMap", -1);
3239 if(SQ_FAILED(sq_get(v, -2))) {
3240 std::ostringstream msg;
3241 msg << "Couldn't resolved squirrel type 'TileMap'";
3242 throw SquirrelError(v, msg.str());
3245 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3246 std::ostringstream msg;
3247 msg << "Couldn't setup squirrel instance for object of type 'TileMap'";
3248 throw SquirrelError(v, msg.str());
3250 sq_remove(v, -2); // remove object name
3252 if(setup_releasehook) {
3253 sq_setreleasehook(v, -1, TileMap_release_hook);
3256 sq_remove(v, -2); // remove root table
3259 void register_supertux_wrapper(HSQUIRRELVM v)
3261 using namespace Wrapper;
3263 sq_pushstring(v, "ANCHOR_TOP", -1);
3264 sq_pushinteger(v, 16);
3265 if(SQ_FAILED(sq_createslot(v, -3))) {
3266 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
3269 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
3270 sq_pushinteger(v, 32);
3271 if(SQ_FAILED(sq_createslot(v, -3))) {
3272 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
3275 sq_pushstring(v, "ANCHOR_LEFT", -1);
3276 sq_pushinteger(v, 1);
3277 if(SQ_FAILED(sq_createslot(v, -3))) {
3278 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
3281 sq_pushstring(v, "ANCHOR_RIGHT", -1);
3282 sq_pushinteger(v, 2);
3283 if(SQ_FAILED(sq_createslot(v, -3))) {
3284 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
3287 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
3288 sq_pushinteger(v, 0);
3289 if(SQ_FAILED(sq_createslot(v, -3))) {
3290 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
3293 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
3294 sq_pushinteger(v, 17);
3295 if(SQ_FAILED(sq_createslot(v, -3))) {
3296 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
3299 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
3300 sq_pushinteger(v, 18);
3301 if(SQ_FAILED(sq_createslot(v, -3))) {
3302 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
3305 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
3306 sq_pushinteger(v, 33);
3307 if(SQ_FAILED(sq_createslot(v, -3))) {
3308 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
3311 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
3312 sq_pushinteger(v, 34);
3313 if(SQ_FAILED(sq_createslot(v, -3))) {
3314 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
3317 sq_pushstring(v, "display", -1);
3318 sq_newclosure(v, &display_wrapper, 0);
3319 if(SQ_FAILED(sq_createslot(v, -3))) {
3320 throw SquirrelError(v, "Couldn't register function 'display'");
3323 sq_pushstring(v, "print_stacktrace", -1);
3324 sq_newclosure(v, &print_stacktrace_wrapper, 0);
3325 if(SQ_FAILED(sq_createslot(v, -3))) {
3326 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
3329 sq_pushstring(v, "get_current_thread", -1);
3330 sq_newclosure(v, &get_current_thread_wrapper, 0);
3331 if(SQ_FAILED(sq_createslot(v, -3))) {
3332 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
3335 sq_pushstring(v, "display_text_file", -1);
3336 sq_newclosure(v, &display_text_file_wrapper, 0);
3337 if(SQ_FAILED(sq_createslot(v, -3))) {
3338 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
3341 sq_pushstring(v, "load_worldmap", -1);
3342 sq_newclosure(v, &load_worldmap_wrapper, 0);
3343 if(SQ_FAILED(sq_createslot(v, -3))) {
3344 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
3347 sq_pushstring(v, "load_level", -1);
3348 sq_newclosure(v, &load_level_wrapper, 0);
3349 if(SQ_FAILED(sq_createslot(v, -3))) {
3350 throw SquirrelError(v, "Couldn't register function 'load_level'");
3353 sq_pushstring(v, "wait", -1);
3354 sq_newclosure(v, &wait_wrapper, 0);
3355 if(SQ_FAILED(sq_createslot(v, -3))) {
3356 throw SquirrelError(v, "Couldn't register function 'wait'");
3359 sq_pushstring(v, "wait_for_screenswitch", -1);
3360 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
3361 if(SQ_FAILED(sq_createslot(v, -3))) {
3362 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
3365 sq_pushstring(v, "exit_screen", -1);
3366 sq_newclosure(v, &exit_screen_wrapper, 0);
3367 if(SQ_FAILED(sq_createslot(v, -3))) {
3368 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
3371 sq_pushstring(v, "fadeout_screen", -1);
3372 sq_newclosure(v, &fadeout_screen_wrapper, 0);
3373 if(SQ_FAILED(sq_createslot(v, -3))) {
3374 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
3377 sq_pushstring(v, "shrink_screen", -1);
3378 sq_newclosure(v, &shrink_screen_wrapper, 0);
3379 if(SQ_FAILED(sq_createslot(v, -3))) {
3380 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
3383 sq_pushstring(v, "translate", -1);
3384 sq_newclosure(v, &translate_wrapper, 0);
3385 if(SQ_FAILED(sq_createslot(v, -3))) {
3386 throw SquirrelError(v, "Couldn't register function 'translate'");
3389 sq_pushstring(v, "import", -1);
3390 sq_newclosure(v, &import_wrapper, 0);
3391 if(SQ_FAILED(sq_createslot(v, -3))) {
3392 throw SquirrelError(v, "Couldn't register function 'import'");
3395 sq_pushstring(v, "save_state", -1);
3396 sq_newclosure(v, &save_state_wrapper, 0);
3397 if(SQ_FAILED(sq_createslot(v, -3))) {
3398 throw SquirrelError(v, "Couldn't register function 'save_state'");
3401 sq_pushstring(v, "debug_collrects", -1);
3402 sq_newclosure(v, &debug_collrects_wrapper, 0);
3403 if(SQ_FAILED(sq_createslot(v, -3))) {
3404 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
3407 sq_pushstring(v, "debug_show_fps", -1);
3408 sq_newclosure(v, &debug_show_fps_wrapper, 0);
3409 if(SQ_FAILED(sq_createslot(v, -3))) {
3410 throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
3413 sq_pushstring(v, "debug_draw_solids_only", -1);
3414 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
3415 if(SQ_FAILED(sq_createslot(v, -3))) {
3416 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
3419 sq_pushstring(v, "play_music", -1);
3420 sq_newclosure(v, &play_music_wrapper, 0);
3421 if(SQ_FAILED(sq_createslot(v, -3))) {
3422 throw SquirrelError(v, "Couldn't register function 'play_music'");
3425 sq_pushstring(v, "play_sound", -1);
3426 sq_newclosure(v, &play_sound_wrapper, 0);
3427 if(SQ_FAILED(sq_createslot(v, -3))) {
3428 throw SquirrelError(v, "Couldn't register function 'play_sound'");
3431 sq_pushstring(v, "grease", -1);
3432 sq_newclosure(v, &grease_wrapper, 0);
3433 if(SQ_FAILED(sq_createslot(v, -3))) {
3434 throw SquirrelError(v, "Couldn't register function 'grease'");
3437 sq_pushstring(v, "invincible", -1);
3438 sq_newclosure(v, &invincible_wrapper, 0);
3439 if(SQ_FAILED(sq_createslot(v, -3))) {
3440 throw SquirrelError(v, "Couldn't register function 'invincible'");
3443 sq_pushstring(v, "ghost", -1);
3444 sq_newclosure(v, &ghost_wrapper, 0);
3445 if(SQ_FAILED(sq_createslot(v, -3))) {
3446 throw SquirrelError(v, "Couldn't register function 'ghost'");
3449 sq_pushstring(v, "mortal", -1);
3450 sq_newclosure(v, &mortal_wrapper, 0);
3451 if(SQ_FAILED(sq_createslot(v, -3))) {
3452 throw SquirrelError(v, "Couldn't register function 'mortal'");
3455 sq_pushstring(v, "restart", -1);
3456 sq_newclosure(v, &restart_wrapper, 0);
3457 if(SQ_FAILED(sq_createslot(v, -3))) {
3458 throw SquirrelError(v, "Couldn't register function 'restart'");
3461 sq_pushstring(v, "whereami", -1);
3462 sq_newclosure(v, &whereami_wrapper, 0);
3463 if(SQ_FAILED(sq_createslot(v, -3))) {
3464 throw SquirrelError(v, "Couldn't register function 'whereami'");
3467 sq_pushstring(v, "gotoend", -1);
3468 sq_newclosure(v, &gotoend_wrapper, 0);
3469 if(SQ_FAILED(sq_createslot(v, -3))) {
3470 throw SquirrelError(v, "Couldn't register function 'gotoend'");
3473 sq_pushstring(v, "camera", -1);
3474 sq_newclosure(v, &camera_wrapper, 0);
3475 if(SQ_FAILED(sq_createslot(v, -3))) {
3476 throw SquirrelError(v, "Couldn't register function 'camera'");
3479 sq_pushstring(v, "quit", -1);
3480 sq_newclosure(v, &quit_wrapper, 0);
3481 if(SQ_FAILED(sq_createslot(v, -3))) {
3482 throw SquirrelError(v, "Couldn't register function 'quit'");
3485 sq_pushstring(v, "rand", -1);
3486 sq_newclosure(v, &rand_wrapper, 0);
3487 if(SQ_FAILED(sq_createslot(v, -3))) {
3488 throw SquirrelError(v, "Couldn't register function 'rand'");
3491 // Register class DisplayEffect
3492 sq_pushstring(v, "DisplayEffect", -1);
3493 if(sq_newclass(v, SQFalse) < 0) {
3494 std::ostringstream msg;
3495 msg << "Couldn't create new class 'DisplayEffect'";
3496 throw SquirrelError(v, msg.str());
3498 sq_pushstring(v, "fade_out", -1);
3499 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
3500 if(SQ_FAILED(sq_createslot(v, -3))) {
3501 throw SquirrelError(v, "Couldn't register function 'fade_out'");
3504 sq_pushstring(v, "fade_in", -1);
3505 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
3506 if(SQ_FAILED(sq_createslot(v, -3))) {
3507 throw SquirrelError(v, "Couldn't register function 'fade_in'");
3510 sq_pushstring(v, "set_black", -1);
3511 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
3512 if(SQ_FAILED(sq_createslot(v, -3))) {
3513 throw SquirrelError(v, "Couldn't register function 'set_black'");
3516 sq_pushstring(v, "is_black", -1);
3517 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
3518 if(SQ_FAILED(sq_createslot(v, -3))) {
3519 throw SquirrelError(v, "Couldn't register function 'is_black'");
3522 sq_pushstring(v, "sixteen_to_nine", -1);
3523 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
3524 if(SQ_FAILED(sq_createslot(v, -3))) {
3525 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
3528 sq_pushstring(v, "four_to_three", -1);
3529 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
3530 if(SQ_FAILED(sq_createslot(v, -3))) {
3531 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
3534 if(SQ_FAILED(sq_createslot(v, -3))) {
3535 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
3538 // Register class Camera
3539 sq_pushstring(v, "Camera", -1);
3540 if(sq_newclass(v, SQFalse) < 0) {
3541 std::ostringstream msg;
3542 msg << "Couldn't create new class 'Camera'";
3543 throw SquirrelError(v, msg.str());
3545 sq_pushstring(v, "shake", -1);
3546 sq_newclosure(v, &Camera_shake_wrapper, 0);
3547 if(SQ_FAILED(sq_createslot(v, -3))) {
3548 throw SquirrelError(v, "Couldn't register function 'shake'");
3551 sq_pushstring(v, "set_pos", -1);
3552 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
3553 if(SQ_FAILED(sq_createslot(v, -3))) {
3554 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3557 sq_pushstring(v, "set_mode", -1);
3558 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
3559 if(SQ_FAILED(sq_createslot(v, -3))) {
3560 throw SquirrelError(v, "Couldn't register function 'set_mode'");
3563 sq_pushstring(v, "scroll_to", -1);
3564 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
3565 if(SQ_FAILED(sq_createslot(v, -3))) {
3566 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
3569 if(SQ_FAILED(sq_createslot(v, -3))) {
3570 throw SquirrelError(v, "Couldn't register class 'Camera'");
3573 // Register class Level
3574 sq_pushstring(v, "Level", -1);
3575 if(sq_newclass(v, SQFalse) < 0) {
3576 std::ostringstream msg;
3577 msg << "Couldn't create new class 'Level'";
3578 throw SquirrelError(v, msg.str());
3580 sq_pushstring(v, "finish", -1);
3581 sq_newclosure(v, &Level_finish_wrapper, 0);
3582 if(SQ_FAILED(sq_createslot(v, -3))) {
3583 throw SquirrelError(v, "Couldn't register function 'finish'");
3586 sq_pushstring(v, "spawn", -1);
3587 sq_newclosure(v, &Level_spawn_wrapper, 0);
3588 if(SQ_FAILED(sq_createslot(v, -3))) {
3589 throw SquirrelError(v, "Couldn't register function 'spawn'");
3592 sq_pushstring(v, "flip_vertically", -1);
3593 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
3594 if(SQ_FAILED(sq_createslot(v, -3))) {
3595 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
3598 sq_pushstring(v, "toggle_pause", -1);
3599 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
3600 if(SQ_FAILED(sq_createslot(v, -3))) {
3601 throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
3604 if(SQ_FAILED(sq_createslot(v, -3))) {
3605 throw SquirrelError(v, "Couldn't register class 'Level'");
3608 // Register class ScriptedObject
3609 sq_pushstring(v, "ScriptedObject", -1);
3610 if(sq_newclass(v, SQFalse) < 0) {
3611 std::ostringstream msg;
3612 msg << "Couldn't create new class 'ScriptedObject'";
3613 throw SquirrelError(v, msg.str());
3615 sq_pushstring(v, "set_action", -1);
3616 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
3617 if(SQ_FAILED(sq_createslot(v, -3))) {
3618 throw SquirrelError(v, "Couldn't register function 'set_action'");
3621 sq_pushstring(v, "get_action", -1);
3622 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
3623 if(SQ_FAILED(sq_createslot(v, -3))) {
3624 throw SquirrelError(v, "Couldn't register function 'get_action'");
3627 sq_pushstring(v, "move", -1);
3628 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
3629 if(SQ_FAILED(sq_createslot(v, -3))) {
3630 throw SquirrelError(v, "Couldn't register function 'move'");
3633 sq_pushstring(v, "set_pos", -1);
3634 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
3635 if(SQ_FAILED(sq_createslot(v, -3))) {
3636 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3639 sq_pushstring(v, "get_pos_x", -1);
3640 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
3641 if(SQ_FAILED(sq_createslot(v, -3))) {
3642 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3645 sq_pushstring(v, "get_pos_y", -1);
3646 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
3647 if(SQ_FAILED(sq_createslot(v, -3))) {
3648 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3651 sq_pushstring(v, "set_velocity", -1);
3652 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
3653 if(SQ_FAILED(sq_createslot(v, -3))) {
3654 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
3657 sq_pushstring(v, "get_velocity_x", -1);
3658 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
3659 if(SQ_FAILED(sq_createslot(v, -3))) {
3660 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
3663 sq_pushstring(v, "get_velocity_y", -1);
3664 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
3665 if(SQ_FAILED(sq_createslot(v, -3))) {
3666 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
3669 sq_pushstring(v, "set_visible", -1);
3670 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
3671 if(SQ_FAILED(sq_createslot(v, -3))) {
3672 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3675 sq_pushstring(v, "is_visible", -1);
3676 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
3677 if(SQ_FAILED(sq_createslot(v, -3))) {
3678 throw SquirrelError(v, "Couldn't register function 'is_visible'");
3681 sq_pushstring(v, "set_solid", -1);
3682 sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
3683 if(SQ_FAILED(sq_createslot(v, -3))) {
3684 throw SquirrelError(v, "Couldn't register function 'set_solid'");
3687 sq_pushstring(v, "is_solid", -1);
3688 sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
3689 if(SQ_FAILED(sq_createslot(v, -3))) {
3690 throw SquirrelError(v, "Couldn't register function 'is_solid'");
3693 sq_pushstring(v, "get_name", -1);
3694 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
3695 if(SQ_FAILED(sq_createslot(v, -3))) {
3696 throw SquirrelError(v, "Couldn't register function 'get_name'");
3699 if(SQ_FAILED(sq_createslot(v, -3))) {
3700 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
3703 // Register class Text
3704 sq_pushstring(v, "Text", -1);
3705 if(sq_newclass(v, SQFalse) < 0) {
3706 std::ostringstream msg;
3707 msg << "Couldn't create new class 'Text'";
3708 throw SquirrelError(v, msg.str());
3710 sq_pushstring(v, "set_text", -1);
3711 sq_newclosure(v, &Text_set_text_wrapper, 0);
3712 if(SQ_FAILED(sq_createslot(v, -3))) {
3713 throw SquirrelError(v, "Couldn't register function 'set_text'");
3716 sq_pushstring(v, "set_font", -1);
3717 sq_newclosure(v, &Text_set_font_wrapper, 0);
3718 if(SQ_FAILED(sq_createslot(v, -3))) {
3719 throw SquirrelError(v, "Couldn't register function 'set_font'");
3722 sq_pushstring(v, "fade_in", -1);
3723 sq_newclosure(v, &Text_fade_in_wrapper, 0);
3724 if(SQ_FAILED(sq_createslot(v, -3))) {
3725 throw SquirrelError(v, "Couldn't register function 'fade_in'");
3728 sq_pushstring(v, "fade_out", -1);
3729 sq_newclosure(v, &Text_fade_out_wrapper, 0);
3730 if(SQ_FAILED(sq_createslot(v, -3))) {
3731 throw SquirrelError(v, "Couldn't register function 'fade_out'");
3734 sq_pushstring(v, "set_visible", -1);
3735 sq_newclosure(v, &Text_set_visible_wrapper, 0);
3736 if(SQ_FAILED(sq_createslot(v, -3))) {
3737 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3740 sq_pushstring(v, "set_centered", -1);
3741 sq_newclosure(v, &Text_set_centered_wrapper, 0);
3742 if(SQ_FAILED(sq_createslot(v, -3))) {
3743 throw SquirrelError(v, "Couldn't register function 'set_centered'");
3746 if(SQ_FAILED(sq_createslot(v, -3))) {
3747 throw SquirrelError(v, "Couldn't register class 'Text'");
3750 // Register class Player
3751 sq_pushstring(v, "Player", -1);
3752 if(sq_newclass(v, SQFalse) < 0) {
3753 std::ostringstream msg;
3754 msg << "Couldn't create new class 'Player'";
3755 throw SquirrelError(v, msg.str());
3757 sq_pushstring(v, "add_bonus", -1);
3758 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
3759 if(SQ_FAILED(sq_createslot(v, -3))) {
3760 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
3763 sq_pushstring(v, "add_coins", -1);
3764 sq_newclosure(v, &Player_add_coins_wrapper, 0);
3765 if(SQ_FAILED(sq_createslot(v, -3))) {
3766 throw SquirrelError(v, "Couldn't register function 'add_coins'");
3769 sq_pushstring(v, "make_invincible", -1);
3770 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
3771 if(SQ_FAILED(sq_createslot(v, -3))) {
3772 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
3775 sq_pushstring(v, "deactivate", -1);
3776 sq_newclosure(v, &Player_deactivate_wrapper, 0);
3777 if(SQ_FAILED(sq_createslot(v, -3))) {
3778 throw SquirrelError(v, "Couldn't register function 'deactivate'");
3781 sq_pushstring(v, "activate", -1);
3782 sq_newclosure(v, &Player_activate_wrapper, 0);
3783 if(SQ_FAILED(sq_createslot(v, -3))) {
3784 throw SquirrelError(v, "Couldn't register function 'activate'");
3787 sq_pushstring(v, "walk", -1);
3788 sq_newclosure(v, &Player_walk_wrapper, 0);
3789 if(SQ_FAILED(sq_createslot(v, -3))) {
3790 throw SquirrelError(v, "Couldn't register function 'walk'");
3793 sq_pushstring(v, "set_visible", -1);
3794 sq_newclosure(v, &Player_set_visible_wrapper, 0);
3795 if(SQ_FAILED(sq_createslot(v, -3))) {
3796 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3799 sq_pushstring(v, "get_visible", -1);
3800 sq_newclosure(v, &Player_get_visible_wrapper, 0);
3801 if(SQ_FAILED(sq_createslot(v, -3))) {
3802 throw SquirrelError(v, "Couldn't register function 'get_visible'");
3805 sq_pushstring(v, "kill", -1);
3806 sq_newclosure(v, &Player_kill_wrapper, 0);
3807 if(SQ_FAILED(sq_createslot(v, -3))) {
3808 throw SquirrelError(v, "Couldn't register function 'kill'");
3811 sq_pushstring(v, "set_ghost_mode", -1);
3812 sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
3813 if(SQ_FAILED(sq_createslot(v, -3))) {
3814 throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
3817 sq_pushstring(v, "get_ghost_mode", -1);
3818 sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
3819 if(SQ_FAILED(sq_createslot(v, -3))) {
3820 throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
3823 sq_pushstring(v, "do_cheer", -1);
3824 sq_newclosure(v, &Player_do_cheer_wrapper, 0);
3825 if(SQ_FAILED(sq_createslot(v, -3))) {
3826 throw SquirrelError(v, "Couldn't register function 'do_cheer'");
3829 sq_pushstring(v, "do_duck", -1);
3830 sq_newclosure(v, &Player_do_duck_wrapper, 0);
3831 if(SQ_FAILED(sq_createslot(v, -3))) {
3832 throw SquirrelError(v, "Couldn't register function 'do_duck'");
3835 sq_pushstring(v, "do_standup", -1);
3836 sq_newclosure(v, &Player_do_standup_wrapper, 0);
3837 if(SQ_FAILED(sq_createslot(v, -3))) {
3838 throw SquirrelError(v, "Couldn't register function 'do_standup'");
3841 sq_pushstring(v, "do_backflip", -1);
3842 sq_newclosure(v, &Player_do_backflip_wrapper, 0);
3843 if(SQ_FAILED(sq_createslot(v, -3))) {
3844 throw SquirrelError(v, "Couldn't register function 'do_backflip'");
3847 sq_pushstring(v, "do_jump", -1);
3848 sq_newclosure(v, &Player_do_jump_wrapper, 0);
3849 if(SQ_FAILED(sq_createslot(v, -3))) {
3850 throw SquirrelError(v, "Couldn't register function 'do_jump'");
3853 if(SQ_FAILED(sq_createslot(v, -3))) {
3854 throw SquirrelError(v, "Couldn't register class 'Player'");
3857 // Register class FloatingImage
3858 sq_pushstring(v, "FloatingImage", -1);
3859 if(sq_newclass(v, SQFalse) < 0) {
3860 std::ostringstream msg;
3861 msg << "Couldn't create new class 'FloatingImage'";
3862 throw SquirrelError(v, msg.str());
3864 sq_pushstring(v, "constructor", -1);
3865 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
3866 if(SQ_FAILED(sq_createslot(v, -3))) {
3867 throw SquirrelError(v, "Couldn't register function 'constructor'");
3870 sq_pushstring(v, "set_layer", -1);
3871 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
3872 if(SQ_FAILED(sq_createslot(v, -3))) {
3873 throw SquirrelError(v, "Couldn't register function 'set_layer'");
3876 sq_pushstring(v, "get_layer", -1);
3877 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
3878 if(SQ_FAILED(sq_createslot(v, -3))) {
3879 throw SquirrelError(v, "Couldn't register function 'get_layer'");
3882 sq_pushstring(v, "set_pos", -1);
3883 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
3884 if(SQ_FAILED(sq_createslot(v, -3))) {
3885 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3888 sq_pushstring(v, "get_pos_x", -1);
3889 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
3890 if(SQ_FAILED(sq_createslot(v, -3))) {
3891 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3894 sq_pushstring(v, "get_pos_y", -1);
3895 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
3896 if(SQ_FAILED(sq_createslot(v, -3))) {
3897 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3900 sq_pushstring(v, "set_anchor_point", -1);
3901 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
3902 if(SQ_FAILED(sq_createslot(v, -3))) {
3903 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
3906 sq_pushstring(v, "get_anchor_point", -1);
3907 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
3908 if(SQ_FAILED(sq_createslot(v, -3))) {
3909 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
3912 sq_pushstring(v, "set_visible", -1);
3913 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
3914 if(SQ_FAILED(sq_createslot(v, -3))) {
3915 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3918 sq_pushstring(v, "get_visible", -1);
3919 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
3920 if(SQ_FAILED(sq_createslot(v, -3))) {
3921 throw SquirrelError(v, "Couldn't register function 'get_visible'");
3924 sq_pushstring(v, "set_action", -1);
3925 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
3926 if(SQ_FAILED(sq_createslot(v, -3))) {
3927 throw SquirrelError(v, "Couldn't register function 'set_action'");
3930 sq_pushstring(v, "get_action", -1);
3931 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
3932 if(SQ_FAILED(sq_createslot(v, -3))) {
3933 throw SquirrelError(v, "Couldn't register function 'get_action'");
3936 if(SQ_FAILED(sq_createslot(v, -3))) {
3937 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
3940 // Register class Platform
3941 sq_pushstring(v, "Platform", -1);
3942 if(sq_newclass(v, SQFalse) < 0) {
3943 std::ostringstream msg;
3944 msg << "Couldn't create new class 'Platform'";
3945 throw SquirrelError(v, msg.str());
3947 sq_pushstring(v, "goto_node", -1);
3948 sq_newclosure(v, &Platform_goto_node_wrapper, 0);
3949 if(SQ_FAILED(sq_createslot(v, -3))) {
3950 throw SquirrelError(v, "Couldn't register function 'goto_node'");
3953 sq_pushstring(v, "start_moving", -1);
3954 sq_newclosure(v, &Platform_start_moving_wrapper, 0);
3955 if(SQ_FAILED(sq_createslot(v, -3))) {
3956 throw SquirrelError(v, "Couldn't register function 'start_moving'");
3959 sq_pushstring(v, "stop_moving", -1);
3960 sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
3961 if(SQ_FAILED(sq_createslot(v, -3))) {
3962 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
3965 if(SQ_FAILED(sq_createslot(v, -3))) {
3966 throw SquirrelError(v, "Couldn't register class 'Platform'");
3969 // Register class Candle
3970 sq_pushstring(v, "Candle", -1);
3971 if(sq_newclass(v, SQFalse) < 0) {
3972 std::ostringstream msg;
3973 msg << "Couldn't create new class 'Candle'";
3974 throw SquirrelError(v, msg.str());
3976 sq_pushstring(v, "get_burning", -1);
3977 sq_newclosure(v, &Candle_get_burning_wrapper, 0);
3978 if(SQ_FAILED(sq_createslot(v, -3))) {
3979 throw SquirrelError(v, "Couldn't register function 'get_burning'");
3982 sq_pushstring(v, "set_burning", -1);
3983 sq_newclosure(v, &Candle_set_burning_wrapper, 0);
3984 if(SQ_FAILED(sq_createslot(v, -3))) {
3985 throw SquirrelError(v, "Couldn't register function 'set_burning'");
3988 if(SQ_FAILED(sq_createslot(v, -3))) {
3989 throw SquirrelError(v, "Couldn't register class 'Candle'");
3992 // Register class Wind
3993 sq_pushstring(v, "Wind", -1);
3994 if(sq_newclass(v, SQFalse) < 0) {
3995 std::ostringstream msg;
3996 msg << "Couldn't create new class 'Wind'";
3997 throw SquirrelError(v, msg.str());
3999 sq_pushstring(v, "start", -1);
4000 sq_newclosure(v, &Wind_start_wrapper, 0);
4001 if(SQ_FAILED(sq_createslot(v, -3))) {
4002 throw SquirrelError(v, "Couldn't register function 'start'");
4005 sq_pushstring(v, "stop", -1);
4006 sq_newclosure(v, &Wind_stop_wrapper, 0);
4007 if(SQ_FAILED(sq_createslot(v, -3))) {
4008 throw SquirrelError(v, "Couldn't register function 'stop'");
4011 if(SQ_FAILED(sq_createslot(v, -3))) {
4012 throw SquirrelError(v, "Couldn't register class 'Wind'");
4015 // Register class AmbientSound
4016 sq_pushstring(v, "AmbientSound", -1);
4017 if(sq_newclass(v, SQFalse) < 0) {
4018 std::ostringstream msg;
4019 msg << "Couldn't create new class 'AmbientSound'";
4020 throw SquirrelError(v, msg.str());
4022 sq_pushstring(v, "set_pos", -1);
4023 sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
4024 if(SQ_FAILED(sq_createslot(v, -3))) {
4025 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4028 sq_pushstring(v, "get_pos_x", -1);
4029 sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
4030 if(SQ_FAILED(sq_createslot(v, -3))) {
4031 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4034 sq_pushstring(v, "get_pos_y", -1);
4035 sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
4036 if(SQ_FAILED(sq_createslot(v, -3))) {
4037 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4040 if(SQ_FAILED(sq_createslot(v, -3))) {
4041 throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
4044 // Register class Thunderstorm
4045 sq_pushstring(v, "Thunderstorm", -1);
4046 if(sq_newclass(v, SQFalse) < 0) {
4047 std::ostringstream msg;
4048 msg << "Couldn't create new class 'Thunderstorm'";
4049 throw SquirrelError(v, msg.str());
4051 sq_pushstring(v, "start", -1);
4052 sq_newclosure(v, &Thunderstorm_start_wrapper, 0);
4053 if(SQ_FAILED(sq_createslot(v, -3))) {
4054 throw SquirrelError(v, "Couldn't register function 'start'");
4057 sq_pushstring(v, "stop", -1);
4058 sq_newclosure(v, &Thunderstorm_stop_wrapper, 0);
4059 if(SQ_FAILED(sq_createslot(v, -3))) {
4060 throw SquirrelError(v, "Couldn't register function 'stop'");
4063 sq_pushstring(v, "thunder", -1);
4064 sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0);
4065 if(SQ_FAILED(sq_createslot(v, -3))) {
4066 throw SquirrelError(v, "Couldn't register function 'thunder'");
4069 sq_pushstring(v, "lightning", -1);
4070 sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0);
4071 if(SQ_FAILED(sq_createslot(v, -3))) {
4072 throw SquirrelError(v, "Couldn't register function 'lightning'");
4075 sq_pushstring(v, "flash", -1);
4076 sq_newclosure(v, &Thunderstorm_flash_wrapper, 0);
4077 if(SQ_FAILED(sq_createslot(v, -3))) {
4078 throw SquirrelError(v, "Couldn't register function 'flash'");
4081 sq_pushstring(v, "electrify", -1);
4082 sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0);
4083 if(SQ_FAILED(sq_createslot(v, -3))) {
4084 throw SquirrelError(v, "Couldn't register function 'electrify'");
4087 if(SQ_FAILED(sq_createslot(v, -3))) {
4088 throw SquirrelError(v, "Couldn't register class 'Thunderstorm'");
4091 // Register class TileMap
4092 sq_pushstring(v, "TileMap", -1);
4093 if(sq_newclass(v, SQFalse) < 0) {
4094 std::ostringstream msg;
4095 msg << "Couldn't create new class 'TileMap'";
4096 throw SquirrelError(v, msg.str());
4098 sq_pushstring(v, "goto_node", -1);
4099 sq_newclosure(v, &TileMap_goto_node_wrapper, 0);
4100 if(SQ_FAILED(sq_createslot(v, -3))) {
4101 throw SquirrelError(v, "Couldn't register function 'goto_node'");
4104 sq_pushstring(v, "start_moving", -1);
4105 sq_newclosure(v, &TileMap_start_moving_wrapper, 0);
4106 if(SQ_FAILED(sq_createslot(v, -3))) {
4107 throw SquirrelError(v, "Couldn't register function 'start_moving'");
4110 sq_pushstring(v, "stop_moving", -1);
4111 sq_newclosure(v, &TileMap_stop_moving_wrapper, 0);
4112 if(SQ_FAILED(sq_createslot(v, -3))) {
4113 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
4116 if(SQ_FAILED(sq_createslot(v, -3))) {
4117 throw SquirrelError(v, "Couldn't register class 'TileMap'");
4122 } // end of namespace Scripting