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 display_wrapper(HSQUIRRELVM vm)
2098 return Scripting::display(vm);
2101 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
2103 HSQUIRRELVM arg0 = vm;
2106 Scripting::print_stacktrace(arg0);
2110 } catch(std::exception& e) {
2111 sq_throwerror(vm, e.what());
2114 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
2120 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
2122 return Scripting::get_current_thread(vm);
2125 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
2128 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2129 sq_throwerror(vm, _SC("Argument 1 not a string"));
2134 Scripting::display_text_file(arg0);
2138 } catch(std::exception& e) {
2139 sq_throwerror(vm, e.what());
2142 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
2148 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
2151 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2152 sq_throwerror(vm, _SC("Argument 1 not a string"));
2157 Scripting::load_worldmap(arg0);
2161 } catch(std::exception& e) {
2162 sq_throwerror(vm, e.what());
2165 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
2171 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
2174 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2175 sq_throwerror(vm, _SC("Argument 1 not a string"));
2180 Scripting::load_level(arg0);
2184 } catch(std::exception& e) {
2185 sq_throwerror(vm, e.what());
2188 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
2194 static SQInteger wait_wrapper(HSQUIRRELVM vm)
2196 HSQUIRRELVM arg0 = vm;
2198 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
2199 sq_throwerror(vm, _SC("Argument 1 not a float"));
2204 Scripting::wait(arg0, static_cast<float> (arg1));
2206 return sq_suspendvm(vm);
2208 } catch(std::exception& e) {
2209 sq_throwerror(vm, e.what());
2212 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
2218 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
2220 HSQUIRRELVM arg0 = vm;
2223 Scripting::wait_for_screenswitch(arg0);
2225 return sq_suspendvm(vm);
2227 } catch(std::exception& e) {
2228 sq_throwerror(vm, e.what());
2231 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
2237 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
2242 Scripting::exit_screen();
2246 } catch(std::exception& e) {
2247 sq_throwerror(vm, e.what());
2250 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
2256 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
2259 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2260 sq_throwerror(vm, _SC("Argument 1 not a float"));
2265 Scripting::fadeout_screen(static_cast<float> (arg0));
2269 } catch(std::exception& e) {
2270 sq_throwerror(vm, e.what());
2273 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
2279 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
2282 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2283 sq_throwerror(vm, _SC("Argument 1 not a float"));
2287 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2288 sq_throwerror(vm, _SC("Argument 2 not a float"));
2292 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2293 sq_throwerror(vm, _SC("Argument 3 not a float"));
2298 Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2302 } catch(std::exception& e) {
2303 sq_throwerror(vm, e.what());
2306 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
2312 static SQInteger translate_wrapper(HSQUIRRELVM vm)
2315 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2316 sq_throwerror(vm, _SC("Argument 1 not a string"));
2321 std::string return_value = Scripting::translate(arg0);
2323 sq_pushstring(vm, return_value.c_str(), return_value.size());
2326 } catch(std::exception& e) {
2327 sq_throwerror(vm, e.what());
2330 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
2336 static SQInteger import_wrapper(HSQUIRRELVM vm)
2338 HSQUIRRELVM arg0 = vm;
2340 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
2341 sq_throwerror(vm, _SC("Argument 1 not a string"));
2346 Scripting::import(arg0, arg1);
2350 } catch(std::exception& e) {
2351 sq_throwerror(vm, e.what());
2354 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
2360 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
2365 Scripting::save_state();
2369 } catch(std::exception& e) {
2370 sq_throwerror(vm, e.what());
2373 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
2379 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
2382 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2383 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2388 Scripting::debug_collrects(arg0 == SQTrue);
2392 } catch(std::exception& e) {
2393 sq_throwerror(vm, e.what());
2396 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
2402 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
2405 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2406 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2411 Scripting::debug_show_fps(arg0 == SQTrue);
2415 } catch(std::exception& e) {
2416 sq_throwerror(vm, e.what());
2419 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
2425 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
2428 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2429 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2434 Scripting::debug_draw_solids_only(arg0 == SQTrue);
2438 } catch(std::exception& e) {
2439 sq_throwerror(vm, e.what());
2442 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
2448 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
2451 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2452 sq_throwerror(vm, _SC("Argument 1 not a string"));
2457 Scripting::play_music(arg0);
2461 } catch(std::exception& e) {
2462 sq_throwerror(vm, e.what());
2465 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
2471 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
2474 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2475 sq_throwerror(vm, _SC("Argument 1 not a string"));
2480 Scripting::play_sound(arg0);
2484 } catch(std::exception& e) {
2485 sq_throwerror(vm, e.what());
2488 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
2494 static SQInteger grease_wrapper(HSQUIRRELVM vm)
2499 Scripting::grease();
2503 } catch(std::exception& e) {
2504 sq_throwerror(vm, e.what());
2507 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
2513 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
2518 Scripting::invincible();
2522 } catch(std::exception& e) {
2523 sq_throwerror(vm, e.what());
2526 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
2532 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
2541 } catch(std::exception& e) {
2542 sq_throwerror(vm, e.what());
2545 sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
2551 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
2556 Scripting::mortal();
2560 } catch(std::exception& e) {
2561 sq_throwerror(vm, e.what());
2564 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
2570 static SQInteger restart_wrapper(HSQUIRRELVM vm)
2575 Scripting::restart();
2579 } catch(std::exception& e) {
2580 sq_throwerror(vm, e.what());
2583 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
2589 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
2594 Scripting::whereami();
2598 } catch(std::exception& e) {
2599 sq_throwerror(vm, e.what());
2602 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
2608 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
2613 Scripting::gotoend();
2617 } catch(std::exception& e) {
2618 sq_throwerror(vm, e.what());
2621 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
2627 static SQInteger camera_wrapper(HSQUIRRELVM vm)
2632 Scripting::camera();
2636 } catch(std::exception& e) {
2637 sq_throwerror(vm, e.what());
2640 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
2646 static SQInteger quit_wrapper(HSQUIRRELVM vm)
2655 } catch(std::exception& e) {
2656 sq_throwerror(vm, e.what());
2659 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
2665 static SQInteger rand_wrapper(HSQUIRRELVM vm)
2669 int return_value = Scripting::rand();
2671 sq_pushinteger(vm, return_value);
2674 } catch(std::exception& e) {
2675 sq_throwerror(vm, e.what());
2678 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
2684 } // end of namespace Wrapper
2686 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
2688 using namespace Wrapper;
2690 sq_pushroottable(v);
2691 sq_pushstring(v, "DisplayEffect", -1);
2692 if(SQ_FAILED(sq_get(v, -2))) {
2693 std::ostringstream msg;
2694 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
2695 throw SquirrelError(v, msg.str());
2698 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2699 std::ostringstream msg;
2700 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
2701 throw SquirrelError(v, msg.str());
2703 sq_remove(v, -2); // remove object name
2705 if(setup_releasehook) {
2706 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
2709 sq_remove(v, -2); // remove root table
2712 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
2714 using namespace Wrapper;
2716 sq_pushroottable(v);
2717 sq_pushstring(v, "Camera", -1);
2718 if(SQ_FAILED(sq_get(v, -2))) {
2719 std::ostringstream msg;
2720 msg << "Couldn't resolved squirrel type 'Camera'";
2721 throw SquirrelError(v, msg.str());
2724 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2725 std::ostringstream msg;
2726 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
2727 throw SquirrelError(v, msg.str());
2729 sq_remove(v, -2); // remove object name
2731 if(setup_releasehook) {
2732 sq_setreleasehook(v, -1, Camera_release_hook);
2735 sq_remove(v, -2); // remove root table
2738 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
2740 using namespace Wrapper;
2742 sq_pushroottable(v);
2743 sq_pushstring(v, "Level", -1);
2744 if(SQ_FAILED(sq_get(v, -2))) {
2745 std::ostringstream msg;
2746 msg << "Couldn't resolved squirrel type 'Level'";
2747 throw SquirrelError(v, msg.str());
2750 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2751 std::ostringstream msg;
2752 msg << "Couldn't setup squirrel instance for object of type 'Level'";
2753 throw SquirrelError(v, msg.str());
2755 sq_remove(v, -2); // remove object name
2757 if(setup_releasehook) {
2758 sq_setreleasehook(v, -1, Level_release_hook);
2761 sq_remove(v, -2); // remove root table
2764 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
2766 using namespace Wrapper;
2768 sq_pushroottable(v);
2769 sq_pushstring(v, "ScriptedObject", -1);
2770 if(SQ_FAILED(sq_get(v, -2))) {
2771 std::ostringstream msg;
2772 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
2773 throw SquirrelError(v, msg.str());
2776 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2777 std::ostringstream msg;
2778 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
2779 throw SquirrelError(v, msg.str());
2781 sq_remove(v, -2); // remove object name
2783 if(setup_releasehook) {
2784 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
2787 sq_remove(v, -2); // remove root table
2790 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
2792 using namespace Wrapper;
2794 sq_pushroottable(v);
2795 sq_pushstring(v, "Text", -1);
2796 if(SQ_FAILED(sq_get(v, -2))) {
2797 std::ostringstream msg;
2798 msg << "Couldn't resolved squirrel type 'Text'";
2799 throw SquirrelError(v, msg.str());
2802 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2803 std::ostringstream msg;
2804 msg << "Couldn't setup squirrel instance for object of type 'Text'";
2805 throw SquirrelError(v, msg.str());
2807 sq_remove(v, -2); // remove object name
2809 if(setup_releasehook) {
2810 sq_setreleasehook(v, -1, Text_release_hook);
2813 sq_remove(v, -2); // remove root table
2816 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
2818 using namespace Wrapper;
2820 sq_pushroottable(v);
2821 sq_pushstring(v, "Player", -1);
2822 if(SQ_FAILED(sq_get(v, -2))) {
2823 std::ostringstream msg;
2824 msg << "Couldn't resolved squirrel type 'Player'";
2825 throw SquirrelError(v, msg.str());
2828 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2829 std::ostringstream msg;
2830 msg << "Couldn't setup squirrel instance for object of type 'Player'";
2831 throw SquirrelError(v, msg.str());
2833 sq_remove(v, -2); // remove object name
2835 if(setup_releasehook) {
2836 sq_setreleasehook(v, -1, Player_release_hook);
2839 sq_remove(v, -2); // remove root table
2842 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
2844 using namespace Wrapper;
2846 sq_pushroottable(v);
2847 sq_pushstring(v, "FloatingImage", -1);
2848 if(SQ_FAILED(sq_get(v, -2))) {
2849 std::ostringstream msg;
2850 msg << "Couldn't resolved squirrel type 'FloatingImage'";
2851 throw SquirrelError(v, msg.str());
2854 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2855 std::ostringstream msg;
2856 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
2857 throw SquirrelError(v, msg.str());
2859 sq_remove(v, -2); // remove object name
2861 if(setup_releasehook) {
2862 sq_setreleasehook(v, -1, FloatingImage_release_hook);
2865 sq_remove(v, -2); // remove root table
2868 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
2870 using namespace Wrapper;
2872 sq_pushroottable(v);
2873 sq_pushstring(v, "Platform", -1);
2874 if(SQ_FAILED(sq_get(v, -2))) {
2875 std::ostringstream msg;
2876 msg << "Couldn't resolved squirrel type 'Platform'";
2877 throw SquirrelError(v, msg.str());
2880 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2881 std::ostringstream msg;
2882 msg << "Couldn't setup squirrel instance for object of type 'Platform'";
2883 throw SquirrelError(v, msg.str());
2885 sq_remove(v, -2); // remove object name
2887 if(setup_releasehook) {
2888 sq_setreleasehook(v, -1, Platform_release_hook);
2891 sq_remove(v, -2); // remove root table
2894 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
2896 using namespace Wrapper;
2898 sq_pushroottable(v);
2899 sq_pushstring(v, "Candle", -1);
2900 if(SQ_FAILED(sq_get(v, -2))) {
2901 std::ostringstream msg;
2902 msg << "Couldn't resolved squirrel type 'Candle'";
2903 throw SquirrelError(v, msg.str());
2906 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2907 std::ostringstream msg;
2908 msg << "Couldn't setup squirrel instance for object of type 'Candle'";
2909 throw SquirrelError(v, msg.str());
2911 sq_remove(v, -2); // remove object name
2913 if(setup_releasehook) {
2914 sq_setreleasehook(v, -1, Candle_release_hook);
2917 sq_remove(v, -2); // remove root table
2920 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
2922 using namespace Wrapper;
2924 sq_pushroottable(v);
2925 sq_pushstring(v, "Wind", -1);
2926 if(SQ_FAILED(sq_get(v, -2))) {
2927 std::ostringstream msg;
2928 msg << "Couldn't resolved squirrel type 'Wind'";
2929 throw SquirrelError(v, msg.str());
2932 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2933 std::ostringstream msg;
2934 msg << "Couldn't setup squirrel instance for object of type 'Wind'";
2935 throw SquirrelError(v, msg.str());
2937 sq_remove(v, -2); // remove object name
2939 if(setup_releasehook) {
2940 sq_setreleasehook(v, -1, Wind_release_hook);
2943 sq_remove(v, -2); // remove root table
2946 void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bool setup_releasehook)
2948 using namespace Wrapper;
2950 sq_pushroottable(v);
2951 sq_pushstring(v, "AmbientSound", -1);
2952 if(SQ_FAILED(sq_get(v, -2))) {
2953 std::ostringstream msg;
2954 msg << "Couldn't resolved squirrel type 'AmbientSound'";
2955 throw SquirrelError(v, msg.str());
2958 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2959 std::ostringstream msg;
2960 msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'";
2961 throw SquirrelError(v, msg.str());
2963 sq_remove(v, -2); // remove object name
2965 if(setup_releasehook) {
2966 sq_setreleasehook(v, -1, AmbientSound_release_hook);
2969 sq_remove(v, -2); // remove root table
2972 void register_supertux_wrapper(HSQUIRRELVM v)
2974 using namespace Wrapper;
2976 sq_pushstring(v, "ANCHOR_TOP", -1);
2977 sq_pushinteger(v, 16);
2978 if(SQ_FAILED(sq_createslot(v, -3))) {
2979 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
2982 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
2983 sq_pushinteger(v, 32);
2984 if(SQ_FAILED(sq_createslot(v, -3))) {
2985 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
2988 sq_pushstring(v, "ANCHOR_LEFT", -1);
2989 sq_pushinteger(v, 1);
2990 if(SQ_FAILED(sq_createslot(v, -3))) {
2991 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
2994 sq_pushstring(v, "ANCHOR_RIGHT", -1);
2995 sq_pushinteger(v, 2);
2996 if(SQ_FAILED(sq_createslot(v, -3))) {
2997 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
3000 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
3001 sq_pushinteger(v, 0);
3002 if(SQ_FAILED(sq_createslot(v, -3))) {
3003 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
3006 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
3007 sq_pushinteger(v, 17);
3008 if(SQ_FAILED(sq_createslot(v, -3))) {
3009 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
3012 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
3013 sq_pushinteger(v, 18);
3014 if(SQ_FAILED(sq_createslot(v, -3))) {
3015 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
3018 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
3019 sq_pushinteger(v, 33);
3020 if(SQ_FAILED(sq_createslot(v, -3))) {
3021 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
3024 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
3025 sq_pushinteger(v, 34);
3026 if(SQ_FAILED(sq_createslot(v, -3))) {
3027 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
3030 sq_pushstring(v, "display", -1);
3031 sq_newclosure(v, &display_wrapper, 0);
3032 if(SQ_FAILED(sq_createslot(v, -3))) {
3033 throw SquirrelError(v, "Couldn't register function 'display'");
3036 sq_pushstring(v, "print_stacktrace", -1);
3037 sq_newclosure(v, &print_stacktrace_wrapper, 0);
3038 if(SQ_FAILED(sq_createslot(v, -3))) {
3039 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
3042 sq_pushstring(v, "get_current_thread", -1);
3043 sq_newclosure(v, &get_current_thread_wrapper, 0);
3044 if(SQ_FAILED(sq_createslot(v, -3))) {
3045 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
3048 sq_pushstring(v, "display_text_file", -1);
3049 sq_newclosure(v, &display_text_file_wrapper, 0);
3050 if(SQ_FAILED(sq_createslot(v, -3))) {
3051 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
3054 sq_pushstring(v, "load_worldmap", -1);
3055 sq_newclosure(v, &load_worldmap_wrapper, 0);
3056 if(SQ_FAILED(sq_createslot(v, -3))) {
3057 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
3060 sq_pushstring(v, "load_level", -1);
3061 sq_newclosure(v, &load_level_wrapper, 0);
3062 if(SQ_FAILED(sq_createslot(v, -3))) {
3063 throw SquirrelError(v, "Couldn't register function 'load_level'");
3066 sq_pushstring(v, "wait", -1);
3067 sq_newclosure(v, &wait_wrapper, 0);
3068 if(SQ_FAILED(sq_createslot(v, -3))) {
3069 throw SquirrelError(v, "Couldn't register function 'wait'");
3072 sq_pushstring(v, "wait_for_screenswitch", -1);
3073 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
3074 if(SQ_FAILED(sq_createslot(v, -3))) {
3075 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
3078 sq_pushstring(v, "exit_screen", -1);
3079 sq_newclosure(v, &exit_screen_wrapper, 0);
3080 if(SQ_FAILED(sq_createslot(v, -3))) {
3081 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
3084 sq_pushstring(v, "fadeout_screen", -1);
3085 sq_newclosure(v, &fadeout_screen_wrapper, 0);
3086 if(SQ_FAILED(sq_createslot(v, -3))) {
3087 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
3090 sq_pushstring(v, "shrink_screen", -1);
3091 sq_newclosure(v, &shrink_screen_wrapper, 0);
3092 if(SQ_FAILED(sq_createslot(v, -3))) {
3093 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
3096 sq_pushstring(v, "translate", -1);
3097 sq_newclosure(v, &translate_wrapper, 0);
3098 if(SQ_FAILED(sq_createslot(v, -3))) {
3099 throw SquirrelError(v, "Couldn't register function 'translate'");
3102 sq_pushstring(v, "import", -1);
3103 sq_newclosure(v, &import_wrapper, 0);
3104 if(SQ_FAILED(sq_createslot(v, -3))) {
3105 throw SquirrelError(v, "Couldn't register function 'import'");
3108 sq_pushstring(v, "save_state", -1);
3109 sq_newclosure(v, &save_state_wrapper, 0);
3110 if(SQ_FAILED(sq_createslot(v, -3))) {
3111 throw SquirrelError(v, "Couldn't register function 'save_state'");
3114 sq_pushstring(v, "debug_collrects", -1);
3115 sq_newclosure(v, &debug_collrects_wrapper, 0);
3116 if(SQ_FAILED(sq_createslot(v, -3))) {
3117 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
3120 sq_pushstring(v, "debug_show_fps", -1);
3121 sq_newclosure(v, &debug_show_fps_wrapper, 0);
3122 if(SQ_FAILED(sq_createslot(v, -3))) {
3123 throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
3126 sq_pushstring(v, "debug_draw_solids_only", -1);
3127 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
3128 if(SQ_FAILED(sq_createslot(v, -3))) {
3129 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
3132 sq_pushstring(v, "play_music", -1);
3133 sq_newclosure(v, &play_music_wrapper, 0);
3134 if(SQ_FAILED(sq_createslot(v, -3))) {
3135 throw SquirrelError(v, "Couldn't register function 'play_music'");
3138 sq_pushstring(v, "play_sound", -1);
3139 sq_newclosure(v, &play_sound_wrapper, 0);
3140 if(SQ_FAILED(sq_createslot(v, -3))) {
3141 throw SquirrelError(v, "Couldn't register function 'play_sound'");
3144 sq_pushstring(v, "grease", -1);
3145 sq_newclosure(v, &grease_wrapper, 0);
3146 if(SQ_FAILED(sq_createslot(v, -3))) {
3147 throw SquirrelError(v, "Couldn't register function 'grease'");
3150 sq_pushstring(v, "invincible", -1);
3151 sq_newclosure(v, &invincible_wrapper, 0);
3152 if(SQ_FAILED(sq_createslot(v, -3))) {
3153 throw SquirrelError(v, "Couldn't register function 'invincible'");
3156 sq_pushstring(v, "ghost", -1);
3157 sq_newclosure(v, &ghost_wrapper, 0);
3158 if(SQ_FAILED(sq_createslot(v, -3))) {
3159 throw SquirrelError(v, "Couldn't register function 'ghost'");
3162 sq_pushstring(v, "mortal", -1);
3163 sq_newclosure(v, &mortal_wrapper, 0);
3164 if(SQ_FAILED(sq_createslot(v, -3))) {
3165 throw SquirrelError(v, "Couldn't register function 'mortal'");
3168 sq_pushstring(v, "restart", -1);
3169 sq_newclosure(v, &restart_wrapper, 0);
3170 if(SQ_FAILED(sq_createslot(v, -3))) {
3171 throw SquirrelError(v, "Couldn't register function 'restart'");
3174 sq_pushstring(v, "whereami", -1);
3175 sq_newclosure(v, &whereami_wrapper, 0);
3176 if(SQ_FAILED(sq_createslot(v, -3))) {
3177 throw SquirrelError(v, "Couldn't register function 'whereami'");
3180 sq_pushstring(v, "gotoend", -1);
3181 sq_newclosure(v, &gotoend_wrapper, 0);
3182 if(SQ_FAILED(sq_createslot(v, -3))) {
3183 throw SquirrelError(v, "Couldn't register function 'gotoend'");
3186 sq_pushstring(v, "camera", -1);
3187 sq_newclosure(v, &camera_wrapper, 0);
3188 if(SQ_FAILED(sq_createslot(v, -3))) {
3189 throw SquirrelError(v, "Couldn't register function 'camera'");
3192 sq_pushstring(v, "quit", -1);
3193 sq_newclosure(v, &quit_wrapper, 0);
3194 if(SQ_FAILED(sq_createslot(v, -3))) {
3195 throw SquirrelError(v, "Couldn't register function 'quit'");
3198 sq_pushstring(v, "rand", -1);
3199 sq_newclosure(v, &rand_wrapper, 0);
3200 if(SQ_FAILED(sq_createslot(v, -3))) {
3201 throw SquirrelError(v, "Couldn't register function 'rand'");
3204 // Register class DisplayEffect
3205 sq_pushstring(v, "DisplayEffect", -1);
3206 if(sq_newclass(v, SQFalse) < 0) {
3207 std::ostringstream msg;
3208 msg << "Couldn't create new class 'DisplayEffect'";
3209 throw SquirrelError(v, msg.str());
3211 sq_pushstring(v, "fade_out", -1);
3212 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
3213 if(SQ_FAILED(sq_createslot(v, -3))) {
3214 throw SquirrelError(v, "Couldn't register function 'fade_out'");
3217 sq_pushstring(v, "fade_in", -1);
3218 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
3219 if(SQ_FAILED(sq_createslot(v, -3))) {
3220 throw SquirrelError(v, "Couldn't register function 'fade_in'");
3223 sq_pushstring(v, "set_black", -1);
3224 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
3225 if(SQ_FAILED(sq_createslot(v, -3))) {
3226 throw SquirrelError(v, "Couldn't register function 'set_black'");
3229 sq_pushstring(v, "is_black", -1);
3230 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
3231 if(SQ_FAILED(sq_createslot(v, -3))) {
3232 throw SquirrelError(v, "Couldn't register function 'is_black'");
3235 sq_pushstring(v, "sixteen_to_nine", -1);
3236 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
3237 if(SQ_FAILED(sq_createslot(v, -3))) {
3238 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
3241 sq_pushstring(v, "four_to_three", -1);
3242 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
3243 if(SQ_FAILED(sq_createslot(v, -3))) {
3244 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
3247 if(SQ_FAILED(sq_createslot(v, -3))) {
3248 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
3251 // Register class Camera
3252 sq_pushstring(v, "Camera", -1);
3253 if(sq_newclass(v, SQFalse) < 0) {
3254 std::ostringstream msg;
3255 msg << "Couldn't create new class 'Camera'";
3256 throw SquirrelError(v, msg.str());
3258 sq_pushstring(v, "shake", -1);
3259 sq_newclosure(v, &Camera_shake_wrapper, 0);
3260 if(SQ_FAILED(sq_createslot(v, -3))) {
3261 throw SquirrelError(v, "Couldn't register function 'shake'");
3264 sq_pushstring(v, "set_pos", -1);
3265 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
3266 if(SQ_FAILED(sq_createslot(v, -3))) {
3267 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3270 sq_pushstring(v, "set_mode", -1);
3271 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
3272 if(SQ_FAILED(sq_createslot(v, -3))) {
3273 throw SquirrelError(v, "Couldn't register function 'set_mode'");
3276 sq_pushstring(v, "scroll_to", -1);
3277 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
3278 if(SQ_FAILED(sq_createslot(v, -3))) {
3279 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
3282 if(SQ_FAILED(sq_createslot(v, -3))) {
3283 throw SquirrelError(v, "Couldn't register class 'Camera'");
3286 // Register class Level
3287 sq_pushstring(v, "Level", -1);
3288 if(sq_newclass(v, SQFalse) < 0) {
3289 std::ostringstream msg;
3290 msg << "Couldn't create new class 'Level'";
3291 throw SquirrelError(v, msg.str());
3293 sq_pushstring(v, "finish", -1);
3294 sq_newclosure(v, &Level_finish_wrapper, 0);
3295 if(SQ_FAILED(sq_createslot(v, -3))) {
3296 throw SquirrelError(v, "Couldn't register function 'finish'");
3299 sq_pushstring(v, "spawn", -1);
3300 sq_newclosure(v, &Level_spawn_wrapper, 0);
3301 if(SQ_FAILED(sq_createslot(v, -3))) {
3302 throw SquirrelError(v, "Couldn't register function 'spawn'");
3305 sq_pushstring(v, "flip_vertically", -1);
3306 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
3307 if(SQ_FAILED(sq_createslot(v, -3))) {
3308 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
3311 sq_pushstring(v, "toggle_pause", -1);
3312 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
3313 if(SQ_FAILED(sq_createslot(v, -3))) {
3314 throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
3317 if(SQ_FAILED(sq_createslot(v, -3))) {
3318 throw SquirrelError(v, "Couldn't register class 'Level'");
3321 // Register class ScriptedObject
3322 sq_pushstring(v, "ScriptedObject", -1);
3323 if(sq_newclass(v, SQFalse) < 0) {
3324 std::ostringstream msg;
3325 msg << "Couldn't create new class 'ScriptedObject'";
3326 throw SquirrelError(v, msg.str());
3328 sq_pushstring(v, "set_action", -1);
3329 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
3330 if(SQ_FAILED(sq_createslot(v, -3))) {
3331 throw SquirrelError(v, "Couldn't register function 'set_action'");
3334 sq_pushstring(v, "get_action", -1);
3335 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
3336 if(SQ_FAILED(sq_createslot(v, -3))) {
3337 throw SquirrelError(v, "Couldn't register function 'get_action'");
3340 sq_pushstring(v, "move", -1);
3341 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
3342 if(SQ_FAILED(sq_createslot(v, -3))) {
3343 throw SquirrelError(v, "Couldn't register function 'move'");
3346 sq_pushstring(v, "set_pos", -1);
3347 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
3348 if(SQ_FAILED(sq_createslot(v, -3))) {
3349 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3352 sq_pushstring(v, "get_pos_x", -1);
3353 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
3354 if(SQ_FAILED(sq_createslot(v, -3))) {
3355 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3358 sq_pushstring(v, "get_pos_y", -1);
3359 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
3360 if(SQ_FAILED(sq_createslot(v, -3))) {
3361 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3364 sq_pushstring(v, "set_velocity", -1);
3365 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
3366 if(SQ_FAILED(sq_createslot(v, -3))) {
3367 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
3370 sq_pushstring(v, "get_velocity_x", -1);
3371 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
3372 if(SQ_FAILED(sq_createslot(v, -3))) {
3373 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
3376 sq_pushstring(v, "get_velocity_y", -1);
3377 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
3378 if(SQ_FAILED(sq_createslot(v, -3))) {
3379 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
3382 sq_pushstring(v, "set_visible", -1);
3383 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
3384 if(SQ_FAILED(sq_createslot(v, -3))) {
3385 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3388 sq_pushstring(v, "is_visible", -1);
3389 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
3390 if(SQ_FAILED(sq_createslot(v, -3))) {
3391 throw SquirrelError(v, "Couldn't register function 'is_visible'");
3394 sq_pushstring(v, "set_solid", -1);
3395 sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
3396 if(SQ_FAILED(sq_createslot(v, -3))) {
3397 throw SquirrelError(v, "Couldn't register function 'set_solid'");
3400 sq_pushstring(v, "is_solid", -1);
3401 sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
3402 if(SQ_FAILED(sq_createslot(v, -3))) {
3403 throw SquirrelError(v, "Couldn't register function 'is_solid'");
3406 sq_pushstring(v, "get_name", -1);
3407 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
3408 if(SQ_FAILED(sq_createslot(v, -3))) {
3409 throw SquirrelError(v, "Couldn't register function 'get_name'");
3412 if(SQ_FAILED(sq_createslot(v, -3))) {
3413 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
3416 // Register class Text
3417 sq_pushstring(v, "Text", -1);
3418 if(sq_newclass(v, SQFalse) < 0) {
3419 std::ostringstream msg;
3420 msg << "Couldn't create new class 'Text'";
3421 throw SquirrelError(v, msg.str());
3423 sq_pushstring(v, "set_text", -1);
3424 sq_newclosure(v, &Text_set_text_wrapper, 0);
3425 if(SQ_FAILED(sq_createslot(v, -3))) {
3426 throw SquirrelError(v, "Couldn't register function 'set_text'");
3429 sq_pushstring(v, "set_font", -1);
3430 sq_newclosure(v, &Text_set_font_wrapper, 0);
3431 if(SQ_FAILED(sq_createslot(v, -3))) {
3432 throw SquirrelError(v, "Couldn't register function 'set_font'");
3435 sq_pushstring(v, "fade_in", -1);
3436 sq_newclosure(v, &Text_fade_in_wrapper, 0);
3437 if(SQ_FAILED(sq_createslot(v, -3))) {
3438 throw SquirrelError(v, "Couldn't register function 'fade_in'");
3441 sq_pushstring(v, "fade_out", -1);
3442 sq_newclosure(v, &Text_fade_out_wrapper, 0);
3443 if(SQ_FAILED(sq_createslot(v, -3))) {
3444 throw SquirrelError(v, "Couldn't register function 'fade_out'");
3447 sq_pushstring(v, "set_visible", -1);
3448 sq_newclosure(v, &Text_set_visible_wrapper, 0);
3449 if(SQ_FAILED(sq_createslot(v, -3))) {
3450 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3453 sq_pushstring(v, "set_centered", -1);
3454 sq_newclosure(v, &Text_set_centered_wrapper, 0);
3455 if(SQ_FAILED(sq_createslot(v, -3))) {
3456 throw SquirrelError(v, "Couldn't register function 'set_centered'");
3459 if(SQ_FAILED(sq_createslot(v, -3))) {
3460 throw SquirrelError(v, "Couldn't register class 'Text'");
3463 // Register class Player
3464 sq_pushstring(v, "Player", -1);
3465 if(sq_newclass(v, SQFalse) < 0) {
3466 std::ostringstream msg;
3467 msg << "Couldn't create new class 'Player'";
3468 throw SquirrelError(v, msg.str());
3470 sq_pushstring(v, "add_bonus", -1);
3471 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
3472 if(SQ_FAILED(sq_createslot(v, -3))) {
3473 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
3476 sq_pushstring(v, "add_coins", -1);
3477 sq_newclosure(v, &Player_add_coins_wrapper, 0);
3478 if(SQ_FAILED(sq_createslot(v, -3))) {
3479 throw SquirrelError(v, "Couldn't register function 'add_coins'");
3482 sq_pushstring(v, "make_invincible", -1);
3483 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
3484 if(SQ_FAILED(sq_createslot(v, -3))) {
3485 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
3488 sq_pushstring(v, "deactivate", -1);
3489 sq_newclosure(v, &Player_deactivate_wrapper, 0);
3490 if(SQ_FAILED(sq_createslot(v, -3))) {
3491 throw SquirrelError(v, "Couldn't register function 'deactivate'");
3494 sq_pushstring(v, "activate", -1);
3495 sq_newclosure(v, &Player_activate_wrapper, 0);
3496 if(SQ_FAILED(sq_createslot(v, -3))) {
3497 throw SquirrelError(v, "Couldn't register function 'activate'");
3500 sq_pushstring(v, "walk", -1);
3501 sq_newclosure(v, &Player_walk_wrapper, 0);
3502 if(SQ_FAILED(sq_createslot(v, -3))) {
3503 throw SquirrelError(v, "Couldn't register function 'walk'");
3506 sq_pushstring(v, "set_visible", -1);
3507 sq_newclosure(v, &Player_set_visible_wrapper, 0);
3508 if(SQ_FAILED(sq_createslot(v, -3))) {
3509 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3512 sq_pushstring(v, "get_visible", -1);
3513 sq_newclosure(v, &Player_get_visible_wrapper, 0);
3514 if(SQ_FAILED(sq_createslot(v, -3))) {
3515 throw SquirrelError(v, "Couldn't register function 'get_visible'");
3518 sq_pushstring(v, "kill", -1);
3519 sq_newclosure(v, &Player_kill_wrapper, 0);
3520 if(SQ_FAILED(sq_createslot(v, -3))) {
3521 throw SquirrelError(v, "Couldn't register function 'kill'");
3524 sq_pushstring(v, "set_ghost_mode", -1);
3525 sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
3526 if(SQ_FAILED(sq_createslot(v, -3))) {
3527 throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
3530 sq_pushstring(v, "get_ghost_mode", -1);
3531 sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
3532 if(SQ_FAILED(sq_createslot(v, -3))) {
3533 throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
3536 sq_pushstring(v, "do_cheer", -1);
3537 sq_newclosure(v, &Player_do_cheer_wrapper, 0);
3538 if(SQ_FAILED(sq_createslot(v, -3))) {
3539 throw SquirrelError(v, "Couldn't register function 'do_cheer'");
3542 sq_pushstring(v, "do_duck", -1);
3543 sq_newclosure(v, &Player_do_duck_wrapper, 0);
3544 if(SQ_FAILED(sq_createslot(v, -3))) {
3545 throw SquirrelError(v, "Couldn't register function 'do_duck'");
3548 sq_pushstring(v, "do_standup", -1);
3549 sq_newclosure(v, &Player_do_standup_wrapper, 0);
3550 if(SQ_FAILED(sq_createslot(v, -3))) {
3551 throw SquirrelError(v, "Couldn't register function 'do_standup'");
3554 sq_pushstring(v, "do_backflip", -1);
3555 sq_newclosure(v, &Player_do_backflip_wrapper, 0);
3556 if(SQ_FAILED(sq_createslot(v, -3))) {
3557 throw SquirrelError(v, "Couldn't register function 'do_backflip'");
3560 sq_pushstring(v, "do_jump", -1);
3561 sq_newclosure(v, &Player_do_jump_wrapper, 0);
3562 if(SQ_FAILED(sq_createslot(v, -3))) {
3563 throw SquirrelError(v, "Couldn't register function 'do_jump'");
3566 if(SQ_FAILED(sq_createslot(v, -3))) {
3567 throw SquirrelError(v, "Couldn't register class 'Player'");
3570 // Register class FloatingImage
3571 sq_pushstring(v, "FloatingImage", -1);
3572 if(sq_newclass(v, SQFalse) < 0) {
3573 std::ostringstream msg;
3574 msg << "Couldn't create new class 'FloatingImage'";
3575 throw SquirrelError(v, msg.str());
3577 sq_pushstring(v, "constructor", -1);
3578 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
3579 if(SQ_FAILED(sq_createslot(v, -3))) {
3580 throw SquirrelError(v, "Couldn't register function 'constructor'");
3583 sq_pushstring(v, "set_layer", -1);
3584 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
3585 if(SQ_FAILED(sq_createslot(v, -3))) {
3586 throw SquirrelError(v, "Couldn't register function 'set_layer'");
3589 sq_pushstring(v, "get_layer", -1);
3590 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
3591 if(SQ_FAILED(sq_createslot(v, -3))) {
3592 throw SquirrelError(v, "Couldn't register function 'get_layer'");
3595 sq_pushstring(v, "set_pos", -1);
3596 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
3597 if(SQ_FAILED(sq_createslot(v, -3))) {
3598 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3601 sq_pushstring(v, "get_pos_x", -1);
3602 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
3603 if(SQ_FAILED(sq_createslot(v, -3))) {
3604 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3607 sq_pushstring(v, "get_pos_y", -1);
3608 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
3609 if(SQ_FAILED(sq_createslot(v, -3))) {
3610 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3613 sq_pushstring(v, "set_anchor_point", -1);
3614 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
3615 if(SQ_FAILED(sq_createslot(v, -3))) {
3616 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
3619 sq_pushstring(v, "get_anchor_point", -1);
3620 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
3621 if(SQ_FAILED(sq_createslot(v, -3))) {
3622 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
3625 sq_pushstring(v, "set_visible", -1);
3626 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
3627 if(SQ_FAILED(sq_createslot(v, -3))) {
3628 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3631 sq_pushstring(v, "get_visible", -1);
3632 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
3633 if(SQ_FAILED(sq_createslot(v, -3))) {
3634 throw SquirrelError(v, "Couldn't register function 'get_visible'");
3637 sq_pushstring(v, "set_action", -1);
3638 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
3639 if(SQ_FAILED(sq_createslot(v, -3))) {
3640 throw SquirrelError(v, "Couldn't register function 'set_action'");
3643 sq_pushstring(v, "get_action", -1);
3644 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
3645 if(SQ_FAILED(sq_createslot(v, -3))) {
3646 throw SquirrelError(v, "Couldn't register function 'get_action'");
3649 if(SQ_FAILED(sq_createslot(v, -3))) {
3650 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
3653 // Register class Platform
3654 sq_pushstring(v, "Platform", -1);
3655 if(sq_newclass(v, SQFalse) < 0) {
3656 std::ostringstream msg;
3657 msg << "Couldn't create new class 'Platform'";
3658 throw SquirrelError(v, msg.str());
3660 sq_pushstring(v, "goto_node", -1);
3661 sq_newclosure(v, &Platform_goto_node_wrapper, 0);
3662 if(SQ_FAILED(sq_createslot(v, -3))) {
3663 throw SquirrelError(v, "Couldn't register function 'goto_node'");
3666 sq_pushstring(v, "start_moving", -1);
3667 sq_newclosure(v, &Platform_start_moving_wrapper, 0);
3668 if(SQ_FAILED(sq_createslot(v, -3))) {
3669 throw SquirrelError(v, "Couldn't register function 'start_moving'");
3672 sq_pushstring(v, "stop_moving", -1);
3673 sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
3674 if(SQ_FAILED(sq_createslot(v, -3))) {
3675 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
3678 if(SQ_FAILED(sq_createslot(v, -3))) {
3679 throw SquirrelError(v, "Couldn't register class 'Platform'");
3682 // Register class Candle
3683 sq_pushstring(v, "Candle", -1);
3684 if(sq_newclass(v, SQFalse) < 0) {
3685 std::ostringstream msg;
3686 msg << "Couldn't create new class 'Candle'";
3687 throw SquirrelError(v, msg.str());
3689 sq_pushstring(v, "get_burning", -1);
3690 sq_newclosure(v, &Candle_get_burning_wrapper, 0);
3691 if(SQ_FAILED(sq_createslot(v, -3))) {
3692 throw SquirrelError(v, "Couldn't register function 'get_burning'");
3695 sq_pushstring(v, "set_burning", -1);
3696 sq_newclosure(v, &Candle_set_burning_wrapper, 0);
3697 if(SQ_FAILED(sq_createslot(v, -3))) {
3698 throw SquirrelError(v, "Couldn't register function 'set_burning'");
3701 if(SQ_FAILED(sq_createslot(v, -3))) {
3702 throw SquirrelError(v, "Couldn't register class 'Candle'");
3705 // Register class Wind
3706 sq_pushstring(v, "Wind", -1);
3707 if(sq_newclass(v, SQFalse) < 0) {
3708 std::ostringstream msg;
3709 msg << "Couldn't create new class 'Wind'";
3710 throw SquirrelError(v, msg.str());
3712 sq_pushstring(v, "start", -1);
3713 sq_newclosure(v, &Wind_start_wrapper, 0);
3714 if(SQ_FAILED(sq_createslot(v, -3))) {
3715 throw SquirrelError(v, "Couldn't register function 'start'");
3718 sq_pushstring(v, "stop", -1);
3719 sq_newclosure(v, &Wind_stop_wrapper, 0);
3720 if(SQ_FAILED(sq_createslot(v, -3))) {
3721 throw SquirrelError(v, "Couldn't register function 'stop'");
3724 if(SQ_FAILED(sq_createslot(v, -3))) {
3725 throw SquirrelError(v, "Couldn't register class 'Wind'");
3728 // Register class AmbientSound
3729 sq_pushstring(v, "AmbientSound", -1);
3730 if(sq_newclass(v, SQFalse) < 0) {
3731 std::ostringstream msg;
3732 msg << "Couldn't create new class 'AmbientSound'";
3733 throw SquirrelError(v, msg.str());
3735 sq_pushstring(v, "set_pos", -1);
3736 sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
3737 if(SQ_FAILED(sq_createslot(v, -3))) {
3738 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3741 sq_pushstring(v, "get_pos_x", -1);
3742 sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
3743 if(SQ_FAILED(sq_createslot(v, -3))) {
3744 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3747 sq_pushstring(v, "get_pos_y", -1);
3748 sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
3749 if(SQ_FAILED(sq_createslot(v, -3))) {
3750 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3753 if(SQ_FAILED(sq_createslot(v, -3))) {
3754 throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
3759 } // end of namespace Scripting