2 * WARNING: This file is automatically generated from:
3 * 'src/scripting/wrapper.interface.hpp'
13 #include "squirrel_error.hpp"
14 #include "wrapper.interface.hpp"
21 static SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger )
23 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (ptr);
28 static SQInteger DisplayEffect_fade_out_wrapper(HSQUIRRELVM vm)
31 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
32 sq_throwerror(vm, _SC("'fade_out' called without instance"));
35 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
37 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
38 sq_throwerror(vm, _SC("Argument 1 not a float"));
43 _this->fade_out(static_cast<float> (arg0));
47 } catch(std::exception& e) {
48 sq_throwerror(vm, e.what());
51 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
57 static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm)
60 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
61 sq_throwerror(vm, _SC("'fade_in' called without instance"));
64 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
66 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
67 sq_throwerror(vm, _SC("Argument 1 not a float"));
72 _this->fade_in(static_cast<float> (arg0));
76 } catch(std::exception& e) {
77 sq_throwerror(vm, e.what());
80 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
86 static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm)
89 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
90 sq_throwerror(vm, _SC("'set_black' called without instance"));
93 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
95 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
96 sq_throwerror(vm, _SC("Argument 1 not a bool"));
101 _this->set_black(arg0 == SQTrue);
105 } catch(std::exception& e) {
106 sq_throwerror(vm, e.what());
109 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_black'"));
115 static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm)
118 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
119 sq_throwerror(vm, _SC("'is_black' called without instance"));
122 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
125 bool return_value = _this->is_black();
127 sq_pushbool(vm, return_value);
130 } catch(std::exception& e) {
131 sq_throwerror(vm, e.what());
134 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_black'"));
140 static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm)
143 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
144 sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance"));
147 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
149 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
150 sq_throwerror(vm, _SC("Argument 1 not a float"));
155 _this->sixteen_to_nine(static_cast<float> (arg0));
159 } catch(std::exception& e) {
160 sq_throwerror(vm, e.what());
163 sq_throwerror(vm, _SC("Unexpected exception while executing function 'sixteen_to_nine'"));
169 static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm)
172 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
173 sq_throwerror(vm, _SC("'four_to_three' called without instance"));
176 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
178 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
179 sq_throwerror(vm, _SC("Argument 1 not a float"));
184 _this->four_to_three(static_cast<float> (arg0));
188 } catch(std::exception& e) {
189 sq_throwerror(vm, e.what());
192 sq_throwerror(vm, _SC("Unexpected exception while executing function 'four_to_three'"));
198 static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger )
200 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
205 static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm)
208 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
209 sq_throwerror(vm, _SC("'shake' called without instance"));
212 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
214 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
215 sq_throwerror(vm, _SC("Argument 1 not a float"));
219 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
220 sq_throwerror(vm, _SC("Argument 2 not a float"));
224 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
225 sq_throwerror(vm, _SC("Argument 3 not a float"));
230 _this->shake(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
234 } catch(std::exception& e) {
235 sq_throwerror(vm, e.what());
238 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'"));
244 static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm)
247 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
248 sq_throwerror(vm, _SC("'set_pos' called without instance"));
251 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
253 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
254 sq_throwerror(vm, _SC("Argument 1 not a float"));
258 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
259 sq_throwerror(vm, _SC("Argument 2 not a float"));
264 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
268 } catch(std::exception& e) {
269 sq_throwerror(vm, e.what());
272 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
278 static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm)
281 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
282 sq_throwerror(vm, _SC("'set_mode' called without instance"));
285 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
287 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
288 sq_throwerror(vm, _SC("Argument 1 not a string"));
293 _this->set_mode(arg0);
297 } catch(std::exception& e) {
298 sq_throwerror(vm, e.what());
301 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_mode'"));
307 static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm)
310 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
311 sq_throwerror(vm, _SC("'scroll_to' called without instance"));
314 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
316 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
317 sq_throwerror(vm, _SC("Argument 1 not a float"));
321 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
322 sq_throwerror(vm, _SC("Argument 2 not a float"));
326 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
327 sq_throwerror(vm, _SC("Argument 3 not a float"));
332 _this->scroll_to(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
336 } catch(std::exception& e) {
337 sq_throwerror(vm, e.what());
340 sq_throwerror(vm, _SC("Unexpected exception while executing function 'scroll_to'"));
346 static SQInteger Level_release_hook(SQUserPointer ptr, SQInteger )
348 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
353 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
356 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
357 sq_throwerror(vm, _SC("'finish' called without instance"));
360 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
362 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
363 sq_throwerror(vm, _SC("Argument 1 not a bool"));
368 _this->finish(arg0 == SQTrue);
372 } catch(std::exception& e) {
373 sq_throwerror(vm, e.what());
376 sq_throwerror(vm, _SC("Unexpected exception while executing function 'finish'"));
382 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
385 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
386 sq_throwerror(vm, _SC("'spawn' called without instance"));
389 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
391 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
392 sq_throwerror(vm, _SC("Argument 1 not a string"));
396 if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
397 sq_throwerror(vm, _SC("Argument 2 not a string"));
402 _this->spawn(arg0, arg1);
406 } catch(std::exception& e) {
407 sq_throwerror(vm, e.what());
410 sq_throwerror(vm, _SC("Unexpected exception while executing function 'spawn'"));
416 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
419 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
420 sq_throwerror(vm, _SC("'flip_vertically' called without instance"));
423 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
426 _this->flip_vertically();
430 } catch(std::exception& e) {
431 sq_throwerror(vm, e.what());
434 sq_throwerror(vm, _SC("Unexpected exception while executing function 'flip_vertically'"));
440 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
443 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
444 sq_throwerror(vm, _SC("'toggle_pause' called without instance"));
447 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
450 _this->toggle_pause();
454 } catch(std::exception& e) {
455 sq_throwerror(vm, e.what());
458 sq_throwerror(vm, _SC("Unexpected exception while executing function 'toggle_pause'"));
464 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
466 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
471 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
474 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
475 sq_throwerror(vm, _SC("'set_action' called without instance"));
478 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
480 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
481 sq_throwerror(vm, _SC("Argument 1 not a string"));
486 _this->set_action(arg0);
490 } catch(std::exception& e) {
491 sq_throwerror(vm, e.what());
494 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
500 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
503 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
504 sq_throwerror(vm, _SC("'get_action' called without instance"));
507 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
510 std::string return_value = _this->get_action();
512 sq_pushstring(vm, return_value.c_str(), return_value.size());
515 } catch(std::exception& e) {
516 sq_throwerror(vm, e.what());
519 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
525 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
528 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
529 sq_throwerror(vm, _SC("'move' called without instance"));
532 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
534 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
535 sq_throwerror(vm, _SC("Argument 1 not a float"));
539 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
540 sq_throwerror(vm, _SC("Argument 2 not a float"));
545 _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
549 } catch(std::exception& e) {
550 sq_throwerror(vm, e.what());
553 sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
559 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
562 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
563 sq_throwerror(vm, _SC("'set_pos' called without instance"));
566 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
568 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
569 sq_throwerror(vm, _SC("Argument 1 not a float"));
573 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
574 sq_throwerror(vm, _SC("Argument 2 not a float"));
579 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
583 } catch(std::exception& e) {
584 sq_throwerror(vm, e.what());
587 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
593 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
596 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
597 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
600 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
603 float return_value = _this->get_pos_x();
605 sq_pushfloat(vm, return_value);
608 } catch(std::exception& e) {
609 sq_throwerror(vm, e.what());
612 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
618 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
621 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
622 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
625 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
628 float return_value = _this->get_pos_y();
630 sq_pushfloat(vm, return_value);
633 } catch(std::exception& e) {
634 sq_throwerror(vm, e.what());
637 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
643 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
646 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
647 sq_throwerror(vm, _SC("'set_velocity' called without instance"));
650 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
652 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
653 sq_throwerror(vm, _SC("Argument 1 not a float"));
657 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
658 sq_throwerror(vm, _SC("Argument 2 not a float"));
663 _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
667 } catch(std::exception& e) {
668 sq_throwerror(vm, e.what());
671 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
677 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
680 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
681 sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
684 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
687 float return_value = _this->get_velocity_x();
689 sq_pushfloat(vm, return_value);
692 } catch(std::exception& e) {
693 sq_throwerror(vm, e.what());
696 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
702 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
705 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
706 sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
709 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
712 float return_value = _this->get_velocity_y();
714 sq_pushfloat(vm, return_value);
717 } catch(std::exception& e) {
718 sq_throwerror(vm, e.what());
721 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
727 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
730 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
731 sq_throwerror(vm, _SC("'set_visible' called without instance"));
734 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
736 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
737 sq_throwerror(vm, _SC("Argument 1 not a bool"));
742 _this->set_visible(arg0 == SQTrue);
746 } catch(std::exception& e) {
747 sq_throwerror(vm, e.what());
750 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
756 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
759 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
760 sq_throwerror(vm, _SC("'is_visible' called without instance"));
763 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
766 bool return_value = _this->is_visible();
768 sq_pushbool(vm, return_value);
771 } catch(std::exception& e) {
772 sq_throwerror(vm, e.what());
775 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
781 static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm)
784 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
785 sq_throwerror(vm, _SC("'set_solid' called without instance"));
788 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
790 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
791 sq_throwerror(vm, _SC("Argument 1 not a bool"));
796 _this->set_solid(arg0 == SQTrue);
800 } catch(std::exception& e) {
801 sq_throwerror(vm, e.what());
804 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_solid'"));
810 static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm)
813 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
814 sq_throwerror(vm, _SC("'is_solid' called without instance"));
817 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
820 bool return_value = _this->is_solid();
822 sq_pushbool(vm, return_value);
825 } catch(std::exception& e) {
826 sq_throwerror(vm, e.what());
829 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_solid'"));
835 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
838 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
839 sq_throwerror(vm, _SC("'get_name' called without instance"));
842 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
845 std::string return_value = _this->get_name();
847 sq_pushstring(vm, return_value.c_str(), return_value.size());
850 } catch(std::exception& e) {
851 sq_throwerror(vm, e.what());
854 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
860 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
862 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
867 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
870 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
871 sq_throwerror(vm, _SC("'set_text' called without instance"));
874 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
876 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
877 sq_throwerror(vm, _SC("Argument 1 not a string"));
882 _this->set_text(arg0);
886 } catch(std::exception& e) {
887 sq_throwerror(vm, e.what());
890 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
896 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
899 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
900 sq_throwerror(vm, _SC("'set_font' called without instance"));
903 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
905 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
906 sq_throwerror(vm, _SC("Argument 1 not a string"));
911 _this->set_font(arg0);
915 } catch(std::exception& e) {
916 sq_throwerror(vm, e.what());
919 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
925 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
928 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
929 sq_throwerror(vm, _SC("'fade_in' called without instance"));
932 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
934 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
935 sq_throwerror(vm, _SC("Argument 1 not a float"));
940 _this->fade_in(static_cast<float> (arg0));
944 } catch(std::exception& e) {
945 sq_throwerror(vm, e.what());
948 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
954 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
957 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
958 sq_throwerror(vm, _SC("'fade_out' called without instance"));
961 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
963 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
964 sq_throwerror(vm, _SC("Argument 1 not a float"));
969 _this->fade_out(static_cast<float> (arg0));
973 } catch(std::exception& e) {
974 sq_throwerror(vm, e.what());
977 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
983 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
986 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
987 sq_throwerror(vm, _SC("'set_visible' called without instance"));
990 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
992 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
993 sq_throwerror(vm, _SC("Argument 1 not a bool"));
998 _this->set_visible(arg0 == SQTrue);
1002 } catch(std::exception& e) {
1003 sq_throwerror(vm, e.what());
1006 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1012 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
1015 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1016 sq_throwerror(vm, _SC("'set_centered' called without instance"));
1019 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1021 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1022 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1027 _this->set_centered(arg0 == SQTrue);
1031 } catch(std::exception& e) {
1032 sq_throwerror(vm, e.what());
1035 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
1041 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
1043 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
1048 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
1051 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1052 sq_throwerror(vm, _SC("'add_bonus' called without instance"));
1055 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1057 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1058 sq_throwerror(vm, _SC("Argument 1 not a string"));
1063 bool return_value = _this->add_bonus(arg0);
1065 sq_pushbool(vm, return_value);
1068 } catch(std::exception& e) {
1069 sq_throwerror(vm, e.what());
1072 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1078 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
1081 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1082 sq_throwerror(vm, _SC("'add_coins' called without instance"));
1085 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1087 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1088 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1093 _this->add_coins(static_cast<int> (arg0));
1097 } catch(std::exception& e) {
1098 sq_throwerror(vm, e.what());
1101 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1107 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1110 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1111 sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1114 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1117 _this->make_invincible();
1121 } catch(std::exception& e) {
1122 sq_throwerror(vm, e.what());
1125 sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1131 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1134 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1135 sq_throwerror(vm, _SC("'deactivate' called without instance"));
1138 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1141 _this->deactivate();
1145 } catch(std::exception& e) {
1146 sq_throwerror(vm, e.what());
1149 sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1155 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1158 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1159 sq_throwerror(vm, _SC("'activate' called without instance"));
1162 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1169 } catch(std::exception& e) {
1170 sq_throwerror(vm, e.what());
1173 sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1179 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1182 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1183 sq_throwerror(vm, _SC("'walk' called without instance"));
1186 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1188 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1189 sq_throwerror(vm, _SC("Argument 1 not a float"));
1194 _this->walk(static_cast<float> (arg0));
1198 } catch(std::exception& e) {
1199 sq_throwerror(vm, e.what());
1202 sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1208 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1211 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1212 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1215 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1217 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1218 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1223 _this->set_visible(arg0 == SQTrue);
1227 } catch(std::exception& e) {
1228 sq_throwerror(vm, e.what());
1231 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1237 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1240 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1241 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1244 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1247 bool return_value = _this->get_visible();
1249 sq_pushbool(vm, return_value);
1252 } catch(std::exception& e) {
1253 sq_throwerror(vm, e.what());
1256 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1262 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1265 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1266 sq_throwerror(vm, _SC("'kill' called without instance"));
1269 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1271 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1272 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1277 _this->kill(arg0 == SQTrue);
1281 } catch(std::exception& e) {
1282 sq_throwerror(vm, e.what());
1285 sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1291 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1294 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1295 sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1298 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1300 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1301 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1306 _this->set_ghost_mode(arg0 == SQTrue);
1310 } catch(std::exception& e) {
1311 sq_throwerror(vm, e.what());
1314 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1320 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1323 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1324 sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1327 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1330 bool return_value = _this->get_ghost_mode();
1332 sq_pushbool(vm, return_value);
1335 } catch(std::exception& e) {
1336 sq_throwerror(vm, e.what());
1339 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1345 static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm)
1348 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1349 sq_throwerror(vm, _SC("'do_cheer' called without instance"));
1352 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1359 } catch(std::exception& e) {
1360 sq_throwerror(vm, e.what());
1363 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'"));
1369 static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm)
1372 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1373 sq_throwerror(vm, _SC("'do_duck' called without instance"));
1376 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1383 } catch(std::exception& e) {
1384 sq_throwerror(vm, e.what());
1387 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'"));
1393 static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm)
1396 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1397 sq_throwerror(vm, _SC("'do_standup' called without instance"));
1400 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1403 _this->do_standup();
1407 } catch(std::exception& e) {
1408 sq_throwerror(vm, e.what());
1411 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'"));
1417 static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm)
1420 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1421 sq_throwerror(vm, _SC("'do_backflip' called without instance"));
1424 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1427 _this->do_backflip();
1431 } catch(std::exception& e) {
1432 sq_throwerror(vm, e.what());
1435 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'"));
1441 static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm)
1444 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1445 sq_throwerror(vm, _SC("'do_jump' called without instance"));
1448 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1450 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1451 sq_throwerror(vm, _SC("Argument 1 not a float"));
1456 _this->do_jump(static_cast<float> (arg0));
1460 } catch(std::exception& e) {
1461 sq_throwerror(vm, e.what());
1464 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_jump'"));
1470 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1472 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1477 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1480 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1481 sq_throwerror(vm, _SC("Argument 1 not a string"));
1486 Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1487 if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1488 sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1491 sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1495 } catch(std::exception& e) {
1496 sq_throwerror(vm, e.what());
1499 sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1505 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1508 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1509 sq_throwerror(vm, _SC("'set_layer' called without instance"));
1512 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1514 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1515 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1520 _this->set_layer(static_cast<int> (arg0));
1524 } catch(std::exception& e) {
1525 sq_throwerror(vm, e.what());
1528 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1534 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1537 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1538 sq_throwerror(vm, _SC("'get_layer' called without instance"));
1541 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1544 int return_value = _this->get_layer();
1546 sq_pushinteger(vm, return_value);
1549 } catch(std::exception& e) {
1550 sq_throwerror(vm, e.what());
1553 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1559 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1562 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1563 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1566 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1568 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1569 sq_throwerror(vm, _SC("Argument 1 not a float"));
1573 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1574 sq_throwerror(vm, _SC("Argument 2 not a float"));
1579 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1583 } catch(std::exception& e) {
1584 sq_throwerror(vm, e.what());
1587 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1593 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1596 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1597 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1600 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1603 float return_value = _this->get_pos_x();
1605 sq_pushfloat(vm, return_value);
1608 } catch(std::exception& e) {
1609 sq_throwerror(vm, e.what());
1612 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1618 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1621 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1622 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1625 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1628 float return_value = _this->get_pos_y();
1630 sq_pushfloat(vm, return_value);
1633 } catch(std::exception& e) {
1634 sq_throwerror(vm, e.what());
1637 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1643 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1646 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1647 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1650 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1652 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1653 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1658 _this->set_anchor_point(static_cast<int> (arg0));
1662 } catch(std::exception& e) {
1663 sq_throwerror(vm, e.what());
1666 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1672 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1675 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1676 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1679 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1682 int return_value = _this->get_anchor_point();
1684 sq_pushinteger(vm, return_value);
1687 } catch(std::exception& e) {
1688 sq_throwerror(vm, e.what());
1691 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1697 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1700 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1701 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1704 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1706 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1707 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1712 _this->set_visible(arg0 == SQTrue);
1716 } catch(std::exception& e) {
1717 sq_throwerror(vm, e.what());
1720 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1726 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1729 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1730 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1733 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1736 bool return_value = _this->get_visible();
1738 sq_pushbool(vm, return_value);
1741 } catch(std::exception& e) {
1742 sq_throwerror(vm, e.what());
1745 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1751 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
1754 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1755 sq_throwerror(vm, _SC("'set_action' called without instance"));
1758 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1760 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1761 sq_throwerror(vm, _SC("Argument 1 not a string"));
1766 _this->set_action(arg0);
1770 } catch(std::exception& e) {
1771 sq_throwerror(vm, e.what());
1774 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1780 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
1783 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1784 sq_throwerror(vm, _SC("'get_action' called without instance"));
1787 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1790 std::string return_value = _this->get_action();
1792 sq_pushstring(vm, return_value.c_str(), return_value.size());
1795 } catch(std::exception& e) {
1796 sq_throwerror(vm, e.what());
1799 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1805 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1807 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
1812 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1815 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1816 sq_throwerror(vm, _SC("'goto_node' called without instance"));
1819 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1821 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1822 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1827 _this->goto_node(static_cast<int> (arg0));
1831 } catch(std::exception& e) {
1832 sq_throwerror(vm, e.what());
1835 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1841 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1844 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1845 sq_throwerror(vm, _SC("'start_moving' called without instance"));
1848 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1851 _this->start_moving();
1855 } catch(std::exception& e) {
1856 sq_throwerror(vm, e.what());
1859 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
1865 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1868 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1869 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1872 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1875 _this->stop_moving();
1879 } catch(std::exception& e) {
1880 sq_throwerror(vm, e.what());
1883 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1889 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
1891 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (ptr);
1896 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
1899 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1900 sq_throwerror(vm, _SC("'get_burning' called without instance"));
1903 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1906 bool return_value = _this->get_burning();
1908 sq_pushbool(vm, return_value);
1911 } catch(std::exception& e) {
1912 sq_throwerror(vm, e.what());
1915 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
1921 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
1924 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1925 sq_throwerror(vm, _SC("'set_burning' called without instance"));
1928 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
1930 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1931 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1936 _this->set_burning(arg0 == SQTrue);
1940 } catch(std::exception& e) {
1941 sq_throwerror(vm, e.what());
1944 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_burning'"));
1950 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
1952 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (ptr);
1957 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
1960 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1961 sq_throwerror(vm, _SC("'start' called without instance"));
1964 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
1971 } catch(std::exception& e) {
1972 sq_throwerror(vm, e.what());
1975 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
1981 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
1984 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1985 sq_throwerror(vm, _SC("'stop' called without instance"));
1988 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
1995 } catch(std::exception& e) {
1996 sq_throwerror(vm, e.what());
1999 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2005 static SQInteger AmbientSound_release_hook(SQUserPointer ptr, SQInteger )
2007 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (ptr);
2012 static SQInteger AmbientSound_set_pos_wrapper(HSQUIRRELVM vm)
2015 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2016 sq_throwerror(vm, _SC("'set_pos' called without instance"));
2019 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2021 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2022 sq_throwerror(vm, _SC("Argument 1 not a float"));
2026 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2027 sq_throwerror(vm, _SC("Argument 2 not a float"));
2032 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
2036 } catch(std::exception& e) {
2037 sq_throwerror(vm, e.what());
2040 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
2046 static SQInteger AmbientSound_get_pos_x_wrapper(HSQUIRRELVM vm)
2049 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2050 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
2053 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2056 float return_value = _this->get_pos_x();
2058 sq_pushfloat(vm, return_value);
2061 } catch(std::exception& e) {
2062 sq_throwerror(vm, e.what());
2065 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
2071 static SQInteger AmbientSound_get_pos_y_wrapper(HSQUIRRELVM vm)
2074 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2075 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
2078 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2081 float return_value = _this->get_pos_y();
2083 sq_pushfloat(vm, return_value);
2086 } catch(std::exception& e) {
2087 sq_throwerror(vm, e.what());
2090 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
2096 static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger )
2098 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (ptr);
2103 static SQInteger Thunderstorm_start_wrapper(HSQUIRRELVM vm)
2106 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2107 sq_throwerror(vm, _SC("'start' called without instance"));
2110 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2117 } catch(std::exception& e) {
2118 sq_throwerror(vm, e.what());
2121 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2127 static SQInteger Thunderstorm_stop_wrapper(HSQUIRRELVM vm)
2130 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2131 sq_throwerror(vm, _SC("'stop' called without instance"));
2134 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2141 } catch(std::exception& e) {
2142 sq_throwerror(vm, e.what());
2145 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2151 static SQInteger Thunderstorm_thunder_wrapper(HSQUIRRELVM vm)
2154 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2155 sq_throwerror(vm, _SC("'thunder' called without instance"));
2158 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2165 } catch(std::exception& e) {
2166 sq_throwerror(vm, e.what());
2169 sq_throwerror(vm, _SC("Unexpected exception while executing function 'thunder'"));
2175 static SQInteger Thunderstorm_lightning_wrapper(HSQUIRRELVM vm)
2178 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2179 sq_throwerror(vm, _SC("'lightning' called without instance"));
2182 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2189 } catch(std::exception& e) {
2190 sq_throwerror(vm, e.what());
2193 sq_throwerror(vm, _SC("Unexpected exception while executing function 'lightning'"));
2199 static SQInteger Thunderstorm_flash_wrapper(HSQUIRRELVM vm)
2202 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2203 sq_throwerror(vm, _SC("'flash' called without instance"));
2206 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2213 } catch(std::exception& e) {
2214 sq_throwerror(vm, e.what());
2217 sq_throwerror(vm, _SC("Unexpected exception while executing function 'flash'"));
2223 static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm)
2226 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2227 sq_throwerror(vm, _SC("'electrify' called without instance"));
2230 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2237 } catch(std::exception& e) {
2238 sq_throwerror(vm, e.what());
2241 sq_throwerror(vm, _SC("Unexpected exception while executing function 'electrify'"));
2247 static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger )
2249 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (ptr);
2254 static SQInteger TileMap_goto_node_wrapper(HSQUIRRELVM vm)
2257 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2258 sq_throwerror(vm, _SC("'goto_node' called without instance"));
2261 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2263 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2264 sq_throwerror(vm, _SC("Argument 1 not an integer"));
2269 _this->goto_node(static_cast<int> (arg0));
2273 } catch(std::exception& e) {
2274 sq_throwerror(vm, e.what());
2277 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2283 static SQInteger TileMap_start_moving_wrapper(HSQUIRRELVM vm)
2286 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2287 sq_throwerror(vm, _SC("'start_moving' called without instance"));
2290 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2293 _this->start_moving();
2297 } catch(std::exception& e) {
2298 sq_throwerror(vm, e.what());
2301 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2307 static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm)
2310 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2311 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2314 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2317 _this->stop_moving();
2321 } catch(std::exception& e) {
2322 sq_throwerror(vm, e.what());
2325 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2331 static SQInteger SSector_release_hook(SQUserPointer ptr, SQInteger )
2333 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (ptr);
2338 static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm)
2341 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2342 sq_throwerror(vm, _SC("'set_ambient_light' called without instance"));
2345 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2347 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2348 sq_throwerror(vm, _SC("Argument 1 not a float"));
2352 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2353 sq_throwerror(vm, _SC("Argument 2 not a float"));
2357 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2358 sq_throwerror(vm, _SC("Argument 3 not a float"));
2363 _this->set_ambient_light(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2367 } catch(std::exception& e) {
2368 sq_throwerror(vm, e.what());
2371 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ambient_light'"));
2377 static SQInteger SSector_get_ambient_red_wrapper(HSQUIRRELVM vm)
2380 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2381 sq_throwerror(vm, _SC("'get_ambient_red' called without instance"));
2384 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2387 float return_value = _this->get_ambient_red();
2389 sq_pushfloat(vm, return_value);
2392 } catch(std::exception& e) {
2393 sq_throwerror(vm, e.what());
2396 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_red'"));
2402 static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm)
2405 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2406 sq_throwerror(vm, _SC("'get_ambient_green' called without instance"));
2409 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2412 float return_value = _this->get_ambient_green();
2414 sq_pushfloat(vm, return_value);
2417 } catch(std::exception& e) {
2418 sq_throwerror(vm, e.what());
2421 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_green'"));
2427 static SQInteger SSector_get_ambient_blue_wrapper(HSQUIRRELVM vm)
2430 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2431 sq_throwerror(vm, _SC("'get_ambient_blue' called without instance"));
2434 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2437 float return_value = _this->get_ambient_blue();
2439 sq_pushfloat(vm, return_value);
2442 } catch(std::exception& e) {
2443 sq_throwerror(vm, e.what());
2446 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_blue'"));
2452 static SQInteger LevelTime_release_hook(SQUserPointer ptr, SQInteger )
2454 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (ptr);
2459 static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm)
2462 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2463 sq_throwerror(vm, _SC("'start' called without instance"));
2466 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2473 } catch(std::exception& e) {
2474 sq_throwerror(vm, e.what());
2477 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2483 static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm)
2486 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2487 sq_throwerror(vm, _SC("'stop' called without instance"));
2490 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2497 } catch(std::exception& e) {
2498 sq_throwerror(vm, e.what());
2501 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2507 static SQInteger LevelTime_get_time_wrapper(HSQUIRRELVM vm)
2510 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2511 sq_throwerror(vm, _SC("'get_time' called without instance"));
2514 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2517 float return_value = _this->get_time();
2519 sq_pushfloat(vm, return_value);
2522 } catch(std::exception& e) {
2523 sq_throwerror(vm, e.what());
2526 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_time'"));
2532 static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm)
2535 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2536 sq_throwerror(vm, _SC("'set_time' called without instance"));
2539 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2541 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2542 sq_throwerror(vm, _SC("Argument 1 not a float"));
2547 _this->set_time(static_cast<float> (arg0));
2551 } catch(std::exception& e) {
2552 sq_throwerror(vm, e.what());
2555 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_time'"));
2561 static SQInteger display_wrapper(HSQUIRRELVM vm)
2563 return Scripting::display(vm);
2566 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
2568 HSQUIRRELVM arg0 = vm;
2571 Scripting::print_stacktrace(arg0);
2575 } catch(std::exception& e) {
2576 sq_throwerror(vm, e.what());
2579 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
2585 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
2587 return Scripting::get_current_thread(vm);
2590 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
2593 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2594 sq_throwerror(vm, _SC("Argument 1 not a string"));
2599 Scripting::display_text_file(arg0);
2603 } catch(std::exception& e) {
2604 sq_throwerror(vm, e.what());
2607 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
2613 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
2616 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2617 sq_throwerror(vm, _SC("Argument 1 not a string"));
2622 Scripting::load_worldmap(arg0);
2626 } catch(std::exception& e) {
2627 sq_throwerror(vm, e.what());
2630 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
2636 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
2639 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2640 sq_throwerror(vm, _SC("Argument 1 not a string"));
2645 Scripting::load_level(arg0);
2649 } catch(std::exception& e) {
2650 sq_throwerror(vm, e.what());
2653 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
2659 static SQInteger wait_wrapper(HSQUIRRELVM vm)
2661 HSQUIRRELVM arg0 = vm;
2663 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
2664 sq_throwerror(vm, _SC("Argument 1 not a float"));
2669 Scripting::wait(arg0, static_cast<float> (arg1));
2671 return sq_suspendvm(vm);
2673 } catch(std::exception& e) {
2674 sq_throwerror(vm, e.what());
2677 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
2683 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
2685 HSQUIRRELVM arg0 = vm;
2688 Scripting::wait_for_screenswitch(arg0);
2690 return sq_suspendvm(vm);
2692 } catch(std::exception& e) {
2693 sq_throwerror(vm, e.what());
2696 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
2702 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
2707 Scripting::exit_screen();
2711 } catch(std::exception& e) {
2712 sq_throwerror(vm, e.what());
2715 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
2721 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
2724 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2725 sq_throwerror(vm, _SC("Argument 1 not a float"));
2730 Scripting::fadeout_screen(static_cast<float> (arg0));
2734 } catch(std::exception& e) {
2735 sq_throwerror(vm, e.what());
2738 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
2744 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
2747 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2748 sq_throwerror(vm, _SC("Argument 1 not a float"));
2752 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2753 sq_throwerror(vm, _SC("Argument 2 not a float"));
2757 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2758 sq_throwerror(vm, _SC("Argument 3 not a float"));
2763 Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2767 } catch(std::exception& e) {
2768 sq_throwerror(vm, e.what());
2771 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
2777 static SQInteger translate_wrapper(HSQUIRRELVM vm)
2780 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2781 sq_throwerror(vm, _SC("Argument 1 not a string"));
2786 std::string return_value = Scripting::translate(arg0);
2788 sq_pushstring(vm, return_value.c_str(), return_value.size());
2791 } catch(std::exception& e) {
2792 sq_throwerror(vm, e.what());
2795 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
2801 static SQInteger import_wrapper(HSQUIRRELVM vm)
2803 HSQUIRRELVM arg0 = vm;
2805 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
2806 sq_throwerror(vm, _SC("Argument 1 not a string"));
2811 Scripting::import(arg0, arg1);
2815 } catch(std::exception& e) {
2816 sq_throwerror(vm, e.what());
2819 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
2825 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
2830 Scripting::save_state();
2834 } catch(std::exception& e) {
2835 sq_throwerror(vm, e.what());
2838 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
2844 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
2847 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2848 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2853 Scripting::debug_collrects(arg0 == SQTrue);
2857 } catch(std::exception& e) {
2858 sq_throwerror(vm, e.what());
2861 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
2867 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
2870 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2871 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2876 Scripting::debug_show_fps(arg0 == SQTrue);
2880 } catch(std::exception& e) {
2881 sq_throwerror(vm, e.what());
2884 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
2890 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
2893 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2894 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2899 Scripting::debug_draw_solids_only(arg0 == SQTrue);
2903 } catch(std::exception& e) {
2904 sq_throwerror(vm, e.what());
2907 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
2913 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
2916 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2917 sq_throwerror(vm, _SC("Argument 1 not a string"));
2922 Scripting::play_music(arg0);
2926 } catch(std::exception& e) {
2927 sq_throwerror(vm, e.what());
2930 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
2936 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
2939 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2940 sq_throwerror(vm, _SC("Argument 1 not a string"));
2945 Scripting::play_sound(arg0);
2949 } catch(std::exception& e) {
2950 sq_throwerror(vm, e.what());
2953 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
2959 static SQInteger grease_wrapper(HSQUIRRELVM vm)
2964 Scripting::grease();
2968 } catch(std::exception& e) {
2969 sq_throwerror(vm, e.what());
2972 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
2978 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
2983 Scripting::invincible();
2987 } catch(std::exception& e) {
2988 sq_throwerror(vm, e.what());
2991 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
2997 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
3006 } catch(std::exception& e) {
3007 sq_throwerror(vm, e.what());
3010 sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
3016 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
3021 Scripting::mortal();
3025 } catch(std::exception& e) {
3026 sq_throwerror(vm, e.what());
3029 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
3035 static SQInteger restart_wrapper(HSQUIRRELVM vm)
3040 Scripting::restart();
3044 } catch(std::exception& e) {
3045 sq_throwerror(vm, e.what());
3048 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
3054 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
3059 Scripting::whereami();
3063 } catch(std::exception& e) {
3064 sq_throwerror(vm, e.what());
3067 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
3073 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
3078 Scripting::gotoend();
3082 } catch(std::exception& e) {
3083 sq_throwerror(vm, e.what());
3086 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
3092 static SQInteger camera_wrapper(HSQUIRRELVM vm)
3097 Scripting::camera();
3101 } catch(std::exception& e) {
3102 sq_throwerror(vm, e.what());
3105 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
3111 static SQInteger quit_wrapper(HSQUIRRELVM vm)
3120 } catch(std::exception& e) {
3121 sq_throwerror(vm, e.what());
3124 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
3130 static SQInteger rand_wrapper(HSQUIRRELVM vm)
3134 int return_value = Scripting::rand();
3136 sq_pushinteger(vm, return_value);
3139 } catch(std::exception& e) {
3140 sq_throwerror(vm, e.what());
3143 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
3149 } // end of namespace Wrapper
3151 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
3153 using namespace Wrapper;
3155 sq_pushroottable(v);
3156 sq_pushstring(v, "DisplayEffect", -1);
3157 if(SQ_FAILED(sq_get(v, -2))) {
3158 std::ostringstream msg;
3159 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
3160 throw SquirrelError(v, msg.str());
3163 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3164 std::ostringstream msg;
3165 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
3166 throw SquirrelError(v, msg.str());
3168 sq_remove(v, -2); // remove object name
3170 if(setup_releasehook) {
3171 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
3174 sq_remove(v, -2); // remove root table
3177 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
3179 using namespace Wrapper;
3181 sq_pushroottable(v);
3182 sq_pushstring(v, "Camera", -1);
3183 if(SQ_FAILED(sq_get(v, -2))) {
3184 std::ostringstream msg;
3185 msg << "Couldn't resolved squirrel type 'Camera'";
3186 throw SquirrelError(v, msg.str());
3189 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3190 std::ostringstream msg;
3191 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
3192 throw SquirrelError(v, msg.str());
3194 sq_remove(v, -2); // remove object name
3196 if(setup_releasehook) {
3197 sq_setreleasehook(v, -1, Camera_release_hook);
3200 sq_remove(v, -2); // remove root table
3203 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
3205 using namespace Wrapper;
3207 sq_pushroottable(v);
3208 sq_pushstring(v, "Level", -1);
3209 if(SQ_FAILED(sq_get(v, -2))) {
3210 std::ostringstream msg;
3211 msg << "Couldn't resolved squirrel type 'Level'";
3212 throw SquirrelError(v, msg.str());
3215 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3216 std::ostringstream msg;
3217 msg << "Couldn't setup squirrel instance for object of type 'Level'";
3218 throw SquirrelError(v, msg.str());
3220 sq_remove(v, -2); // remove object name
3222 if(setup_releasehook) {
3223 sq_setreleasehook(v, -1, Level_release_hook);
3226 sq_remove(v, -2); // remove root table
3229 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
3231 using namespace Wrapper;
3233 sq_pushroottable(v);
3234 sq_pushstring(v, "ScriptedObject", -1);
3235 if(SQ_FAILED(sq_get(v, -2))) {
3236 std::ostringstream msg;
3237 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
3238 throw SquirrelError(v, msg.str());
3241 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3242 std::ostringstream msg;
3243 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
3244 throw SquirrelError(v, msg.str());
3246 sq_remove(v, -2); // remove object name
3248 if(setup_releasehook) {
3249 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
3252 sq_remove(v, -2); // remove root table
3255 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
3257 using namespace Wrapper;
3259 sq_pushroottable(v);
3260 sq_pushstring(v, "Text", -1);
3261 if(SQ_FAILED(sq_get(v, -2))) {
3262 std::ostringstream msg;
3263 msg << "Couldn't resolved squirrel type 'Text'";
3264 throw SquirrelError(v, msg.str());
3267 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3268 std::ostringstream msg;
3269 msg << "Couldn't setup squirrel instance for object of type 'Text'";
3270 throw SquirrelError(v, msg.str());
3272 sq_remove(v, -2); // remove object name
3274 if(setup_releasehook) {
3275 sq_setreleasehook(v, -1, Text_release_hook);
3278 sq_remove(v, -2); // remove root table
3281 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
3283 using namespace Wrapper;
3285 sq_pushroottable(v);
3286 sq_pushstring(v, "Player", -1);
3287 if(SQ_FAILED(sq_get(v, -2))) {
3288 std::ostringstream msg;
3289 msg << "Couldn't resolved squirrel type 'Player'";
3290 throw SquirrelError(v, msg.str());
3293 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3294 std::ostringstream msg;
3295 msg << "Couldn't setup squirrel instance for object of type 'Player'";
3296 throw SquirrelError(v, msg.str());
3298 sq_remove(v, -2); // remove object name
3300 if(setup_releasehook) {
3301 sq_setreleasehook(v, -1, Player_release_hook);
3304 sq_remove(v, -2); // remove root table
3307 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
3309 using namespace Wrapper;
3311 sq_pushroottable(v);
3312 sq_pushstring(v, "FloatingImage", -1);
3313 if(SQ_FAILED(sq_get(v, -2))) {
3314 std::ostringstream msg;
3315 msg << "Couldn't resolved squirrel type 'FloatingImage'";
3316 throw SquirrelError(v, msg.str());
3319 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3320 std::ostringstream msg;
3321 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
3322 throw SquirrelError(v, msg.str());
3324 sq_remove(v, -2); // remove object name
3326 if(setup_releasehook) {
3327 sq_setreleasehook(v, -1, FloatingImage_release_hook);
3330 sq_remove(v, -2); // remove root table
3333 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
3335 using namespace Wrapper;
3337 sq_pushroottable(v);
3338 sq_pushstring(v, "Platform", -1);
3339 if(SQ_FAILED(sq_get(v, -2))) {
3340 std::ostringstream msg;
3341 msg << "Couldn't resolved squirrel type 'Platform'";
3342 throw SquirrelError(v, msg.str());
3345 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3346 std::ostringstream msg;
3347 msg << "Couldn't setup squirrel instance for object of type 'Platform'";
3348 throw SquirrelError(v, msg.str());
3350 sq_remove(v, -2); // remove object name
3352 if(setup_releasehook) {
3353 sq_setreleasehook(v, -1, Platform_release_hook);
3356 sq_remove(v, -2); // remove root table
3359 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
3361 using namespace Wrapper;
3363 sq_pushroottable(v);
3364 sq_pushstring(v, "Candle", -1);
3365 if(SQ_FAILED(sq_get(v, -2))) {
3366 std::ostringstream msg;
3367 msg << "Couldn't resolved squirrel type 'Candle'";
3368 throw SquirrelError(v, msg.str());
3371 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3372 std::ostringstream msg;
3373 msg << "Couldn't setup squirrel instance for object of type 'Candle'";
3374 throw SquirrelError(v, msg.str());
3376 sq_remove(v, -2); // remove object name
3378 if(setup_releasehook) {
3379 sq_setreleasehook(v, -1, Candle_release_hook);
3382 sq_remove(v, -2); // remove root table
3385 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
3387 using namespace Wrapper;
3389 sq_pushroottable(v);
3390 sq_pushstring(v, "Wind", -1);
3391 if(SQ_FAILED(sq_get(v, -2))) {
3392 std::ostringstream msg;
3393 msg << "Couldn't resolved squirrel type 'Wind'";
3394 throw SquirrelError(v, msg.str());
3397 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3398 std::ostringstream msg;
3399 msg << "Couldn't setup squirrel instance for object of type 'Wind'";
3400 throw SquirrelError(v, msg.str());
3402 sq_remove(v, -2); // remove object name
3404 if(setup_releasehook) {
3405 sq_setreleasehook(v, -1, Wind_release_hook);
3408 sq_remove(v, -2); // remove root table
3411 void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bool setup_releasehook)
3413 using namespace Wrapper;
3415 sq_pushroottable(v);
3416 sq_pushstring(v, "AmbientSound", -1);
3417 if(SQ_FAILED(sq_get(v, -2))) {
3418 std::ostringstream msg;
3419 msg << "Couldn't resolved squirrel type 'AmbientSound'";
3420 throw SquirrelError(v, msg.str());
3423 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3424 std::ostringstream msg;
3425 msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'";
3426 throw SquirrelError(v, msg.str());
3428 sq_remove(v, -2); // remove object name
3430 if(setup_releasehook) {
3431 sq_setreleasehook(v, -1, AmbientSound_release_hook);
3434 sq_remove(v, -2); // remove root table
3437 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Thunderstorm* object, bool setup_releasehook)
3439 using namespace Wrapper;
3441 sq_pushroottable(v);
3442 sq_pushstring(v, "Thunderstorm", -1);
3443 if(SQ_FAILED(sq_get(v, -2))) {
3444 std::ostringstream msg;
3445 msg << "Couldn't resolved squirrel type 'Thunderstorm'";
3446 throw SquirrelError(v, msg.str());
3449 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3450 std::ostringstream msg;
3451 msg << "Couldn't setup squirrel instance for object of type 'Thunderstorm'";
3452 throw SquirrelError(v, msg.str());
3454 sq_remove(v, -2); // remove object name
3456 if(setup_releasehook) {
3457 sq_setreleasehook(v, -1, Thunderstorm_release_hook);
3460 sq_remove(v, -2); // remove root table
3463 void create_squirrel_instance(HSQUIRRELVM v, Scripting::TileMap* object, bool setup_releasehook)
3465 using namespace Wrapper;
3467 sq_pushroottable(v);
3468 sq_pushstring(v, "TileMap", -1);
3469 if(SQ_FAILED(sq_get(v, -2))) {
3470 std::ostringstream msg;
3471 msg << "Couldn't resolved squirrel type 'TileMap'";
3472 throw SquirrelError(v, msg.str());
3475 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3476 std::ostringstream msg;
3477 msg << "Couldn't setup squirrel instance for object of type 'TileMap'";
3478 throw SquirrelError(v, msg.str());
3480 sq_remove(v, -2); // remove object name
3482 if(setup_releasehook) {
3483 sq_setreleasehook(v, -1, TileMap_release_hook);
3486 sq_remove(v, -2); // remove root table
3489 void create_squirrel_instance(HSQUIRRELVM v, Scripting::SSector* object, bool setup_releasehook)
3491 using namespace Wrapper;
3493 sq_pushroottable(v);
3494 sq_pushstring(v, "SSector", -1);
3495 if(SQ_FAILED(sq_get(v, -2))) {
3496 std::ostringstream msg;
3497 msg << "Couldn't resolved squirrel type 'SSector'";
3498 throw SquirrelError(v, msg.str());
3501 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3502 std::ostringstream msg;
3503 msg << "Couldn't setup squirrel instance for object of type 'SSector'";
3504 throw SquirrelError(v, msg.str());
3506 sq_remove(v, -2); // remove object name
3508 if(setup_releasehook) {
3509 sq_setreleasehook(v, -1, SSector_release_hook);
3512 sq_remove(v, -2); // remove root table
3515 void create_squirrel_instance(HSQUIRRELVM v, Scripting::LevelTime* object, bool setup_releasehook)
3517 using namespace Wrapper;
3519 sq_pushroottable(v);
3520 sq_pushstring(v, "LevelTime", -1);
3521 if(SQ_FAILED(sq_get(v, -2))) {
3522 std::ostringstream msg;
3523 msg << "Couldn't resolved squirrel type 'LevelTime'";
3524 throw SquirrelError(v, msg.str());
3527 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3528 std::ostringstream msg;
3529 msg << "Couldn't setup squirrel instance for object of type 'LevelTime'";
3530 throw SquirrelError(v, msg.str());
3532 sq_remove(v, -2); // remove object name
3534 if(setup_releasehook) {
3535 sq_setreleasehook(v, -1, LevelTime_release_hook);
3538 sq_remove(v, -2); // remove root table
3541 void register_supertux_wrapper(HSQUIRRELVM v)
3543 using namespace Wrapper;
3545 sq_pushstring(v, "ANCHOR_TOP", -1);
3546 sq_pushinteger(v, 16);
3547 if(SQ_FAILED(sq_createslot(v, -3))) {
3548 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
3551 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
3552 sq_pushinteger(v, 32);
3553 if(SQ_FAILED(sq_createslot(v, -3))) {
3554 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
3557 sq_pushstring(v, "ANCHOR_LEFT", -1);
3558 sq_pushinteger(v, 1);
3559 if(SQ_FAILED(sq_createslot(v, -3))) {
3560 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
3563 sq_pushstring(v, "ANCHOR_RIGHT", -1);
3564 sq_pushinteger(v, 2);
3565 if(SQ_FAILED(sq_createslot(v, -3))) {
3566 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
3569 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
3570 sq_pushinteger(v, 0);
3571 if(SQ_FAILED(sq_createslot(v, -3))) {
3572 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
3575 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
3576 sq_pushinteger(v, 17);
3577 if(SQ_FAILED(sq_createslot(v, -3))) {
3578 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
3581 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
3582 sq_pushinteger(v, 18);
3583 if(SQ_FAILED(sq_createslot(v, -3))) {
3584 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
3587 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
3588 sq_pushinteger(v, 33);
3589 if(SQ_FAILED(sq_createslot(v, -3))) {
3590 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
3593 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
3594 sq_pushinteger(v, 34);
3595 if(SQ_FAILED(sq_createslot(v, -3))) {
3596 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
3599 sq_pushstring(v, "display", -1);
3600 sq_newclosure(v, &display_wrapper, 0);
3601 if(SQ_FAILED(sq_createslot(v, -3))) {
3602 throw SquirrelError(v, "Couldn't register function 'display'");
3605 sq_pushstring(v, "print_stacktrace", -1);
3606 sq_newclosure(v, &print_stacktrace_wrapper, 0);
3607 if(SQ_FAILED(sq_createslot(v, -3))) {
3608 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
3611 sq_pushstring(v, "get_current_thread", -1);
3612 sq_newclosure(v, &get_current_thread_wrapper, 0);
3613 if(SQ_FAILED(sq_createslot(v, -3))) {
3614 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
3617 sq_pushstring(v, "display_text_file", -1);
3618 sq_newclosure(v, &display_text_file_wrapper, 0);
3619 if(SQ_FAILED(sq_createslot(v, -3))) {
3620 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
3623 sq_pushstring(v, "load_worldmap", -1);
3624 sq_newclosure(v, &load_worldmap_wrapper, 0);
3625 if(SQ_FAILED(sq_createslot(v, -3))) {
3626 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
3629 sq_pushstring(v, "load_level", -1);
3630 sq_newclosure(v, &load_level_wrapper, 0);
3631 if(SQ_FAILED(sq_createslot(v, -3))) {
3632 throw SquirrelError(v, "Couldn't register function 'load_level'");
3635 sq_pushstring(v, "wait", -1);
3636 sq_newclosure(v, &wait_wrapper, 0);
3637 if(SQ_FAILED(sq_createslot(v, -3))) {
3638 throw SquirrelError(v, "Couldn't register function 'wait'");
3641 sq_pushstring(v, "wait_for_screenswitch", -1);
3642 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
3643 if(SQ_FAILED(sq_createslot(v, -3))) {
3644 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
3647 sq_pushstring(v, "exit_screen", -1);
3648 sq_newclosure(v, &exit_screen_wrapper, 0);
3649 if(SQ_FAILED(sq_createslot(v, -3))) {
3650 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
3653 sq_pushstring(v, "fadeout_screen", -1);
3654 sq_newclosure(v, &fadeout_screen_wrapper, 0);
3655 if(SQ_FAILED(sq_createslot(v, -3))) {
3656 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
3659 sq_pushstring(v, "shrink_screen", -1);
3660 sq_newclosure(v, &shrink_screen_wrapper, 0);
3661 if(SQ_FAILED(sq_createslot(v, -3))) {
3662 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
3665 sq_pushstring(v, "translate", -1);
3666 sq_newclosure(v, &translate_wrapper, 0);
3667 if(SQ_FAILED(sq_createslot(v, -3))) {
3668 throw SquirrelError(v, "Couldn't register function 'translate'");
3671 sq_pushstring(v, "import", -1);
3672 sq_newclosure(v, &import_wrapper, 0);
3673 if(SQ_FAILED(sq_createslot(v, -3))) {
3674 throw SquirrelError(v, "Couldn't register function 'import'");
3677 sq_pushstring(v, "save_state", -1);
3678 sq_newclosure(v, &save_state_wrapper, 0);
3679 if(SQ_FAILED(sq_createslot(v, -3))) {
3680 throw SquirrelError(v, "Couldn't register function 'save_state'");
3683 sq_pushstring(v, "debug_collrects", -1);
3684 sq_newclosure(v, &debug_collrects_wrapper, 0);
3685 if(SQ_FAILED(sq_createslot(v, -3))) {
3686 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
3689 sq_pushstring(v, "debug_show_fps", -1);
3690 sq_newclosure(v, &debug_show_fps_wrapper, 0);
3691 if(SQ_FAILED(sq_createslot(v, -3))) {
3692 throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
3695 sq_pushstring(v, "debug_draw_solids_only", -1);
3696 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
3697 if(SQ_FAILED(sq_createslot(v, -3))) {
3698 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
3701 sq_pushstring(v, "play_music", -1);
3702 sq_newclosure(v, &play_music_wrapper, 0);
3703 if(SQ_FAILED(sq_createslot(v, -3))) {
3704 throw SquirrelError(v, "Couldn't register function 'play_music'");
3707 sq_pushstring(v, "play_sound", -1);
3708 sq_newclosure(v, &play_sound_wrapper, 0);
3709 if(SQ_FAILED(sq_createslot(v, -3))) {
3710 throw SquirrelError(v, "Couldn't register function 'play_sound'");
3713 sq_pushstring(v, "grease", -1);
3714 sq_newclosure(v, &grease_wrapper, 0);
3715 if(SQ_FAILED(sq_createslot(v, -3))) {
3716 throw SquirrelError(v, "Couldn't register function 'grease'");
3719 sq_pushstring(v, "invincible", -1);
3720 sq_newclosure(v, &invincible_wrapper, 0);
3721 if(SQ_FAILED(sq_createslot(v, -3))) {
3722 throw SquirrelError(v, "Couldn't register function 'invincible'");
3725 sq_pushstring(v, "ghost", -1);
3726 sq_newclosure(v, &ghost_wrapper, 0);
3727 if(SQ_FAILED(sq_createslot(v, -3))) {
3728 throw SquirrelError(v, "Couldn't register function 'ghost'");
3731 sq_pushstring(v, "mortal", -1);
3732 sq_newclosure(v, &mortal_wrapper, 0);
3733 if(SQ_FAILED(sq_createslot(v, -3))) {
3734 throw SquirrelError(v, "Couldn't register function 'mortal'");
3737 sq_pushstring(v, "restart", -1);
3738 sq_newclosure(v, &restart_wrapper, 0);
3739 if(SQ_FAILED(sq_createslot(v, -3))) {
3740 throw SquirrelError(v, "Couldn't register function 'restart'");
3743 sq_pushstring(v, "whereami", -1);
3744 sq_newclosure(v, &whereami_wrapper, 0);
3745 if(SQ_FAILED(sq_createslot(v, -3))) {
3746 throw SquirrelError(v, "Couldn't register function 'whereami'");
3749 sq_pushstring(v, "gotoend", -1);
3750 sq_newclosure(v, &gotoend_wrapper, 0);
3751 if(SQ_FAILED(sq_createslot(v, -3))) {
3752 throw SquirrelError(v, "Couldn't register function 'gotoend'");
3755 sq_pushstring(v, "camera", -1);
3756 sq_newclosure(v, &camera_wrapper, 0);
3757 if(SQ_FAILED(sq_createslot(v, -3))) {
3758 throw SquirrelError(v, "Couldn't register function 'camera'");
3761 sq_pushstring(v, "quit", -1);
3762 sq_newclosure(v, &quit_wrapper, 0);
3763 if(SQ_FAILED(sq_createslot(v, -3))) {
3764 throw SquirrelError(v, "Couldn't register function 'quit'");
3767 sq_pushstring(v, "rand", -1);
3768 sq_newclosure(v, &rand_wrapper, 0);
3769 if(SQ_FAILED(sq_createslot(v, -3))) {
3770 throw SquirrelError(v, "Couldn't register function 'rand'");
3773 // Register class DisplayEffect
3774 sq_pushstring(v, "DisplayEffect", -1);
3775 if(sq_newclass(v, SQFalse) < 0) {
3776 std::ostringstream msg;
3777 msg << "Couldn't create new class 'DisplayEffect'";
3778 throw SquirrelError(v, msg.str());
3780 sq_pushstring(v, "fade_out", -1);
3781 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
3782 if(SQ_FAILED(sq_createslot(v, -3))) {
3783 throw SquirrelError(v, "Couldn't register function 'fade_out'");
3786 sq_pushstring(v, "fade_in", -1);
3787 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
3788 if(SQ_FAILED(sq_createslot(v, -3))) {
3789 throw SquirrelError(v, "Couldn't register function 'fade_in'");
3792 sq_pushstring(v, "set_black", -1);
3793 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
3794 if(SQ_FAILED(sq_createslot(v, -3))) {
3795 throw SquirrelError(v, "Couldn't register function 'set_black'");
3798 sq_pushstring(v, "is_black", -1);
3799 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
3800 if(SQ_FAILED(sq_createslot(v, -3))) {
3801 throw SquirrelError(v, "Couldn't register function 'is_black'");
3804 sq_pushstring(v, "sixteen_to_nine", -1);
3805 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
3806 if(SQ_FAILED(sq_createslot(v, -3))) {
3807 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
3810 sq_pushstring(v, "four_to_three", -1);
3811 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
3812 if(SQ_FAILED(sq_createslot(v, -3))) {
3813 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
3816 if(SQ_FAILED(sq_createslot(v, -3))) {
3817 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
3820 // Register class Camera
3821 sq_pushstring(v, "Camera", -1);
3822 if(sq_newclass(v, SQFalse) < 0) {
3823 std::ostringstream msg;
3824 msg << "Couldn't create new class 'Camera'";
3825 throw SquirrelError(v, msg.str());
3827 sq_pushstring(v, "shake", -1);
3828 sq_newclosure(v, &Camera_shake_wrapper, 0);
3829 if(SQ_FAILED(sq_createslot(v, -3))) {
3830 throw SquirrelError(v, "Couldn't register function 'shake'");
3833 sq_pushstring(v, "set_pos", -1);
3834 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
3835 if(SQ_FAILED(sq_createslot(v, -3))) {
3836 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3839 sq_pushstring(v, "set_mode", -1);
3840 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
3841 if(SQ_FAILED(sq_createslot(v, -3))) {
3842 throw SquirrelError(v, "Couldn't register function 'set_mode'");
3845 sq_pushstring(v, "scroll_to", -1);
3846 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
3847 if(SQ_FAILED(sq_createslot(v, -3))) {
3848 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
3851 if(SQ_FAILED(sq_createslot(v, -3))) {
3852 throw SquirrelError(v, "Couldn't register class 'Camera'");
3855 // Register class Level
3856 sq_pushstring(v, "Level", -1);
3857 if(sq_newclass(v, SQFalse) < 0) {
3858 std::ostringstream msg;
3859 msg << "Couldn't create new class 'Level'";
3860 throw SquirrelError(v, msg.str());
3862 sq_pushstring(v, "finish", -1);
3863 sq_newclosure(v, &Level_finish_wrapper, 0);
3864 if(SQ_FAILED(sq_createslot(v, -3))) {
3865 throw SquirrelError(v, "Couldn't register function 'finish'");
3868 sq_pushstring(v, "spawn", -1);
3869 sq_newclosure(v, &Level_spawn_wrapper, 0);
3870 if(SQ_FAILED(sq_createslot(v, -3))) {
3871 throw SquirrelError(v, "Couldn't register function 'spawn'");
3874 sq_pushstring(v, "flip_vertically", -1);
3875 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
3876 if(SQ_FAILED(sq_createslot(v, -3))) {
3877 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
3880 sq_pushstring(v, "toggle_pause", -1);
3881 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
3882 if(SQ_FAILED(sq_createslot(v, -3))) {
3883 throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
3886 if(SQ_FAILED(sq_createslot(v, -3))) {
3887 throw SquirrelError(v, "Couldn't register class 'Level'");
3890 // Register class ScriptedObject
3891 sq_pushstring(v, "ScriptedObject", -1);
3892 if(sq_newclass(v, SQFalse) < 0) {
3893 std::ostringstream msg;
3894 msg << "Couldn't create new class 'ScriptedObject'";
3895 throw SquirrelError(v, msg.str());
3897 sq_pushstring(v, "set_action", -1);
3898 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
3899 if(SQ_FAILED(sq_createslot(v, -3))) {
3900 throw SquirrelError(v, "Couldn't register function 'set_action'");
3903 sq_pushstring(v, "get_action", -1);
3904 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
3905 if(SQ_FAILED(sq_createslot(v, -3))) {
3906 throw SquirrelError(v, "Couldn't register function 'get_action'");
3909 sq_pushstring(v, "move", -1);
3910 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
3911 if(SQ_FAILED(sq_createslot(v, -3))) {
3912 throw SquirrelError(v, "Couldn't register function 'move'");
3915 sq_pushstring(v, "set_pos", -1);
3916 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
3917 if(SQ_FAILED(sq_createslot(v, -3))) {
3918 throw SquirrelError(v, "Couldn't register function 'set_pos'");
3921 sq_pushstring(v, "get_pos_x", -1);
3922 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
3923 if(SQ_FAILED(sq_createslot(v, -3))) {
3924 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
3927 sq_pushstring(v, "get_pos_y", -1);
3928 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
3929 if(SQ_FAILED(sq_createslot(v, -3))) {
3930 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
3933 sq_pushstring(v, "set_velocity", -1);
3934 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
3935 if(SQ_FAILED(sq_createslot(v, -3))) {
3936 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
3939 sq_pushstring(v, "get_velocity_x", -1);
3940 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
3941 if(SQ_FAILED(sq_createslot(v, -3))) {
3942 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
3945 sq_pushstring(v, "get_velocity_y", -1);
3946 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
3947 if(SQ_FAILED(sq_createslot(v, -3))) {
3948 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
3951 sq_pushstring(v, "set_visible", -1);
3952 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
3953 if(SQ_FAILED(sq_createslot(v, -3))) {
3954 throw SquirrelError(v, "Couldn't register function 'set_visible'");
3957 sq_pushstring(v, "is_visible", -1);
3958 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
3959 if(SQ_FAILED(sq_createslot(v, -3))) {
3960 throw SquirrelError(v, "Couldn't register function 'is_visible'");
3963 sq_pushstring(v, "set_solid", -1);
3964 sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
3965 if(SQ_FAILED(sq_createslot(v, -3))) {
3966 throw SquirrelError(v, "Couldn't register function 'set_solid'");
3969 sq_pushstring(v, "is_solid", -1);
3970 sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
3971 if(SQ_FAILED(sq_createslot(v, -3))) {
3972 throw SquirrelError(v, "Couldn't register function 'is_solid'");
3975 sq_pushstring(v, "get_name", -1);
3976 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
3977 if(SQ_FAILED(sq_createslot(v, -3))) {
3978 throw SquirrelError(v, "Couldn't register function 'get_name'");
3981 if(SQ_FAILED(sq_createslot(v, -3))) {
3982 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
3985 // Register class Text
3986 sq_pushstring(v, "Text", -1);
3987 if(sq_newclass(v, SQFalse) < 0) {
3988 std::ostringstream msg;
3989 msg << "Couldn't create new class 'Text'";
3990 throw SquirrelError(v, msg.str());
3992 sq_pushstring(v, "set_text", -1);
3993 sq_newclosure(v, &Text_set_text_wrapper, 0);
3994 if(SQ_FAILED(sq_createslot(v, -3))) {
3995 throw SquirrelError(v, "Couldn't register function 'set_text'");
3998 sq_pushstring(v, "set_font", -1);
3999 sq_newclosure(v, &Text_set_font_wrapper, 0);
4000 if(SQ_FAILED(sq_createslot(v, -3))) {
4001 throw SquirrelError(v, "Couldn't register function 'set_font'");
4004 sq_pushstring(v, "fade_in", -1);
4005 sq_newclosure(v, &Text_fade_in_wrapper, 0);
4006 if(SQ_FAILED(sq_createslot(v, -3))) {
4007 throw SquirrelError(v, "Couldn't register function 'fade_in'");
4010 sq_pushstring(v, "fade_out", -1);
4011 sq_newclosure(v, &Text_fade_out_wrapper, 0);
4012 if(SQ_FAILED(sq_createslot(v, -3))) {
4013 throw SquirrelError(v, "Couldn't register function 'fade_out'");
4016 sq_pushstring(v, "set_visible", -1);
4017 sq_newclosure(v, &Text_set_visible_wrapper, 0);
4018 if(SQ_FAILED(sq_createslot(v, -3))) {
4019 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4022 sq_pushstring(v, "set_centered", -1);
4023 sq_newclosure(v, &Text_set_centered_wrapper, 0);
4024 if(SQ_FAILED(sq_createslot(v, -3))) {
4025 throw SquirrelError(v, "Couldn't register function 'set_centered'");
4028 if(SQ_FAILED(sq_createslot(v, -3))) {
4029 throw SquirrelError(v, "Couldn't register class 'Text'");
4032 // Register class Player
4033 sq_pushstring(v, "Player", -1);
4034 if(sq_newclass(v, SQFalse) < 0) {
4035 std::ostringstream msg;
4036 msg << "Couldn't create new class 'Player'";
4037 throw SquirrelError(v, msg.str());
4039 sq_pushstring(v, "add_bonus", -1);
4040 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
4041 if(SQ_FAILED(sq_createslot(v, -3))) {
4042 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
4045 sq_pushstring(v, "add_coins", -1);
4046 sq_newclosure(v, &Player_add_coins_wrapper, 0);
4047 if(SQ_FAILED(sq_createslot(v, -3))) {
4048 throw SquirrelError(v, "Couldn't register function 'add_coins'");
4051 sq_pushstring(v, "make_invincible", -1);
4052 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
4053 if(SQ_FAILED(sq_createslot(v, -3))) {
4054 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
4057 sq_pushstring(v, "deactivate", -1);
4058 sq_newclosure(v, &Player_deactivate_wrapper, 0);
4059 if(SQ_FAILED(sq_createslot(v, -3))) {
4060 throw SquirrelError(v, "Couldn't register function 'deactivate'");
4063 sq_pushstring(v, "activate", -1);
4064 sq_newclosure(v, &Player_activate_wrapper, 0);
4065 if(SQ_FAILED(sq_createslot(v, -3))) {
4066 throw SquirrelError(v, "Couldn't register function 'activate'");
4069 sq_pushstring(v, "walk", -1);
4070 sq_newclosure(v, &Player_walk_wrapper, 0);
4071 if(SQ_FAILED(sq_createslot(v, -3))) {
4072 throw SquirrelError(v, "Couldn't register function 'walk'");
4075 sq_pushstring(v, "set_visible", -1);
4076 sq_newclosure(v, &Player_set_visible_wrapper, 0);
4077 if(SQ_FAILED(sq_createslot(v, -3))) {
4078 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4081 sq_pushstring(v, "get_visible", -1);
4082 sq_newclosure(v, &Player_get_visible_wrapper, 0);
4083 if(SQ_FAILED(sq_createslot(v, -3))) {
4084 throw SquirrelError(v, "Couldn't register function 'get_visible'");
4087 sq_pushstring(v, "kill", -1);
4088 sq_newclosure(v, &Player_kill_wrapper, 0);
4089 if(SQ_FAILED(sq_createslot(v, -3))) {
4090 throw SquirrelError(v, "Couldn't register function 'kill'");
4093 sq_pushstring(v, "set_ghost_mode", -1);
4094 sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
4095 if(SQ_FAILED(sq_createslot(v, -3))) {
4096 throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
4099 sq_pushstring(v, "get_ghost_mode", -1);
4100 sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
4101 if(SQ_FAILED(sq_createslot(v, -3))) {
4102 throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
4105 sq_pushstring(v, "do_cheer", -1);
4106 sq_newclosure(v, &Player_do_cheer_wrapper, 0);
4107 if(SQ_FAILED(sq_createslot(v, -3))) {
4108 throw SquirrelError(v, "Couldn't register function 'do_cheer'");
4111 sq_pushstring(v, "do_duck", -1);
4112 sq_newclosure(v, &Player_do_duck_wrapper, 0);
4113 if(SQ_FAILED(sq_createslot(v, -3))) {
4114 throw SquirrelError(v, "Couldn't register function 'do_duck'");
4117 sq_pushstring(v, "do_standup", -1);
4118 sq_newclosure(v, &Player_do_standup_wrapper, 0);
4119 if(SQ_FAILED(sq_createslot(v, -3))) {
4120 throw SquirrelError(v, "Couldn't register function 'do_standup'");
4123 sq_pushstring(v, "do_backflip", -1);
4124 sq_newclosure(v, &Player_do_backflip_wrapper, 0);
4125 if(SQ_FAILED(sq_createslot(v, -3))) {
4126 throw SquirrelError(v, "Couldn't register function 'do_backflip'");
4129 sq_pushstring(v, "do_jump", -1);
4130 sq_newclosure(v, &Player_do_jump_wrapper, 0);
4131 if(SQ_FAILED(sq_createslot(v, -3))) {
4132 throw SquirrelError(v, "Couldn't register function 'do_jump'");
4135 if(SQ_FAILED(sq_createslot(v, -3))) {
4136 throw SquirrelError(v, "Couldn't register class 'Player'");
4139 // Register class FloatingImage
4140 sq_pushstring(v, "FloatingImage", -1);
4141 if(sq_newclass(v, SQFalse) < 0) {
4142 std::ostringstream msg;
4143 msg << "Couldn't create new class 'FloatingImage'";
4144 throw SquirrelError(v, msg.str());
4146 sq_pushstring(v, "constructor", -1);
4147 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
4148 if(SQ_FAILED(sq_createslot(v, -3))) {
4149 throw SquirrelError(v, "Couldn't register function 'constructor'");
4152 sq_pushstring(v, "set_layer", -1);
4153 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
4154 if(SQ_FAILED(sq_createslot(v, -3))) {
4155 throw SquirrelError(v, "Couldn't register function 'set_layer'");
4158 sq_pushstring(v, "get_layer", -1);
4159 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
4160 if(SQ_FAILED(sq_createslot(v, -3))) {
4161 throw SquirrelError(v, "Couldn't register function 'get_layer'");
4164 sq_pushstring(v, "set_pos", -1);
4165 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
4166 if(SQ_FAILED(sq_createslot(v, -3))) {
4167 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4170 sq_pushstring(v, "get_pos_x", -1);
4171 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
4172 if(SQ_FAILED(sq_createslot(v, -3))) {
4173 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4176 sq_pushstring(v, "get_pos_y", -1);
4177 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
4178 if(SQ_FAILED(sq_createslot(v, -3))) {
4179 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4182 sq_pushstring(v, "set_anchor_point", -1);
4183 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
4184 if(SQ_FAILED(sq_createslot(v, -3))) {
4185 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4188 sq_pushstring(v, "get_anchor_point", -1);
4189 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
4190 if(SQ_FAILED(sq_createslot(v, -3))) {
4191 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4194 sq_pushstring(v, "set_visible", -1);
4195 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
4196 if(SQ_FAILED(sq_createslot(v, -3))) {
4197 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4200 sq_pushstring(v, "get_visible", -1);
4201 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
4202 if(SQ_FAILED(sq_createslot(v, -3))) {
4203 throw SquirrelError(v, "Couldn't register function 'get_visible'");
4206 sq_pushstring(v, "set_action", -1);
4207 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
4208 if(SQ_FAILED(sq_createslot(v, -3))) {
4209 throw SquirrelError(v, "Couldn't register function 'set_action'");
4212 sq_pushstring(v, "get_action", -1);
4213 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
4214 if(SQ_FAILED(sq_createslot(v, -3))) {
4215 throw SquirrelError(v, "Couldn't register function 'get_action'");
4218 if(SQ_FAILED(sq_createslot(v, -3))) {
4219 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
4222 // Register class Platform
4223 sq_pushstring(v, "Platform", -1);
4224 if(sq_newclass(v, SQFalse) < 0) {
4225 std::ostringstream msg;
4226 msg << "Couldn't create new class 'Platform'";
4227 throw SquirrelError(v, msg.str());
4229 sq_pushstring(v, "goto_node", -1);
4230 sq_newclosure(v, &Platform_goto_node_wrapper, 0);
4231 if(SQ_FAILED(sq_createslot(v, -3))) {
4232 throw SquirrelError(v, "Couldn't register function 'goto_node'");
4235 sq_pushstring(v, "start_moving", -1);
4236 sq_newclosure(v, &Platform_start_moving_wrapper, 0);
4237 if(SQ_FAILED(sq_createslot(v, -3))) {
4238 throw SquirrelError(v, "Couldn't register function 'start_moving'");
4241 sq_pushstring(v, "stop_moving", -1);
4242 sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
4243 if(SQ_FAILED(sq_createslot(v, -3))) {
4244 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
4247 if(SQ_FAILED(sq_createslot(v, -3))) {
4248 throw SquirrelError(v, "Couldn't register class 'Platform'");
4251 // Register class Candle
4252 sq_pushstring(v, "Candle", -1);
4253 if(sq_newclass(v, SQFalse) < 0) {
4254 std::ostringstream msg;
4255 msg << "Couldn't create new class 'Candle'";
4256 throw SquirrelError(v, msg.str());
4258 sq_pushstring(v, "get_burning", -1);
4259 sq_newclosure(v, &Candle_get_burning_wrapper, 0);
4260 if(SQ_FAILED(sq_createslot(v, -3))) {
4261 throw SquirrelError(v, "Couldn't register function 'get_burning'");
4264 sq_pushstring(v, "set_burning", -1);
4265 sq_newclosure(v, &Candle_set_burning_wrapper, 0);
4266 if(SQ_FAILED(sq_createslot(v, -3))) {
4267 throw SquirrelError(v, "Couldn't register function 'set_burning'");
4270 if(SQ_FAILED(sq_createslot(v, -3))) {
4271 throw SquirrelError(v, "Couldn't register class 'Candle'");
4274 // Register class Wind
4275 sq_pushstring(v, "Wind", -1);
4276 if(sq_newclass(v, SQFalse) < 0) {
4277 std::ostringstream msg;
4278 msg << "Couldn't create new class 'Wind'";
4279 throw SquirrelError(v, msg.str());
4281 sq_pushstring(v, "start", -1);
4282 sq_newclosure(v, &Wind_start_wrapper, 0);
4283 if(SQ_FAILED(sq_createslot(v, -3))) {
4284 throw SquirrelError(v, "Couldn't register function 'start'");
4287 sq_pushstring(v, "stop", -1);
4288 sq_newclosure(v, &Wind_stop_wrapper, 0);
4289 if(SQ_FAILED(sq_createslot(v, -3))) {
4290 throw SquirrelError(v, "Couldn't register function 'stop'");
4293 if(SQ_FAILED(sq_createslot(v, -3))) {
4294 throw SquirrelError(v, "Couldn't register class 'Wind'");
4297 // Register class AmbientSound
4298 sq_pushstring(v, "AmbientSound", -1);
4299 if(sq_newclass(v, SQFalse) < 0) {
4300 std::ostringstream msg;
4301 msg << "Couldn't create new class 'AmbientSound'";
4302 throw SquirrelError(v, msg.str());
4304 sq_pushstring(v, "set_pos", -1);
4305 sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
4306 if(SQ_FAILED(sq_createslot(v, -3))) {
4307 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4310 sq_pushstring(v, "get_pos_x", -1);
4311 sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
4312 if(SQ_FAILED(sq_createslot(v, -3))) {
4313 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4316 sq_pushstring(v, "get_pos_y", -1);
4317 sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
4318 if(SQ_FAILED(sq_createslot(v, -3))) {
4319 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4322 if(SQ_FAILED(sq_createslot(v, -3))) {
4323 throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
4326 // Register class Thunderstorm
4327 sq_pushstring(v, "Thunderstorm", -1);
4328 if(sq_newclass(v, SQFalse) < 0) {
4329 std::ostringstream msg;
4330 msg << "Couldn't create new class 'Thunderstorm'";
4331 throw SquirrelError(v, msg.str());
4333 sq_pushstring(v, "start", -1);
4334 sq_newclosure(v, &Thunderstorm_start_wrapper, 0);
4335 if(SQ_FAILED(sq_createslot(v, -3))) {
4336 throw SquirrelError(v, "Couldn't register function 'start'");
4339 sq_pushstring(v, "stop", -1);
4340 sq_newclosure(v, &Thunderstorm_stop_wrapper, 0);
4341 if(SQ_FAILED(sq_createslot(v, -3))) {
4342 throw SquirrelError(v, "Couldn't register function 'stop'");
4345 sq_pushstring(v, "thunder", -1);
4346 sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0);
4347 if(SQ_FAILED(sq_createslot(v, -3))) {
4348 throw SquirrelError(v, "Couldn't register function 'thunder'");
4351 sq_pushstring(v, "lightning", -1);
4352 sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0);
4353 if(SQ_FAILED(sq_createslot(v, -3))) {
4354 throw SquirrelError(v, "Couldn't register function 'lightning'");
4357 sq_pushstring(v, "flash", -1);
4358 sq_newclosure(v, &Thunderstorm_flash_wrapper, 0);
4359 if(SQ_FAILED(sq_createslot(v, -3))) {
4360 throw SquirrelError(v, "Couldn't register function 'flash'");
4363 sq_pushstring(v, "electrify", -1);
4364 sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0);
4365 if(SQ_FAILED(sq_createslot(v, -3))) {
4366 throw SquirrelError(v, "Couldn't register function 'electrify'");
4369 if(SQ_FAILED(sq_createslot(v, -3))) {
4370 throw SquirrelError(v, "Couldn't register class 'Thunderstorm'");
4373 // Register class TileMap
4374 sq_pushstring(v, "TileMap", -1);
4375 if(sq_newclass(v, SQFalse) < 0) {
4376 std::ostringstream msg;
4377 msg << "Couldn't create new class 'TileMap'";
4378 throw SquirrelError(v, msg.str());
4380 sq_pushstring(v, "goto_node", -1);
4381 sq_newclosure(v, &TileMap_goto_node_wrapper, 0);
4382 if(SQ_FAILED(sq_createslot(v, -3))) {
4383 throw SquirrelError(v, "Couldn't register function 'goto_node'");
4386 sq_pushstring(v, "start_moving", -1);
4387 sq_newclosure(v, &TileMap_start_moving_wrapper, 0);
4388 if(SQ_FAILED(sq_createslot(v, -3))) {
4389 throw SquirrelError(v, "Couldn't register function 'start_moving'");
4392 sq_pushstring(v, "stop_moving", -1);
4393 sq_newclosure(v, &TileMap_stop_moving_wrapper, 0);
4394 if(SQ_FAILED(sq_createslot(v, -3))) {
4395 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
4398 if(SQ_FAILED(sq_createslot(v, -3))) {
4399 throw SquirrelError(v, "Couldn't register class 'TileMap'");
4402 // Register class SSector
4403 sq_pushstring(v, "SSector", -1);
4404 if(sq_newclass(v, SQFalse) < 0) {
4405 std::ostringstream msg;
4406 msg << "Couldn't create new class 'SSector'";
4407 throw SquirrelError(v, msg.str());
4409 sq_pushstring(v, "set_ambient_light", -1);
4410 sq_newclosure(v, &SSector_set_ambient_light_wrapper, 0);
4411 if(SQ_FAILED(sq_createslot(v, -3))) {
4412 throw SquirrelError(v, "Couldn't register function 'set_ambient_light'");
4415 sq_pushstring(v, "get_ambient_red", -1);
4416 sq_newclosure(v, &SSector_get_ambient_red_wrapper, 0);
4417 if(SQ_FAILED(sq_createslot(v, -3))) {
4418 throw SquirrelError(v, "Couldn't register function 'get_ambient_red'");
4421 sq_pushstring(v, "get_ambient_green", -1);
4422 sq_newclosure(v, &SSector_get_ambient_green_wrapper, 0);
4423 if(SQ_FAILED(sq_createslot(v, -3))) {
4424 throw SquirrelError(v, "Couldn't register function 'get_ambient_green'");
4427 sq_pushstring(v, "get_ambient_blue", -1);
4428 sq_newclosure(v, &SSector_get_ambient_blue_wrapper, 0);
4429 if(SQ_FAILED(sq_createslot(v, -3))) {
4430 throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'");
4433 if(SQ_FAILED(sq_createslot(v, -3))) {
4434 throw SquirrelError(v, "Couldn't register class 'SSector'");
4437 // Register class LevelTime
4438 sq_pushstring(v, "LevelTime", -1);
4439 if(sq_newclass(v, SQFalse) < 0) {
4440 std::ostringstream msg;
4441 msg << "Couldn't create new class 'LevelTime'";
4442 throw SquirrelError(v, msg.str());
4444 sq_pushstring(v, "start", -1);
4445 sq_newclosure(v, &LevelTime_start_wrapper, 0);
4446 if(SQ_FAILED(sq_createslot(v, -3))) {
4447 throw SquirrelError(v, "Couldn't register function 'start'");
4450 sq_pushstring(v, "stop", -1);
4451 sq_newclosure(v, &LevelTime_stop_wrapper, 0);
4452 if(SQ_FAILED(sq_createslot(v, -3))) {
4453 throw SquirrelError(v, "Couldn't register function 'stop'");
4456 sq_pushstring(v, "get_time", -1);
4457 sq_newclosure(v, &LevelTime_get_time_wrapper, 0);
4458 if(SQ_FAILED(sq_createslot(v, -3))) {
4459 throw SquirrelError(v, "Couldn't register function 'get_time'");
4462 sq_pushstring(v, "set_time", -1);
4463 sq_newclosure(v, &LevelTime_set_time_wrapper, 0);
4464 if(SQ_FAILED(sq_createslot(v, -3))) {
4465 throw SquirrelError(v, "Couldn't register function 'set_time'");
4468 if(SQ_FAILED(sq_createslot(v, -3))) {
4469 throw SquirrelError(v, "Couldn't register class 'LevelTime'");
4474 } // end of namespace Scripting