2 * WARNING: This file is automatically generated from:
3 * 'src/scripting/wrapper.interface.hpp'
13 #include "squirrel_error.hpp"
14 #include "wrapper.interface.hpp"
21 static SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger )
23 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (ptr);
28 static SQInteger DisplayEffect_fade_out_wrapper(HSQUIRRELVM vm)
31 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
32 sq_throwerror(vm, _SC("'fade_out' called without instance"));
35 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
37 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
38 sq_throwerror(vm, _SC("Argument 1 not a float"));
43 _this->fade_out(static_cast<float> (arg0));
47 } catch(std::exception& e) {
48 sq_throwerror(vm, e.what());
51 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
57 static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm)
60 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
61 sq_throwerror(vm, _SC("'fade_in' called without instance"));
64 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
66 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
67 sq_throwerror(vm, _SC("Argument 1 not a float"));
72 _this->fade_in(static_cast<float> (arg0));
76 } catch(std::exception& e) {
77 sq_throwerror(vm, e.what());
80 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
86 static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm)
89 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
90 sq_throwerror(vm, _SC("'set_black' called without instance"));
93 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
95 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
96 sq_throwerror(vm, _SC("Argument 1 not a bool"));
101 _this->set_black(arg0 == SQTrue);
105 } catch(std::exception& e) {
106 sq_throwerror(vm, e.what());
109 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_black'"));
115 static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm)
118 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
119 sq_throwerror(vm, _SC("'is_black' called without instance"));
122 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
125 bool return_value = _this->is_black();
127 sq_pushbool(vm, return_value);
130 } catch(std::exception& e) {
131 sq_throwerror(vm, e.what());
134 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_black'"));
140 static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm)
143 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
144 sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance"));
147 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
149 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
150 sq_throwerror(vm, _SC("Argument 1 not a float"));
155 _this->sixteen_to_nine(static_cast<float> (arg0));
159 } catch(std::exception& e) {
160 sq_throwerror(vm, e.what());
163 sq_throwerror(vm, _SC("Unexpected exception while executing function 'sixteen_to_nine'"));
169 static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm)
172 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
173 sq_throwerror(vm, _SC("'four_to_three' called without instance"));
176 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
178 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
179 sq_throwerror(vm, _SC("Argument 1 not a float"));
184 _this->four_to_three(static_cast<float> (arg0));
188 } catch(std::exception& e) {
189 sq_throwerror(vm, e.what());
192 sq_throwerror(vm, _SC("Unexpected exception while executing function 'four_to_three'"));
198 static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger )
200 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
205 static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm)
208 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
209 sq_throwerror(vm, _SC("'shake' called without instance"));
212 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
214 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
215 sq_throwerror(vm, _SC("Argument 1 not a float"));
219 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
220 sq_throwerror(vm, _SC("Argument 2 not a float"));
224 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
225 sq_throwerror(vm, _SC("Argument 3 not a float"));
230 _this->shake(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
234 } catch(std::exception& e) {
235 sq_throwerror(vm, e.what());
238 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'"));
244 static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm)
247 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
248 sq_throwerror(vm, _SC("'set_pos' called without instance"));
251 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
253 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
254 sq_throwerror(vm, _SC("Argument 1 not a float"));
258 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
259 sq_throwerror(vm, _SC("Argument 2 not a float"));
264 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
268 } catch(std::exception& e) {
269 sq_throwerror(vm, e.what());
272 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
278 static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm)
281 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
282 sq_throwerror(vm, _SC("'set_mode' called without instance"));
285 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
287 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
288 sq_throwerror(vm, _SC("Argument 1 not a string"));
293 _this->set_mode(arg0);
297 } catch(std::exception& e) {
298 sq_throwerror(vm, e.what());
301 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_mode'"));
307 static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm)
310 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
311 sq_throwerror(vm, _SC("'scroll_to' called without instance"));
314 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
316 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
317 sq_throwerror(vm, _SC("Argument 1 not a float"));
321 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
322 sq_throwerror(vm, _SC("Argument 2 not a float"));
326 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
327 sq_throwerror(vm, _SC("Argument 3 not a float"));
332 _this->scroll_to(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
336 } catch(std::exception& e) {
337 sq_throwerror(vm, e.what());
340 sq_throwerror(vm, _SC("Unexpected exception while executing function 'scroll_to'"));
346 static SQInteger Level_release_hook(SQUserPointer ptr, SQInteger )
348 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
353 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
356 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
357 sq_throwerror(vm, _SC("'finish' called without instance"));
360 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
362 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
363 sq_throwerror(vm, _SC("Argument 1 not a bool"));
368 _this->finish(arg0 == SQTrue);
372 } catch(std::exception& e) {
373 sq_throwerror(vm, e.what());
376 sq_throwerror(vm, _SC("Unexpected exception while executing function 'finish'"));
382 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
385 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
386 sq_throwerror(vm, _SC("'spawn' called without instance"));
389 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
391 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
392 sq_throwerror(vm, _SC("Argument 1 not a string"));
396 if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
397 sq_throwerror(vm, _SC("Argument 2 not a string"));
402 _this->spawn(arg0, arg1);
406 } catch(std::exception& e) {
407 sq_throwerror(vm, e.what());
410 sq_throwerror(vm, _SC("Unexpected exception while executing function 'spawn'"));
416 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
419 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
420 sq_throwerror(vm, _SC("'flip_vertically' called without instance"));
423 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
426 _this->flip_vertically();
430 } catch(std::exception& e) {
431 sq_throwerror(vm, e.what());
434 sq_throwerror(vm, _SC("Unexpected exception while executing function 'flip_vertically'"));
440 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
443 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
444 sq_throwerror(vm, _SC("'toggle_pause' called without instance"));
447 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
450 _this->toggle_pause();
454 } catch(std::exception& e) {
455 sq_throwerror(vm, e.what());
458 sq_throwerror(vm, _SC("Unexpected exception while executing function 'toggle_pause'"));
464 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
466 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
471 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
474 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
475 sq_throwerror(vm, _SC("'set_action' called without instance"));
478 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
480 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
481 sq_throwerror(vm, _SC("Argument 1 not a string"));
486 _this->set_action(arg0);
490 } catch(std::exception& e) {
491 sq_throwerror(vm, e.what());
494 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
500 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
503 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
504 sq_throwerror(vm, _SC("'get_action' called without instance"));
507 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
510 std::string return_value = _this->get_action();
512 sq_pushstring(vm, return_value.c_str(), return_value.size());
515 } catch(std::exception& e) {
516 sq_throwerror(vm, e.what());
519 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
525 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
528 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
529 sq_throwerror(vm, _SC("'move' called without instance"));
532 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
534 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
535 sq_throwerror(vm, _SC("Argument 1 not a float"));
539 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
540 sq_throwerror(vm, _SC("Argument 2 not a float"));
545 _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
549 } catch(std::exception& e) {
550 sq_throwerror(vm, e.what());
553 sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
559 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
562 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
563 sq_throwerror(vm, _SC("'set_pos' called without instance"));
566 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
568 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
569 sq_throwerror(vm, _SC("Argument 1 not a float"));
573 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
574 sq_throwerror(vm, _SC("Argument 2 not a float"));
579 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
583 } catch(std::exception& e) {
584 sq_throwerror(vm, e.what());
587 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
593 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
596 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
597 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
600 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
603 float return_value = _this->get_pos_x();
605 sq_pushfloat(vm, return_value);
608 } catch(std::exception& e) {
609 sq_throwerror(vm, e.what());
612 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
618 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
621 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
622 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
625 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
628 float return_value = _this->get_pos_y();
630 sq_pushfloat(vm, return_value);
633 } catch(std::exception& e) {
634 sq_throwerror(vm, e.what());
637 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
643 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
646 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
647 sq_throwerror(vm, _SC("'set_velocity' called without instance"));
650 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
652 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
653 sq_throwerror(vm, _SC("Argument 1 not a float"));
657 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
658 sq_throwerror(vm, _SC("Argument 2 not a float"));
663 _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
667 } catch(std::exception& e) {
668 sq_throwerror(vm, e.what());
671 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
677 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
680 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
681 sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
684 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
687 float return_value = _this->get_velocity_x();
689 sq_pushfloat(vm, return_value);
692 } catch(std::exception& e) {
693 sq_throwerror(vm, e.what());
696 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
702 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
705 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
706 sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
709 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
712 float return_value = _this->get_velocity_y();
714 sq_pushfloat(vm, return_value);
717 } catch(std::exception& e) {
718 sq_throwerror(vm, e.what());
721 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
727 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
730 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
731 sq_throwerror(vm, _SC("'set_visible' called without instance"));
734 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
736 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
737 sq_throwerror(vm, _SC("Argument 1 not a bool"));
742 _this->set_visible(arg0 == SQTrue);
746 } catch(std::exception& e) {
747 sq_throwerror(vm, e.what());
750 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
756 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
759 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
760 sq_throwerror(vm, _SC("'is_visible' called without instance"));
763 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
766 bool return_value = _this->is_visible();
768 sq_pushbool(vm, return_value);
771 } catch(std::exception& e) {
772 sq_throwerror(vm, e.what());
775 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
781 static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm)
784 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
785 sq_throwerror(vm, _SC("'set_solid' called without instance"));
788 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
790 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
791 sq_throwerror(vm, _SC("Argument 1 not a bool"));
796 _this->set_solid(arg0 == SQTrue);
800 } catch(std::exception& e) {
801 sq_throwerror(vm, e.what());
804 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_solid'"));
810 static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm)
813 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
814 sq_throwerror(vm, _SC("'is_solid' called without instance"));
817 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
820 bool return_value = _this->is_solid();
822 sq_pushbool(vm, return_value);
825 } catch(std::exception& e) {
826 sq_throwerror(vm, e.what());
829 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_solid'"));
835 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
838 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
839 sq_throwerror(vm, _SC("'get_name' called without instance"));
842 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
845 std::string return_value = _this->get_name();
847 sq_pushstring(vm, return_value.c_str(), return_value.size());
850 } catch(std::exception& e) {
851 sq_throwerror(vm, e.what());
854 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
860 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
862 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
867 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
870 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
871 sq_throwerror(vm, _SC("'set_text' called without instance"));
874 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
876 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
877 sq_throwerror(vm, _SC("Argument 1 not a string"));
882 _this->set_text(arg0);
886 } catch(std::exception& e) {
887 sq_throwerror(vm, e.what());
890 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
896 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
899 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
900 sq_throwerror(vm, _SC("'set_font' called without instance"));
903 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
905 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
906 sq_throwerror(vm, _SC("Argument 1 not a string"));
911 _this->set_font(arg0);
915 } catch(std::exception& e) {
916 sq_throwerror(vm, e.what());
919 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
925 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
928 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
929 sq_throwerror(vm, _SC("'fade_in' called without instance"));
932 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
934 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
935 sq_throwerror(vm, _SC("Argument 1 not a float"));
940 _this->fade_in(static_cast<float> (arg0));
944 } catch(std::exception& e) {
945 sq_throwerror(vm, e.what());
948 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
954 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
957 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
958 sq_throwerror(vm, _SC("'fade_out' called without instance"));
961 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
963 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
964 sq_throwerror(vm, _SC("Argument 1 not a float"));
969 _this->fade_out(static_cast<float> (arg0));
973 } catch(std::exception& e) {
974 sq_throwerror(vm, e.what());
977 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
983 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
986 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
987 sq_throwerror(vm, _SC("'set_visible' called without instance"));
990 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
992 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
993 sq_throwerror(vm, _SC("Argument 1 not a bool"));
998 _this->set_visible(arg0 == SQTrue);
1002 } catch(std::exception& e) {
1003 sq_throwerror(vm, e.what());
1006 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1012 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
1015 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1016 sq_throwerror(vm, _SC("'set_centered' called without instance"));
1019 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1021 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1022 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1027 _this->set_centered(arg0 == SQTrue);
1031 } catch(std::exception& e) {
1032 sq_throwerror(vm, e.what());
1035 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
1041 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
1043 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
1048 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
1051 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1052 sq_throwerror(vm, _SC("'add_bonus' called without instance"));
1055 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1057 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1058 sq_throwerror(vm, _SC("Argument 1 not a string"));
1063 bool return_value = _this->add_bonus(arg0);
1065 sq_pushbool(vm, return_value);
1068 } catch(std::exception& e) {
1069 sq_throwerror(vm, e.what());
1072 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1078 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
1081 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1082 sq_throwerror(vm, _SC("'add_coins' called without instance"));
1085 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1087 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1088 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1093 _this->add_coins(static_cast<int> (arg0));
1097 } catch(std::exception& e) {
1098 sq_throwerror(vm, e.what());
1101 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1107 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1110 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1111 sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1114 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1117 _this->make_invincible();
1121 } catch(std::exception& e) {
1122 sq_throwerror(vm, e.what());
1125 sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1131 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1134 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1135 sq_throwerror(vm, _SC("'deactivate' called without instance"));
1138 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1141 _this->deactivate();
1145 } catch(std::exception& e) {
1146 sq_throwerror(vm, e.what());
1149 sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1155 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1158 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1159 sq_throwerror(vm, _SC("'activate' called without instance"));
1162 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1169 } catch(std::exception& e) {
1170 sq_throwerror(vm, e.what());
1173 sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1179 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1182 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1183 sq_throwerror(vm, _SC("'walk' called without instance"));
1186 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1188 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1189 sq_throwerror(vm, _SC("Argument 1 not a float"));
1194 _this->walk(static_cast<float> (arg0));
1198 } catch(std::exception& e) {
1199 sq_throwerror(vm, e.what());
1202 sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1208 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1211 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1212 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1215 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1217 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1218 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1223 _this->set_visible(arg0 == SQTrue);
1227 } catch(std::exception& e) {
1228 sq_throwerror(vm, e.what());
1231 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1237 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1240 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1241 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1244 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1247 bool return_value = _this->get_visible();
1249 sq_pushbool(vm, return_value);
1252 } catch(std::exception& e) {
1253 sq_throwerror(vm, e.what());
1256 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1262 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1265 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1266 sq_throwerror(vm, _SC("'kill' called without instance"));
1269 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1271 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1272 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1277 _this->kill(arg0 == SQTrue);
1281 } catch(std::exception& e) {
1282 sq_throwerror(vm, e.what());
1285 sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1291 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1294 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1295 sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1298 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1300 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1301 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1306 _this->set_ghost_mode(arg0 == SQTrue);
1310 } catch(std::exception& e) {
1311 sq_throwerror(vm, e.what());
1314 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1320 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1323 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1324 sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1327 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1330 bool return_value = _this->get_ghost_mode();
1332 sq_pushbool(vm, return_value);
1335 } catch(std::exception& e) {
1336 sq_throwerror(vm, e.what());
1339 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1345 static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm)
1348 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1349 sq_throwerror(vm, _SC("'do_cheer' called without instance"));
1352 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1359 } catch(std::exception& e) {
1360 sq_throwerror(vm, e.what());
1363 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'"));
1369 static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm)
1372 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1373 sq_throwerror(vm, _SC("'do_duck' called without instance"));
1376 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1383 } catch(std::exception& e) {
1384 sq_throwerror(vm, e.what());
1387 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'"));
1393 static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm)
1396 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1397 sq_throwerror(vm, _SC("'do_standup' called without instance"));
1400 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1403 _this->do_standup();
1407 } catch(std::exception& e) {
1408 sq_throwerror(vm, e.what());
1411 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'"));
1417 static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm)
1420 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1421 sq_throwerror(vm, _SC("'do_backflip' called without instance"));
1424 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1427 _this->do_backflip();
1431 } catch(std::exception& e) {
1432 sq_throwerror(vm, e.what());
1435 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'"));
1441 static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm)
1444 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1445 sq_throwerror(vm, _SC("'do_jump' called without instance"));
1448 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1450 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1451 sq_throwerror(vm, _SC("Argument 1 not a float"));
1456 _this->do_jump(static_cast<float> (arg0));
1460 } catch(std::exception& e) {
1461 sq_throwerror(vm, e.what());
1464 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_jump'"));
1470 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1472 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1477 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1480 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1481 sq_throwerror(vm, _SC("Argument 1 not a string"));
1486 Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1487 if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1488 sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1491 sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1495 } catch(std::exception& e) {
1496 sq_throwerror(vm, e.what());
1499 sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1505 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1508 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1509 sq_throwerror(vm, _SC("'set_layer' called without instance"));
1512 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1514 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1515 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1520 _this->set_layer(static_cast<int> (arg0));
1524 } catch(std::exception& e) {
1525 sq_throwerror(vm, e.what());
1528 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1534 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1537 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1538 sq_throwerror(vm, _SC("'get_layer' called without instance"));
1541 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1544 int return_value = _this->get_layer();
1546 sq_pushinteger(vm, return_value);
1549 } catch(std::exception& e) {
1550 sq_throwerror(vm, e.what());
1553 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1559 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1562 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1563 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1566 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1568 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1569 sq_throwerror(vm, _SC("Argument 1 not a float"));
1573 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1574 sq_throwerror(vm, _SC("Argument 2 not a float"));
1579 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1583 } catch(std::exception& e) {
1584 sq_throwerror(vm, e.what());
1587 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1593 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1596 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1597 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1600 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1603 float return_value = _this->get_pos_x();
1605 sq_pushfloat(vm, return_value);
1608 } catch(std::exception& e) {
1609 sq_throwerror(vm, e.what());
1612 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1618 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1621 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1622 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1625 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1628 float return_value = _this->get_pos_y();
1630 sq_pushfloat(vm, return_value);
1633 } catch(std::exception& e) {
1634 sq_throwerror(vm, e.what());
1637 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1643 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1646 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1647 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1650 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1652 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1653 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1658 _this->set_anchor_point(static_cast<int> (arg0));
1662 } catch(std::exception& e) {
1663 sq_throwerror(vm, e.what());
1666 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1672 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1675 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1676 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1679 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1682 int return_value = _this->get_anchor_point();
1684 sq_pushinteger(vm, return_value);
1687 } catch(std::exception& e) {
1688 sq_throwerror(vm, e.what());
1691 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1697 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1700 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1701 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1704 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1706 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1707 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1712 _this->set_visible(arg0 == SQTrue);
1716 } catch(std::exception& e) {
1717 sq_throwerror(vm, e.what());
1720 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1726 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1729 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1730 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1733 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1736 bool return_value = _this->get_visible();
1738 sq_pushbool(vm, return_value);
1741 } catch(std::exception& e) {
1742 sq_throwerror(vm, e.what());
1745 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1751 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
1754 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1755 sq_throwerror(vm, _SC("'set_action' called without instance"));
1758 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1760 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1761 sq_throwerror(vm, _SC("Argument 1 not a string"));
1766 _this->set_action(arg0);
1770 } catch(std::exception& e) {
1771 sq_throwerror(vm, e.what());
1774 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1780 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
1783 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1784 sq_throwerror(vm, _SC("'get_action' called without instance"));
1787 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1790 std::string return_value = _this->get_action();
1792 sq_pushstring(vm, return_value.c_str(), return_value.size());
1795 } catch(std::exception& e) {
1796 sq_throwerror(vm, e.what());
1799 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1805 static SQInteger FloatingImage_fade_in_wrapper(HSQUIRRELVM vm)
1808 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1809 sq_throwerror(vm, _SC("'fade_in' called without instance"));
1812 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1814 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1815 sq_throwerror(vm, _SC("Argument 1 not a float"));
1820 _this->fade_in(static_cast<float> (arg0));
1824 } catch(std::exception& e) {
1825 sq_throwerror(vm, e.what());
1828 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
1834 static SQInteger FloatingImage_fade_out_wrapper(HSQUIRRELVM vm)
1837 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1838 sq_throwerror(vm, _SC("'fade_out' called without instance"));
1841 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1843 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1844 sq_throwerror(vm, _SC("Argument 1 not a float"));
1849 _this->fade_out(static_cast<float> (arg0));
1853 } catch(std::exception& e) {
1854 sq_throwerror(vm, e.what());
1857 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
1863 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1865 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
1870 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1873 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1874 sq_throwerror(vm, _SC("'goto_node' called without instance"));
1877 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1879 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1880 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1885 _this->goto_node(static_cast<int> (arg0));
1889 } catch(std::exception& e) {
1890 sq_throwerror(vm, e.what());
1893 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1899 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1902 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1903 sq_throwerror(vm, _SC("'start_moving' called without instance"));
1906 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1909 _this->start_moving();
1913 } catch(std::exception& e) {
1914 sq_throwerror(vm, e.what());
1917 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
1923 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1926 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1927 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1930 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1933 _this->stop_moving();
1937 } catch(std::exception& e) {
1938 sq_throwerror(vm, e.what());
1941 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1947 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
1949 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (ptr);
1954 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
1957 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1958 sq_throwerror(vm, _SC("'get_burning' called without instance"));
1961 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1964 bool return_value = _this->get_burning();
1966 sq_pushbool(vm, return_value);
1969 } catch(std::exception& e) {
1970 sq_throwerror(vm, e.what());
1973 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
1979 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
1982 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1983 sq_throwerror(vm, _SC("'set_burning' called without instance"));
1986 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1988 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1989 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1994 _this->set_burning(arg0 == SQTrue);
1998 } catch(std::exception& e) {
1999 sq_throwerror(vm, e.what());
2002 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_burning'"));
2008 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
2010 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (ptr);
2015 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
2018 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2019 sq_throwerror(vm, _SC("'start' called without instance"));
2022 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
2029 } catch(std::exception& e) {
2030 sq_throwerror(vm, e.what());
2033 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2039 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
2042 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2043 sq_throwerror(vm, _SC("'stop' called without instance"));
2046 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
2053 } catch(std::exception& e) {
2054 sq_throwerror(vm, e.what());
2057 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2063 static SQInteger AmbientSound_release_hook(SQUserPointer ptr, SQInteger )
2065 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (ptr);
2070 static SQInteger AmbientSound_set_pos_wrapper(HSQUIRRELVM vm)
2073 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2074 sq_throwerror(vm, _SC("'set_pos' called without instance"));
2077 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2079 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2080 sq_throwerror(vm, _SC("Argument 1 not a float"));
2084 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2085 sq_throwerror(vm, _SC("Argument 2 not a float"));
2090 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
2094 } catch(std::exception& e) {
2095 sq_throwerror(vm, e.what());
2098 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
2104 static SQInteger AmbientSound_get_pos_x_wrapper(HSQUIRRELVM vm)
2107 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2108 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
2111 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2114 float return_value = _this->get_pos_x();
2116 sq_pushfloat(vm, return_value);
2119 } catch(std::exception& e) {
2120 sq_throwerror(vm, e.what());
2123 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
2129 static SQInteger AmbientSound_get_pos_y_wrapper(HSQUIRRELVM vm)
2132 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2133 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
2136 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2139 float return_value = _this->get_pos_y();
2141 sq_pushfloat(vm, return_value);
2144 } catch(std::exception& e) {
2145 sq_throwerror(vm, e.what());
2148 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
2154 static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger )
2156 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (ptr);
2161 static SQInteger Thunderstorm_start_wrapper(HSQUIRRELVM vm)
2164 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2165 sq_throwerror(vm, _SC("'start' called without instance"));
2168 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2175 } catch(std::exception& e) {
2176 sq_throwerror(vm, e.what());
2179 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2185 static SQInteger Thunderstorm_stop_wrapper(HSQUIRRELVM vm)
2188 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2189 sq_throwerror(vm, _SC("'stop' called without instance"));
2192 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2199 } catch(std::exception& e) {
2200 sq_throwerror(vm, e.what());
2203 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2209 static SQInteger Thunderstorm_thunder_wrapper(HSQUIRRELVM vm)
2212 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2213 sq_throwerror(vm, _SC("'thunder' called without instance"));
2216 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2223 } catch(std::exception& e) {
2224 sq_throwerror(vm, e.what());
2227 sq_throwerror(vm, _SC("Unexpected exception while executing function 'thunder'"));
2233 static SQInteger Thunderstorm_lightning_wrapper(HSQUIRRELVM vm)
2236 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2237 sq_throwerror(vm, _SC("'lightning' called without instance"));
2240 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2247 } catch(std::exception& e) {
2248 sq_throwerror(vm, e.what());
2251 sq_throwerror(vm, _SC("Unexpected exception while executing function 'lightning'"));
2257 static SQInteger Thunderstorm_flash_wrapper(HSQUIRRELVM vm)
2260 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2261 sq_throwerror(vm, _SC("'flash' called without instance"));
2264 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2271 } catch(std::exception& e) {
2272 sq_throwerror(vm, e.what());
2275 sq_throwerror(vm, _SC("Unexpected exception while executing function 'flash'"));
2281 static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm)
2284 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2285 sq_throwerror(vm, _SC("'electrify' called without instance"));
2288 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2295 } catch(std::exception& e) {
2296 sq_throwerror(vm, e.what());
2299 sq_throwerror(vm, _SC("Unexpected exception while executing function 'electrify'"));
2305 static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger )
2307 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (ptr);
2312 static SQInteger TileMap_goto_node_wrapper(HSQUIRRELVM vm)
2315 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2316 sq_throwerror(vm, _SC("'goto_node' called without instance"));
2319 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2321 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2322 sq_throwerror(vm, _SC("Argument 1 not an integer"));
2327 _this->goto_node(static_cast<int> (arg0));
2331 } catch(std::exception& e) {
2332 sq_throwerror(vm, e.what());
2335 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2341 static SQInteger TileMap_start_moving_wrapper(HSQUIRRELVM vm)
2344 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2345 sq_throwerror(vm, _SC("'start_moving' called without instance"));
2348 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2351 _this->start_moving();
2355 } catch(std::exception& e) {
2356 sq_throwerror(vm, e.what());
2359 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2365 static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm)
2368 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2369 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2372 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2375 _this->stop_moving();
2379 } catch(std::exception& e) {
2380 sq_throwerror(vm, e.what());
2383 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2389 static SQInteger SSector_release_hook(SQUserPointer ptr, SQInteger )
2391 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (ptr);
2396 static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm)
2399 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2400 sq_throwerror(vm, _SC("'set_ambient_light' called without instance"));
2403 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2405 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2406 sq_throwerror(vm, _SC("Argument 1 not a float"));
2410 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2411 sq_throwerror(vm, _SC("Argument 2 not a float"));
2415 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2416 sq_throwerror(vm, _SC("Argument 3 not a float"));
2421 _this->set_ambient_light(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2425 } catch(std::exception& e) {
2426 sq_throwerror(vm, e.what());
2429 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ambient_light'"));
2435 static SQInteger SSector_get_ambient_red_wrapper(HSQUIRRELVM vm)
2438 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2439 sq_throwerror(vm, _SC("'get_ambient_red' called without instance"));
2442 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2445 float return_value = _this->get_ambient_red();
2447 sq_pushfloat(vm, return_value);
2450 } catch(std::exception& e) {
2451 sq_throwerror(vm, e.what());
2454 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_red'"));
2460 static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm)
2463 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2464 sq_throwerror(vm, _SC("'get_ambient_green' called without instance"));
2467 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2470 float return_value = _this->get_ambient_green();
2472 sq_pushfloat(vm, return_value);
2475 } catch(std::exception& e) {
2476 sq_throwerror(vm, e.what());
2479 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_green'"));
2485 static SQInteger SSector_get_ambient_blue_wrapper(HSQUIRRELVM vm)
2488 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2489 sq_throwerror(vm, _SC("'get_ambient_blue' called without instance"));
2492 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2495 float return_value = _this->get_ambient_blue();
2497 sq_pushfloat(vm, return_value);
2500 } catch(std::exception& e) {
2501 sq_throwerror(vm, e.what());
2504 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_blue'"));
2510 static SQInteger LevelTime_release_hook(SQUserPointer ptr, SQInteger )
2512 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (ptr);
2517 static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm)
2520 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2521 sq_throwerror(vm, _SC("'start' called without instance"));
2524 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2531 } catch(std::exception& e) {
2532 sq_throwerror(vm, e.what());
2535 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2541 static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm)
2544 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2545 sq_throwerror(vm, _SC("'stop' called without instance"));
2548 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2555 } catch(std::exception& e) {
2556 sq_throwerror(vm, e.what());
2559 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2565 static SQInteger LevelTime_get_time_wrapper(HSQUIRRELVM vm)
2568 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2569 sq_throwerror(vm, _SC("'get_time' called without instance"));
2572 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2575 float return_value = _this->get_time();
2577 sq_pushfloat(vm, return_value);
2580 } catch(std::exception& e) {
2581 sq_throwerror(vm, e.what());
2584 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_time'"));
2590 static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm)
2593 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2594 sq_throwerror(vm, _SC("'set_time' called without instance"));
2597 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2599 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2600 sq_throwerror(vm, _SC("Argument 1 not a float"));
2605 _this->set_time(static_cast<float> (arg0));
2609 } catch(std::exception& e) {
2610 sq_throwerror(vm, e.what());
2613 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_time'"));
2619 static SQInteger display_wrapper(HSQUIRRELVM vm)
2621 return Scripting::display(vm);
2624 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
2626 HSQUIRRELVM arg0 = vm;
2629 Scripting::print_stacktrace(arg0);
2633 } catch(std::exception& e) {
2634 sq_throwerror(vm, e.what());
2637 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
2643 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
2645 return Scripting::get_current_thread(vm);
2648 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
2651 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2652 sq_throwerror(vm, _SC("Argument 1 not a string"));
2657 Scripting::display_text_file(arg0);
2661 } catch(std::exception& e) {
2662 sq_throwerror(vm, e.what());
2665 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
2671 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
2674 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2675 sq_throwerror(vm, _SC("Argument 1 not a string"));
2680 Scripting::load_worldmap(arg0);
2684 } catch(std::exception& e) {
2685 sq_throwerror(vm, e.what());
2688 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
2694 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
2697 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2698 sq_throwerror(vm, _SC("Argument 1 not a string"));
2703 Scripting::load_level(arg0);
2707 } catch(std::exception& e) {
2708 sq_throwerror(vm, e.what());
2711 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
2717 static SQInteger wait_wrapper(HSQUIRRELVM vm)
2719 HSQUIRRELVM arg0 = vm;
2721 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
2722 sq_throwerror(vm, _SC("Argument 1 not a float"));
2727 Scripting::wait(arg0, static_cast<float> (arg1));
2729 return sq_suspendvm(vm);
2731 } catch(std::exception& e) {
2732 sq_throwerror(vm, e.what());
2735 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
2741 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
2743 HSQUIRRELVM arg0 = vm;
2746 Scripting::wait_for_screenswitch(arg0);
2748 return sq_suspendvm(vm);
2750 } catch(std::exception& e) {
2751 sq_throwerror(vm, e.what());
2754 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
2760 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
2765 Scripting::exit_screen();
2769 } catch(std::exception& e) {
2770 sq_throwerror(vm, e.what());
2773 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
2779 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
2782 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2783 sq_throwerror(vm, _SC("Argument 1 not a float"));
2788 Scripting::fadeout_screen(static_cast<float> (arg0));
2792 } catch(std::exception& e) {
2793 sq_throwerror(vm, e.what());
2796 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
2802 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
2805 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2806 sq_throwerror(vm, _SC("Argument 1 not a float"));
2810 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2811 sq_throwerror(vm, _SC("Argument 2 not a float"));
2815 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2816 sq_throwerror(vm, _SC("Argument 3 not a float"));
2821 Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2825 } catch(std::exception& e) {
2826 sq_throwerror(vm, e.what());
2829 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
2835 static SQInteger translate_wrapper(HSQUIRRELVM vm)
2838 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2839 sq_throwerror(vm, _SC("Argument 1 not a string"));
2844 std::string return_value = Scripting::translate(arg0);
2846 sq_pushstring(vm, return_value.c_str(), return_value.size());
2849 } catch(std::exception& e) {
2850 sq_throwerror(vm, e.what());
2853 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
2859 static SQInteger import_wrapper(HSQUIRRELVM vm)
2861 HSQUIRRELVM arg0 = vm;
2863 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
2864 sq_throwerror(vm, _SC("Argument 1 not a string"));
2869 Scripting::import(arg0, arg1);
2873 } catch(std::exception& e) {
2874 sq_throwerror(vm, e.what());
2877 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
2883 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
2888 Scripting::save_state();
2892 } catch(std::exception& e) {
2893 sq_throwerror(vm, e.what());
2896 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
2902 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
2905 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2906 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2911 Scripting::debug_collrects(arg0 == SQTrue);
2915 } catch(std::exception& e) {
2916 sq_throwerror(vm, e.what());
2919 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
2925 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
2928 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2929 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2934 Scripting::debug_show_fps(arg0 == SQTrue);
2938 } catch(std::exception& e) {
2939 sq_throwerror(vm, e.what());
2942 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
2948 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
2951 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2952 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2957 Scripting::debug_draw_solids_only(arg0 == SQTrue);
2961 } catch(std::exception& e) {
2962 sq_throwerror(vm, e.what());
2965 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
2971 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
2974 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2975 sq_throwerror(vm, _SC("Argument 1 not a string"));
2980 Scripting::play_music(arg0);
2984 } catch(std::exception& e) {
2985 sq_throwerror(vm, e.what());
2988 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
2994 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
2997 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2998 sq_throwerror(vm, _SC("Argument 1 not a string"));
3003 Scripting::play_sound(arg0);
3007 } catch(std::exception& e) {
3008 sq_throwerror(vm, e.what());
3011 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
3017 static SQInteger grease_wrapper(HSQUIRRELVM vm)
3022 Scripting::grease();
3026 } catch(std::exception& e) {
3027 sq_throwerror(vm, e.what());
3030 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
3036 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
3041 Scripting::invincible();
3045 } catch(std::exception& e) {
3046 sq_throwerror(vm, e.what());
3049 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
3055 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
3064 } catch(std::exception& e) {
3065 sq_throwerror(vm, e.what());
3068 sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
3074 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
3079 Scripting::mortal();
3083 } catch(std::exception& e) {
3084 sq_throwerror(vm, e.what());
3087 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
3093 static SQInteger restart_wrapper(HSQUIRRELVM vm)
3098 Scripting::restart();
3102 } catch(std::exception& e) {
3103 sq_throwerror(vm, e.what());
3106 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
3112 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
3117 Scripting::whereami();
3121 } catch(std::exception& e) {
3122 sq_throwerror(vm, e.what());
3125 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
3131 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
3136 Scripting::gotoend();
3140 } catch(std::exception& e) {
3141 sq_throwerror(vm, e.what());
3144 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
3150 static SQInteger camera_wrapper(HSQUIRRELVM vm)
3155 Scripting::camera();
3159 } catch(std::exception& e) {
3160 sq_throwerror(vm, e.what());
3163 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
3169 static SQInteger quit_wrapper(HSQUIRRELVM vm)
3178 } catch(std::exception& e) {
3179 sq_throwerror(vm, e.what());
3182 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
3188 static SQInteger rand_wrapper(HSQUIRRELVM vm)
3192 int return_value = Scripting::rand();
3194 sq_pushinteger(vm, return_value);
3197 } catch(std::exception& e) {
3198 sq_throwerror(vm, e.what());
3201 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
3207 } // end of namespace Wrapper
3209 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
3211 using namespace Wrapper;
3213 sq_pushroottable(v);
3214 sq_pushstring(v, "DisplayEffect", -1);
3215 if(SQ_FAILED(sq_get(v, -2))) {
3216 std::ostringstream msg;
3217 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
3218 throw SquirrelError(v, msg.str());
3221 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3222 std::ostringstream msg;
3223 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
3224 throw SquirrelError(v, msg.str());
3226 sq_remove(v, -2); // remove object name
3228 if(setup_releasehook) {
3229 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
3232 sq_remove(v, -2); // remove root table
3235 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
3237 using namespace Wrapper;
3239 sq_pushroottable(v);
3240 sq_pushstring(v, "Camera", -1);
3241 if(SQ_FAILED(sq_get(v, -2))) {
3242 std::ostringstream msg;
3243 msg << "Couldn't resolved squirrel type 'Camera'";
3244 throw SquirrelError(v, msg.str());
3247 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3248 std::ostringstream msg;
3249 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
3250 throw SquirrelError(v, msg.str());
3252 sq_remove(v, -2); // remove object name
3254 if(setup_releasehook) {
3255 sq_setreleasehook(v, -1, Camera_release_hook);
3258 sq_remove(v, -2); // remove root table
3261 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
3263 using namespace Wrapper;
3265 sq_pushroottable(v);
3266 sq_pushstring(v, "Level", -1);
3267 if(SQ_FAILED(sq_get(v, -2))) {
3268 std::ostringstream msg;
3269 msg << "Couldn't resolved squirrel type 'Level'";
3270 throw SquirrelError(v, msg.str());
3273 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3274 std::ostringstream msg;
3275 msg << "Couldn't setup squirrel instance for object of type 'Level'";
3276 throw SquirrelError(v, msg.str());
3278 sq_remove(v, -2); // remove object name
3280 if(setup_releasehook) {
3281 sq_setreleasehook(v, -1, Level_release_hook);
3284 sq_remove(v, -2); // remove root table
3287 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
3289 using namespace Wrapper;
3291 sq_pushroottable(v);
3292 sq_pushstring(v, "ScriptedObject", -1);
3293 if(SQ_FAILED(sq_get(v, -2))) {
3294 std::ostringstream msg;
3295 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
3296 throw SquirrelError(v, msg.str());
3299 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3300 std::ostringstream msg;
3301 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
3302 throw SquirrelError(v, msg.str());
3304 sq_remove(v, -2); // remove object name
3306 if(setup_releasehook) {
3307 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
3310 sq_remove(v, -2); // remove root table
3313 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
3315 using namespace Wrapper;
3317 sq_pushroottable(v);
3318 sq_pushstring(v, "Text", -1);
3319 if(SQ_FAILED(sq_get(v, -2))) {
3320 std::ostringstream msg;
3321 msg << "Couldn't resolved squirrel type 'Text'";
3322 throw SquirrelError(v, msg.str());
3325 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3326 std::ostringstream msg;
3327 msg << "Couldn't setup squirrel instance for object of type 'Text'";
3328 throw SquirrelError(v, msg.str());
3330 sq_remove(v, -2); // remove object name
3332 if(setup_releasehook) {
3333 sq_setreleasehook(v, -1, Text_release_hook);
3336 sq_remove(v, -2); // remove root table
3339 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
3341 using namespace Wrapper;
3343 sq_pushroottable(v);
3344 sq_pushstring(v, "Player", -1);
3345 if(SQ_FAILED(sq_get(v, -2))) {
3346 std::ostringstream msg;
3347 msg << "Couldn't resolved squirrel type 'Player'";
3348 throw SquirrelError(v, msg.str());
3351 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3352 std::ostringstream msg;
3353 msg << "Couldn't setup squirrel instance for object of type 'Player'";
3354 throw SquirrelError(v, msg.str());
3356 sq_remove(v, -2); // remove object name
3358 if(setup_releasehook) {
3359 sq_setreleasehook(v, -1, Player_release_hook);
3362 sq_remove(v, -2); // remove root table
3365 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
3367 using namespace Wrapper;
3369 sq_pushroottable(v);
3370 sq_pushstring(v, "FloatingImage", -1);
3371 if(SQ_FAILED(sq_get(v, -2))) {
3372 std::ostringstream msg;
3373 msg << "Couldn't resolved squirrel type 'FloatingImage'";
3374 throw SquirrelError(v, msg.str());
3377 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3378 std::ostringstream msg;
3379 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
3380 throw SquirrelError(v, msg.str());
3382 sq_remove(v, -2); // remove object name
3384 if(setup_releasehook) {
3385 sq_setreleasehook(v, -1, FloatingImage_release_hook);
3388 sq_remove(v, -2); // remove root table
3391 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
3393 using namespace Wrapper;
3395 sq_pushroottable(v);
3396 sq_pushstring(v, "Platform", -1);
3397 if(SQ_FAILED(sq_get(v, -2))) {
3398 std::ostringstream msg;
3399 msg << "Couldn't resolved squirrel type 'Platform'";
3400 throw SquirrelError(v, msg.str());
3403 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3404 std::ostringstream msg;
3405 msg << "Couldn't setup squirrel instance for object of type 'Platform'";
3406 throw SquirrelError(v, msg.str());
3408 sq_remove(v, -2); // remove object name
3410 if(setup_releasehook) {
3411 sq_setreleasehook(v, -1, Platform_release_hook);
3414 sq_remove(v, -2); // remove root table
3417 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
3419 using namespace Wrapper;
3421 sq_pushroottable(v);
3422 sq_pushstring(v, "Candle", -1);
3423 if(SQ_FAILED(sq_get(v, -2))) {
3424 std::ostringstream msg;
3425 msg << "Couldn't resolved squirrel type 'Candle'";
3426 throw SquirrelError(v, msg.str());
3429 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3430 std::ostringstream msg;
3431 msg << "Couldn't setup squirrel instance for object of type 'Candle'";
3432 throw SquirrelError(v, msg.str());
3434 sq_remove(v, -2); // remove object name
3436 if(setup_releasehook) {
3437 sq_setreleasehook(v, -1, Candle_release_hook);
3440 sq_remove(v, -2); // remove root table
3443 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
3445 using namespace Wrapper;
3447 sq_pushroottable(v);
3448 sq_pushstring(v, "Wind", -1);
3449 if(SQ_FAILED(sq_get(v, -2))) {
3450 std::ostringstream msg;
3451 msg << "Couldn't resolved squirrel type 'Wind'";
3452 throw SquirrelError(v, msg.str());
3455 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3456 std::ostringstream msg;
3457 msg << "Couldn't setup squirrel instance for object of type 'Wind'";
3458 throw SquirrelError(v, msg.str());
3460 sq_remove(v, -2); // remove object name
3462 if(setup_releasehook) {
3463 sq_setreleasehook(v, -1, Wind_release_hook);
3466 sq_remove(v, -2); // remove root table
3469 void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bool setup_releasehook)
3471 using namespace Wrapper;
3473 sq_pushroottable(v);
3474 sq_pushstring(v, "AmbientSound", -1);
3475 if(SQ_FAILED(sq_get(v, -2))) {
3476 std::ostringstream msg;
3477 msg << "Couldn't resolved squirrel type 'AmbientSound'";
3478 throw SquirrelError(v, msg.str());
3481 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3482 std::ostringstream msg;
3483 msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'";
3484 throw SquirrelError(v, msg.str());
3486 sq_remove(v, -2); // remove object name
3488 if(setup_releasehook) {
3489 sq_setreleasehook(v, -1, AmbientSound_release_hook);
3492 sq_remove(v, -2); // remove root table
3495 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Thunderstorm* object, bool setup_releasehook)
3497 using namespace Wrapper;
3499 sq_pushroottable(v);
3500 sq_pushstring(v, "Thunderstorm", -1);
3501 if(SQ_FAILED(sq_get(v, -2))) {
3502 std::ostringstream msg;
3503 msg << "Couldn't resolved squirrel type 'Thunderstorm'";
3504 throw SquirrelError(v, msg.str());
3507 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3508 std::ostringstream msg;
3509 msg << "Couldn't setup squirrel instance for object of type 'Thunderstorm'";
3510 throw SquirrelError(v, msg.str());
3512 sq_remove(v, -2); // remove object name
3514 if(setup_releasehook) {
3515 sq_setreleasehook(v, -1, Thunderstorm_release_hook);
3518 sq_remove(v, -2); // remove root table
3521 void create_squirrel_instance(HSQUIRRELVM v, Scripting::TileMap* object, bool setup_releasehook)
3523 using namespace Wrapper;
3525 sq_pushroottable(v);
3526 sq_pushstring(v, "TileMap", -1);
3527 if(SQ_FAILED(sq_get(v, -2))) {
3528 std::ostringstream msg;
3529 msg << "Couldn't resolved squirrel type 'TileMap'";
3530 throw SquirrelError(v, msg.str());
3533 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3534 std::ostringstream msg;
3535 msg << "Couldn't setup squirrel instance for object of type 'TileMap'";
3536 throw SquirrelError(v, msg.str());
3538 sq_remove(v, -2); // remove object name
3540 if(setup_releasehook) {
3541 sq_setreleasehook(v, -1, TileMap_release_hook);
3544 sq_remove(v, -2); // remove root table
3547 void create_squirrel_instance(HSQUIRRELVM v, Scripting::SSector* object, bool setup_releasehook)
3549 using namespace Wrapper;
3551 sq_pushroottable(v);
3552 sq_pushstring(v, "SSector", -1);
3553 if(SQ_FAILED(sq_get(v, -2))) {
3554 std::ostringstream msg;
3555 msg << "Couldn't resolved squirrel type 'SSector'";
3556 throw SquirrelError(v, msg.str());
3559 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3560 std::ostringstream msg;
3561 msg << "Couldn't setup squirrel instance for object of type 'SSector'";
3562 throw SquirrelError(v, msg.str());
3564 sq_remove(v, -2); // remove object name
3566 if(setup_releasehook) {
3567 sq_setreleasehook(v, -1, SSector_release_hook);
3570 sq_remove(v, -2); // remove root table
3573 void create_squirrel_instance(HSQUIRRELVM v, Scripting::LevelTime* object, bool setup_releasehook)
3575 using namespace Wrapper;
3577 sq_pushroottable(v);
3578 sq_pushstring(v, "LevelTime", -1);
3579 if(SQ_FAILED(sq_get(v, -2))) {
3580 std::ostringstream msg;
3581 msg << "Couldn't resolved squirrel type 'LevelTime'";
3582 throw SquirrelError(v, msg.str());
3585 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3586 std::ostringstream msg;
3587 msg << "Couldn't setup squirrel instance for object of type 'LevelTime'";
3588 throw SquirrelError(v, msg.str());
3590 sq_remove(v, -2); // remove object name
3592 if(setup_releasehook) {
3593 sq_setreleasehook(v, -1, LevelTime_release_hook);
3596 sq_remove(v, -2); // remove root table
3599 void register_supertux_wrapper(HSQUIRRELVM v)
3601 using namespace Wrapper;
3603 sq_pushstring(v, "ANCHOR_TOP", -1);
3604 sq_pushinteger(v, 16);
3605 if(SQ_FAILED(sq_createslot(v, -3))) {
3606 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
3609 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
3610 sq_pushinteger(v, 32);
3611 if(SQ_FAILED(sq_createslot(v, -3))) {
3612 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
3615 sq_pushstring(v, "ANCHOR_LEFT", -1);
3616 sq_pushinteger(v, 1);
3617 if(SQ_FAILED(sq_createslot(v, -3))) {
3618 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
3621 sq_pushstring(v, "ANCHOR_RIGHT", -1);
3622 sq_pushinteger(v, 2);
3623 if(SQ_FAILED(sq_createslot(v, -3))) {
3624 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
3627 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
3628 sq_pushinteger(v, 0);
3629 if(SQ_FAILED(sq_createslot(v, -3))) {
3630 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
3633 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
3634 sq_pushinteger(v, 17);
3635 if(SQ_FAILED(sq_createslot(v, -3))) {
3636 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
3639 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
3640 sq_pushinteger(v, 18);
3641 if(SQ_FAILED(sq_createslot(v, -3))) {
3642 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
3645 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
3646 sq_pushinteger(v, 33);
3647 if(SQ_FAILED(sq_createslot(v, -3))) {
3648 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
3651 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
3652 sq_pushinteger(v, 34);
3653 if(SQ_FAILED(sq_createslot(v, -3))) {
3654 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
3657 sq_pushstring(v, "display", -1);
3658 sq_newclosure(v, &display_wrapper, 0);
3659 if(SQ_FAILED(sq_createslot(v, -3))) {
3660 throw SquirrelError(v, "Couldn't register function 'display'");
3663 sq_pushstring(v, "print_stacktrace", -1);
3664 sq_newclosure(v, &print_stacktrace_wrapper, 0);
3665 if(SQ_FAILED(sq_createslot(v, -3))) {
3666 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
3669 sq_pushstring(v, "get_current_thread", -1);
3670 sq_newclosure(v, &get_current_thread_wrapper, 0);
3671 if(SQ_FAILED(sq_createslot(v, -3))) {
3672 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
3675 sq_pushstring(v, "display_text_file", -1);
3676 sq_newclosure(v, &display_text_file_wrapper, 0);
3677 if(SQ_FAILED(sq_createslot(v, -3))) {
3678 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
3681 sq_pushstring(v, "load_worldmap", -1);
3682 sq_newclosure(v, &load_worldmap_wrapper, 0);
3683 if(SQ_FAILED(sq_createslot(v, -3))) {
3684 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
3687 sq_pushstring(v, "load_level", -1);
3688 sq_newclosure(v, &load_level_wrapper, 0);
3689 if(SQ_FAILED(sq_createslot(v, -3))) {
3690 throw SquirrelError(v, "Couldn't register function 'load_level'");
3693 sq_pushstring(v, "wait", -1);
3694 sq_newclosure(v, &wait_wrapper, 0);
3695 if(SQ_FAILED(sq_createslot(v, -3))) {
3696 throw SquirrelError(v, "Couldn't register function 'wait'");
3699 sq_pushstring(v, "wait_for_screenswitch", -1);
3700 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
3701 if(SQ_FAILED(sq_createslot(v, -3))) {
3702 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
3705 sq_pushstring(v, "exit_screen", -1);
3706 sq_newclosure(v, &exit_screen_wrapper, 0);
3707 if(SQ_FAILED(sq_createslot(v, -3))) {
3708 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
3711 sq_pushstring(v, "fadeout_screen", -1);
3712 sq_newclosure(v, &fadeout_screen_wrapper, 0);
3713 if(SQ_FAILED(sq_createslot(v, -3))) {
3714 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
3717 sq_pushstring(v, "shrink_screen", -1);
3718 sq_newclosure(v, &shrink_screen_wrapper, 0);
3719 if(SQ_FAILED(sq_createslot(v, -3))) {
3720 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
3723 sq_pushstring(v, "translate", -1);
3724 sq_newclosure(v, &translate_wrapper, 0);
3725 if(SQ_FAILED(sq_createslot(v, -3))) {
3726 throw SquirrelError(v, "Couldn't register function 'translate'");
3729 sq_pushstring(v, "import", -1);
3730 sq_newclosure(v, &import_wrapper, 0);
3731 if(SQ_FAILED(sq_createslot(v, -3))) {
3732 throw SquirrelError(v, "Couldn't register function 'import'");
3735 sq_pushstring(v, "save_state", -1);
3736 sq_newclosure(v, &save_state_wrapper, 0);
3737 if(SQ_FAILED(sq_createslot(v, -3))) {
3738 throw SquirrelError(v, "Couldn't register function 'save_state'");
3741 sq_pushstring(v, "debug_collrects", -1);
3742 sq_newclosure(v, &debug_collrects_wrapper, 0);
3743 if(SQ_FAILED(sq_createslot(v, -3))) {
3744 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
3747 sq_pushstring(v, "debug_show_fps", -1);
3748 sq_newclosure(v, &debug_show_fps_wrapper, 0);
3749 if(SQ_FAILED(sq_createslot(v, -3))) {
3750 throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
3753 sq_pushstring(v, "debug_draw_solids_only", -1);
3754 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
3755 if(SQ_FAILED(sq_createslot(v, -3))) {
3756 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
3759 sq_pushstring(v, "play_music", -1);
3760 sq_newclosure(v, &play_music_wrapper, 0);
3761 if(SQ_FAILED(sq_createslot(v, -3))) {
3762 throw SquirrelError(v, "Couldn't register function 'play_music'");
3765 sq_pushstring(v, "play_sound", -1);
3766 sq_newclosure(v, &play_sound_wrapper, 0);
3767 if(SQ_FAILED(sq_createslot(v, -3))) {
3768 throw SquirrelError(v, "Couldn't register function 'play_sound'");
3771 sq_pushstring(v, "grease", -1);
3772 sq_newclosure(v, &grease_wrapper, 0);
3773 if(SQ_FAILED(sq_createslot(v, -3))) {
3774 throw SquirrelError(v, "Couldn't register function 'grease'");
3777 sq_pushstring(v, "invincible", -1);
3778 sq_newclosure(v, &invincible_wrapper, 0);
3779 if(SQ_FAILED(sq_createslot(v, -3))) {
3780 throw SquirrelError(v, "Couldn't register function 'invincible'");
3783 sq_pushstring(v, "ghost", -1);
3784 sq_newclosure(v, &ghost_wrapper, 0);
3785 if(SQ_FAILED(sq_createslot(v, -3))) {
3786 throw SquirrelError(v, "Couldn't register function 'ghost'");
3789 sq_pushstring(v, "mortal", -1);
3790 sq_newclosure(v, &mortal_wrapper, 0);
3791 if(SQ_FAILED(sq_createslot(v, -3))) {
3792 throw SquirrelError(v, "Couldn't register function 'mortal'");
3795 sq_pushstring(v, "restart", -1);
3796 sq_newclosure(v, &restart_wrapper, 0);
3797 if(SQ_FAILED(sq_createslot(v, -3))) {
3798 throw SquirrelError(v, "Couldn't register function 'restart'");
3801 sq_pushstring(v, "whereami", -1);
3802 sq_newclosure(v, &whereami_wrapper, 0);
3803 if(SQ_FAILED(sq_createslot(v, -3))) {
3804 throw SquirrelError(v, "Couldn't register function 'whereami'");
3807 sq_pushstring(v, "gotoend", -1);
3808 sq_newclosure(v, &gotoend_wrapper, 0);
3809 if(SQ_FAILED(sq_createslot(v, -3))) {
3810 throw SquirrelError(v, "Couldn't register function 'gotoend'");
3813 sq_pushstring(v, "camera", -1);
3814 sq_newclosure(v, &camera_wrapper, 0);
3815 if(SQ_FAILED(sq_createslot(v, -3))) {
3816 throw SquirrelError(v, "Couldn't register function 'camera'");
3819 sq_pushstring(v, "quit", -1);
3820 sq_newclosure(v, &quit_wrapper, 0);
3821 if(SQ_FAILED(sq_createslot(v, -3))) {
3822 throw SquirrelError(v, "Couldn't register function 'quit'");
3825 sq_pushstring(v, "rand", -1);
3826 sq_newclosure(v, &rand_wrapper, 0);
3827 if(SQ_FAILED(sq_createslot(v, -3))) {
3828 throw SquirrelError(v, "Couldn't register function 'rand'");
3831 // Register class DisplayEffect
3832 sq_pushstring(v, "DisplayEffect", -1);
3833 if(sq_newclass(v, SQFalse) < 0) {
3834 std::ostringstream msg;
3835 msg << "Couldn't create new class 'DisplayEffect'";
3836 throw SquirrelError(v, msg.str());
3838 sq_pushstring(v, "fade_out", -1);
3839 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
3840 if(SQ_FAILED(sq_createslot(v, -3))) {
3841 throw SquirrelError(v, "Couldn't register function 'fade_out'");
3844 sq_pushstring(v, "fade_in", -1);
3845 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
3846 if(SQ_FAILED(sq_createslot(v, -3))) {
3847 throw SquirrelError(v, "Couldn't register function 'fade_in'");
3850 sq_pushstring(v, "set_black", -1);
3851 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
3852 if(SQ_FAILED(sq_createslot(v, -3))) {
3853 throw SquirrelError(v, "Couldn't register function 'set_black'");
3856 sq_pushstring(v, "is_black", -1);
3857 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
3858 if(SQ_FAILED(sq_createslot(v, -3))) {
3859 throw SquirrelError(v, "Couldn't register function 'is_black'");
3862 sq_pushstring(v, "sixteen_to_nine", -1);
3863 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
3864 if(SQ_FAILED(sq_createslot(v, -3))) {
3865 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
3868 sq_pushstring(v, "four_to_three", -1);
3869 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
3870 if(SQ_FAILED(sq_createslot(v, -3))) {
3871 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
3874 if(SQ_FAILED(sq_createslot(v, -3))) {
3875 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
3878 // Register class Camera
3879 sq_pushstring(v, "Camera", -1);
3880 if(sq_newclass(v, SQFalse) < 0) {
3881 std::ostringstream msg;
3882 msg << "Couldn't create new class 'Camera'";
3883 throw SquirrelError(v, msg.str());
3885 sq_pushstring(v, "shake", -1);
3886 sq_newclosure(v, &Camera_shake_wrapper, 0);
3887 if(SQ_FAILED(sq_createslot(v, -3))) {
3888 throw SquirrelError(v, "Couldn't register function 'shake'");
3891 sq_pushstring(v, "set_pos", -1);
3892 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
3893 if(SQ_FAILED(sq_createslot(v, -3))) {
3894 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3897 sq_pushstring(v, "set_mode", -1);
3898 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
3899 if(SQ_FAILED(sq_createslot(v, -3))) {
3900 throw SquirrelError(v, "Couldn't register function 'set_mode'");
3903 sq_pushstring(v, "scroll_to", -1);
3904 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
3905 if(SQ_FAILED(sq_createslot(v, -3))) {
3906 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
3909 if(SQ_FAILED(sq_createslot(v, -3))) {
3910 throw SquirrelError(v, "Couldn't register class 'Camera'");
3913 // Register class Level
3914 sq_pushstring(v, "Level", -1);
3915 if(sq_newclass(v, SQFalse) < 0) {
3916 std::ostringstream msg;
3917 msg << "Couldn't create new class 'Level'";
3918 throw SquirrelError(v, msg.str());
3920 sq_pushstring(v, "finish", -1);
3921 sq_newclosure(v, &Level_finish_wrapper, 0);
3922 if(SQ_FAILED(sq_createslot(v, -3))) {
3923 throw SquirrelError(v, "Couldn't register function 'finish'");
3926 sq_pushstring(v, "spawn", -1);
3927 sq_newclosure(v, &Level_spawn_wrapper, 0);
3928 if(SQ_FAILED(sq_createslot(v, -3))) {
3929 throw SquirrelError(v, "Couldn't register function 'spawn'");
3932 sq_pushstring(v, "flip_vertically", -1);
3933 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
3934 if(SQ_FAILED(sq_createslot(v, -3))) {
3935 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
3938 sq_pushstring(v, "toggle_pause", -1);
3939 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
3940 if(SQ_FAILED(sq_createslot(v, -3))) {
3941 throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
3944 if(SQ_FAILED(sq_createslot(v, -3))) {
3945 throw SquirrelError(v, "Couldn't register class 'Level'");
3948 // Register class ScriptedObject
3949 sq_pushstring(v, "ScriptedObject", -1);
3950 if(sq_newclass(v, SQFalse) < 0) {
3951 std::ostringstream msg;
3952 msg << "Couldn't create new class 'ScriptedObject'";
3953 throw SquirrelError(v, msg.str());
3955 sq_pushstring(v, "set_action", -1);
3956 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
3957 if(SQ_FAILED(sq_createslot(v, -3))) {
3958 throw SquirrelError(v, "Couldn't register function 'set_action'");
3961 sq_pushstring(v, "get_action", -1);
3962 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
3963 if(SQ_FAILED(sq_createslot(v, -3))) {
3964 throw SquirrelError(v, "Couldn't register function 'get_action'");
3967 sq_pushstring(v, "move", -1);
3968 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
3969 if(SQ_FAILED(sq_createslot(v, -3))) {
3970 throw SquirrelError(v, "Couldn't register function 'move'");
3973 sq_pushstring(v, "set_pos", -1);
3974 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
3975 if(SQ_FAILED(sq_createslot(v, -3))) {
3976 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3979 sq_pushstring(v, "get_pos_x", -1);
3980 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
3981 if(SQ_FAILED(sq_createslot(v, -3))) {
3982 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3985 sq_pushstring(v, "get_pos_y", -1);
3986 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
3987 if(SQ_FAILED(sq_createslot(v, -3))) {
3988 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3991 sq_pushstring(v, "set_velocity", -1);
3992 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
3993 if(SQ_FAILED(sq_createslot(v, -3))) {
3994 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
3997 sq_pushstring(v, "get_velocity_x", -1);
3998 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
3999 if(SQ_FAILED(sq_createslot(v, -3))) {
4000 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
4003 sq_pushstring(v, "get_velocity_y", -1);
4004 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
4005 if(SQ_FAILED(sq_createslot(v, -3))) {
4006 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
4009 sq_pushstring(v, "set_visible", -1);
4010 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
4011 if(SQ_FAILED(sq_createslot(v, -3))) {
4012 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4015 sq_pushstring(v, "is_visible", -1);
4016 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
4017 if(SQ_FAILED(sq_createslot(v, -3))) {
4018 throw SquirrelError(v, "Couldn't register function 'is_visible'");
4021 sq_pushstring(v, "set_solid", -1);
4022 sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
4023 if(SQ_FAILED(sq_createslot(v, -3))) {
4024 throw SquirrelError(v, "Couldn't register function 'set_solid'");
4027 sq_pushstring(v, "is_solid", -1);
4028 sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
4029 if(SQ_FAILED(sq_createslot(v, -3))) {
4030 throw SquirrelError(v, "Couldn't register function 'is_solid'");
4033 sq_pushstring(v, "get_name", -1);
4034 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
4035 if(SQ_FAILED(sq_createslot(v, -3))) {
4036 throw SquirrelError(v, "Couldn't register function 'get_name'");
4039 if(SQ_FAILED(sq_createslot(v, -3))) {
4040 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
4043 // Register class Text
4044 sq_pushstring(v, "Text", -1);
4045 if(sq_newclass(v, SQFalse) < 0) {
4046 std::ostringstream msg;
4047 msg << "Couldn't create new class 'Text'";
4048 throw SquirrelError(v, msg.str());
4050 sq_pushstring(v, "set_text", -1);
4051 sq_newclosure(v, &Text_set_text_wrapper, 0);
4052 if(SQ_FAILED(sq_createslot(v, -3))) {
4053 throw SquirrelError(v, "Couldn't register function 'set_text'");
4056 sq_pushstring(v, "set_font", -1);
4057 sq_newclosure(v, &Text_set_font_wrapper, 0);
4058 if(SQ_FAILED(sq_createslot(v, -3))) {
4059 throw SquirrelError(v, "Couldn't register function 'set_font'");
4062 sq_pushstring(v, "fade_in", -1);
4063 sq_newclosure(v, &Text_fade_in_wrapper, 0);
4064 if(SQ_FAILED(sq_createslot(v, -3))) {
4065 throw SquirrelError(v, "Couldn't register function 'fade_in'");
4068 sq_pushstring(v, "fade_out", -1);
4069 sq_newclosure(v, &Text_fade_out_wrapper, 0);
4070 if(SQ_FAILED(sq_createslot(v, -3))) {
4071 throw SquirrelError(v, "Couldn't register function 'fade_out'");
4074 sq_pushstring(v, "set_visible", -1);
4075 sq_newclosure(v, &Text_set_visible_wrapper, 0);
4076 if(SQ_FAILED(sq_createslot(v, -3))) {
4077 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4080 sq_pushstring(v, "set_centered", -1);
4081 sq_newclosure(v, &Text_set_centered_wrapper, 0);
4082 if(SQ_FAILED(sq_createslot(v, -3))) {
4083 throw SquirrelError(v, "Couldn't register function 'set_centered'");
4086 if(SQ_FAILED(sq_createslot(v, -3))) {
4087 throw SquirrelError(v, "Couldn't register class 'Text'");
4090 // Register class Player
4091 sq_pushstring(v, "Player", -1);
4092 if(sq_newclass(v, SQFalse) < 0) {
4093 std::ostringstream msg;
4094 msg << "Couldn't create new class 'Player'";
4095 throw SquirrelError(v, msg.str());
4097 sq_pushstring(v, "add_bonus", -1);
4098 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
4099 if(SQ_FAILED(sq_createslot(v, -3))) {
4100 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
4103 sq_pushstring(v, "add_coins", -1);
4104 sq_newclosure(v, &Player_add_coins_wrapper, 0);
4105 if(SQ_FAILED(sq_createslot(v, -3))) {
4106 throw SquirrelError(v, "Couldn't register function 'add_coins'");
4109 sq_pushstring(v, "make_invincible", -1);
4110 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
4111 if(SQ_FAILED(sq_createslot(v, -3))) {
4112 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
4115 sq_pushstring(v, "deactivate", -1);
4116 sq_newclosure(v, &Player_deactivate_wrapper, 0);
4117 if(SQ_FAILED(sq_createslot(v, -3))) {
4118 throw SquirrelError(v, "Couldn't register function 'deactivate'");
4121 sq_pushstring(v, "activate", -1);
4122 sq_newclosure(v, &Player_activate_wrapper, 0);
4123 if(SQ_FAILED(sq_createslot(v, -3))) {
4124 throw SquirrelError(v, "Couldn't register function 'activate'");
4127 sq_pushstring(v, "walk", -1);
4128 sq_newclosure(v, &Player_walk_wrapper, 0);
4129 if(SQ_FAILED(sq_createslot(v, -3))) {
4130 throw SquirrelError(v, "Couldn't register function 'walk'");
4133 sq_pushstring(v, "set_visible", -1);
4134 sq_newclosure(v, &Player_set_visible_wrapper, 0);
4135 if(SQ_FAILED(sq_createslot(v, -3))) {
4136 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4139 sq_pushstring(v, "get_visible", -1);
4140 sq_newclosure(v, &Player_get_visible_wrapper, 0);
4141 if(SQ_FAILED(sq_createslot(v, -3))) {
4142 throw SquirrelError(v, "Couldn't register function 'get_visible'");
4145 sq_pushstring(v, "kill", -1);
4146 sq_newclosure(v, &Player_kill_wrapper, 0);
4147 if(SQ_FAILED(sq_createslot(v, -3))) {
4148 throw SquirrelError(v, "Couldn't register function 'kill'");
4151 sq_pushstring(v, "set_ghost_mode", -1);
4152 sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
4153 if(SQ_FAILED(sq_createslot(v, -3))) {
4154 throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
4157 sq_pushstring(v, "get_ghost_mode", -1);
4158 sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
4159 if(SQ_FAILED(sq_createslot(v, -3))) {
4160 throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
4163 sq_pushstring(v, "do_cheer", -1);
4164 sq_newclosure(v, &Player_do_cheer_wrapper, 0);
4165 if(SQ_FAILED(sq_createslot(v, -3))) {
4166 throw SquirrelError(v, "Couldn't register function 'do_cheer'");
4169 sq_pushstring(v, "do_duck", -1);
4170 sq_newclosure(v, &Player_do_duck_wrapper, 0);
4171 if(SQ_FAILED(sq_createslot(v, -3))) {
4172 throw SquirrelError(v, "Couldn't register function 'do_duck'");
4175 sq_pushstring(v, "do_standup", -1);
4176 sq_newclosure(v, &Player_do_standup_wrapper, 0);
4177 if(SQ_FAILED(sq_createslot(v, -3))) {
4178 throw SquirrelError(v, "Couldn't register function 'do_standup'");
4181 sq_pushstring(v, "do_backflip", -1);
4182 sq_newclosure(v, &Player_do_backflip_wrapper, 0);
4183 if(SQ_FAILED(sq_createslot(v, -3))) {
4184 throw SquirrelError(v, "Couldn't register function 'do_backflip'");
4187 sq_pushstring(v, "do_jump", -1);
4188 sq_newclosure(v, &Player_do_jump_wrapper, 0);
4189 if(SQ_FAILED(sq_createslot(v, -3))) {
4190 throw SquirrelError(v, "Couldn't register function 'do_jump'");
4193 if(SQ_FAILED(sq_createslot(v, -3))) {
4194 throw SquirrelError(v, "Couldn't register class 'Player'");
4197 // Register class FloatingImage
4198 sq_pushstring(v, "FloatingImage", -1);
4199 if(sq_newclass(v, SQFalse) < 0) {
4200 std::ostringstream msg;
4201 msg << "Couldn't create new class 'FloatingImage'";
4202 throw SquirrelError(v, msg.str());
4204 sq_pushstring(v, "constructor", -1);
4205 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
4206 if(SQ_FAILED(sq_createslot(v, -3))) {
4207 throw SquirrelError(v, "Couldn't register function 'constructor'");
4210 sq_pushstring(v, "set_layer", -1);
4211 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
4212 if(SQ_FAILED(sq_createslot(v, -3))) {
4213 throw SquirrelError(v, "Couldn't register function 'set_layer'");
4216 sq_pushstring(v, "get_layer", -1);
4217 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
4218 if(SQ_FAILED(sq_createslot(v, -3))) {
4219 throw SquirrelError(v, "Couldn't register function 'get_layer'");
4222 sq_pushstring(v, "set_pos", -1);
4223 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
4224 if(SQ_FAILED(sq_createslot(v, -3))) {
4225 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4228 sq_pushstring(v, "get_pos_x", -1);
4229 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
4230 if(SQ_FAILED(sq_createslot(v, -3))) {
4231 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4234 sq_pushstring(v, "get_pos_y", -1);
4235 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
4236 if(SQ_FAILED(sq_createslot(v, -3))) {
4237 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4240 sq_pushstring(v, "set_anchor_point", -1);
4241 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
4242 if(SQ_FAILED(sq_createslot(v, -3))) {
4243 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4246 sq_pushstring(v, "get_anchor_point", -1);
4247 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
4248 if(SQ_FAILED(sq_createslot(v, -3))) {
4249 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4252 sq_pushstring(v, "set_visible", -1);
4253 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
4254 if(SQ_FAILED(sq_createslot(v, -3))) {
4255 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4258 sq_pushstring(v, "get_visible", -1);
4259 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
4260 if(SQ_FAILED(sq_createslot(v, -3))) {
4261 throw SquirrelError(v, "Couldn't register function 'get_visible'");
4264 sq_pushstring(v, "set_action", -1);
4265 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
4266 if(SQ_FAILED(sq_createslot(v, -3))) {
4267 throw SquirrelError(v, "Couldn't register function 'set_action'");
4270 sq_pushstring(v, "get_action", -1);
4271 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
4272 if(SQ_FAILED(sq_createslot(v, -3))) {
4273 throw SquirrelError(v, "Couldn't register function 'get_action'");
4276 sq_pushstring(v, "fade_in", -1);
4277 sq_newclosure(v, &FloatingImage_fade_in_wrapper, 0);
4278 if(SQ_FAILED(sq_createslot(v, -3))) {
4279 throw SquirrelError(v, "Couldn't register function 'fade_in'");
4282 sq_pushstring(v, "fade_out", -1);
4283 sq_newclosure(v, &FloatingImage_fade_out_wrapper, 0);
4284 if(SQ_FAILED(sq_createslot(v, -3))) {
4285 throw SquirrelError(v, "Couldn't register function 'fade_out'");
4288 if(SQ_FAILED(sq_createslot(v, -3))) {
4289 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
4292 // Register class Platform
4293 sq_pushstring(v, "Platform", -1);
4294 if(sq_newclass(v, SQFalse) < 0) {
4295 std::ostringstream msg;
4296 msg << "Couldn't create new class 'Platform'";
4297 throw SquirrelError(v, msg.str());
4299 sq_pushstring(v, "goto_node", -1);
4300 sq_newclosure(v, &Platform_goto_node_wrapper, 0);
4301 if(SQ_FAILED(sq_createslot(v, -3))) {
4302 throw SquirrelError(v, "Couldn't register function 'goto_node'");
4305 sq_pushstring(v, "start_moving", -1);
4306 sq_newclosure(v, &Platform_start_moving_wrapper, 0);
4307 if(SQ_FAILED(sq_createslot(v, -3))) {
4308 throw SquirrelError(v, "Couldn't register function 'start_moving'");
4311 sq_pushstring(v, "stop_moving", -1);
4312 sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
4313 if(SQ_FAILED(sq_createslot(v, -3))) {
4314 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
4317 if(SQ_FAILED(sq_createslot(v, -3))) {
4318 throw SquirrelError(v, "Couldn't register class 'Platform'");
4321 // Register class Candle
4322 sq_pushstring(v, "Candle", -1);
4323 if(sq_newclass(v, SQFalse) < 0) {
4324 std::ostringstream msg;
4325 msg << "Couldn't create new class 'Candle'";
4326 throw SquirrelError(v, msg.str());
4328 sq_pushstring(v, "get_burning", -1);
4329 sq_newclosure(v, &Candle_get_burning_wrapper, 0);
4330 if(SQ_FAILED(sq_createslot(v, -3))) {
4331 throw SquirrelError(v, "Couldn't register function 'get_burning'");
4334 sq_pushstring(v, "set_burning", -1);
4335 sq_newclosure(v, &Candle_set_burning_wrapper, 0);
4336 if(SQ_FAILED(sq_createslot(v, -3))) {
4337 throw SquirrelError(v, "Couldn't register function 'set_burning'");
4340 if(SQ_FAILED(sq_createslot(v, -3))) {
4341 throw SquirrelError(v, "Couldn't register class 'Candle'");
4344 // Register class Wind
4345 sq_pushstring(v, "Wind", -1);
4346 if(sq_newclass(v, SQFalse) < 0) {
4347 std::ostringstream msg;
4348 msg << "Couldn't create new class 'Wind'";
4349 throw SquirrelError(v, msg.str());
4351 sq_pushstring(v, "start", -1);
4352 sq_newclosure(v, &Wind_start_wrapper, 0);
4353 if(SQ_FAILED(sq_createslot(v, -3))) {
4354 throw SquirrelError(v, "Couldn't register function 'start'");
4357 sq_pushstring(v, "stop", -1);
4358 sq_newclosure(v, &Wind_stop_wrapper, 0);
4359 if(SQ_FAILED(sq_createslot(v, -3))) {
4360 throw SquirrelError(v, "Couldn't register function 'stop'");
4363 if(SQ_FAILED(sq_createslot(v, -3))) {
4364 throw SquirrelError(v, "Couldn't register class 'Wind'");
4367 // Register class AmbientSound
4368 sq_pushstring(v, "AmbientSound", -1);
4369 if(sq_newclass(v, SQFalse) < 0) {
4370 std::ostringstream msg;
4371 msg << "Couldn't create new class 'AmbientSound'";
4372 throw SquirrelError(v, msg.str());
4374 sq_pushstring(v, "set_pos", -1);
4375 sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
4376 if(SQ_FAILED(sq_createslot(v, -3))) {
4377 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4380 sq_pushstring(v, "get_pos_x", -1);
4381 sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
4382 if(SQ_FAILED(sq_createslot(v, -3))) {
4383 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4386 sq_pushstring(v, "get_pos_y", -1);
4387 sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
4388 if(SQ_FAILED(sq_createslot(v, -3))) {
4389 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4392 if(SQ_FAILED(sq_createslot(v, -3))) {
4393 throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
4396 // Register class Thunderstorm
4397 sq_pushstring(v, "Thunderstorm", -1);
4398 if(sq_newclass(v, SQFalse) < 0) {
4399 std::ostringstream msg;
4400 msg << "Couldn't create new class 'Thunderstorm'";
4401 throw SquirrelError(v, msg.str());
4403 sq_pushstring(v, "start", -1);
4404 sq_newclosure(v, &Thunderstorm_start_wrapper, 0);
4405 if(SQ_FAILED(sq_createslot(v, -3))) {
4406 throw SquirrelError(v, "Couldn't register function 'start'");
4409 sq_pushstring(v, "stop", -1);
4410 sq_newclosure(v, &Thunderstorm_stop_wrapper, 0);
4411 if(SQ_FAILED(sq_createslot(v, -3))) {
4412 throw SquirrelError(v, "Couldn't register function 'stop'");
4415 sq_pushstring(v, "thunder", -1);
4416 sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0);
4417 if(SQ_FAILED(sq_createslot(v, -3))) {
4418 throw SquirrelError(v, "Couldn't register function 'thunder'");
4421 sq_pushstring(v, "lightning", -1);
4422 sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0);
4423 if(SQ_FAILED(sq_createslot(v, -3))) {
4424 throw SquirrelError(v, "Couldn't register function 'lightning'");
4427 sq_pushstring(v, "flash", -1);
4428 sq_newclosure(v, &Thunderstorm_flash_wrapper, 0);
4429 if(SQ_FAILED(sq_createslot(v, -3))) {
4430 throw SquirrelError(v, "Couldn't register function 'flash'");
4433 sq_pushstring(v, "electrify", -1);
4434 sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0);
4435 if(SQ_FAILED(sq_createslot(v, -3))) {
4436 throw SquirrelError(v, "Couldn't register function 'electrify'");
4439 if(SQ_FAILED(sq_createslot(v, -3))) {
4440 throw SquirrelError(v, "Couldn't register class 'Thunderstorm'");
4443 // Register class TileMap
4444 sq_pushstring(v, "TileMap", -1);
4445 if(sq_newclass(v, SQFalse) < 0) {
4446 std::ostringstream msg;
4447 msg << "Couldn't create new class 'TileMap'";
4448 throw SquirrelError(v, msg.str());
4450 sq_pushstring(v, "goto_node", -1);
4451 sq_newclosure(v, &TileMap_goto_node_wrapper, 0);
4452 if(SQ_FAILED(sq_createslot(v, -3))) {
4453 throw SquirrelError(v, "Couldn't register function 'goto_node'");
4456 sq_pushstring(v, "start_moving", -1);
4457 sq_newclosure(v, &TileMap_start_moving_wrapper, 0);
4458 if(SQ_FAILED(sq_createslot(v, -3))) {
4459 throw SquirrelError(v, "Couldn't register function 'start_moving'");
4462 sq_pushstring(v, "stop_moving", -1);
4463 sq_newclosure(v, &TileMap_stop_moving_wrapper, 0);
4464 if(SQ_FAILED(sq_createslot(v, -3))) {
4465 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
4468 if(SQ_FAILED(sq_createslot(v, -3))) {
4469 throw SquirrelError(v, "Couldn't register class 'TileMap'");
4472 // Register class SSector
4473 sq_pushstring(v, "SSector", -1);
4474 if(sq_newclass(v, SQFalse) < 0) {
4475 std::ostringstream msg;
4476 msg << "Couldn't create new class 'SSector'";
4477 throw SquirrelError(v, msg.str());
4479 sq_pushstring(v, "set_ambient_light", -1);
4480 sq_newclosure(v, &SSector_set_ambient_light_wrapper, 0);
4481 if(SQ_FAILED(sq_createslot(v, -3))) {
4482 throw SquirrelError(v, "Couldn't register function 'set_ambient_light'");
4485 sq_pushstring(v, "get_ambient_red", -1);
4486 sq_newclosure(v, &SSector_get_ambient_red_wrapper, 0);
4487 if(SQ_FAILED(sq_createslot(v, -3))) {
4488 throw SquirrelError(v, "Couldn't register function 'get_ambient_red'");
4491 sq_pushstring(v, "get_ambient_green", -1);
4492 sq_newclosure(v, &SSector_get_ambient_green_wrapper, 0);
4493 if(SQ_FAILED(sq_createslot(v, -3))) {
4494 throw SquirrelError(v, "Couldn't register function 'get_ambient_green'");
4497 sq_pushstring(v, "get_ambient_blue", -1);
4498 sq_newclosure(v, &SSector_get_ambient_blue_wrapper, 0);
4499 if(SQ_FAILED(sq_createslot(v, -3))) {
4500 throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'");
4503 if(SQ_FAILED(sq_createslot(v, -3))) {
4504 throw SquirrelError(v, "Couldn't register class 'SSector'");
4507 // Register class LevelTime
4508 sq_pushstring(v, "LevelTime", -1);
4509 if(sq_newclass(v, SQFalse) < 0) {
4510 std::ostringstream msg;
4511 msg << "Couldn't create new class 'LevelTime'";
4512 throw SquirrelError(v, msg.str());
4514 sq_pushstring(v, "start", -1);
4515 sq_newclosure(v, &LevelTime_start_wrapper, 0);
4516 if(SQ_FAILED(sq_createslot(v, -3))) {
4517 throw SquirrelError(v, "Couldn't register function 'start'");
4520 sq_pushstring(v, "stop", -1);
4521 sq_newclosure(v, &LevelTime_stop_wrapper, 0);
4522 if(SQ_FAILED(sq_createslot(v, -3))) {
4523 throw SquirrelError(v, "Couldn't register function 'stop'");
4526 sq_pushstring(v, "get_time", -1);
4527 sq_newclosure(v, &LevelTime_get_time_wrapper, 0);
4528 if(SQ_FAILED(sq_createslot(v, -3))) {
4529 throw SquirrelError(v, "Couldn't register function 'get_time'");
4532 sq_pushstring(v, "set_time", -1);
4533 sq_newclosure(v, &LevelTime_set_time_wrapper, 0);
4534 if(SQ_FAILED(sq_createslot(v, -3))) {
4535 throw SquirrelError(v, "Couldn't register function 'set_time'");
4538 if(SQ_FAILED(sq_createslot(v, -3))) {
4539 throw SquirrelError(v, "Couldn't register class 'LevelTime'");
4544 } // end of namespace Scripting