2 * WARNING: This file is automatically generated from:
3 * 'src/scripting/wrapper.interface.hpp'
13 #include "squirrel_error.hpp"
14 #include "wrapper.interface.hpp"
21 static SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger )
23 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (ptr);
28 static SQInteger DisplayEffect_fade_out_wrapper(HSQUIRRELVM vm)
31 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
32 sq_throwerror(vm, _SC("'fade_out' called without instance"));
35 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
37 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
38 sq_throwerror(vm, _SC("Argument 1 not a float"));
43 _this->fade_out(static_cast<float> (arg0));
47 } catch(std::exception& e) {
48 sq_throwerror(vm, e.what());
51 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
57 static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm)
60 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
61 sq_throwerror(vm, _SC("'fade_in' called without instance"));
64 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
66 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
67 sq_throwerror(vm, _SC("Argument 1 not a float"));
72 _this->fade_in(static_cast<float> (arg0));
76 } catch(std::exception& e) {
77 sq_throwerror(vm, e.what());
80 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
86 static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm)
89 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
90 sq_throwerror(vm, _SC("'set_black' called without instance"));
93 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
95 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
96 sq_throwerror(vm, _SC("Argument 1 not a bool"));
101 _this->set_black(arg0 == SQTrue);
105 } catch(std::exception& e) {
106 sq_throwerror(vm, e.what());
109 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_black'"));
115 static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm)
118 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
119 sq_throwerror(vm, _SC("'is_black' called without instance"));
122 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
125 bool return_value = _this->is_black();
127 sq_pushbool(vm, return_value);
130 } catch(std::exception& e) {
131 sq_throwerror(vm, e.what());
134 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_black'"));
140 static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm)
143 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
144 sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance"));
147 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
149 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
150 sq_throwerror(vm, _SC("Argument 1 not a float"));
155 _this->sixteen_to_nine(static_cast<float> (arg0));
159 } catch(std::exception& e) {
160 sq_throwerror(vm, e.what());
163 sq_throwerror(vm, _SC("Unexpected exception while executing function 'sixteen_to_nine'"));
169 static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm)
172 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
173 sq_throwerror(vm, _SC("'four_to_three' called without instance"));
176 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
178 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
179 sq_throwerror(vm, _SC("Argument 1 not a float"));
184 _this->four_to_three(static_cast<float> (arg0));
188 } catch(std::exception& e) {
189 sq_throwerror(vm, e.what());
192 sq_throwerror(vm, _SC("Unexpected exception while executing function 'four_to_three'"));
198 static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger )
200 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
205 static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm)
208 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
209 sq_throwerror(vm, _SC("'shake' called without instance"));
212 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
214 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
215 sq_throwerror(vm, _SC("Argument 1 not a float"));
219 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
220 sq_throwerror(vm, _SC("Argument 2 not a float"));
224 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
225 sq_throwerror(vm, _SC("Argument 3 not a float"));
230 _this->shake(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
234 } catch(std::exception& e) {
235 sq_throwerror(vm, e.what());
238 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'"));
244 static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm)
247 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
248 sq_throwerror(vm, _SC("'set_pos' called without instance"));
251 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
253 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
254 sq_throwerror(vm, _SC("Argument 1 not a float"));
258 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
259 sq_throwerror(vm, _SC("Argument 2 not a float"));
264 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
268 } catch(std::exception& e) {
269 sq_throwerror(vm, e.what());
272 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
278 static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm)
281 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
282 sq_throwerror(vm, _SC("'set_mode' called without instance"));
285 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
287 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
288 sq_throwerror(vm, _SC("Argument 1 not a string"));
293 _this->set_mode(arg0);
297 } catch(std::exception& e) {
298 sq_throwerror(vm, e.what());
301 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_mode'"));
307 static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm)
310 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
311 sq_throwerror(vm, _SC("'scroll_to' called without instance"));
314 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
316 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
317 sq_throwerror(vm, _SC("Argument 1 not a float"));
321 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
322 sq_throwerror(vm, _SC("Argument 2 not a float"));
326 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
327 sq_throwerror(vm, _SC("Argument 3 not a float"));
332 _this->scroll_to(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
336 } catch(std::exception& e) {
337 sq_throwerror(vm, e.what());
340 sq_throwerror(vm, _SC("Unexpected exception while executing function 'scroll_to'"));
346 static SQInteger Level_release_hook(SQUserPointer ptr, SQInteger )
348 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
353 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
356 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
357 sq_throwerror(vm, _SC("'finish' called without instance"));
360 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
362 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
363 sq_throwerror(vm, _SC("Argument 1 not a bool"));
368 _this->finish(arg0 == SQTrue);
372 } catch(std::exception& e) {
373 sq_throwerror(vm, e.what());
376 sq_throwerror(vm, _SC("Unexpected exception while executing function 'finish'"));
382 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
385 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
386 sq_throwerror(vm, _SC("'spawn' called without instance"));
389 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
391 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
392 sq_throwerror(vm, _SC("Argument 1 not a string"));
396 if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
397 sq_throwerror(vm, _SC("Argument 2 not a string"));
402 _this->spawn(arg0, arg1);
406 } catch(std::exception& e) {
407 sq_throwerror(vm, e.what());
410 sq_throwerror(vm, _SC("Unexpected exception while executing function 'spawn'"));
416 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
419 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
420 sq_throwerror(vm, _SC("'flip_vertically' called without instance"));
423 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
426 _this->flip_vertically();
430 } catch(std::exception& e) {
431 sq_throwerror(vm, e.what());
434 sq_throwerror(vm, _SC("Unexpected exception while executing function 'flip_vertically'"));
440 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
443 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
444 sq_throwerror(vm, _SC("'toggle_pause' called without instance"));
447 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
450 _this->toggle_pause();
454 } catch(std::exception& e) {
455 sq_throwerror(vm, e.what());
458 sq_throwerror(vm, _SC("Unexpected exception while executing function 'toggle_pause'"));
464 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
466 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
471 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
474 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
475 sq_throwerror(vm, _SC("'set_action' called without instance"));
478 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
480 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
481 sq_throwerror(vm, _SC("Argument 1 not a string"));
486 _this->set_action(arg0);
490 } catch(std::exception& e) {
491 sq_throwerror(vm, e.what());
494 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
500 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
503 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
504 sq_throwerror(vm, _SC("'get_action' called without instance"));
507 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
510 std::string return_value = _this->get_action();
512 sq_pushstring(vm, return_value.c_str(), return_value.size());
515 } catch(std::exception& e) {
516 sq_throwerror(vm, e.what());
519 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
525 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
528 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
529 sq_throwerror(vm, _SC("'move' called without instance"));
532 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
534 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
535 sq_throwerror(vm, _SC("Argument 1 not a float"));
539 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
540 sq_throwerror(vm, _SC("Argument 2 not a float"));
545 _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
549 } catch(std::exception& e) {
550 sq_throwerror(vm, e.what());
553 sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
559 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
562 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
563 sq_throwerror(vm, _SC("'set_pos' called without instance"));
566 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
568 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
569 sq_throwerror(vm, _SC("Argument 1 not a float"));
573 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
574 sq_throwerror(vm, _SC("Argument 2 not a float"));
579 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
583 } catch(std::exception& e) {
584 sq_throwerror(vm, e.what());
587 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
593 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
596 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
597 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
600 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
603 float return_value = _this->get_pos_x();
605 sq_pushfloat(vm, return_value);
608 } catch(std::exception& e) {
609 sq_throwerror(vm, e.what());
612 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
618 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
621 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
622 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
625 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
628 float return_value = _this->get_pos_y();
630 sq_pushfloat(vm, return_value);
633 } catch(std::exception& e) {
634 sq_throwerror(vm, e.what());
637 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
643 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
646 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
647 sq_throwerror(vm, _SC("'set_velocity' called without instance"));
650 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
652 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
653 sq_throwerror(vm, _SC("Argument 1 not a float"));
657 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
658 sq_throwerror(vm, _SC("Argument 2 not a float"));
663 _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
667 } catch(std::exception& e) {
668 sq_throwerror(vm, e.what());
671 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
677 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
680 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
681 sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
684 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
687 float return_value = _this->get_velocity_x();
689 sq_pushfloat(vm, return_value);
692 } catch(std::exception& e) {
693 sq_throwerror(vm, e.what());
696 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
702 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
705 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
706 sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
709 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
712 float return_value = _this->get_velocity_y();
714 sq_pushfloat(vm, return_value);
717 } catch(std::exception& e) {
718 sq_throwerror(vm, e.what());
721 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
727 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
730 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
731 sq_throwerror(vm, _SC("'set_visible' called without instance"));
734 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
736 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
737 sq_throwerror(vm, _SC("Argument 1 not a bool"));
742 _this->set_visible(arg0 == SQTrue);
746 } catch(std::exception& e) {
747 sq_throwerror(vm, e.what());
750 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
756 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
759 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
760 sq_throwerror(vm, _SC("'is_visible' called without instance"));
763 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
766 bool return_value = _this->is_visible();
768 sq_pushbool(vm, return_value);
771 } catch(std::exception& e) {
772 sq_throwerror(vm, e.what());
775 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
781 static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm)
784 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
785 sq_throwerror(vm, _SC("'set_solid' called without instance"));
788 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
790 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
791 sq_throwerror(vm, _SC("Argument 1 not a bool"));
796 _this->set_solid(arg0 == SQTrue);
800 } catch(std::exception& e) {
801 sq_throwerror(vm, e.what());
804 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_solid'"));
810 static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm)
813 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
814 sq_throwerror(vm, _SC("'is_solid' called without instance"));
817 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
820 bool return_value = _this->is_solid();
822 sq_pushbool(vm, return_value);
825 } catch(std::exception& e) {
826 sq_throwerror(vm, e.what());
829 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_solid'"));
835 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
838 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
839 sq_throwerror(vm, _SC("'get_name' called without instance"));
842 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
845 std::string return_value = _this->get_name();
847 sq_pushstring(vm, return_value.c_str(), return_value.size());
850 } catch(std::exception& e) {
851 sq_throwerror(vm, e.what());
854 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
860 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
862 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
867 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
870 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
871 sq_throwerror(vm, _SC("'set_text' called without instance"));
874 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
876 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
877 sq_throwerror(vm, _SC("Argument 1 not a string"));
882 _this->set_text(arg0);
886 } catch(std::exception& e) {
887 sq_throwerror(vm, e.what());
890 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
896 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
899 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
900 sq_throwerror(vm, _SC("'set_font' called without instance"));
903 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
905 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
906 sq_throwerror(vm, _SC("Argument 1 not a string"));
911 _this->set_font(arg0);
915 } catch(std::exception& e) {
916 sq_throwerror(vm, e.what());
919 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
925 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
928 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
929 sq_throwerror(vm, _SC("'fade_in' called without instance"));
932 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
934 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
935 sq_throwerror(vm, _SC("Argument 1 not a float"));
940 _this->fade_in(static_cast<float> (arg0));
944 } catch(std::exception& e) {
945 sq_throwerror(vm, e.what());
948 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
954 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
957 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
958 sq_throwerror(vm, _SC("'fade_out' called without instance"));
961 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
963 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
964 sq_throwerror(vm, _SC("Argument 1 not a float"));
969 _this->fade_out(static_cast<float> (arg0));
973 } catch(std::exception& e) {
974 sq_throwerror(vm, e.what());
977 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
983 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
986 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
987 sq_throwerror(vm, _SC("'set_visible' called without instance"));
990 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
992 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
993 sq_throwerror(vm, _SC("Argument 1 not a bool"));
998 _this->set_visible(arg0 == SQTrue);
1002 } catch(std::exception& e) {
1003 sq_throwerror(vm, e.what());
1006 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1012 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
1015 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1016 sq_throwerror(vm, _SC("'set_centered' called without instance"));
1019 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1021 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1022 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1027 _this->set_centered(arg0 == SQTrue);
1031 } catch(std::exception& e) {
1032 sq_throwerror(vm, e.what());
1035 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
1041 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
1043 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
1048 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
1051 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1052 sq_throwerror(vm, _SC("'add_bonus' called without instance"));
1055 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1057 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1058 sq_throwerror(vm, _SC("Argument 1 not a string"));
1063 _this->add_bonus(arg0);
1067 } catch(std::exception& e) {
1068 sq_throwerror(vm, e.what());
1071 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1077 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
1080 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1081 sq_throwerror(vm, _SC("'add_coins' called without instance"));
1084 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1086 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1087 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1092 _this->add_coins(static_cast<int> (arg0));
1096 } catch(std::exception& e) {
1097 sq_throwerror(vm, e.what());
1100 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1106 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1109 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1110 sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1113 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1116 _this->make_invincible();
1120 } catch(std::exception& e) {
1121 sq_throwerror(vm, e.what());
1124 sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1130 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1133 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1134 sq_throwerror(vm, _SC("'deactivate' called without instance"));
1137 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1140 _this->deactivate();
1144 } catch(std::exception& e) {
1145 sq_throwerror(vm, e.what());
1148 sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1154 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1157 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1158 sq_throwerror(vm, _SC("'activate' called without instance"));
1161 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1168 } catch(std::exception& e) {
1169 sq_throwerror(vm, e.what());
1172 sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1178 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1181 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1182 sq_throwerror(vm, _SC("'walk' called without instance"));
1185 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1187 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1188 sq_throwerror(vm, _SC("Argument 1 not a float"));
1193 _this->walk(static_cast<float> (arg0));
1197 } catch(std::exception& e) {
1198 sq_throwerror(vm, e.what());
1201 sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1207 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1210 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1211 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1214 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1216 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1217 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1222 _this->set_visible(arg0 == SQTrue);
1226 } catch(std::exception& e) {
1227 sq_throwerror(vm, e.what());
1230 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1236 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1239 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1240 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1243 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1246 bool return_value = _this->get_visible();
1248 sq_pushbool(vm, return_value);
1251 } catch(std::exception& e) {
1252 sq_throwerror(vm, e.what());
1255 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1261 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1264 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1265 sq_throwerror(vm, _SC("'kill' called without instance"));
1268 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1270 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1271 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1276 _this->kill(arg0 == SQTrue);
1280 } catch(std::exception& e) {
1281 sq_throwerror(vm, e.what());
1284 sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1290 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1293 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1294 sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1297 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1299 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1300 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1305 _this->set_ghost_mode(arg0 == SQTrue);
1309 } catch(std::exception& e) {
1310 sq_throwerror(vm, e.what());
1313 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1319 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1322 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1323 sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1326 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1329 bool return_value = _this->get_ghost_mode();
1331 sq_pushbool(vm, return_value);
1334 } catch(std::exception& e) {
1335 sq_throwerror(vm, e.what());
1338 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1344 static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm)
1347 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1348 sq_throwerror(vm, _SC("'do_cheer' called without instance"));
1351 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1358 } catch(std::exception& e) {
1359 sq_throwerror(vm, e.what());
1362 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'"));
1368 static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm)
1371 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1372 sq_throwerror(vm, _SC("'do_duck' called without instance"));
1375 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1382 } catch(std::exception& e) {
1383 sq_throwerror(vm, e.what());
1386 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'"));
1392 static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm)
1395 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1396 sq_throwerror(vm, _SC("'do_standup' called without instance"));
1399 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1402 _this->do_standup();
1406 } catch(std::exception& e) {
1407 sq_throwerror(vm, e.what());
1410 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'"));
1416 static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm)
1419 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1420 sq_throwerror(vm, _SC("'do_backflip' called without instance"));
1423 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1426 _this->do_backflip();
1430 } catch(std::exception& e) {
1431 sq_throwerror(vm, e.what());
1434 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'"));
1440 static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm)
1443 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1444 sq_throwerror(vm, _SC("'do_jump' called without instance"));
1447 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1449 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1450 sq_throwerror(vm, _SC("Argument 1 not a float"));
1455 _this->do_jump(static_cast<float> (arg0));
1459 } catch(std::exception& e) {
1460 sq_throwerror(vm, e.what());
1463 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_jump'"));
1469 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1471 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1476 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1479 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1480 sq_throwerror(vm, _SC("Argument 1 not a string"));
1485 Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1486 if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1487 sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1490 sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1494 } catch(std::exception& e) {
1495 sq_throwerror(vm, e.what());
1498 sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1504 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1507 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1508 sq_throwerror(vm, _SC("'set_layer' called without instance"));
1511 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1513 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1514 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1519 _this->set_layer(static_cast<int> (arg0));
1523 } catch(std::exception& e) {
1524 sq_throwerror(vm, e.what());
1527 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1533 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1536 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1537 sq_throwerror(vm, _SC("'get_layer' called without instance"));
1540 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1543 int return_value = _this->get_layer();
1545 sq_pushinteger(vm, return_value);
1548 } catch(std::exception& e) {
1549 sq_throwerror(vm, e.what());
1552 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1558 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1561 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1562 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1565 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1567 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1568 sq_throwerror(vm, _SC("Argument 1 not a float"));
1572 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1573 sq_throwerror(vm, _SC("Argument 2 not a float"));
1578 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1582 } catch(std::exception& e) {
1583 sq_throwerror(vm, e.what());
1586 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1592 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1595 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1596 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1599 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1602 float return_value = _this->get_pos_x();
1604 sq_pushfloat(vm, return_value);
1607 } catch(std::exception& e) {
1608 sq_throwerror(vm, e.what());
1611 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1617 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1620 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1621 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1624 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1627 float return_value = _this->get_pos_y();
1629 sq_pushfloat(vm, return_value);
1632 } catch(std::exception& e) {
1633 sq_throwerror(vm, e.what());
1636 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1642 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1645 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1646 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1649 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1651 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1652 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1657 _this->set_anchor_point(static_cast<int> (arg0));
1661 } catch(std::exception& e) {
1662 sq_throwerror(vm, e.what());
1665 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1671 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1674 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1675 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1678 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1681 int return_value = _this->get_anchor_point();
1683 sq_pushinteger(vm, return_value);
1686 } catch(std::exception& e) {
1687 sq_throwerror(vm, e.what());
1690 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1696 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1699 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1700 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1703 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1705 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1706 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1711 _this->set_visible(arg0 == SQTrue);
1715 } catch(std::exception& e) {
1716 sq_throwerror(vm, e.what());
1719 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1725 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1728 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1729 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1732 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1735 bool return_value = _this->get_visible();
1737 sq_pushbool(vm, return_value);
1740 } catch(std::exception& e) {
1741 sq_throwerror(vm, e.what());
1744 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1750 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
1753 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1754 sq_throwerror(vm, _SC("'set_action' called without instance"));
1757 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1759 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1760 sq_throwerror(vm, _SC("Argument 1 not a string"));
1765 _this->set_action(arg0);
1769 } catch(std::exception& e) {
1770 sq_throwerror(vm, e.what());
1773 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1779 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
1782 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1783 sq_throwerror(vm, _SC("'get_action' called without instance"));
1786 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1789 std::string return_value = _this->get_action();
1791 sq_pushstring(vm, return_value.c_str(), return_value.size());
1794 } catch(std::exception& e) {
1795 sq_throwerror(vm, e.what());
1798 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1804 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1806 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
1811 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1814 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1815 sq_throwerror(vm, _SC("'goto_node' called without instance"));
1818 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1820 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1821 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1826 _this->goto_node(static_cast<int> (arg0));
1830 } catch(std::exception& e) {
1831 sq_throwerror(vm, e.what());
1834 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1840 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1843 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1844 sq_throwerror(vm, _SC("'start_moving' called without instance"));
1847 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1850 _this->start_moving();
1854 } catch(std::exception& e) {
1855 sq_throwerror(vm, e.what());
1858 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
1864 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1867 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1868 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1871 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1874 _this->stop_moving();
1878 } catch(std::exception& e) {
1879 sq_throwerror(vm, e.what());
1882 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1888 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
1890 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (ptr);
1895 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
1898 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1899 sq_throwerror(vm, _SC("'get_burning' called without instance"));
1902 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1905 bool return_value = _this->get_burning();
1907 sq_pushbool(vm, return_value);
1910 } catch(std::exception& e) {
1911 sq_throwerror(vm, e.what());
1914 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
1920 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
1923 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1924 sq_throwerror(vm, _SC("'set_burning' called without instance"));
1927 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1929 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1930 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1935 _this->set_burning(arg0 == SQTrue);
1939 } catch(std::exception& e) {
1940 sq_throwerror(vm, e.what());
1943 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_burning'"));
1949 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
1951 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (ptr);
1956 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
1959 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1960 sq_throwerror(vm, _SC("'start' called without instance"));
1963 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
1970 } catch(std::exception& e) {
1971 sq_throwerror(vm, e.what());
1974 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
1980 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
1983 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1984 sq_throwerror(vm, _SC("'stop' called without instance"));
1987 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
1994 } catch(std::exception& e) {
1995 sq_throwerror(vm, e.what());
1998 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2004 static SQInteger display_wrapper(HSQUIRRELVM vm)
2006 return Scripting::display(vm);
2009 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
2011 HSQUIRRELVM arg0 = vm;
2014 Scripting::print_stacktrace(arg0);
2018 } catch(std::exception& e) {
2019 sq_throwerror(vm, e.what());
2022 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
2028 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
2030 return Scripting::get_current_thread(vm);
2033 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
2036 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2037 sq_throwerror(vm, _SC("Argument 1 not a string"));
2042 Scripting::display_text_file(arg0);
2046 } catch(std::exception& e) {
2047 sq_throwerror(vm, e.what());
2050 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
2056 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
2059 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2060 sq_throwerror(vm, _SC("Argument 1 not a string"));
2065 Scripting::load_worldmap(arg0);
2069 } catch(std::exception& e) {
2070 sq_throwerror(vm, e.what());
2073 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
2079 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
2082 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2083 sq_throwerror(vm, _SC("Argument 1 not a string"));
2088 Scripting::load_level(arg0);
2092 } catch(std::exception& e) {
2093 sq_throwerror(vm, e.what());
2096 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
2102 static SQInteger wait_wrapper(HSQUIRRELVM vm)
2104 HSQUIRRELVM arg0 = vm;
2106 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
2107 sq_throwerror(vm, _SC("Argument 1 not a float"));
2112 Scripting::wait(arg0, static_cast<float> (arg1));
2114 return sq_suspendvm(vm);
2116 } catch(std::exception& e) {
2117 sq_throwerror(vm, e.what());
2120 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
2126 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
2128 HSQUIRRELVM arg0 = vm;
2131 Scripting::wait_for_screenswitch(arg0);
2133 return sq_suspendvm(vm);
2135 } catch(std::exception& e) {
2136 sq_throwerror(vm, e.what());
2139 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
2145 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
2150 Scripting::exit_screen();
2154 } catch(std::exception& e) {
2155 sq_throwerror(vm, e.what());
2158 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
2164 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
2167 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2168 sq_throwerror(vm, _SC("Argument 1 not a float"));
2173 Scripting::fadeout_screen(static_cast<float> (arg0));
2177 } catch(std::exception& e) {
2178 sq_throwerror(vm, e.what());
2181 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
2187 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
2190 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2191 sq_throwerror(vm, _SC("Argument 1 not a float"));
2195 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2196 sq_throwerror(vm, _SC("Argument 2 not a float"));
2200 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2201 sq_throwerror(vm, _SC("Argument 3 not a float"));
2206 Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2210 } catch(std::exception& e) {
2211 sq_throwerror(vm, e.what());
2214 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
2220 static SQInteger translate_wrapper(HSQUIRRELVM vm)
2223 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2224 sq_throwerror(vm, _SC("Argument 1 not a string"));
2229 std::string return_value = Scripting::translate(arg0);
2231 sq_pushstring(vm, return_value.c_str(), return_value.size());
2234 } catch(std::exception& e) {
2235 sq_throwerror(vm, e.what());
2238 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
2244 static SQInteger import_wrapper(HSQUIRRELVM vm)
2246 HSQUIRRELVM arg0 = vm;
2248 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
2249 sq_throwerror(vm, _SC("Argument 1 not a string"));
2254 Scripting::import(arg0, arg1);
2258 } catch(std::exception& e) {
2259 sq_throwerror(vm, e.what());
2262 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
2268 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
2273 Scripting::save_state();
2277 } catch(std::exception& e) {
2278 sq_throwerror(vm, e.what());
2281 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
2287 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
2290 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2291 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2296 Scripting::debug_collrects(arg0 == SQTrue);
2300 } catch(std::exception& e) {
2301 sq_throwerror(vm, e.what());
2304 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
2310 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
2313 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2314 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2319 Scripting::debug_show_fps(arg0 == SQTrue);
2323 } catch(std::exception& e) {
2324 sq_throwerror(vm, e.what());
2327 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
2333 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
2336 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2337 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2342 Scripting::debug_draw_solids_only(arg0 == SQTrue);
2346 } catch(std::exception& e) {
2347 sq_throwerror(vm, e.what());
2350 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
2356 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
2359 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2360 sq_throwerror(vm, _SC("Argument 1 not a string"));
2365 Scripting::play_music(arg0);
2369 } catch(std::exception& e) {
2370 sq_throwerror(vm, e.what());
2373 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
2379 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
2382 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2383 sq_throwerror(vm, _SC("Argument 1 not a string"));
2388 Scripting::play_sound(arg0);
2392 } catch(std::exception& e) {
2393 sq_throwerror(vm, e.what());
2396 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
2402 static SQInteger grease_wrapper(HSQUIRRELVM vm)
2407 Scripting::grease();
2411 } catch(std::exception& e) {
2412 sq_throwerror(vm, e.what());
2415 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
2421 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
2426 Scripting::invincible();
2430 } catch(std::exception& e) {
2431 sq_throwerror(vm, e.what());
2434 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
2440 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
2449 } catch(std::exception& e) {
2450 sq_throwerror(vm, e.what());
2453 sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
2459 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
2464 Scripting::mortal();
2468 } catch(std::exception& e) {
2469 sq_throwerror(vm, e.what());
2472 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
2478 static SQInteger restart_wrapper(HSQUIRRELVM vm)
2483 Scripting::restart();
2487 } catch(std::exception& e) {
2488 sq_throwerror(vm, e.what());
2491 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
2497 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
2502 Scripting::whereami();
2506 } catch(std::exception& e) {
2507 sq_throwerror(vm, e.what());
2510 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
2516 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
2521 Scripting::gotoend();
2525 } catch(std::exception& e) {
2526 sq_throwerror(vm, e.what());
2529 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
2535 static SQInteger camera_wrapper(HSQUIRRELVM vm)
2540 Scripting::camera();
2544 } catch(std::exception& e) {
2545 sq_throwerror(vm, e.what());
2548 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
2554 static SQInteger quit_wrapper(HSQUIRRELVM vm)
2563 } catch(std::exception& e) {
2564 sq_throwerror(vm, e.what());
2567 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
2573 static SQInteger rand_wrapper(HSQUIRRELVM vm)
2577 int return_value = Scripting::rand();
2579 sq_pushinteger(vm, return_value);
2582 } catch(std::exception& e) {
2583 sq_throwerror(vm, e.what());
2586 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
2592 } // end of namespace Wrapper
2594 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
2596 using namespace Wrapper;
2598 sq_pushroottable(v);
2599 sq_pushstring(v, "DisplayEffect", -1);
2600 if(SQ_FAILED(sq_get(v, -2))) {
2601 std::ostringstream msg;
2602 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
2603 throw SquirrelError(v, msg.str());
2606 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2607 std::ostringstream msg;
2608 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
2609 throw SquirrelError(v, msg.str());
2611 sq_remove(v, -2); // remove object name
2613 if(setup_releasehook) {
2614 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
2617 sq_remove(v, -2); // remove root table
2620 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
2622 using namespace Wrapper;
2624 sq_pushroottable(v);
2625 sq_pushstring(v, "Camera", -1);
2626 if(SQ_FAILED(sq_get(v, -2))) {
2627 std::ostringstream msg;
2628 msg << "Couldn't resolved squirrel type 'Camera'";
2629 throw SquirrelError(v, msg.str());
2632 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2633 std::ostringstream msg;
2634 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
2635 throw SquirrelError(v, msg.str());
2637 sq_remove(v, -2); // remove object name
2639 if(setup_releasehook) {
2640 sq_setreleasehook(v, -1, Camera_release_hook);
2643 sq_remove(v, -2); // remove root table
2646 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
2648 using namespace Wrapper;
2650 sq_pushroottable(v);
2651 sq_pushstring(v, "Level", -1);
2652 if(SQ_FAILED(sq_get(v, -2))) {
2653 std::ostringstream msg;
2654 msg << "Couldn't resolved squirrel type 'Level'";
2655 throw SquirrelError(v, msg.str());
2658 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2659 std::ostringstream msg;
2660 msg << "Couldn't setup squirrel instance for object of type 'Level'";
2661 throw SquirrelError(v, msg.str());
2663 sq_remove(v, -2); // remove object name
2665 if(setup_releasehook) {
2666 sq_setreleasehook(v, -1, Level_release_hook);
2669 sq_remove(v, -2); // remove root table
2672 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
2674 using namespace Wrapper;
2676 sq_pushroottable(v);
2677 sq_pushstring(v, "ScriptedObject", -1);
2678 if(SQ_FAILED(sq_get(v, -2))) {
2679 std::ostringstream msg;
2680 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
2681 throw SquirrelError(v, msg.str());
2684 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2685 std::ostringstream msg;
2686 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
2687 throw SquirrelError(v, msg.str());
2689 sq_remove(v, -2); // remove object name
2691 if(setup_releasehook) {
2692 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
2695 sq_remove(v, -2); // remove root table
2698 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
2700 using namespace Wrapper;
2702 sq_pushroottable(v);
2703 sq_pushstring(v, "Text", -1);
2704 if(SQ_FAILED(sq_get(v, -2))) {
2705 std::ostringstream msg;
2706 msg << "Couldn't resolved squirrel type 'Text'";
2707 throw SquirrelError(v, msg.str());
2710 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2711 std::ostringstream msg;
2712 msg << "Couldn't setup squirrel instance for object of type 'Text'";
2713 throw SquirrelError(v, msg.str());
2715 sq_remove(v, -2); // remove object name
2717 if(setup_releasehook) {
2718 sq_setreleasehook(v, -1, Text_release_hook);
2721 sq_remove(v, -2); // remove root table
2724 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
2726 using namespace Wrapper;
2728 sq_pushroottable(v);
2729 sq_pushstring(v, "Player", -1);
2730 if(SQ_FAILED(sq_get(v, -2))) {
2731 std::ostringstream msg;
2732 msg << "Couldn't resolved squirrel type 'Player'";
2733 throw SquirrelError(v, msg.str());
2736 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2737 std::ostringstream msg;
2738 msg << "Couldn't setup squirrel instance for object of type 'Player'";
2739 throw SquirrelError(v, msg.str());
2741 sq_remove(v, -2); // remove object name
2743 if(setup_releasehook) {
2744 sq_setreleasehook(v, -1, Player_release_hook);
2747 sq_remove(v, -2); // remove root table
2750 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
2752 using namespace Wrapper;
2754 sq_pushroottable(v);
2755 sq_pushstring(v, "FloatingImage", -1);
2756 if(SQ_FAILED(sq_get(v, -2))) {
2757 std::ostringstream msg;
2758 msg << "Couldn't resolved squirrel type 'FloatingImage'";
2759 throw SquirrelError(v, msg.str());
2762 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2763 std::ostringstream msg;
2764 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
2765 throw SquirrelError(v, msg.str());
2767 sq_remove(v, -2); // remove object name
2769 if(setup_releasehook) {
2770 sq_setreleasehook(v, -1, FloatingImage_release_hook);
2773 sq_remove(v, -2); // remove root table
2776 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
2778 using namespace Wrapper;
2780 sq_pushroottable(v);
2781 sq_pushstring(v, "Platform", -1);
2782 if(SQ_FAILED(sq_get(v, -2))) {
2783 std::ostringstream msg;
2784 msg << "Couldn't resolved squirrel type 'Platform'";
2785 throw SquirrelError(v, msg.str());
2788 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2789 std::ostringstream msg;
2790 msg << "Couldn't setup squirrel instance for object of type 'Platform'";
2791 throw SquirrelError(v, msg.str());
2793 sq_remove(v, -2); // remove object name
2795 if(setup_releasehook) {
2796 sq_setreleasehook(v, -1, Platform_release_hook);
2799 sq_remove(v, -2); // remove root table
2802 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
2804 using namespace Wrapper;
2806 sq_pushroottable(v);
2807 sq_pushstring(v, "Candle", -1);
2808 if(SQ_FAILED(sq_get(v, -2))) {
2809 std::ostringstream msg;
2810 msg << "Couldn't resolved squirrel type 'Candle'";
2811 throw SquirrelError(v, msg.str());
2814 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2815 std::ostringstream msg;
2816 msg << "Couldn't setup squirrel instance for object of type 'Candle'";
2817 throw SquirrelError(v, msg.str());
2819 sq_remove(v, -2); // remove object name
2821 if(setup_releasehook) {
2822 sq_setreleasehook(v, -1, Candle_release_hook);
2825 sq_remove(v, -2); // remove root table
2828 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
2830 using namespace Wrapper;
2832 sq_pushroottable(v);
2833 sq_pushstring(v, "Wind", -1);
2834 if(SQ_FAILED(sq_get(v, -2))) {
2835 std::ostringstream msg;
2836 msg << "Couldn't resolved squirrel type 'Wind'";
2837 throw SquirrelError(v, msg.str());
2840 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2841 std::ostringstream msg;
2842 msg << "Couldn't setup squirrel instance for object of type 'Wind'";
2843 throw SquirrelError(v, msg.str());
2845 sq_remove(v, -2); // remove object name
2847 if(setup_releasehook) {
2848 sq_setreleasehook(v, -1, Wind_release_hook);
2851 sq_remove(v, -2); // remove root table
2854 void register_supertux_wrapper(HSQUIRRELVM v)
2856 using namespace Wrapper;
2858 sq_pushstring(v, "ANCHOR_TOP", -1);
2859 sq_pushinteger(v, 16);
2860 if(SQ_FAILED(sq_createslot(v, -3))) {
2861 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
2864 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
2865 sq_pushinteger(v, 32);
2866 if(SQ_FAILED(sq_createslot(v, -3))) {
2867 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
2870 sq_pushstring(v, "ANCHOR_LEFT", -1);
2871 sq_pushinteger(v, 1);
2872 if(SQ_FAILED(sq_createslot(v, -3))) {
2873 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
2876 sq_pushstring(v, "ANCHOR_RIGHT", -1);
2877 sq_pushinteger(v, 2);
2878 if(SQ_FAILED(sq_createslot(v, -3))) {
2879 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
2882 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
2883 sq_pushinteger(v, 0);
2884 if(SQ_FAILED(sq_createslot(v, -3))) {
2885 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
2888 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
2889 sq_pushinteger(v, 17);
2890 if(SQ_FAILED(sq_createslot(v, -3))) {
2891 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
2894 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
2895 sq_pushinteger(v, 18);
2896 if(SQ_FAILED(sq_createslot(v, -3))) {
2897 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
2900 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
2901 sq_pushinteger(v, 33);
2902 if(SQ_FAILED(sq_createslot(v, -3))) {
2903 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
2906 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
2907 sq_pushinteger(v, 34);
2908 if(SQ_FAILED(sq_createslot(v, -3))) {
2909 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
2912 sq_pushstring(v, "display", -1);
2913 sq_newclosure(v, &display_wrapper, 0);
2914 if(SQ_FAILED(sq_createslot(v, -3))) {
2915 throw SquirrelError(v, "Couldn't register function 'display'");
2918 sq_pushstring(v, "print_stacktrace", -1);
2919 sq_newclosure(v, &print_stacktrace_wrapper, 0);
2920 if(SQ_FAILED(sq_createslot(v, -3))) {
2921 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
2924 sq_pushstring(v, "get_current_thread", -1);
2925 sq_newclosure(v, &get_current_thread_wrapper, 0);
2926 if(SQ_FAILED(sq_createslot(v, -3))) {
2927 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
2930 sq_pushstring(v, "display_text_file", -1);
2931 sq_newclosure(v, &display_text_file_wrapper, 0);
2932 if(SQ_FAILED(sq_createslot(v, -3))) {
2933 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
2936 sq_pushstring(v, "load_worldmap", -1);
2937 sq_newclosure(v, &load_worldmap_wrapper, 0);
2938 if(SQ_FAILED(sq_createslot(v, -3))) {
2939 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
2942 sq_pushstring(v, "load_level", -1);
2943 sq_newclosure(v, &load_level_wrapper, 0);
2944 if(SQ_FAILED(sq_createslot(v, -3))) {
2945 throw SquirrelError(v, "Couldn't register function 'load_level'");
2948 sq_pushstring(v, "wait", -1);
2949 sq_newclosure(v, &wait_wrapper, 0);
2950 if(SQ_FAILED(sq_createslot(v, -3))) {
2951 throw SquirrelError(v, "Couldn't register function 'wait'");
2954 sq_pushstring(v, "wait_for_screenswitch", -1);
2955 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
2956 if(SQ_FAILED(sq_createslot(v, -3))) {
2957 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
2960 sq_pushstring(v, "exit_screen", -1);
2961 sq_newclosure(v, &exit_screen_wrapper, 0);
2962 if(SQ_FAILED(sq_createslot(v, -3))) {
2963 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
2966 sq_pushstring(v, "fadeout_screen", -1);
2967 sq_newclosure(v, &fadeout_screen_wrapper, 0);
2968 if(SQ_FAILED(sq_createslot(v, -3))) {
2969 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
2972 sq_pushstring(v, "shrink_screen", -1);
2973 sq_newclosure(v, &shrink_screen_wrapper, 0);
2974 if(SQ_FAILED(sq_createslot(v, -3))) {
2975 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
2978 sq_pushstring(v, "translate", -1);
2979 sq_newclosure(v, &translate_wrapper, 0);
2980 if(SQ_FAILED(sq_createslot(v, -3))) {
2981 throw SquirrelError(v, "Couldn't register function 'translate'");
2984 sq_pushstring(v, "import", -1);
2985 sq_newclosure(v, &import_wrapper, 0);
2986 if(SQ_FAILED(sq_createslot(v, -3))) {
2987 throw SquirrelError(v, "Couldn't register function 'import'");
2990 sq_pushstring(v, "save_state", -1);
2991 sq_newclosure(v, &save_state_wrapper, 0);
2992 if(SQ_FAILED(sq_createslot(v, -3))) {
2993 throw SquirrelError(v, "Couldn't register function 'save_state'");
2996 sq_pushstring(v, "debug_collrects", -1);
2997 sq_newclosure(v, &debug_collrects_wrapper, 0);
2998 if(SQ_FAILED(sq_createslot(v, -3))) {
2999 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
3002 sq_pushstring(v, "debug_show_fps", -1);
3003 sq_newclosure(v, &debug_show_fps_wrapper, 0);
3004 if(SQ_FAILED(sq_createslot(v, -3))) {
3005 throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
3008 sq_pushstring(v, "debug_draw_solids_only", -1);
3009 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
3010 if(SQ_FAILED(sq_createslot(v, -3))) {
3011 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
3014 sq_pushstring(v, "play_music", -1);
3015 sq_newclosure(v, &play_music_wrapper, 0);
3016 if(SQ_FAILED(sq_createslot(v, -3))) {
3017 throw SquirrelError(v, "Couldn't register function 'play_music'");
3020 sq_pushstring(v, "play_sound", -1);
3021 sq_newclosure(v, &play_sound_wrapper, 0);
3022 if(SQ_FAILED(sq_createslot(v, -3))) {
3023 throw SquirrelError(v, "Couldn't register function 'play_sound'");
3026 sq_pushstring(v, "grease", -1);
3027 sq_newclosure(v, &grease_wrapper, 0);
3028 if(SQ_FAILED(sq_createslot(v, -3))) {
3029 throw SquirrelError(v, "Couldn't register function 'grease'");
3032 sq_pushstring(v, "invincible", -1);
3033 sq_newclosure(v, &invincible_wrapper, 0);
3034 if(SQ_FAILED(sq_createslot(v, -3))) {
3035 throw SquirrelError(v, "Couldn't register function 'invincible'");
3038 sq_pushstring(v, "ghost", -1);
3039 sq_newclosure(v, &ghost_wrapper, 0);
3040 if(SQ_FAILED(sq_createslot(v, -3))) {
3041 throw SquirrelError(v, "Couldn't register function 'ghost'");
3044 sq_pushstring(v, "mortal", -1);
3045 sq_newclosure(v, &mortal_wrapper, 0);
3046 if(SQ_FAILED(sq_createslot(v, -3))) {
3047 throw SquirrelError(v, "Couldn't register function 'mortal'");
3050 sq_pushstring(v, "restart", -1);
3051 sq_newclosure(v, &restart_wrapper, 0);
3052 if(SQ_FAILED(sq_createslot(v, -3))) {
3053 throw SquirrelError(v, "Couldn't register function 'restart'");
3056 sq_pushstring(v, "whereami", -1);
3057 sq_newclosure(v, &whereami_wrapper, 0);
3058 if(SQ_FAILED(sq_createslot(v, -3))) {
3059 throw SquirrelError(v, "Couldn't register function 'whereami'");
3062 sq_pushstring(v, "gotoend", -1);
3063 sq_newclosure(v, &gotoend_wrapper, 0);
3064 if(SQ_FAILED(sq_createslot(v, -3))) {
3065 throw SquirrelError(v, "Couldn't register function 'gotoend'");
3068 sq_pushstring(v, "camera", -1);
3069 sq_newclosure(v, &camera_wrapper, 0);
3070 if(SQ_FAILED(sq_createslot(v, -3))) {
3071 throw SquirrelError(v, "Couldn't register function 'camera'");
3074 sq_pushstring(v, "quit", -1);
3075 sq_newclosure(v, &quit_wrapper, 0);
3076 if(SQ_FAILED(sq_createslot(v, -3))) {
3077 throw SquirrelError(v, "Couldn't register function 'quit'");
3080 sq_pushstring(v, "rand", -1);
3081 sq_newclosure(v, &rand_wrapper, 0);
3082 if(SQ_FAILED(sq_createslot(v, -3))) {
3083 throw SquirrelError(v, "Couldn't register function 'rand'");
3086 // Register class DisplayEffect
3087 sq_pushstring(v, "DisplayEffect", -1);
3088 if(sq_newclass(v, SQFalse) < 0) {
3089 std::ostringstream msg;
3090 msg << "Couldn't create new class 'DisplayEffect'";
3091 throw SquirrelError(v, msg.str());
3093 sq_pushstring(v, "fade_out", -1);
3094 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
3095 if(SQ_FAILED(sq_createslot(v, -3))) {
3096 throw SquirrelError(v, "Couldn't register function 'fade_out'");
3099 sq_pushstring(v, "fade_in", -1);
3100 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
3101 if(SQ_FAILED(sq_createslot(v, -3))) {
3102 throw SquirrelError(v, "Couldn't register function 'fade_in'");
3105 sq_pushstring(v, "set_black", -1);
3106 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
3107 if(SQ_FAILED(sq_createslot(v, -3))) {
3108 throw SquirrelError(v, "Couldn't register function 'set_black'");
3111 sq_pushstring(v, "is_black", -1);
3112 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
3113 if(SQ_FAILED(sq_createslot(v, -3))) {
3114 throw SquirrelError(v, "Couldn't register function 'is_black'");
3117 sq_pushstring(v, "sixteen_to_nine", -1);
3118 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
3119 if(SQ_FAILED(sq_createslot(v, -3))) {
3120 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
3123 sq_pushstring(v, "four_to_three", -1);
3124 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
3125 if(SQ_FAILED(sq_createslot(v, -3))) {
3126 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
3129 if(SQ_FAILED(sq_createslot(v, -3))) {
3130 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
3133 // Register class Camera
3134 sq_pushstring(v, "Camera", -1);
3135 if(sq_newclass(v, SQFalse) < 0) {
3136 std::ostringstream msg;
3137 msg << "Couldn't create new class 'Camera'";
3138 throw SquirrelError(v, msg.str());
3140 sq_pushstring(v, "shake", -1);
3141 sq_newclosure(v, &Camera_shake_wrapper, 0);
3142 if(SQ_FAILED(sq_createslot(v, -3))) {
3143 throw SquirrelError(v, "Couldn't register function 'shake'");
3146 sq_pushstring(v, "set_pos", -1);
3147 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
3148 if(SQ_FAILED(sq_createslot(v, -3))) {
3149 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3152 sq_pushstring(v, "set_mode", -1);
3153 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
3154 if(SQ_FAILED(sq_createslot(v, -3))) {
3155 throw SquirrelError(v, "Couldn't register function 'set_mode'");
3158 sq_pushstring(v, "scroll_to", -1);
3159 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
3160 if(SQ_FAILED(sq_createslot(v, -3))) {
3161 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
3164 if(SQ_FAILED(sq_createslot(v, -3))) {
3165 throw SquirrelError(v, "Couldn't register class 'Camera'");
3168 // Register class Level
3169 sq_pushstring(v, "Level", -1);
3170 if(sq_newclass(v, SQFalse) < 0) {
3171 std::ostringstream msg;
3172 msg << "Couldn't create new class 'Level'";
3173 throw SquirrelError(v, msg.str());
3175 sq_pushstring(v, "finish", -1);
3176 sq_newclosure(v, &Level_finish_wrapper, 0);
3177 if(SQ_FAILED(sq_createslot(v, -3))) {
3178 throw SquirrelError(v, "Couldn't register function 'finish'");
3181 sq_pushstring(v, "spawn", -1);
3182 sq_newclosure(v, &Level_spawn_wrapper, 0);
3183 if(SQ_FAILED(sq_createslot(v, -3))) {
3184 throw SquirrelError(v, "Couldn't register function 'spawn'");
3187 sq_pushstring(v, "flip_vertically", -1);
3188 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
3189 if(SQ_FAILED(sq_createslot(v, -3))) {
3190 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
3193 sq_pushstring(v, "toggle_pause", -1);
3194 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
3195 if(SQ_FAILED(sq_createslot(v, -3))) {
3196 throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
3199 if(SQ_FAILED(sq_createslot(v, -3))) {
3200 throw SquirrelError(v, "Couldn't register class 'Level'");
3203 // Register class ScriptedObject
3204 sq_pushstring(v, "ScriptedObject", -1);
3205 if(sq_newclass(v, SQFalse) < 0) {
3206 std::ostringstream msg;
3207 msg << "Couldn't create new class 'ScriptedObject'";
3208 throw SquirrelError(v, msg.str());
3210 sq_pushstring(v, "set_action", -1);
3211 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
3212 if(SQ_FAILED(sq_createslot(v, -3))) {
3213 throw SquirrelError(v, "Couldn't register function 'set_action'");
3216 sq_pushstring(v, "get_action", -1);
3217 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
3218 if(SQ_FAILED(sq_createslot(v, -3))) {
3219 throw SquirrelError(v, "Couldn't register function 'get_action'");
3222 sq_pushstring(v, "move", -1);
3223 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
3224 if(SQ_FAILED(sq_createslot(v, -3))) {
3225 throw SquirrelError(v, "Couldn't register function 'move'");
3228 sq_pushstring(v, "set_pos", -1);
3229 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
3230 if(SQ_FAILED(sq_createslot(v, -3))) {
3231 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3234 sq_pushstring(v, "get_pos_x", -1);
3235 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
3236 if(SQ_FAILED(sq_createslot(v, -3))) {
3237 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3240 sq_pushstring(v, "get_pos_y", -1);
3241 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
3242 if(SQ_FAILED(sq_createslot(v, -3))) {
3243 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3246 sq_pushstring(v, "set_velocity", -1);
3247 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
3248 if(SQ_FAILED(sq_createslot(v, -3))) {
3249 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
3252 sq_pushstring(v, "get_velocity_x", -1);
3253 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
3254 if(SQ_FAILED(sq_createslot(v, -3))) {
3255 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
3258 sq_pushstring(v, "get_velocity_y", -1);
3259 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
3260 if(SQ_FAILED(sq_createslot(v, -3))) {
3261 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
3264 sq_pushstring(v, "set_visible", -1);
3265 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
3266 if(SQ_FAILED(sq_createslot(v, -3))) {
3267 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3270 sq_pushstring(v, "is_visible", -1);
3271 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
3272 if(SQ_FAILED(sq_createslot(v, -3))) {
3273 throw SquirrelError(v, "Couldn't register function 'is_visible'");
3276 sq_pushstring(v, "set_solid", -1);
3277 sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
3278 if(SQ_FAILED(sq_createslot(v, -3))) {
3279 throw SquirrelError(v, "Couldn't register function 'set_solid'");
3282 sq_pushstring(v, "is_solid", -1);
3283 sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
3284 if(SQ_FAILED(sq_createslot(v, -3))) {
3285 throw SquirrelError(v, "Couldn't register function 'is_solid'");
3288 sq_pushstring(v, "get_name", -1);
3289 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
3290 if(SQ_FAILED(sq_createslot(v, -3))) {
3291 throw SquirrelError(v, "Couldn't register function 'get_name'");
3294 if(SQ_FAILED(sq_createslot(v, -3))) {
3295 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
3298 // Register class Text
3299 sq_pushstring(v, "Text", -1);
3300 if(sq_newclass(v, SQFalse) < 0) {
3301 std::ostringstream msg;
3302 msg << "Couldn't create new class 'Text'";
3303 throw SquirrelError(v, msg.str());
3305 sq_pushstring(v, "set_text", -1);
3306 sq_newclosure(v, &Text_set_text_wrapper, 0);
3307 if(SQ_FAILED(sq_createslot(v, -3))) {
3308 throw SquirrelError(v, "Couldn't register function 'set_text'");
3311 sq_pushstring(v, "set_font", -1);
3312 sq_newclosure(v, &Text_set_font_wrapper, 0);
3313 if(SQ_FAILED(sq_createslot(v, -3))) {
3314 throw SquirrelError(v, "Couldn't register function 'set_font'");
3317 sq_pushstring(v, "fade_in", -1);
3318 sq_newclosure(v, &Text_fade_in_wrapper, 0);
3319 if(SQ_FAILED(sq_createslot(v, -3))) {
3320 throw SquirrelError(v, "Couldn't register function 'fade_in'");
3323 sq_pushstring(v, "fade_out", -1);
3324 sq_newclosure(v, &Text_fade_out_wrapper, 0);
3325 if(SQ_FAILED(sq_createslot(v, -3))) {
3326 throw SquirrelError(v, "Couldn't register function 'fade_out'");
3329 sq_pushstring(v, "set_visible", -1);
3330 sq_newclosure(v, &Text_set_visible_wrapper, 0);
3331 if(SQ_FAILED(sq_createslot(v, -3))) {
3332 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3335 sq_pushstring(v, "set_centered", -1);
3336 sq_newclosure(v, &Text_set_centered_wrapper, 0);
3337 if(SQ_FAILED(sq_createslot(v, -3))) {
3338 throw SquirrelError(v, "Couldn't register function 'set_centered'");
3341 if(SQ_FAILED(sq_createslot(v, -3))) {
3342 throw SquirrelError(v, "Couldn't register class 'Text'");
3345 // Register class Player
3346 sq_pushstring(v, "Player", -1);
3347 if(sq_newclass(v, SQFalse) < 0) {
3348 std::ostringstream msg;
3349 msg << "Couldn't create new class 'Player'";
3350 throw SquirrelError(v, msg.str());
3352 sq_pushstring(v, "add_bonus", -1);
3353 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
3354 if(SQ_FAILED(sq_createslot(v, -3))) {
3355 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
3358 sq_pushstring(v, "add_coins", -1);
3359 sq_newclosure(v, &Player_add_coins_wrapper, 0);
3360 if(SQ_FAILED(sq_createslot(v, -3))) {
3361 throw SquirrelError(v, "Couldn't register function 'add_coins'");
3364 sq_pushstring(v, "make_invincible", -1);
3365 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
3366 if(SQ_FAILED(sq_createslot(v, -3))) {
3367 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
3370 sq_pushstring(v, "deactivate", -1);
3371 sq_newclosure(v, &Player_deactivate_wrapper, 0);
3372 if(SQ_FAILED(sq_createslot(v, -3))) {
3373 throw SquirrelError(v, "Couldn't register function 'deactivate'");
3376 sq_pushstring(v, "activate", -1);
3377 sq_newclosure(v, &Player_activate_wrapper, 0);
3378 if(SQ_FAILED(sq_createslot(v, -3))) {
3379 throw SquirrelError(v, "Couldn't register function 'activate'");
3382 sq_pushstring(v, "walk", -1);
3383 sq_newclosure(v, &Player_walk_wrapper, 0);
3384 if(SQ_FAILED(sq_createslot(v, -3))) {
3385 throw SquirrelError(v, "Couldn't register function 'walk'");
3388 sq_pushstring(v, "set_visible", -1);
3389 sq_newclosure(v, &Player_set_visible_wrapper, 0);
3390 if(SQ_FAILED(sq_createslot(v, -3))) {
3391 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3394 sq_pushstring(v, "get_visible", -1);
3395 sq_newclosure(v, &Player_get_visible_wrapper, 0);
3396 if(SQ_FAILED(sq_createslot(v, -3))) {
3397 throw SquirrelError(v, "Couldn't register function 'get_visible'");
3400 sq_pushstring(v, "kill", -1);
3401 sq_newclosure(v, &Player_kill_wrapper, 0);
3402 if(SQ_FAILED(sq_createslot(v, -3))) {
3403 throw SquirrelError(v, "Couldn't register function 'kill'");
3406 sq_pushstring(v, "set_ghost_mode", -1);
3407 sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
3408 if(SQ_FAILED(sq_createslot(v, -3))) {
3409 throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
3412 sq_pushstring(v, "get_ghost_mode", -1);
3413 sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
3414 if(SQ_FAILED(sq_createslot(v, -3))) {
3415 throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
3418 sq_pushstring(v, "do_cheer", -1);
3419 sq_newclosure(v, &Player_do_cheer_wrapper, 0);
3420 if(SQ_FAILED(sq_createslot(v, -3))) {
3421 throw SquirrelError(v, "Couldn't register function 'do_cheer'");
3424 sq_pushstring(v, "do_duck", -1);
3425 sq_newclosure(v, &Player_do_duck_wrapper, 0);
3426 if(SQ_FAILED(sq_createslot(v, -3))) {
3427 throw SquirrelError(v, "Couldn't register function 'do_duck'");
3430 sq_pushstring(v, "do_standup", -1);
3431 sq_newclosure(v, &Player_do_standup_wrapper, 0);
3432 if(SQ_FAILED(sq_createslot(v, -3))) {
3433 throw SquirrelError(v, "Couldn't register function 'do_standup'");
3436 sq_pushstring(v, "do_backflip", -1);
3437 sq_newclosure(v, &Player_do_backflip_wrapper, 0);
3438 if(SQ_FAILED(sq_createslot(v, -3))) {
3439 throw SquirrelError(v, "Couldn't register function 'do_backflip'");
3442 sq_pushstring(v, "do_jump", -1);
3443 sq_newclosure(v, &Player_do_jump_wrapper, 0);
3444 if(SQ_FAILED(sq_createslot(v, -3))) {
3445 throw SquirrelError(v, "Couldn't register function 'do_jump'");
3448 if(SQ_FAILED(sq_createslot(v, -3))) {
3449 throw SquirrelError(v, "Couldn't register class 'Player'");
3452 // Register class FloatingImage
3453 sq_pushstring(v, "FloatingImage", -1);
3454 if(sq_newclass(v, SQFalse) < 0) {
3455 std::ostringstream msg;
3456 msg << "Couldn't create new class 'FloatingImage'";
3457 throw SquirrelError(v, msg.str());
3459 sq_pushstring(v, "constructor", -1);
3460 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
3461 if(SQ_FAILED(sq_createslot(v, -3))) {
3462 throw SquirrelError(v, "Couldn't register function 'constructor'");
3465 sq_pushstring(v, "set_layer", -1);
3466 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
3467 if(SQ_FAILED(sq_createslot(v, -3))) {
3468 throw SquirrelError(v, "Couldn't register function 'set_layer'");
3471 sq_pushstring(v, "get_layer", -1);
3472 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
3473 if(SQ_FAILED(sq_createslot(v, -3))) {
3474 throw SquirrelError(v, "Couldn't register function 'get_layer'");
3477 sq_pushstring(v, "set_pos", -1);
3478 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
3479 if(SQ_FAILED(sq_createslot(v, -3))) {
3480 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3483 sq_pushstring(v, "get_pos_x", -1);
3484 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
3485 if(SQ_FAILED(sq_createslot(v, -3))) {
3486 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3489 sq_pushstring(v, "get_pos_y", -1);
3490 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
3491 if(SQ_FAILED(sq_createslot(v, -3))) {
3492 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3495 sq_pushstring(v, "set_anchor_point", -1);
3496 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
3497 if(SQ_FAILED(sq_createslot(v, -3))) {
3498 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
3501 sq_pushstring(v, "get_anchor_point", -1);
3502 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
3503 if(SQ_FAILED(sq_createslot(v, -3))) {
3504 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
3507 sq_pushstring(v, "set_visible", -1);
3508 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
3509 if(SQ_FAILED(sq_createslot(v, -3))) {
3510 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3513 sq_pushstring(v, "get_visible", -1);
3514 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
3515 if(SQ_FAILED(sq_createslot(v, -3))) {
3516 throw SquirrelError(v, "Couldn't register function 'get_visible'");
3519 sq_pushstring(v, "set_action", -1);
3520 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
3521 if(SQ_FAILED(sq_createslot(v, -3))) {
3522 throw SquirrelError(v, "Couldn't register function 'set_action'");
3525 sq_pushstring(v, "get_action", -1);
3526 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
3527 if(SQ_FAILED(sq_createslot(v, -3))) {
3528 throw SquirrelError(v, "Couldn't register function 'get_action'");
3531 if(SQ_FAILED(sq_createslot(v, -3))) {
3532 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
3535 // Register class Platform
3536 sq_pushstring(v, "Platform", -1);
3537 if(sq_newclass(v, SQFalse) < 0) {
3538 std::ostringstream msg;
3539 msg << "Couldn't create new class 'Platform'";
3540 throw SquirrelError(v, msg.str());
3542 sq_pushstring(v, "goto_node", -1);
3543 sq_newclosure(v, &Platform_goto_node_wrapper, 0);
3544 if(SQ_FAILED(sq_createslot(v, -3))) {
3545 throw SquirrelError(v, "Couldn't register function 'goto_node'");
3548 sq_pushstring(v, "start_moving", -1);
3549 sq_newclosure(v, &Platform_start_moving_wrapper, 0);
3550 if(SQ_FAILED(sq_createslot(v, -3))) {
3551 throw SquirrelError(v, "Couldn't register function 'start_moving'");
3554 sq_pushstring(v, "stop_moving", -1);
3555 sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
3556 if(SQ_FAILED(sq_createslot(v, -3))) {
3557 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
3560 if(SQ_FAILED(sq_createslot(v, -3))) {
3561 throw SquirrelError(v, "Couldn't register class 'Platform'");
3564 // Register class Candle
3565 sq_pushstring(v, "Candle", -1);
3566 if(sq_newclass(v, SQFalse) < 0) {
3567 std::ostringstream msg;
3568 msg << "Couldn't create new class 'Candle'";
3569 throw SquirrelError(v, msg.str());
3571 sq_pushstring(v, "get_burning", -1);
3572 sq_newclosure(v, &Candle_get_burning_wrapper, 0);
3573 if(SQ_FAILED(sq_createslot(v, -3))) {
3574 throw SquirrelError(v, "Couldn't register function 'get_burning'");
3577 sq_pushstring(v, "set_burning", -1);
3578 sq_newclosure(v, &Candle_set_burning_wrapper, 0);
3579 if(SQ_FAILED(sq_createslot(v, -3))) {
3580 throw SquirrelError(v, "Couldn't register function 'set_burning'");
3583 if(SQ_FAILED(sq_createslot(v, -3))) {
3584 throw SquirrelError(v, "Couldn't register class 'Candle'");
3587 // Register class Wind
3588 sq_pushstring(v, "Wind", -1);
3589 if(sq_newclass(v, SQFalse) < 0) {
3590 std::ostringstream msg;
3591 msg << "Couldn't create new class 'Wind'";
3592 throw SquirrelError(v, msg.str());
3594 sq_pushstring(v, "start", -1);
3595 sq_newclosure(v, &Wind_start_wrapper, 0);
3596 if(SQ_FAILED(sq_createslot(v, -3))) {
3597 throw SquirrelError(v, "Couldn't register function 'start'");
3600 sq_pushstring(v, "stop", -1);
3601 sq_newclosure(v, &Wind_stop_wrapper, 0);
3602 if(SQ_FAILED(sq_createslot(v, -3))) {
3603 throw SquirrelError(v, "Couldn't register function 'stop'");
3606 if(SQ_FAILED(sq_createslot(v, -3))) {
3607 throw SquirrelError(v, "Couldn't register class 'Wind'");
3612 } // end of namespace Scripting