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 FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1346 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1351 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1354 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1355 sq_throwerror(vm, _SC("Argument 1 not a string"));
1360 Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1361 if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1362 sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1365 sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1369 } catch(std::exception& e) {
1370 sq_throwerror(vm, e.what());
1373 sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1379 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1382 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1383 sq_throwerror(vm, _SC("'set_layer' called without instance"));
1386 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1388 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1389 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1394 _this->set_layer(static_cast<int> (arg0));
1398 } catch(std::exception& e) {
1399 sq_throwerror(vm, e.what());
1402 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1408 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1411 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1412 sq_throwerror(vm, _SC("'get_layer' called without instance"));
1415 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1418 int return_value = _this->get_layer();
1420 sq_pushinteger(vm, return_value);
1423 } catch(std::exception& e) {
1424 sq_throwerror(vm, e.what());
1427 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1433 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1436 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1437 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1440 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1442 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1443 sq_throwerror(vm, _SC("Argument 1 not a float"));
1447 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1448 sq_throwerror(vm, _SC("Argument 2 not a float"));
1453 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1457 } catch(std::exception& e) {
1458 sq_throwerror(vm, e.what());
1461 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1467 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1470 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1471 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1474 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1477 float return_value = _this->get_pos_x();
1479 sq_pushfloat(vm, return_value);
1482 } catch(std::exception& e) {
1483 sq_throwerror(vm, e.what());
1486 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1492 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1495 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1496 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1499 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1502 float return_value = _this->get_pos_y();
1504 sq_pushfloat(vm, return_value);
1507 } catch(std::exception& e) {
1508 sq_throwerror(vm, e.what());
1511 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1517 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1520 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1521 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1524 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1526 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1527 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1532 _this->set_anchor_point(static_cast<int> (arg0));
1536 } catch(std::exception& e) {
1537 sq_throwerror(vm, e.what());
1540 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1546 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1549 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1550 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1553 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1556 int return_value = _this->get_anchor_point();
1558 sq_pushinteger(vm, return_value);
1561 } catch(std::exception& e) {
1562 sq_throwerror(vm, e.what());
1565 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1571 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1574 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1575 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1578 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1580 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1581 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1586 _this->set_visible(arg0 == SQTrue);
1590 } catch(std::exception& e) {
1591 sq_throwerror(vm, e.what());
1594 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1600 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1603 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1604 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1607 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1610 bool return_value = _this->get_visible();
1612 sq_pushbool(vm, return_value);
1615 } catch(std::exception& e) {
1616 sq_throwerror(vm, e.what());
1619 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1625 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
1628 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1629 sq_throwerror(vm, _SC("'set_action' called without instance"));
1632 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1634 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1635 sq_throwerror(vm, _SC("Argument 1 not a string"));
1640 _this->set_action(arg0);
1644 } catch(std::exception& e) {
1645 sq_throwerror(vm, e.what());
1648 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1654 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
1657 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1658 sq_throwerror(vm, _SC("'get_action' called without instance"));
1661 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1664 std::string return_value = _this->get_action();
1666 sq_pushstring(vm, return_value.c_str(), return_value.size());
1669 } catch(std::exception& e) {
1670 sq_throwerror(vm, e.what());
1673 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1679 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1681 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
1686 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1689 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1690 sq_throwerror(vm, _SC("'goto_node' called without instance"));
1693 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1695 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1696 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1701 _this->goto_node(static_cast<int> (arg0));
1705 } catch(std::exception& e) {
1706 sq_throwerror(vm, e.what());
1709 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1715 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1718 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1719 sq_throwerror(vm, _SC("'start_moving' called without instance"));
1722 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1725 _this->start_moving();
1729 } catch(std::exception& e) {
1730 sq_throwerror(vm, e.what());
1733 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
1739 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1742 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1743 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1746 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1749 _this->stop_moving();
1753 } catch(std::exception& e) {
1754 sq_throwerror(vm, e.what());
1757 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1763 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
1765 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (ptr);
1770 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
1773 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1774 sq_throwerror(vm, _SC("'get_burning' called without instance"));
1777 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1780 bool return_value = _this->get_burning();
1782 sq_pushbool(vm, return_value);
1785 } catch(std::exception& e) {
1786 sq_throwerror(vm, e.what());
1789 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
1795 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
1798 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1799 sq_throwerror(vm, _SC("'set_burning' called without instance"));
1802 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1804 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1805 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1810 _this->set_burning(arg0 == SQTrue);
1814 } catch(std::exception& e) {
1815 sq_throwerror(vm, e.what());
1818 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_burning'"));
1824 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
1826 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (ptr);
1831 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
1834 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1835 sq_throwerror(vm, _SC("'start' called without instance"));
1838 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
1845 } catch(std::exception& e) {
1846 sq_throwerror(vm, e.what());
1849 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
1855 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
1858 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1859 sq_throwerror(vm, _SC("'stop' called without instance"));
1862 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
1869 } catch(std::exception& e) {
1870 sq_throwerror(vm, e.what());
1873 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
1879 static SQInteger display_wrapper(HSQUIRRELVM vm)
1881 return Scripting::display(vm);
1884 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
1886 HSQUIRRELVM arg0 = vm;
1889 Scripting::print_stacktrace(arg0);
1893 } catch(std::exception& e) {
1894 sq_throwerror(vm, e.what());
1897 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
1903 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
1905 return Scripting::get_current_thread(vm);
1908 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
1911 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1912 sq_throwerror(vm, _SC("Argument 1 not a string"));
1917 Scripting::display_text_file(arg0);
1921 } catch(std::exception& e) {
1922 sq_throwerror(vm, e.what());
1925 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
1931 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
1934 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1935 sq_throwerror(vm, _SC("Argument 1 not a string"));
1940 Scripting::load_worldmap(arg0);
1944 } catch(std::exception& e) {
1945 sq_throwerror(vm, e.what());
1948 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
1954 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
1957 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1958 sq_throwerror(vm, _SC("Argument 1 not a string"));
1963 Scripting::load_level(arg0);
1967 } catch(std::exception& e) {
1968 sq_throwerror(vm, e.what());
1971 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
1977 static SQInteger wait_wrapper(HSQUIRRELVM vm)
1979 HSQUIRRELVM arg0 = vm;
1981 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
1982 sq_throwerror(vm, _SC("Argument 1 not a float"));
1987 Scripting::wait(arg0, static_cast<float> (arg1));
1989 return sq_suspendvm(vm);
1991 } catch(std::exception& e) {
1992 sq_throwerror(vm, e.what());
1995 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
2001 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
2003 HSQUIRRELVM arg0 = vm;
2006 Scripting::wait_for_screenswitch(arg0);
2008 return sq_suspendvm(vm);
2010 } catch(std::exception& e) {
2011 sq_throwerror(vm, e.what());
2014 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
2020 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
2025 Scripting::exit_screen();
2029 } catch(std::exception& e) {
2030 sq_throwerror(vm, e.what());
2033 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
2039 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
2042 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2043 sq_throwerror(vm, _SC("Argument 1 not a float"));
2048 Scripting::fadeout_screen(static_cast<float> (arg0));
2052 } catch(std::exception& e) {
2053 sq_throwerror(vm, e.what());
2056 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
2062 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
2065 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2066 sq_throwerror(vm, _SC("Argument 1 not a float"));
2070 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2071 sq_throwerror(vm, _SC("Argument 2 not a float"));
2075 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2076 sq_throwerror(vm, _SC("Argument 3 not a float"));
2081 Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2085 } catch(std::exception& e) {
2086 sq_throwerror(vm, e.what());
2089 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
2095 static SQInteger translate_wrapper(HSQUIRRELVM vm)
2098 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2099 sq_throwerror(vm, _SC("Argument 1 not a string"));
2104 std::string return_value = Scripting::translate(arg0);
2106 sq_pushstring(vm, return_value.c_str(), return_value.size());
2109 } catch(std::exception& e) {
2110 sq_throwerror(vm, e.what());
2113 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
2119 static SQInteger import_wrapper(HSQUIRRELVM vm)
2121 HSQUIRRELVM arg0 = vm;
2123 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
2124 sq_throwerror(vm, _SC("Argument 1 not a string"));
2129 Scripting::import(arg0, arg1);
2133 } catch(std::exception& e) {
2134 sq_throwerror(vm, e.what());
2137 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
2143 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
2148 Scripting::save_state();
2152 } catch(std::exception& e) {
2153 sq_throwerror(vm, e.what());
2156 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
2162 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
2165 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2166 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2171 Scripting::debug_collrects(arg0 == SQTrue);
2175 } catch(std::exception& e) {
2176 sq_throwerror(vm, e.what());
2179 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
2185 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
2188 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2189 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2194 Scripting::debug_show_fps(arg0 == SQTrue);
2198 } catch(std::exception& e) {
2199 sq_throwerror(vm, e.what());
2202 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
2208 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
2211 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2212 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2217 Scripting::debug_draw_solids_only(arg0 == SQTrue);
2221 } catch(std::exception& e) {
2222 sq_throwerror(vm, e.what());
2225 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
2231 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
2234 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2235 sq_throwerror(vm, _SC("Argument 1 not a string"));
2240 Scripting::play_music(arg0);
2244 } catch(std::exception& e) {
2245 sq_throwerror(vm, e.what());
2248 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
2254 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
2257 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2258 sq_throwerror(vm, _SC("Argument 1 not a string"));
2263 Scripting::play_sound(arg0);
2267 } catch(std::exception& e) {
2268 sq_throwerror(vm, e.what());
2271 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
2277 static SQInteger grease_wrapper(HSQUIRRELVM vm)
2282 Scripting::grease();
2286 } catch(std::exception& e) {
2287 sq_throwerror(vm, e.what());
2290 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
2296 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
2301 Scripting::invincible();
2305 } catch(std::exception& e) {
2306 sq_throwerror(vm, e.what());
2309 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
2315 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
2324 } catch(std::exception& e) {
2325 sq_throwerror(vm, e.what());
2328 sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
2334 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
2339 Scripting::mortal();
2343 } catch(std::exception& e) {
2344 sq_throwerror(vm, e.what());
2347 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
2353 static SQInteger restart_wrapper(HSQUIRRELVM vm)
2358 Scripting::restart();
2362 } catch(std::exception& e) {
2363 sq_throwerror(vm, e.what());
2366 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
2372 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
2377 Scripting::whereami();
2381 } catch(std::exception& e) {
2382 sq_throwerror(vm, e.what());
2385 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
2391 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
2396 Scripting::gotoend();
2400 } catch(std::exception& e) {
2401 sq_throwerror(vm, e.what());
2404 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
2410 static SQInteger camera_wrapper(HSQUIRRELVM vm)
2415 Scripting::camera();
2419 } catch(std::exception& e) {
2420 sq_throwerror(vm, e.what());
2423 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
2429 static SQInteger quit_wrapper(HSQUIRRELVM vm)
2438 } catch(std::exception& e) {
2439 sq_throwerror(vm, e.what());
2442 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
2448 static SQInteger rand_wrapper(HSQUIRRELVM vm)
2452 int return_value = Scripting::rand();
2454 sq_pushinteger(vm, return_value);
2457 } catch(std::exception& e) {
2458 sq_throwerror(vm, e.what());
2461 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
2467 } // end of namespace Wrapper
2469 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
2471 using namespace Wrapper;
2473 sq_pushroottable(v);
2474 sq_pushstring(v, "DisplayEffect", -1);
2475 if(SQ_FAILED(sq_get(v, -2))) {
2476 std::ostringstream msg;
2477 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
2478 throw SquirrelError(v, msg.str());
2481 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2482 std::ostringstream msg;
2483 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
2484 throw SquirrelError(v, msg.str());
2486 sq_remove(v, -2); // remove object name
2488 if(setup_releasehook) {
2489 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
2492 sq_remove(v, -2); // remove root table
2495 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
2497 using namespace Wrapper;
2499 sq_pushroottable(v);
2500 sq_pushstring(v, "Camera", -1);
2501 if(SQ_FAILED(sq_get(v, -2))) {
2502 std::ostringstream msg;
2503 msg << "Couldn't resolved squirrel type 'Camera'";
2504 throw SquirrelError(v, msg.str());
2507 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2508 std::ostringstream msg;
2509 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
2510 throw SquirrelError(v, msg.str());
2512 sq_remove(v, -2); // remove object name
2514 if(setup_releasehook) {
2515 sq_setreleasehook(v, -1, Camera_release_hook);
2518 sq_remove(v, -2); // remove root table
2521 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
2523 using namespace Wrapper;
2525 sq_pushroottable(v);
2526 sq_pushstring(v, "Level", -1);
2527 if(SQ_FAILED(sq_get(v, -2))) {
2528 std::ostringstream msg;
2529 msg << "Couldn't resolved squirrel type 'Level'";
2530 throw SquirrelError(v, msg.str());
2533 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2534 std::ostringstream msg;
2535 msg << "Couldn't setup squirrel instance for object of type 'Level'";
2536 throw SquirrelError(v, msg.str());
2538 sq_remove(v, -2); // remove object name
2540 if(setup_releasehook) {
2541 sq_setreleasehook(v, -1, Level_release_hook);
2544 sq_remove(v, -2); // remove root table
2547 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
2549 using namespace Wrapper;
2551 sq_pushroottable(v);
2552 sq_pushstring(v, "ScriptedObject", -1);
2553 if(SQ_FAILED(sq_get(v, -2))) {
2554 std::ostringstream msg;
2555 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
2556 throw SquirrelError(v, msg.str());
2559 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2560 std::ostringstream msg;
2561 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
2562 throw SquirrelError(v, msg.str());
2564 sq_remove(v, -2); // remove object name
2566 if(setup_releasehook) {
2567 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
2570 sq_remove(v, -2); // remove root table
2573 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
2575 using namespace Wrapper;
2577 sq_pushroottable(v);
2578 sq_pushstring(v, "Text", -1);
2579 if(SQ_FAILED(sq_get(v, -2))) {
2580 std::ostringstream msg;
2581 msg << "Couldn't resolved squirrel type 'Text'";
2582 throw SquirrelError(v, msg.str());
2585 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2586 std::ostringstream msg;
2587 msg << "Couldn't setup squirrel instance for object of type 'Text'";
2588 throw SquirrelError(v, msg.str());
2590 sq_remove(v, -2); // remove object name
2592 if(setup_releasehook) {
2593 sq_setreleasehook(v, -1, Text_release_hook);
2596 sq_remove(v, -2); // remove root table
2599 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
2601 using namespace Wrapper;
2603 sq_pushroottable(v);
2604 sq_pushstring(v, "Player", -1);
2605 if(SQ_FAILED(sq_get(v, -2))) {
2606 std::ostringstream msg;
2607 msg << "Couldn't resolved squirrel type 'Player'";
2608 throw SquirrelError(v, msg.str());
2611 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2612 std::ostringstream msg;
2613 msg << "Couldn't setup squirrel instance for object of type 'Player'";
2614 throw SquirrelError(v, msg.str());
2616 sq_remove(v, -2); // remove object name
2618 if(setup_releasehook) {
2619 sq_setreleasehook(v, -1, Player_release_hook);
2622 sq_remove(v, -2); // remove root table
2625 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
2627 using namespace Wrapper;
2629 sq_pushroottable(v);
2630 sq_pushstring(v, "FloatingImage", -1);
2631 if(SQ_FAILED(sq_get(v, -2))) {
2632 std::ostringstream msg;
2633 msg << "Couldn't resolved squirrel type 'FloatingImage'";
2634 throw SquirrelError(v, msg.str());
2637 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2638 std::ostringstream msg;
2639 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
2640 throw SquirrelError(v, msg.str());
2642 sq_remove(v, -2); // remove object name
2644 if(setup_releasehook) {
2645 sq_setreleasehook(v, -1, FloatingImage_release_hook);
2648 sq_remove(v, -2); // remove root table
2651 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
2653 using namespace Wrapper;
2655 sq_pushroottable(v);
2656 sq_pushstring(v, "Platform", -1);
2657 if(SQ_FAILED(sq_get(v, -2))) {
2658 std::ostringstream msg;
2659 msg << "Couldn't resolved squirrel type 'Platform'";
2660 throw SquirrelError(v, msg.str());
2663 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2664 std::ostringstream msg;
2665 msg << "Couldn't setup squirrel instance for object of type 'Platform'";
2666 throw SquirrelError(v, msg.str());
2668 sq_remove(v, -2); // remove object name
2670 if(setup_releasehook) {
2671 sq_setreleasehook(v, -1, Platform_release_hook);
2674 sq_remove(v, -2); // remove root table
2677 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
2679 using namespace Wrapper;
2681 sq_pushroottable(v);
2682 sq_pushstring(v, "Candle", -1);
2683 if(SQ_FAILED(sq_get(v, -2))) {
2684 std::ostringstream msg;
2685 msg << "Couldn't resolved squirrel type 'Candle'";
2686 throw SquirrelError(v, msg.str());
2689 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2690 std::ostringstream msg;
2691 msg << "Couldn't setup squirrel instance for object of type 'Candle'";
2692 throw SquirrelError(v, msg.str());
2694 sq_remove(v, -2); // remove object name
2696 if(setup_releasehook) {
2697 sq_setreleasehook(v, -1, Candle_release_hook);
2700 sq_remove(v, -2); // remove root table
2703 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
2705 using namespace Wrapper;
2707 sq_pushroottable(v);
2708 sq_pushstring(v, "Wind", -1);
2709 if(SQ_FAILED(sq_get(v, -2))) {
2710 std::ostringstream msg;
2711 msg << "Couldn't resolved squirrel type 'Wind'";
2712 throw SquirrelError(v, msg.str());
2715 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2716 std::ostringstream msg;
2717 msg << "Couldn't setup squirrel instance for object of type 'Wind'";
2718 throw SquirrelError(v, msg.str());
2720 sq_remove(v, -2); // remove object name
2722 if(setup_releasehook) {
2723 sq_setreleasehook(v, -1, Wind_release_hook);
2726 sq_remove(v, -2); // remove root table
2729 void register_supertux_wrapper(HSQUIRRELVM v)
2731 using namespace Wrapper;
2733 sq_pushstring(v, "ANCHOR_TOP", -1);
2734 sq_pushinteger(v, 16);
2735 if(SQ_FAILED(sq_createslot(v, -3))) {
2736 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
2739 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
2740 sq_pushinteger(v, 32);
2741 if(SQ_FAILED(sq_createslot(v, -3))) {
2742 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
2745 sq_pushstring(v, "ANCHOR_LEFT", -1);
2746 sq_pushinteger(v, 1);
2747 if(SQ_FAILED(sq_createslot(v, -3))) {
2748 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
2751 sq_pushstring(v, "ANCHOR_RIGHT", -1);
2752 sq_pushinteger(v, 2);
2753 if(SQ_FAILED(sq_createslot(v, -3))) {
2754 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
2757 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
2758 sq_pushinteger(v, 0);
2759 if(SQ_FAILED(sq_createslot(v, -3))) {
2760 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
2763 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
2764 sq_pushinteger(v, 17);
2765 if(SQ_FAILED(sq_createslot(v, -3))) {
2766 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
2769 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
2770 sq_pushinteger(v, 18);
2771 if(SQ_FAILED(sq_createslot(v, -3))) {
2772 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
2775 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
2776 sq_pushinteger(v, 33);
2777 if(SQ_FAILED(sq_createslot(v, -3))) {
2778 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
2781 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
2782 sq_pushinteger(v, 34);
2783 if(SQ_FAILED(sq_createslot(v, -3))) {
2784 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
2787 sq_pushstring(v, "display", -1);
2788 sq_newclosure(v, &display_wrapper, 0);
2789 if(SQ_FAILED(sq_createslot(v, -3))) {
2790 throw SquirrelError(v, "Couldn't register function 'display'");
2793 sq_pushstring(v, "print_stacktrace", -1);
2794 sq_newclosure(v, &print_stacktrace_wrapper, 0);
2795 if(SQ_FAILED(sq_createslot(v, -3))) {
2796 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
2799 sq_pushstring(v, "get_current_thread", -1);
2800 sq_newclosure(v, &get_current_thread_wrapper, 0);
2801 if(SQ_FAILED(sq_createslot(v, -3))) {
2802 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
2805 sq_pushstring(v, "display_text_file", -1);
2806 sq_newclosure(v, &display_text_file_wrapper, 0);
2807 if(SQ_FAILED(sq_createslot(v, -3))) {
2808 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
2811 sq_pushstring(v, "load_worldmap", -1);
2812 sq_newclosure(v, &load_worldmap_wrapper, 0);
2813 if(SQ_FAILED(sq_createslot(v, -3))) {
2814 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
2817 sq_pushstring(v, "load_level", -1);
2818 sq_newclosure(v, &load_level_wrapper, 0);
2819 if(SQ_FAILED(sq_createslot(v, -3))) {
2820 throw SquirrelError(v, "Couldn't register function 'load_level'");
2823 sq_pushstring(v, "wait", -1);
2824 sq_newclosure(v, &wait_wrapper, 0);
2825 if(SQ_FAILED(sq_createslot(v, -3))) {
2826 throw SquirrelError(v, "Couldn't register function 'wait'");
2829 sq_pushstring(v, "wait_for_screenswitch", -1);
2830 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
2831 if(SQ_FAILED(sq_createslot(v, -3))) {
2832 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
2835 sq_pushstring(v, "exit_screen", -1);
2836 sq_newclosure(v, &exit_screen_wrapper, 0);
2837 if(SQ_FAILED(sq_createslot(v, -3))) {
2838 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
2841 sq_pushstring(v, "fadeout_screen", -1);
2842 sq_newclosure(v, &fadeout_screen_wrapper, 0);
2843 if(SQ_FAILED(sq_createslot(v, -3))) {
2844 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
2847 sq_pushstring(v, "shrink_screen", -1);
2848 sq_newclosure(v, &shrink_screen_wrapper, 0);
2849 if(SQ_FAILED(sq_createslot(v, -3))) {
2850 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
2853 sq_pushstring(v, "translate", -1);
2854 sq_newclosure(v, &translate_wrapper, 0);
2855 if(SQ_FAILED(sq_createslot(v, -3))) {
2856 throw SquirrelError(v, "Couldn't register function 'translate'");
2859 sq_pushstring(v, "import", -1);
2860 sq_newclosure(v, &import_wrapper, 0);
2861 if(SQ_FAILED(sq_createslot(v, -3))) {
2862 throw SquirrelError(v, "Couldn't register function 'import'");
2865 sq_pushstring(v, "save_state", -1);
2866 sq_newclosure(v, &save_state_wrapper, 0);
2867 if(SQ_FAILED(sq_createslot(v, -3))) {
2868 throw SquirrelError(v, "Couldn't register function 'save_state'");
2871 sq_pushstring(v, "debug_collrects", -1);
2872 sq_newclosure(v, &debug_collrects_wrapper, 0);
2873 if(SQ_FAILED(sq_createslot(v, -3))) {
2874 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
2877 sq_pushstring(v, "debug_show_fps", -1);
2878 sq_newclosure(v, &debug_show_fps_wrapper, 0);
2879 if(SQ_FAILED(sq_createslot(v, -3))) {
2880 throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
2883 sq_pushstring(v, "debug_draw_solids_only", -1);
2884 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
2885 if(SQ_FAILED(sq_createslot(v, -3))) {
2886 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
2889 sq_pushstring(v, "play_music", -1);
2890 sq_newclosure(v, &play_music_wrapper, 0);
2891 if(SQ_FAILED(sq_createslot(v, -3))) {
2892 throw SquirrelError(v, "Couldn't register function 'play_music'");
2895 sq_pushstring(v, "play_sound", -1);
2896 sq_newclosure(v, &play_sound_wrapper, 0);
2897 if(SQ_FAILED(sq_createslot(v, -3))) {
2898 throw SquirrelError(v, "Couldn't register function 'play_sound'");
2901 sq_pushstring(v, "grease", -1);
2902 sq_newclosure(v, &grease_wrapper, 0);
2903 if(SQ_FAILED(sq_createslot(v, -3))) {
2904 throw SquirrelError(v, "Couldn't register function 'grease'");
2907 sq_pushstring(v, "invincible", -1);
2908 sq_newclosure(v, &invincible_wrapper, 0);
2909 if(SQ_FAILED(sq_createslot(v, -3))) {
2910 throw SquirrelError(v, "Couldn't register function 'invincible'");
2913 sq_pushstring(v, "ghost", -1);
2914 sq_newclosure(v, &ghost_wrapper, 0);
2915 if(SQ_FAILED(sq_createslot(v, -3))) {
2916 throw SquirrelError(v, "Couldn't register function 'ghost'");
2919 sq_pushstring(v, "mortal", -1);
2920 sq_newclosure(v, &mortal_wrapper, 0);
2921 if(SQ_FAILED(sq_createslot(v, -3))) {
2922 throw SquirrelError(v, "Couldn't register function 'mortal'");
2925 sq_pushstring(v, "restart", -1);
2926 sq_newclosure(v, &restart_wrapper, 0);
2927 if(SQ_FAILED(sq_createslot(v, -3))) {
2928 throw SquirrelError(v, "Couldn't register function 'restart'");
2931 sq_pushstring(v, "whereami", -1);
2932 sq_newclosure(v, &whereami_wrapper, 0);
2933 if(SQ_FAILED(sq_createslot(v, -3))) {
2934 throw SquirrelError(v, "Couldn't register function 'whereami'");
2937 sq_pushstring(v, "gotoend", -1);
2938 sq_newclosure(v, &gotoend_wrapper, 0);
2939 if(SQ_FAILED(sq_createslot(v, -3))) {
2940 throw SquirrelError(v, "Couldn't register function 'gotoend'");
2943 sq_pushstring(v, "camera", -1);
2944 sq_newclosure(v, &camera_wrapper, 0);
2945 if(SQ_FAILED(sq_createslot(v, -3))) {
2946 throw SquirrelError(v, "Couldn't register function 'camera'");
2949 sq_pushstring(v, "quit", -1);
2950 sq_newclosure(v, &quit_wrapper, 0);
2951 if(SQ_FAILED(sq_createslot(v, -3))) {
2952 throw SquirrelError(v, "Couldn't register function 'quit'");
2955 sq_pushstring(v, "rand", -1);
2956 sq_newclosure(v, &rand_wrapper, 0);
2957 if(SQ_FAILED(sq_createslot(v, -3))) {
2958 throw SquirrelError(v, "Couldn't register function 'rand'");
2961 // Register class DisplayEffect
2962 sq_pushstring(v, "DisplayEffect", -1);
2963 if(sq_newclass(v, SQFalse) < 0) {
2964 std::ostringstream msg;
2965 msg << "Couldn't create new class 'DisplayEffect'";
2966 throw SquirrelError(v, msg.str());
2968 sq_pushstring(v, "fade_out", -1);
2969 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
2970 if(SQ_FAILED(sq_createslot(v, -3))) {
2971 throw SquirrelError(v, "Couldn't register function 'fade_out'");
2974 sq_pushstring(v, "fade_in", -1);
2975 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
2976 if(SQ_FAILED(sq_createslot(v, -3))) {
2977 throw SquirrelError(v, "Couldn't register function 'fade_in'");
2980 sq_pushstring(v, "set_black", -1);
2981 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
2982 if(SQ_FAILED(sq_createslot(v, -3))) {
2983 throw SquirrelError(v, "Couldn't register function 'set_black'");
2986 sq_pushstring(v, "is_black", -1);
2987 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
2988 if(SQ_FAILED(sq_createslot(v, -3))) {
2989 throw SquirrelError(v, "Couldn't register function 'is_black'");
2992 sq_pushstring(v, "sixteen_to_nine", -1);
2993 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
2994 if(SQ_FAILED(sq_createslot(v, -3))) {
2995 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
2998 sq_pushstring(v, "four_to_three", -1);
2999 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
3000 if(SQ_FAILED(sq_createslot(v, -3))) {
3001 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
3004 if(SQ_FAILED(sq_createslot(v, -3))) {
3005 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
3008 // Register class Camera
3009 sq_pushstring(v, "Camera", -1);
3010 if(sq_newclass(v, SQFalse) < 0) {
3011 std::ostringstream msg;
3012 msg << "Couldn't create new class 'Camera'";
3013 throw SquirrelError(v, msg.str());
3015 sq_pushstring(v, "shake", -1);
3016 sq_newclosure(v, &Camera_shake_wrapper, 0);
3017 if(SQ_FAILED(sq_createslot(v, -3))) {
3018 throw SquirrelError(v, "Couldn't register function 'shake'");
3021 sq_pushstring(v, "set_pos", -1);
3022 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
3023 if(SQ_FAILED(sq_createslot(v, -3))) {
3024 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3027 sq_pushstring(v, "set_mode", -1);
3028 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
3029 if(SQ_FAILED(sq_createslot(v, -3))) {
3030 throw SquirrelError(v, "Couldn't register function 'set_mode'");
3033 sq_pushstring(v, "scroll_to", -1);
3034 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
3035 if(SQ_FAILED(sq_createslot(v, -3))) {
3036 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
3039 if(SQ_FAILED(sq_createslot(v, -3))) {
3040 throw SquirrelError(v, "Couldn't register class 'Camera'");
3043 // Register class Level
3044 sq_pushstring(v, "Level", -1);
3045 if(sq_newclass(v, SQFalse) < 0) {
3046 std::ostringstream msg;
3047 msg << "Couldn't create new class 'Level'";
3048 throw SquirrelError(v, msg.str());
3050 sq_pushstring(v, "finish", -1);
3051 sq_newclosure(v, &Level_finish_wrapper, 0);
3052 if(SQ_FAILED(sq_createslot(v, -3))) {
3053 throw SquirrelError(v, "Couldn't register function 'finish'");
3056 sq_pushstring(v, "spawn", -1);
3057 sq_newclosure(v, &Level_spawn_wrapper, 0);
3058 if(SQ_FAILED(sq_createslot(v, -3))) {
3059 throw SquirrelError(v, "Couldn't register function 'spawn'");
3062 sq_pushstring(v, "flip_vertically", -1);
3063 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
3064 if(SQ_FAILED(sq_createslot(v, -3))) {
3065 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
3068 sq_pushstring(v, "toggle_pause", -1);
3069 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
3070 if(SQ_FAILED(sq_createslot(v, -3))) {
3071 throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
3074 if(SQ_FAILED(sq_createslot(v, -3))) {
3075 throw SquirrelError(v, "Couldn't register class 'Level'");
3078 // Register class ScriptedObject
3079 sq_pushstring(v, "ScriptedObject", -1);
3080 if(sq_newclass(v, SQFalse) < 0) {
3081 std::ostringstream msg;
3082 msg << "Couldn't create new class 'ScriptedObject'";
3083 throw SquirrelError(v, msg.str());
3085 sq_pushstring(v, "set_action", -1);
3086 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
3087 if(SQ_FAILED(sq_createslot(v, -3))) {
3088 throw SquirrelError(v, "Couldn't register function 'set_action'");
3091 sq_pushstring(v, "get_action", -1);
3092 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
3093 if(SQ_FAILED(sq_createslot(v, -3))) {
3094 throw SquirrelError(v, "Couldn't register function 'get_action'");
3097 sq_pushstring(v, "move", -1);
3098 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
3099 if(SQ_FAILED(sq_createslot(v, -3))) {
3100 throw SquirrelError(v, "Couldn't register function 'move'");
3103 sq_pushstring(v, "set_pos", -1);
3104 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
3105 if(SQ_FAILED(sq_createslot(v, -3))) {
3106 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3109 sq_pushstring(v, "get_pos_x", -1);
3110 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
3111 if(SQ_FAILED(sq_createslot(v, -3))) {
3112 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3115 sq_pushstring(v, "get_pos_y", -1);
3116 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
3117 if(SQ_FAILED(sq_createslot(v, -3))) {
3118 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3121 sq_pushstring(v, "set_velocity", -1);
3122 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
3123 if(SQ_FAILED(sq_createslot(v, -3))) {
3124 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
3127 sq_pushstring(v, "get_velocity_x", -1);
3128 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
3129 if(SQ_FAILED(sq_createslot(v, -3))) {
3130 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
3133 sq_pushstring(v, "get_velocity_y", -1);
3134 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
3135 if(SQ_FAILED(sq_createslot(v, -3))) {
3136 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
3139 sq_pushstring(v, "set_visible", -1);
3140 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
3141 if(SQ_FAILED(sq_createslot(v, -3))) {
3142 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3145 sq_pushstring(v, "is_visible", -1);
3146 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
3147 if(SQ_FAILED(sq_createslot(v, -3))) {
3148 throw SquirrelError(v, "Couldn't register function 'is_visible'");
3151 sq_pushstring(v, "set_solid", -1);
3152 sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
3153 if(SQ_FAILED(sq_createslot(v, -3))) {
3154 throw SquirrelError(v, "Couldn't register function 'set_solid'");
3157 sq_pushstring(v, "is_solid", -1);
3158 sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
3159 if(SQ_FAILED(sq_createslot(v, -3))) {
3160 throw SquirrelError(v, "Couldn't register function 'is_solid'");
3163 sq_pushstring(v, "get_name", -1);
3164 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
3165 if(SQ_FAILED(sq_createslot(v, -3))) {
3166 throw SquirrelError(v, "Couldn't register function 'get_name'");
3169 if(SQ_FAILED(sq_createslot(v, -3))) {
3170 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
3173 // Register class Text
3174 sq_pushstring(v, "Text", -1);
3175 if(sq_newclass(v, SQFalse) < 0) {
3176 std::ostringstream msg;
3177 msg << "Couldn't create new class 'Text'";
3178 throw SquirrelError(v, msg.str());
3180 sq_pushstring(v, "set_text", -1);
3181 sq_newclosure(v, &Text_set_text_wrapper, 0);
3182 if(SQ_FAILED(sq_createslot(v, -3))) {
3183 throw SquirrelError(v, "Couldn't register function 'set_text'");
3186 sq_pushstring(v, "set_font", -1);
3187 sq_newclosure(v, &Text_set_font_wrapper, 0);
3188 if(SQ_FAILED(sq_createslot(v, -3))) {
3189 throw SquirrelError(v, "Couldn't register function 'set_font'");
3192 sq_pushstring(v, "fade_in", -1);
3193 sq_newclosure(v, &Text_fade_in_wrapper, 0);
3194 if(SQ_FAILED(sq_createslot(v, -3))) {
3195 throw SquirrelError(v, "Couldn't register function 'fade_in'");
3198 sq_pushstring(v, "fade_out", -1);
3199 sq_newclosure(v, &Text_fade_out_wrapper, 0);
3200 if(SQ_FAILED(sq_createslot(v, -3))) {
3201 throw SquirrelError(v, "Couldn't register function 'fade_out'");
3204 sq_pushstring(v, "set_visible", -1);
3205 sq_newclosure(v, &Text_set_visible_wrapper, 0);
3206 if(SQ_FAILED(sq_createslot(v, -3))) {
3207 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3210 sq_pushstring(v, "set_centered", -1);
3211 sq_newclosure(v, &Text_set_centered_wrapper, 0);
3212 if(SQ_FAILED(sq_createslot(v, -3))) {
3213 throw SquirrelError(v, "Couldn't register function 'set_centered'");
3216 if(SQ_FAILED(sq_createslot(v, -3))) {
3217 throw SquirrelError(v, "Couldn't register class 'Text'");
3220 // Register class Player
3221 sq_pushstring(v, "Player", -1);
3222 if(sq_newclass(v, SQFalse) < 0) {
3223 std::ostringstream msg;
3224 msg << "Couldn't create new class 'Player'";
3225 throw SquirrelError(v, msg.str());
3227 sq_pushstring(v, "add_bonus", -1);
3228 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
3229 if(SQ_FAILED(sq_createslot(v, -3))) {
3230 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
3233 sq_pushstring(v, "add_coins", -1);
3234 sq_newclosure(v, &Player_add_coins_wrapper, 0);
3235 if(SQ_FAILED(sq_createslot(v, -3))) {
3236 throw SquirrelError(v, "Couldn't register function 'add_coins'");
3239 sq_pushstring(v, "make_invincible", -1);
3240 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
3241 if(SQ_FAILED(sq_createslot(v, -3))) {
3242 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
3245 sq_pushstring(v, "deactivate", -1);
3246 sq_newclosure(v, &Player_deactivate_wrapper, 0);
3247 if(SQ_FAILED(sq_createslot(v, -3))) {
3248 throw SquirrelError(v, "Couldn't register function 'deactivate'");
3251 sq_pushstring(v, "activate", -1);
3252 sq_newclosure(v, &Player_activate_wrapper, 0);
3253 if(SQ_FAILED(sq_createslot(v, -3))) {
3254 throw SquirrelError(v, "Couldn't register function 'activate'");
3257 sq_pushstring(v, "walk", -1);
3258 sq_newclosure(v, &Player_walk_wrapper, 0);
3259 if(SQ_FAILED(sq_createslot(v, -3))) {
3260 throw SquirrelError(v, "Couldn't register function 'walk'");
3263 sq_pushstring(v, "set_visible", -1);
3264 sq_newclosure(v, &Player_set_visible_wrapper, 0);
3265 if(SQ_FAILED(sq_createslot(v, -3))) {
3266 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3269 sq_pushstring(v, "get_visible", -1);
3270 sq_newclosure(v, &Player_get_visible_wrapper, 0);
3271 if(SQ_FAILED(sq_createslot(v, -3))) {
3272 throw SquirrelError(v, "Couldn't register function 'get_visible'");
3275 sq_pushstring(v, "kill", -1);
3276 sq_newclosure(v, &Player_kill_wrapper, 0);
3277 if(SQ_FAILED(sq_createslot(v, -3))) {
3278 throw SquirrelError(v, "Couldn't register function 'kill'");
3281 sq_pushstring(v, "set_ghost_mode", -1);
3282 sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
3283 if(SQ_FAILED(sq_createslot(v, -3))) {
3284 throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
3287 sq_pushstring(v, "get_ghost_mode", -1);
3288 sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
3289 if(SQ_FAILED(sq_createslot(v, -3))) {
3290 throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
3293 if(SQ_FAILED(sq_createslot(v, -3))) {
3294 throw SquirrelError(v, "Couldn't register class 'Player'");
3297 // Register class FloatingImage
3298 sq_pushstring(v, "FloatingImage", -1);
3299 if(sq_newclass(v, SQFalse) < 0) {
3300 std::ostringstream msg;
3301 msg << "Couldn't create new class 'FloatingImage'";
3302 throw SquirrelError(v, msg.str());
3304 sq_pushstring(v, "constructor", -1);
3305 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
3306 if(SQ_FAILED(sq_createslot(v, -3))) {
3307 throw SquirrelError(v, "Couldn't register function 'constructor'");
3310 sq_pushstring(v, "set_layer", -1);
3311 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
3312 if(SQ_FAILED(sq_createslot(v, -3))) {
3313 throw SquirrelError(v, "Couldn't register function 'set_layer'");
3316 sq_pushstring(v, "get_layer", -1);
3317 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
3318 if(SQ_FAILED(sq_createslot(v, -3))) {
3319 throw SquirrelError(v, "Couldn't register function 'get_layer'");
3322 sq_pushstring(v, "set_pos", -1);
3323 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
3324 if(SQ_FAILED(sq_createslot(v, -3))) {
3325 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3328 sq_pushstring(v, "get_pos_x", -1);
3329 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
3330 if(SQ_FAILED(sq_createslot(v, -3))) {
3331 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3334 sq_pushstring(v, "get_pos_y", -1);
3335 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
3336 if(SQ_FAILED(sq_createslot(v, -3))) {
3337 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3340 sq_pushstring(v, "set_anchor_point", -1);
3341 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
3342 if(SQ_FAILED(sq_createslot(v, -3))) {
3343 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
3346 sq_pushstring(v, "get_anchor_point", -1);
3347 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
3348 if(SQ_FAILED(sq_createslot(v, -3))) {
3349 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
3352 sq_pushstring(v, "set_visible", -1);
3353 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
3354 if(SQ_FAILED(sq_createslot(v, -3))) {
3355 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3358 sq_pushstring(v, "get_visible", -1);
3359 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
3360 if(SQ_FAILED(sq_createslot(v, -3))) {
3361 throw SquirrelError(v, "Couldn't register function 'get_visible'");
3364 sq_pushstring(v, "set_action", -1);
3365 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
3366 if(SQ_FAILED(sq_createslot(v, -3))) {
3367 throw SquirrelError(v, "Couldn't register function 'set_action'");
3370 sq_pushstring(v, "get_action", -1);
3371 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
3372 if(SQ_FAILED(sq_createslot(v, -3))) {
3373 throw SquirrelError(v, "Couldn't register function 'get_action'");
3376 if(SQ_FAILED(sq_createslot(v, -3))) {
3377 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
3380 // Register class Platform
3381 sq_pushstring(v, "Platform", -1);
3382 if(sq_newclass(v, SQFalse) < 0) {
3383 std::ostringstream msg;
3384 msg << "Couldn't create new class 'Platform'";
3385 throw SquirrelError(v, msg.str());
3387 sq_pushstring(v, "goto_node", -1);
3388 sq_newclosure(v, &Platform_goto_node_wrapper, 0);
3389 if(SQ_FAILED(sq_createslot(v, -3))) {
3390 throw SquirrelError(v, "Couldn't register function 'goto_node'");
3393 sq_pushstring(v, "start_moving", -1);
3394 sq_newclosure(v, &Platform_start_moving_wrapper, 0);
3395 if(SQ_FAILED(sq_createslot(v, -3))) {
3396 throw SquirrelError(v, "Couldn't register function 'start_moving'");
3399 sq_pushstring(v, "stop_moving", -1);
3400 sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
3401 if(SQ_FAILED(sq_createslot(v, -3))) {
3402 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
3405 if(SQ_FAILED(sq_createslot(v, -3))) {
3406 throw SquirrelError(v, "Couldn't register class 'Platform'");
3409 // Register class Candle
3410 sq_pushstring(v, "Candle", -1);
3411 if(sq_newclass(v, SQFalse) < 0) {
3412 std::ostringstream msg;
3413 msg << "Couldn't create new class 'Candle'";
3414 throw SquirrelError(v, msg.str());
3416 sq_pushstring(v, "get_burning", -1);
3417 sq_newclosure(v, &Candle_get_burning_wrapper, 0);
3418 if(SQ_FAILED(sq_createslot(v, -3))) {
3419 throw SquirrelError(v, "Couldn't register function 'get_burning'");
3422 sq_pushstring(v, "set_burning", -1);
3423 sq_newclosure(v, &Candle_set_burning_wrapper, 0);
3424 if(SQ_FAILED(sq_createslot(v, -3))) {
3425 throw SquirrelError(v, "Couldn't register function 'set_burning'");
3428 if(SQ_FAILED(sq_createslot(v, -3))) {
3429 throw SquirrelError(v, "Couldn't register class 'Candle'");
3432 // Register class Wind
3433 sq_pushstring(v, "Wind", -1);
3434 if(sq_newclass(v, SQFalse) < 0) {
3435 std::ostringstream msg;
3436 msg << "Couldn't create new class 'Wind'";
3437 throw SquirrelError(v, msg.str());
3439 sq_pushstring(v, "start", -1);
3440 sq_newclosure(v, &Wind_start_wrapper, 0);
3441 if(SQ_FAILED(sq_createslot(v, -3))) {
3442 throw SquirrelError(v, "Couldn't register function 'start'");
3445 sq_pushstring(v, "stop", -1);
3446 sq_newclosure(v, &Wind_stop_wrapper, 0);
3447 if(SQ_FAILED(sq_createslot(v, -3))) {
3448 throw SquirrelError(v, "Couldn't register function 'stop'");
3451 if(SQ_FAILED(sq_createslot(v, -3))) {
3452 throw SquirrelError(v, "Couldn't register class 'Wind'");
3457 } // end of namespace Scripting