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_reload_config_wrapper(HSQUIRRELVM vm)
208 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
209 sq_throwerror(vm, _SC("'reload_config' called without instance"));
212 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
215 _this->reload_config();
219 } catch(std::exception& e) {
220 sq_throwerror(vm, e.what());
223 sq_throwerror(vm, _SC("Unexpected exception while executing function 'reload_config'"));
229 static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm)
232 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
233 sq_throwerror(vm, _SC("'shake' called without instance"));
236 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
238 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
239 sq_throwerror(vm, _SC("Argument 1 not a float"));
243 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
244 sq_throwerror(vm, _SC("Argument 2 not a float"));
248 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
249 sq_throwerror(vm, _SC("Argument 3 not a float"));
254 _this->shake(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
258 } catch(std::exception& e) {
259 sq_throwerror(vm, e.what());
262 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'"));
268 static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm)
271 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
272 sq_throwerror(vm, _SC("'set_pos' called without instance"));
275 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
277 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
278 sq_throwerror(vm, _SC("Argument 1 not a float"));
282 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
283 sq_throwerror(vm, _SC("Argument 2 not a float"));
288 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
292 } catch(std::exception& e) {
293 sq_throwerror(vm, e.what());
296 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
302 static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm)
305 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
306 sq_throwerror(vm, _SC("'set_mode' called without instance"));
309 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
311 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
312 sq_throwerror(vm, _SC("Argument 1 not a string"));
317 _this->set_mode(arg0);
321 } catch(std::exception& e) {
322 sq_throwerror(vm, e.what());
325 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_mode'"));
331 static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm)
334 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
335 sq_throwerror(vm, _SC("'scroll_to' called without instance"));
338 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
340 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
341 sq_throwerror(vm, _SC("Argument 1 not a float"));
345 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
346 sq_throwerror(vm, _SC("Argument 2 not a float"));
350 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
351 sq_throwerror(vm, _SC("Argument 3 not a float"));
356 _this->scroll_to(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
360 } catch(std::exception& e) {
361 sq_throwerror(vm, e.what());
364 sq_throwerror(vm, _SC("Unexpected exception while executing function 'scroll_to'"));
370 static SQInteger Level_release_hook(SQUserPointer ptr, SQInteger )
372 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
377 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
380 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
381 sq_throwerror(vm, _SC("'finish' called without instance"));
384 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
386 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
387 sq_throwerror(vm, _SC("Argument 1 not a bool"));
392 _this->finish(arg0 == SQTrue);
396 } catch(std::exception& e) {
397 sq_throwerror(vm, e.what());
400 sq_throwerror(vm, _SC("Unexpected exception while executing function 'finish'"));
406 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
409 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
410 sq_throwerror(vm, _SC("'spawn' called without instance"));
413 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
415 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
416 sq_throwerror(vm, _SC("Argument 1 not a string"));
420 if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
421 sq_throwerror(vm, _SC("Argument 2 not a string"));
426 _this->spawn(arg0, arg1);
430 } catch(std::exception& e) {
431 sq_throwerror(vm, e.what());
434 sq_throwerror(vm, _SC("Unexpected exception while executing function 'spawn'"));
440 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
443 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
444 sq_throwerror(vm, _SC("'flip_vertically' called without instance"));
447 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
450 _this->flip_vertically();
454 } catch(std::exception& e) {
455 sq_throwerror(vm, e.what());
458 sq_throwerror(vm, _SC("Unexpected exception while executing function 'flip_vertically'"));
464 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
467 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
468 sq_throwerror(vm, _SC("'toggle_pause' called without instance"));
471 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
474 _this->toggle_pause();
478 } catch(std::exception& e) {
479 sq_throwerror(vm, e.what());
482 sq_throwerror(vm, _SC("Unexpected exception while executing function 'toggle_pause'"));
488 static SQInteger Level_edit_wrapper(HSQUIRRELVM vm)
491 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
492 sq_throwerror(vm, _SC("'edit' called without instance"));
495 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
497 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
498 sq_throwerror(vm, _SC("Argument 1 not a bool"));
503 _this->edit(arg0 == SQTrue);
507 } catch(std::exception& e) {
508 sq_throwerror(vm, e.what());
511 sq_throwerror(vm, _SC("Unexpected exception while executing function 'edit'"));
517 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
519 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
524 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
527 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
528 sq_throwerror(vm, _SC("'set_action' called without instance"));
531 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
533 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
534 sq_throwerror(vm, _SC("Argument 1 not a string"));
539 _this->set_action(arg0);
543 } catch(std::exception& e) {
544 sq_throwerror(vm, e.what());
547 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
553 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
556 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
557 sq_throwerror(vm, _SC("'get_action' called without instance"));
560 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
563 std::string return_value = _this->get_action();
565 sq_pushstring(vm, return_value.c_str(), return_value.size());
568 } catch(std::exception& e) {
569 sq_throwerror(vm, e.what());
572 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
578 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
581 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
582 sq_throwerror(vm, _SC("'move' called without instance"));
585 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
587 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
588 sq_throwerror(vm, _SC("Argument 1 not a float"));
592 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
593 sq_throwerror(vm, _SC("Argument 2 not a float"));
598 _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
602 } catch(std::exception& e) {
603 sq_throwerror(vm, e.what());
606 sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
612 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
615 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
616 sq_throwerror(vm, _SC("'set_pos' called without instance"));
619 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
621 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
622 sq_throwerror(vm, _SC("Argument 1 not a float"));
626 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
627 sq_throwerror(vm, _SC("Argument 2 not a float"));
632 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
636 } catch(std::exception& e) {
637 sq_throwerror(vm, e.what());
640 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
646 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
649 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
650 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
653 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
656 float return_value = _this->get_pos_x();
658 sq_pushfloat(vm, return_value);
661 } catch(std::exception& e) {
662 sq_throwerror(vm, e.what());
665 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
671 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
674 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
675 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
678 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
681 float return_value = _this->get_pos_y();
683 sq_pushfloat(vm, return_value);
686 } catch(std::exception& e) {
687 sq_throwerror(vm, e.what());
690 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
696 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
699 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
700 sq_throwerror(vm, _SC("'set_velocity' called without instance"));
703 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
705 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
706 sq_throwerror(vm, _SC("Argument 1 not a float"));
710 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
711 sq_throwerror(vm, _SC("Argument 2 not a float"));
716 _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
720 } catch(std::exception& e) {
721 sq_throwerror(vm, e.what());
724 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
730 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
733 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
734 sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
737 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
740 float return_value = _this->get_velocity_x();
742 sq_pushfloat(vm, return_value);
745 } catch(std::exception& e) {
746 sq_throwerror(vm, e.what());
749 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
755 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
758 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
759 sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
762 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
765 float return_value = _this->get_velocity_y();
767 sq_pushfloat(vm, return_value);
770 } catch(std::exception& e) {
771 sq_throwerror(vm, e.what());
774 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
780 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
783 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
784 sq_throwerror(vm, _SC("'set_visible' called without instance"));
787 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
789 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
790 sq_throwerror(vm, _SC("Argument 1 not a bool"));
795 _this->set_visible(arg0 == SQTrue);
799 } catch(std::exception& e) {
800 sq_throwerror(vm, e.what());
803 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
809 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
812 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
813 sq_throwerror(vm, _SC("'is_visible' called without instance"));
816 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
819 bool return_value = _this->is_visible();
821 sq_pushbool(vm, return_value);
824 } catch(std::exception& e) {
825 sq_throwerror(vm, e.what());
828 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
834 static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm)
837 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
838 sq_throwerror(vm, _SC("'set_solid' called without instance"));
841 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
843 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
844 sq_throwerror(vm, _SC("Argument 1 not a bool"));
849 _this->set_solid(arg0 == SQTrue);
853 } catch(std::exception& e) {
854 sq_throwerror(vm, e.what());
857 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_solid'"));
863 static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm)
866 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
867 sq_throwerror(vm, _SC("'is_solid' called without instance"));
870 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
873 bool return_value = _this->is_solid();
875 sq_pushbool(vm, return_value);
878 } catch(std::exception& e) {
879 sq_throwerror(vm, e.what());
882 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_solid'"));
888 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
891 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
892 sq_throwerror(vm, _SC("'get_name' called without instance"));
895 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
898 std::string return_value = _this->get_name();
900 sq_pushstring(vm, return_value.c_str(), return_value.size());
903 } catch(std::exception& e) {
904 sq_throwerror(vm, e.what());
907 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
913 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
915 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
920 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
923 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
924 sq_throwerror(vm, _SC("'set_text' called without instance"));
927 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
929 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
930 sq_throwerror(vm, _SC("Argument 1 not a string"));
935 _this->set_text(arg0);
939 } catch(std::exception& e) {
940 sq_throwerror(vm, e.what());
943 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
949 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
952 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
953 sq_throwerror(vm, _SC("'set_font' called without instance"));
956 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
958 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
959 sq_throwerror(vm, _SC("Argument 1 not a string"));
964 _this->set_font(arg0);
968 } catch(std::exception& e) {
969 sq_throwerror(vm, e.what());
972 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
978 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
981 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
982 sq_throwerror(vm, _SC("'fade_in' called without instance"));
985 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
987 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
988 sq_throwerror(vm, _SC("Argument 1 not a float"));
993 _this->fade_in(static_cast<float> (arg0));
997 } catch(std::exception& e) {
998 sq_throwerror(vm, e.what());
1001 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
1007 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
1010 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1011 sq_throwerror(vm, _SC("'fade_out' called without instance"));
1014 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1016 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1017 sq_throwerror(vm, _SC("Argument 1 not a float"));
1022 _this->fade_out(static_cast<float> (arg0));
1026 } catch(std::exception& e) {
1027 sq_throwerror(vm, e.what());
1030 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
1036 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
1039 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1040 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1043 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1045 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1046 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1051 _this->set_visible(arg0 == SQTrue);
1055 } catch(std::exception& e) {
1056 sq_throwerror(vm, e.what());
1059 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1065 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
1068 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1069 sq_throwerror(vm, _SC("'set_centered' called without instance"));
1072 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1074 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1075 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1080 _this->set_centered(arg0 == SQTrue);
1084 } catch(std::exception& e) {
1085 sq_throwerror(vm, e.what());
1088 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
1094 static SQInteger Text_set_pos_wrapper(HSQUIRRELVM vm)
1097 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1098 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1101 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1103 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1104 sq_throwerror(vm, _SC("Argument 1 not a float"));
1108 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1109 sq_throwerror(vm, _SC("Argument 2 not a float"));
1114 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1118 } catch(std::exception& e) {
1119 sq_throwerror(vm, e.what());
1122 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1128 static SQInteger Text_get_pos_x_wrapper(HSQUIRRELVM vm)
1131 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1132 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1135 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1138 float return_value = _this->get_pos_x();
1140 sq_pushfloat(vm, return_value);
1143 } catch(std::exception& e) {
1144 sq_throwerror(vm, e.what());
1147 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1153 static SQInteger Text_get_pos_y_wrapper(HSQUIRRELVM vm)
1156 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1157 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1160 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1163 float return_value = _this->get_pos_y();
1165 sq_pushfloat(vm, return_value);
1168 } catch(std::exception& e) {
1169 sq_throwerror(vm, e.what());
1172 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1178 static SQInteger Text_set_anchor_point_wrapper(HSQUIRRELVM vm)
1181 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1182 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1185 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1187 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1188 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1193 _this->set_anchor_point(static_cast<int> (arg0));
1197 } catch(std::exception& e) {
1198 sq_throwerror(vm, e.what());
1201 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1207 static SQInteger Text_get_anchor_point_wrapper(HSQUIRRELVM vm)
1210 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1211 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1214 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1217 int return_value = _this->get_anchor_point();
1219 sq_pushinteger(vm, return_value);
1222 } catch(std::exception& e) {
1223 sq_throwerror(vm, e.what());
1226 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1232 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
1234 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
1239 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
1242 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1243 sq_throwerror(vm, _SC("'add_bonus' called without instance"));
1246 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1248 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1249 sq_throwerror(vm, _SC("Argument 1 not a string"));
1254 bool return_value = _this->add_bonus(arg0);
1256 sq_pushbool(vm, return_value);
1259 } catch(std::exception& e) {
1260 sq_throwerror(vm, e.what());
1263 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1269 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
1272 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1273 sq_throwerror(vm, _SC("'add_coins' called without instance"));
1276 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1278 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1279 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1284 _this->add_coins(static_cast<int> (arg0));
1288 } catch(std::exception& e) {
1289 sq_throwerror(vm, e.what());
1292 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1298 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1301 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1302 sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1305 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1308 _this->make_invincible();
1312 } catch(std::exception& e) {
1313 sq_throwerror(vm, e.what());
1316 sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1322 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1325 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1326 sq_throwerror(vm, _SC("'deactivate' called without instance"));
1329 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1332 _this->deactivate();
1336 } catch(std::exception& e) {
1337 sq_throwerror(vm, e.what());
1340 sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1346 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1349 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1350 sq_throwerror(vm, _SC("'activate' called without instance"));
1353 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1360 } catch(std::exception& e) {
1361 sq_throwerror(vm, e.what());
1364 sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1370 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1373 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1374 sq_throwerror(vm, _SC("'walk' called without instance"));
1377 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1379 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1380 sq_throwerror(vm, _SC("Argument 1 not a float"));
1385 _this->walk(static_cast<float> (arg0));
1389 } catch(std::exception& e) {
1390 sq_throwerror(vm, e.what());
1393 sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1399 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1402 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1403 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1406 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1408 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1409 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1414 _this->set_visible(arg0 == SQTrue);
1418 } catch(std::exception& e) {
1419 sq_throwerror(vm, e.what());
1422 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1428 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1431 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1432 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1435 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1438 bool return_value = _this->get_visible();
1440 sq_pushbool(vm, return_value);
1443 } catch(std::exception& e) {
1444 sq_throwerror(vm, e.what());
1447 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1453 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1456 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1457 sq_throwerror(vm, _SC("'kill' called without instance"));
1460 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1462 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1463 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1468 _this->kill(arg0 == SQTrue);
1472 } catch(std::exception& e) {
1473 sq_throwerror(vm, e.what());
1476 sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1482 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1485 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1486 sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1489 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1491 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1492 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1497 _this->set_ghost_mode(arg0 == SQTrue);
1501 } catch(std::exception& e) {
1502 sq_throwerror(vm, e.what());
1505 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1511 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1514 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1515 sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1518 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1521 bool return_value = _this->get_ghost_mode();
1523 sq_pushbool(vm, return_value);
1526 } catch(std::exception& e) {
1527 sq_throwerror(vm, e.what());
1530 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1536 static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm)
1539 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1540 sq_throwerror(vm, _SC("'do_cheer' called without instance"));
1543 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1550 } catch(std::exception& e) {
1551 sq_throwerror(vm, e.what());
1554 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'"));
1560 static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm)
1563 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1564 sq_throwerror(vm, _SC("'do_duck' called without instance"));
1567 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1574 } catch(std::exception& e) {
1575 sq_throwerror(vm, e.what());
1578 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'"));
1584 static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm)
1587 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1588 sq_throwerror(vm, _SC("'do_standup' called without instance"));
1591 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1594 _this->do_standup();
1598 } catch(std::exception& e) {
1599 sq_throwerror(vm, e.what());
1602 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'"));
1608 static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm)
1611 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1612 sq_throwerror(vm, _SC("'do_backflip' called without instance"));
1615 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1618 _this->do_backflip();
1622 } catch(std::exception& e) {
1623 sq_throwerror(vm, e.what());
1626 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'"));
1632 static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm)
1635 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1636 sq_throwerror(vm, _SC("'do_jump' called without instance"));
1639 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1641 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1642 sq_throwerror(vm, _SC("Argument 1 not a float"));
1647 _this->do_jump(static_cast<float> (arg0));
1651 } catch(std::exception& e) {
1652 sq_throwerror(vm, e.what());
1655 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_jump'"));
1661 static SQInteger Player_trigger_sequence_wrapper(HSQUIRRELVM vm)
1664 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1665 sq_throwerror(vm, _SC("'trigger_sequence' called without instance"));
1668 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1670 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1671 sq_throwerror(vm, _SC("Argument 1 not a string"));
1676 _this->trigger_sequence(arg0);
1680 } catch(std::exception& e) {
1681 sq_throwerror(vm, e.what());
1684 sq_throwerror(vm, _SC("Unexpected exception while executing function 'trigger_sequence'"));
1690 static SQInteger Player_use_scripting_controller_wrapper(HSQUIRRELVM vm)
1693 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1694 sq_throwerror(vm, _SC("'use_scripting_controller' called without instance"));
1697 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1699 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1700 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1705 _this->use_scripting_controller(arg0 == SQTrue);
1709 } catch(std::exception& e) {
1710 sq_throwerror(vm, e.what());
1713 sq_throwerror(vm, _SC("Unexpected exception while executing function 'use_scripting_controller'"));
1719 static SQInteger Player_do_scripting_controller_wrapper(HSQUIRRELVM vm)
1722 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1723 sq_throwerror(vm, _SC("'do_scripting_controller' called without instance"));
1726 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1728 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1729 sq_throwerror(vm, _SC("Argument 1 not a string"));
1733 if(SQ_FAILED(sq_getbool(vm, 3, &arg1))) {
1734 sq_throwerror(vm, _SC("Argument 2 not a bool"));
1739 _this->do_scripting_controller(arg0, arg1 == SQTrue);
1743 } catch(std::exception& e) {
1744 sq_throwerror(vm, e.what());
1747 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_scripting_controller'"));
1753 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1755 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1760 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1763 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1764 sq_throwerror(vm, _SC("Argument 1 not a string"));
1769 Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1770 if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1771 sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1774 sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1778 } catch(std::exception& e) {
1779 sq_throwerror(vm, e.what());
1782 sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1788 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1791 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1792 sq_throwerror(vm, _SC("'set_layer' called without instance"));
1795 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1797 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1798 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1803 _this->set_layer(static_cast<int> (arg0));
1807 } catch(std::exception& e) {
1808 sq_throwerror(vm, e.what());
1811 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1817 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1820 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1821 sq_throwerror(vm, _SC("'get_layer' called without instance"));
1824 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1827 int return_value = _this->get_layer();
1829 sq_pushinteger(vm, return_value);
1832 } catch(std::exception& e) {
1833 sq_throwerror(vm, e.what());
1836 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1842 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1845 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1846 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1849 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1851 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1852 sq_throwerror(vm, _SC("Argument 1 not a float"));
1856 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1857 sq_throwerror(vm, _SC("Argument 2 not a float"));
1862 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1866 } catch(std::exception& e) {
1867 sq_throwerror(vm, e.what());
1870 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1876 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1879 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1880 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1883 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1886 float return_value = _this->get_pos_x();
1888 sq_pushfloat(vm, return_value);
1891 } catch(std::exception& e) {
1892 sq_throwerror(vm, e.what());
1895 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1901 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1904 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1905 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1908 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1911 float return_value = _this->get_pos_y();
1913 sq_pushfloat(vm, return_value);
1916 } catch(std::exception& e) {
1917 sq_throwerror(vm, e.what());
1920 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1926 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1929 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1930 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1933 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1935 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1936 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1941 _this->set_anchor_point(static_cast<int> (arg0));
1945 } catch(std::exception& e) {
1946 sq_throwerror(vm, e.what());
1949 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1955 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1958 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1959 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1962 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1965 int return_value = _this->get_anchor_point();
1967 sq_pushinteger(vm, return_value);
1970 } catch(std::exception& e) {
1971 sq_throwerror(vm, e.what());
1974 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1980 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1983 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1984 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1987 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1989 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1990 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1995 _this->set_visible(arg0 == SQTrue);
1999 } catch(std::exception& e) {
2000 sq_throwerror(vm, e.what());
2003 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
2009 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
2012 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2013 sq_throwerror(vm, _SC("'get_visible' called without instance"));
2016 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
2019 bool return_value = _this->get_visible();
2021 sq_pushbool(vm, return_value);
2024 } catch(std::exception& e) {
2025 sq_throwerror(vm, e.what());
2028 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
2034 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
2037 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2038 sq_throwerror(vm, _SC("'set_action' called without instance"));
2041 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
2043 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2044 sq_throwerror(vm, _SC("Argument 1 not a string"));
2049 _this->set_action(arg0);
2053 } catch(std::exception& e) {
2054 sq_throwerror(vm, e.what());
2057 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
2063 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
2066 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2067 sq_throwerror(vm, _SC("'get_action' called without instance"));
2070 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
2073 std::string return_value = _this->get_action();
2075 sq_pushstring(vm, return_value.c_str(), return_value.size());
2078 } catch(std::exception& e) {
2079 sq_throwerror(vm, e.what());
2082 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
2088 static SQInteger FloatingImage_fade_in_wrapper(HSQUIRRELVM vm)
2091 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2092 sq_throwerror(vm, _SC("'fade_in' called without instance"));
2095 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
2097 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2098 sq_throwerror(vm, _SC("Argument 1 not a float"));
2103 _this->fade_in(static_cast<float> (arg0));
2107 } catch(std::exception& e) {
2108 sq_throwerror(vm, e.what());
2111 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
2117 static SQInteger FloatingImage_fade_out_wrapper(HSQUIRRELVM vm)
2120 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2121 sq_throwerror(vm, _SC("'fade_out' called without instance"));
2124 Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
2126 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2127 sq_throwerror(vm, _SC("Argument 1 not a float"));
2132 _this->fade_out(static_cast<float> (arg0));
2136 } catch(std::exception& e) {
2137 sq_throwerror(vm, e.what());
2140 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
2146 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
2148 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
2153 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
2156 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2157 sq_throwerror(vm, _SC("'goto_node' called without instance"));
2160 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
2162 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2163 sq_throwerror(vm, _SC("Argument 1 not an integer"));
2168 _this->goto_node(static_cast<int> (arg0));
2172 } catch(std::exception& e) {
2173 sq_throwerror(vm, e.what());
2176 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2182 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
2185 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2186 sq_throwerror(vm, _SC("'start_moving' called without instance"));
2189 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
2192 _this->start_moving();
2196 } catch(std::exception& e) {
2197 sq_throwerror(vm, e.what());
2200 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2206 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
2209 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2210 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2213 Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
2216 _this->stop_moving();
2220 } catch(std::exception& e) {
2221 sq_throwerror(vm, e.what());
2224 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2230 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
2232 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (ptr);
2237 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
2240 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2241 sq_throwerror(vm, _SC("'get_burning' called without instance"));
2244 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
2247 bool return_value = _this->get_burning();
2249 sq_pushbool(vm, return_value);
2252 } catch(std::exception& e) {
2253 sq_throwerror(vm, e.what());
2256 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
2262 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
2265 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2266 sq_throwerror(vm, _SC("'set_burning' called without instance"));
2269 Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
2271 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2272 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2277 _this->set_burning(arg0 == SQTrue);
2281 } catch(std::exception& e) {
2282 sq_throwerror(vm, e.what());
2285 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_burning'"));
2291 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
2293 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (ptr);
2298 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
2301 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2302 sq_throwerror(vm, _SC("'start' called without instance"));
2305 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
2312 } catch(std::exception& e) {
2313 sq_throwerror(vm, e.what());
2316 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2322 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
2325 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2326 sq_throwerror(vm, _SC("'stop' called without instance"));
2329 Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
2336 } catch(std::exception& e) {
2337 sq_throwerror(vm, e.what());
2340 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2346 static SQInteger AmbientSound_release_hook(SQUserPointer ptr, SQInteger )
2348 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (ptr);
2353 static SQInteger AmbientSound_set_pos_wrapper(HSQUIRRELVM vm)
2356 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2357 sq_throwerror(vm, _SC("'set_pos' called without instance"));
2360 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2362 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2363 sq_throwerror(vm, _SC("Argument 1 not a float"));
2367 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2368 sq_throwerror(vm, _SC("Argument 2 not a float"));
2373 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
2377 } catch(std::exception& e) {
2378 sq_throwerror(vm, e.what());
2381 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
2387 static SQInteger AmbientSound_get_pos_x_wrapper(HSQUIRRELVM vm)
2390 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2391 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
2394 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2397 float return_value = _this->get_pos_x();
2399 sq_pushfloat(vm, return_value);
2402 } catch(std::exception& e) {
2403 sq_throwerror(vm, e.what());
2406 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
2412 static SQInteger AmbientSound_get_pos_y_wrapper(HSQUIRRELVM vm)
2415 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2416 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
2419 Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2422 float return_value = _this->get_pos_y();
2424 sq_pushfloat(vm, return_value);
2427 } catch(std::exception& e) {
2428 sq_throwerror(vm, e.what());
2431 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
2437 static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger )
2439 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (ptr);
2444 static SQInteger Thunderstorm_start_wrapper(HSQUIRRELVM vm)
2447 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2448 sq_throwerror(vm, _SC("'start' called without instance"));
2451 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2458 } catch(std::exception& e) {
2459 sq_throwerror(vm, e.what());
2462 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2468 static SQInteger Thunderstorm_stop_wrapper(HSQUIRRELVM vm)
2471 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2472 sq_throwerror(vm, _SC("'stop' called without instance"));
2475 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2482 } catch(std::exception& e) {
2483 sq_throwerror(vm, e.what());
2486 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2492 static SQInteger Thunderstorm_thunder_wrapper(HSQUIRRELVM vm)
2495 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2496 sq_throwerror(vm, _SC("'thunder' called without instance"));
2499 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2506 } catch(std::exception& e) {
2507 sq_throwerror(vm, e.what());
2510 sq_throwerror(vm, _SC("Unexpected exception while executing function 'thunder'"));
2516 static SQInteger Thunderstorm_lightning_wrapper(HSQUIRRELVM vm)
2519 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2520 sq_throwerror(vm, _SC("'lightning' called without instance"));
2523 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2530 } catch(std::exception& e) {
2531 sq_throwerror(vm, e.what());
2534 sq_throwerror(vm, _SC("Unexpected exception while executing function 'lightning'"));
2540 static SQInteger Thunderstorm_flash_wrapper(HSQUIRRELVM vm)
2543 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2544 sq_throwerror(vm, _SC("'flash' called without instance"));
2547 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2554 } catch(std::exception& e) {
2555 sq_throwerror(vm, e.what());
2558 sq_throwerror(vm, _SC("Unexpected exception while executing function 'flash'"));
2564 static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm)
2567 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2568 sq_throwerror(vm, _SC("'electrify' called without instance"));
2571 Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2578 } catch(std::exception& e) {
2579 sq_throwerror(vm, e.what());
2582 sq_throwerror(vm, _SC("Unexpected exception while executing function 'electrify'"));
2588 static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger )
2590 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (ptr);
2595 static SQInteger TileMap_goto_node_wrapper(HSQUIRRELVM vm)
2598 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2599 sq_throwerror(vm, _SC("'goto_node' called without instance"));
2602 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2604 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2605 sq_throwerror(vm, _SC("Argument 1 not an integer"));
2610 _this->goto_node(static_cast<int> (arg0));
2614 } catch(std::exception& e) {
2615 sq_throwerror(vm, e.what());
2618 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2624 static SQInteger TileMap_start_moving_wrapper(HSQUIRRELVM vm)
2627 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2628 sq_throwerror(vm, _SC("'start_moving' called without instance"));
2631 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2634 _this->start_moving();
2638 } catch(std::exception& e) {
2639 sq_throwerror(vm, e.what());
2642 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2648 static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm)
2651 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2652 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2655 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2658 _this->stop_moving();
2662 } catch(std::exception& e) {
2663 sq_throwerror(vm, e.what());
2666 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2672 static SQInteger TileMap_fade_wrapper(HSQUIRRELVM vm)
2675 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2676 sq_throwerror(vm, _SC("'fade' called without instance"));
2679 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2681 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2682 sq_throwerror(vm, _SC("Argument 1 not a float"));
2686 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2687 sq_throwerror(vm, _SC("Argument 2 not a float"));
2692 _this->fade(static_cast<float> (arg0), static_cast<float> (arg1));
2696 } catch(std::exception& e) {
2697 sq_throwerror(vm, e.what());
2700 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade'"));
2706 static SQInteger TileMap_set_alpha_wrapper(HSQUIRRELVM vm)
2709 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2710 sq_throwerror(vm, _SC("'set_alpha' called without instance"));
2713 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2715 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2716 sq_throwerror(vm, _SC("Argument 1 not a float"));
2721 _this->set_alpha(static_cast<float> (arg0));
2725 } catch(std::exception& e) {
2726 sq_throwerror(vm, e.what());
2729 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_alpha'"));
2735 static SQInteger TileMap_get_alpha_wrapper(HSQUIRRELVM vm)
2738 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2739 sq_throwerror(vm, _SC("'get_alpha' called without instance"));
2742 Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2745 float return_value = _this->get_alpha();
2747 sq_pushfloat(vm, return_value);
2750 } catch(std::exception& e) {
2751 sq_throwerror(vm, e.what());
2754 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_alpha'"));
2760 static SQInteger SSector_release_hook(SQUserPointer ptr, SQInteger )
2762 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (ptr);
2767 static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm)
2770 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2771 sq_throwerror(vm, _SC("'set_ambient_light' called without instance"));
2774 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2776 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2777 sq_throwerror(vm, _SC("Argument 1 not a float"));
2781 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2782 sq_throwerror(vm, _SC("Argument 2 not a float"));
2786 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2787 sq_throwerror(vm, _SC("Argument 3 not a float"));
2792 _this->set_ambient_light(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2796 } catch(std::exception& e) {
2797 sq_throwerror(vm, e.what());
2800 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ambient_light'"));
2806 static SQInteger SSector_get_ambient_red_wrapper(HSQUIRRELVM vm)
2809 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2810 sq_throwerror(vm, _SC("'get_ambient_red' called without instance"));
2813 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2816 float return_value = _this->get_ambient_red();
2818 sq_pushfloat(vm, return_value);
2821 } catch(std::exception& e) {
2822 sq_throwerror(vm, e.what());
2825 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_red'"));
2831 static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm)
2834 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2835 sq_throwerror(vm, _SC("'get_ambient_green' called without instance"));
2838 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2841 float return_value = _this->get_ambient_green();
2843 sq_pushfloat(vm, return_value);
2846 } catch(std::exception& e) {
2847 sq_throwerror(vm, e.what());
2850 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_green'"));
2856 static SQInteger SSector_get_ambient_blue_wrapper(HSQUIRRELVM vm)
2859 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2860 sq_throwerror(vm, _SC("'get_ambient_blue' called without instance"));
2863 Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2866 float return_value = _this->get_ambient_blue();
2868 sq_pushfloat(vm, return_value);
2871 } catch(std::exception& e) {
2872 sq_throwerror(vm, e.what());
2875 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_blue'"));
2881 static SQInteger LevelTime_release_hook(SQUserPointer ptr, SQInteger )
2883 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (ptr);
2888 static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm)
2891 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2892 sq_throwerror(vm, _SC("'start' called without instance"));
2895 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2902 } catch(std::exception& e) {
2903 sq_throwerror(vm, e.what());
2906 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2912 static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm)
2915 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2916 sq_throwerror(vm, _SC("'stop' called without instance"));
2919 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2926 } catch(std::exception& e) {
2927 sq_throwerror(vm, e.what());
2930 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2936 static SQInteger LevelTime_get_time_wrapper(HSQUIRRELVM vm)
2939 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2940 sq_throwerror(vm, _SC("'get_time' called without instance"));
2943 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2946 float return_value = _this->get_time();
2948 sq_pushfloat(vm, return_value);
2951 } catch(std::exception& e) {
2952 sq_throwerror(vm, e.what());
2955 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_time'"));
2961 static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm)
2964 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2965 sq_throwerror(vm, _SC("'set_time' called without instance"));
2968 Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2970 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2971 sq_throwerror(vm, _SC("Argument 1 not a float"));
2976 _this->set_time(static_cast<float> (arg0));
2980 } catch(std::exception& e) {
2981 sq_throwerror(vm, e.what());
2984 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_time'"));
2990 static SQInteger WillOWisp_release_hook(SQUserPointer ptr, SQInteger )
2992 Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (ptr);
2997 static SQInteger WillOWisp_goto_node_wrapper(HSQUIRRELVM vm)
3000 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
3001 sq_throwerror(vm, _SC("'goto_node' called without instance"));
3004 Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3006 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
3007 sq_throwerror(vm, _SC("Argument 1 not an integer"));
3012 _this->goto_node(static_cast<int> (arg0));
3016 } catch(std::exception& e) {
3017 sq_throwerror(vm, e.what());
3020 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
3026 static SQInteger WillOWisp_set_state_wrapper(HSQUIRRELVM vm)
3029 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
3030 sq_throwerror(vm, _SC("'set_state' called without instance"));
3033 Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3035 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3036 sq_throwerror(vm, _SC("Argument 1 not a string"));
3041 _this->set_state(arg0);
3045 } catch(std::exception& e) {
3046 sq_throwerror(vm, e.what());
3049 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_state'"));
3055 static SQInteger WillOWisp_start_moving_wrapper(HSQUIRRELVM vm)
3058 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
3059 sq_throwerror(vm, _SC("'start_moving' called without instance"));
3062 Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3065 _this->start_moving();
3069 } catch(std::exception& e) {
3070 sq_throwerror(vm, e.what());
3073 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
3079 static SQInteger WillOWisp_stop_moving_wrapper(HSQUIRRELVM vm)
3082 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
3083 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
3086 Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
3089 _this->stop_moving();
3093 } catch(std::exception& e) {
3094 sq_throwerror(vm, e.what());
3097 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
3103 static SQInteger display_wrapper(HSQUIRRELVM vm)
3105 return Scripting::display(vm);
3108 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
3110 HSQUIRRELVM arg0 = vm;
3113 Scripting::print_stacktrace(arg0);
3117 } catch(std::exception& e) {
3118 sq_throwerror(vm, e.what());
3121 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
3127 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
3129 return Scripting::get_current_thread(vm);
3132 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
3135 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3136 sq_throwerror(vm, _SC("Argument 1 not a string"));
3141 Scripting::display_text_file(arg0);
3145 } catch(std::exception& e) {
3146 sq_throwerror(vm, e.what());
3149 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
3155 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
3158 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3159 sq_throwerror(vm, _SC("Argument 1 not a string"));
3164 Scripting::load_worldmap(arg0);
3168 } catch(std::exception& e) {
3169 sq_throwerror(vm, e.what());
3172 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
3178 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
3181 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3182 sq_throwerror(vm, _SC("Argument 1 not a string"));
3187 Scripting::load_level(arg0);
3191 } catch(std::exception& e) {
3192 sq_throwerror(vm, e.what());
3195 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
3201 static SQInteger wait_wrapper(HSQUIRRELVM vm)
3203 HSQUIRRELVM arg0 = vm;
3205 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
3206 sq_throwerror(vm, _SC("Argument 1 not a float"));
3211 Scripting::wait(arg0, static_cast<float> (arg1));
3213 return sq_suspendvm(vm);
3215 } catch(std::exception& e) {
3216 sq_throwerror(vm, e.what());
3219 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
3225 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
3227 HSQUIRRELVM arg0 = vm;
3230 Scripting::wait_for_screenswitch(arg0);
3232 return sq_suspendvm(vm);
3234 } catch(std::exception& e) {
3235 sq_throwerror(vm, e.what());
3238 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
3244 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
3249 Scripting::exit_screen();
3253 } catch(std::exception& e) {
3254 sq_throwerror(vm, e.what());
3257 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
3263 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
3266 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3267 sq_throwerror(vm, _SC("Argument 1 not a float"));
3272 Scripting::fadeout_screen(static_cast<float> (arg0));
3276 } catch(std::exception& e) {
3277 sq_throwerror(vm, e.what());
3280 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
3286 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
3289 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3290 sq_throwerror(vm, _SC("Argument 1 not a float"));
3294 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
3295 sq_throwerror(vm, _SC("Argument 2 not a float"));
3299 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
3300 sq_throwerror(vm, _SC("Argument 3 not a float"));
3305 Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
3309 } catch(std::exception& e) {
3310 sq_throwerror(vm, e.what());
3313 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
3319 static SQInteger abort_screenfade_wrapper(HSQUIRRELVM vm)
3324 Scripting::abort_screenfade();
3328 } catch(std::exception& e) {
3329 sq_throwerror(vm, e.what());
3332 sq_throwerror(vm, _SC("Unexpected exception while executing function 'abort_screenfade'"));
3338 static SQInteger translate_wrapper(HSQUIRRELVM vm)
3341 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3342 sq_throwerror(vm, _SC("Argument 1 not a string"));
3347 std::string return_value = Scripting::translate(arg0);
3349 sq_pushstring(vm, return_value.c_str(), return_value.size());
3352 } catch(std::exception& e) {
3353 sq_throwerror(vm, e.what());
3356 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
3362 static SQInteger import_wrapper(HSQUIRRELVM vm)
3364 HSQUIRRELVM arg0 = vm;
3366 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
3367 sq_throwerror(vm, _SC("Argument 1 not a string"));
3372 Scripting::import(arg0, arg1);
3376 } catch(std::exception& e) {
3377 sq_throwerror(vm, e.what());
3380 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
3386 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
3391 Scripting::save_state();
3395 } catch(std::exception& e) {
3396 sq_throwerror(vm, e.what());
3399 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
3405 static SQInteger update_worldmap_wrapper(HSQUIRRELVM vm)
3410 Scripting::update_worldmap();
3414 } catch(std::exception& e) {
3415 sq_throwerror(vm, e.what());
3418 sq_throwerror(vm, _SC("Unexpected exception while executing function 'update_worldmap'"));
3424 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
3427 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3428 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3433 Scripting::debug_collrects(arg0 == SQTrue);
3437 } catch(std::exception& e) {
3438 sq_throwerror(vm, e.what());
3441 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
3447 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
3450 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3451 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3456 Scripting::debug_show_fps(arg0 == SQTrue);
3460 } catch(std::exception& e) {
3461 sq_throwerror(vm, e.what());
3464 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
3470 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
3473 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3474 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3479 Scripting::debug_draw_solids_only(arg0 == SQTrue);
3483 } catch(std::exception& e) {
3484 sq_throwerror(vm, e.what());
3487 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
3493 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
3496 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3497 sq_throwerror(vm, _SC("Argument 1 not a string"));
3502 Scripting::play_music(arg0);
3506 } catch(std::exception& e) {
3507 sq_throwerror(vm, e.what());
3510 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
3516 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
3519 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3520 sq_throwerror(vm, _SC("Argument 1 not a string"));
3525 Scripting::play_sound(arg0);
3529 } catch(std::exception& e) {
3530 sq_throwerror(vm, e.what());
3533 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
3539 static SQInteger grease_wrapper(HSQUIRRELVM vm)
3544 Scripting::grease();
3548 } catch(std::exception& e) {
3549 sq_throwerror(vm, e.what());
3552 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
3558 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
3563 Scripting::invincible();
3567 } catch(std::exception& e) {
3568 sq_throwerror(vm, e.what());
3571 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
3577 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
3586 } catch(std::exception& e) {
3587 sq_throwerror(vm, e.what());
3590 sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
3596 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
3601 Scripting::mortal();
3605 } catch(std::exception& e) {
3606 sq_throwerror(vm, e.what());
3609 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
3615 static SQInteger restart_wrapper(HSQUIRRELVM vm)
3620 Scripting::restart();
3624 } catch(std::exception& e) {
3625 sq_throwerror(vm, e.what());
3628 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
3634 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
3639 Scripting::whereami();
3643 } catch(std::exception& e) {
3644 sq_throwerror(vm, e.what());
3647 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
3653 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
3658 Scripting::gotoend();
3662 } catch(std::exception& e) {
3663 sq_throwerror(vm, e.what());
3666 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
3672 static SQInteger camera_wrapper(HSQUIRRELVM vm)
3677 Scripting::camera();
3681 } catch(std::exception& e) {
3682 sq_throwerror(vm, e.what());
3685 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
3691 static SQInteger quit_wrapper(HSQUIRRELVM vm)
3700 } catch(std::exception& e) {
3701 sq_throwerror(vm, e.what());
3704 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
3710 static SQInteger rand_wrapper(HSQUIRRELVM vm)
3714 int return_value = Scripting::rand();
3716 sq_pushinteger(vm, return_value);
3719 } catch(std::exception& e) {
3720 sq_throwerror(vm, e.what());
3723 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
3729 } // end of namespace Wrapper
3730 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
3732 using namespace Wrapper;
3734 sq_pushroottable(v);
3735 sq_pushstring(v, "DisplayEffect", -1);
3736 if(SQ_FAILED(sq_get(v, -2))) {
3737 std::ostringstream msg;
3738 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
3739 throw SquirrelError(v, msg.str());
3742 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3743 std::ostringstream msg;
3744 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
3745 throw SquirrelError(v, msg.str());
3747 sq_remove(v, -2); // remove object name
3749 if(setup_releasehook) {
3750 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
3753 sq_remove(v, -2); // remove root table
3756 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
3758 using namespace Wrapper;
3760 sq_pushroottable(v);
3761 sq_pushstring(v, "Camera", -1);
3762 if(SQ_FAILED(sq_get(v, -2))) {
3763 std::ostringstream msg;
3764 msg << "Couldn't resolved squirrel type 'Camera'";
3765 throw SquirrelError(v, msg.str());
3768 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3769 std::ostringstream msg;
3770 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
3771 throw SquirrelError(v, msg.str());
3773 sq_remove(v, -2); // remove object name
3775 if(setup_releasehook) {
3776 sq_setreleasehook(v, -1, Camera_release_hook);
3779 sq_remove(v, -2); // remove root table
3782 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
3784 using namespace Wrapper;
3786 sq_pushroottable(v);
3787 sq_pushstring(v, "Level", -1);
3788 if(SQ_FAILED(sq_get(v, -2))) {
3789 std::ostringstream msg;
3790 msg << "Couldn't resolved squirrel type 'Level'";
3791 throw SquirrelError(v, msg.str());
3794 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3795 std::ostringstream msg;
3796 msg << "Couldn't setup squirrel instance for object of type 'Level'";
3797 throw SquirrelError(v, msg.str());
3799 sq_remove(v, -2); // remove object name
3801 if(setup_releasehook) {
3802 sq_setreleasehook(v, -1, Level_release_hook);
3805 sq_remove(v, -2); // remove root table
3808 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
3810 using namespace Wrapper;
3812 sq_pushroottable(v);
3813 sq_pushstring(v, "ScriptedObject", -1);
3814 if(SQ_FAILED(sq_get(v, -2))) {
3815 std::ostringstream msg;
3816 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
3817 throw SquirrelError(v, msg.str());
3820 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3821 std::ostringstream msg;
3822 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
3823 throw SquirrelError(v, msg.str());
3825 sq_remove(v, -2); // remove object name
3827 if(setup_releasehook) {
3828 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
3831 sq_remove(v, -2); // remove root table
3834 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
3836 using namespace Wrapper;
3838 sq_pushroottable(v);
3839 sq_pushstring(v, "Text", -1);
3840 if(SQ_FAILED(sq_get(v, -2))) {
3841 std::ostringstream msg;
3842 msg << "Couldn't resolved squirrel type 'Text'";
3843 throw SquirrelError(v, msg.str());
3846 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3847 std::ostringstream msg;
3848 msg << "Couldn't setup squirrel instance for object of type 'Text'";
3849 throw SquirrelError(v, msg.str());
3851 sq_remove(v, -2); // remove object name
3853 if(setup_releasehook) {
3854 sq_setreleasehook(v, -1, Text_release_hook);
3857 sq_remove(v, -2); // remove root table
3860 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
3862 using namespace Wrapper;
3864 sq_pushroottable(v);
3865 sq_pushstring(v, "Player", -1);
3866 if(SQ_FAILED(sq_get(v, -2))) {
3867 std::ostringstream msg;
3868 msg << "Couldn't resolved squirrel type 'Player'";
3869 throw SquirrelError(v, msg.str());
3872 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3873 std::ostringstream msg;
3874 msg << "Couldn't setup squirrel instance for object of type 'Player'";
3875 throw SquirrelError(v, msg.str());
3877 sq_remove(v, -2); // remove object name
3879 if(setup_releasehook) {
3880 sq_setreleasehook(v, -1, Player_release_hook);
3883 sq_remove(v, -2); // remove root table
3886 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
3888 using namespace Wrapper;
3890 sq_pushroottable(v);
3891 sq_pushstring(v, "FloatingImage", -1);
3892 if(SQ_FAILED(sq_get(v, -2))) {
3893 std::ostringstream msg;
3894 msg << "Couldn't resolved squirrel type 'FloatingImage'";
3895 throw SquirrelError(v, msg.str());
3898 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3899 std::ostringstream msg;
3900 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
3901 throw SquirrelError(v, msg.str());
3903 sq_remove(v, -2); // remove object name
3905 if(setup_releasehook) {
3906 sq_setreleasehook(v, -1, FloatingImage_release_hook);
3909 sq_remove(v, -2); // remove root table
3912 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
3914 using namespace Wrapper;
3916 sq_pushroottable(v);
3917 sq_pushstring(v, "Platform", -1);
3918 if(SQ_FAILED(sq_get(v, -2))) {
3919 std::ostringstream msg;
3920 msg << "Couldn't resolved squirrel type 'Platform'";
3921 throw SquirrelError(v, msg.str());
3924 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3925 std::ostringstream msg;
3926 msg << "Couldn't setup squirrel instance for object of type 'Platform'";
3927 throw SquirrelError(v, msg.str());
3929 sq_remove(v, -2); // remove object name
3931 if(setup_releasehook) {
3932 sq_setreleasehook(v, -1, Platform_release_hook);
3935 sq_remove(v, -2); // remove root table
3938 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
3940 using namespace Wrapper;
3942 sq_pushroottable(v);
3943 sq_pushstring(v, "Candle", -1);
3944 if(SQ_FAILED(sq_get(v, -2))) {
3945 std::ostringstream msg;
3946 msg << "Couldn't resolved squirrel type 'Candle'";
3947 throw SquirrelError(v, msg.str());
3950 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3951 std::ostringstream msg;
3952 msg << "Couldn't setup squirrel instance for object of type 'Candle'";
3953 throw SquirrelError(v, msg.str());
3955 sq_remove(v, -2); // remove object name
3957 if(setup_releasehook) {
3958 sq_setreleasehook(v, -1, Candle_release_hook);
3961 sq_remove(v, -2); // remove root table
3964 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
3966 using namespace Wrapper;
3968 sq_pushroottable(v);
3969 sq_pushstring(v, "Wind", -1);
3970 if(SQ_FAILED(sq_get(v, -2))) {
3971 std::ostringstream msg;
3972 msg << "Couldn't resolved squirrel type 'Wind'";
3973 throw SquirrelError(v, msg.str());
3976 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3977 std::ostringstream msg;
3978 msg << "Couldn't setup squirrel instance for object of type 'Wind'";
3979 throw SquirrelError(v, msg.str());
3981 sq_remove(v, -2); // remove object name
3983 if(setup_releasehook) {
3984 sq_setreleasehook(v, -1, Wind_release_hook);
3987 sq_remove(v, -2); // remove root table
3990 void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bool setup_releasehook)
3992 using namespace Wrapper;
3994 sq_pushroottable(v);
3995 sq_pushstring(v, "AmbientSound", -1);
3996 if(SQ_FAILED(sq_get(v, -2))) {
3997 std::ostringstream msg;
3998 msg << "Couldn't resolved squirrel type 'AmbientSound'";
3999 throw SquirrelError(v, msg.str());
4002 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4003 std::ostringstream msg;
4004 msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'";
4005 throw SquirrelError(v, msg.str());
4007 sq_remove(v, -2); // remove object name
4009 if(setup_releasehook) {
4010 sq_setreleasehook(v, -1, AmbientSound_release_hook);
4013 sq_remove(v, -2); // remove root table
4016 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Thunderstorm* object, bool setup_releasehook)
4018 using namespace Wrapper;
4020 sq_pushroottable(v);
4021 sq_pushstring(v, "Thunderstorm", -1);
4022 if(SQ_FAILED(sq_get(v, -2))) {
4023 std::ostringstream msg;
4024 msg << "Couldn't resolved squirrel type 'Thunderstorm'";
4025 throw SquirrelError(v, msg.str());
4028 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4029 std::ostringstream msg;
4030 msg << "Couldn't setup squirrel instance for object of type 'Thunderstorm'";
4031 throw SquirrelError(v, msg.str());
4033 sq_remove(v, -2); // remove object name
4035 if(setup_releasehook) {
4036 sq_setreleasehook(v, -1, Thunderstorm_release_hook);
4039 sq_remove(v, -2); // remove root table
4042 void create_squirrel_instance(HSQUIRRELVM v, Scripting::TileMap* object, bool setup_releasehook)
4044 using namespace Wrapper;
4046 sq_pushroottable(v);
4047 sq_pushstring(v, "TileMap", -1);
4048 if(SQ_FAILED(sq_get(v, -2))) {
4049 std::ostringstream msg;
4050 msg << "Couldn't resolved squirrel type 'TileMap'";
4051 throw SquirrelError(v, msg.str());
4054 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4055 std::ostringstream msg;
4056 msg << "Couldn't setup squirrel instance for object of type 'TileMap'";
4057 throw SquirrelError(v, msg.str());
4059 sq_remove(v, -2); // remove object name
4061 if(setup_releasehook) {
4062 sq_setreleasehook(v, -1, TileMap_release_hook);
4065 sq_remove(v, -2); // remove root table
4068 void create_squirrel_instance(HSQUIRRELVM v, Scripting::SSector* object, bool setup_releasehook)
4070 using namespace Wrapper;
4072 sq_pushroottable(v);
4073 sq_pushstring(v, "SSector", -1);
4074 if(SQ_FAILED(sq_get(v, -2))) {
4075 std::ostringstream msg;
4076 msg << "Couldn't resolved squirrel type 'SSector'";
4077 throw SquirrelError(v, msg.str());
4080 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4081 std::ostringstream msg;
4082 msg << "Couldn't setup squirrel instance for object of type 'SSector'";
4083 throw SquirrelError(v, msg.str());
4085 sq_remove(v, -2); // remove object name
4087 if(setup_releasehook) {
4088 sq_setreleasehook(v, -1, SSector_release_hook);
4091 sq_remove(v, -2); // remove root table
4094 void create_squirrel_instance(HSQUIRRELVM v, Scripting::LevelTime* object, bool setup_releasehook)
4096 using namespace Wrapper;
4098 sq_pushroottable(v);
4099 sq_pushstring(v, "LevelTime", -1);
4100 if(SQ_FAILED(sq_get(v, -2))) {
4101 std::ostringstream msg;
4102 msg << "Couldn't resolved squirrel type 'LevelTime'";
4103 throw SquirrelError(v, msg.str());
4106 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4107 std::ostringstream msg;
4108 msg << "Couldn't setup squirrel instance for object of type 'LevelTime'";
4109 throw SquirrelError(v, msg.str());
4111 sq_remove(v, -2); // remove object name
4113 if(setup_releasehook) {
4114 sq_setreleasehook(v, -1, LevelTime_release_hook);
4117 sq_remove(v, -2); // remove root table
4120 void create_squirrel_instance(HSQUIRRELVM v, Scripting::WillOWisp* object, bool setup_releasehook)
4122 using namespace Wrapper;
4124 sq_pushroottable(v);
4125 sq_pushstring(v, "WillOWisp", -1);
4126 if(SQ_FAILED(sq_get(v, -2))) {
4127 std::ostringstream msg;
4128 msg << "Couldn't resolved squirrel type 'WillOWisp'";
4129 throw SquirrelError(v, msg.str());
4132 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4133 std::ostringstream msg;
4134 msg << "Couldn't setup squirrel instance for object of type 'WillOWisp'";
4135 throw SquirrelError(v, msg.str());
4137 sq_remove(v, -2); // remove object name
4139 if(setup_releasehook) {
4140 sq_setreleasehook(v, -1, WillOWisp_release_hook);
4143 sq_remove(v, -2); // remove root table
4146 void register_supertux_wrapper(HSQUIRRELVM v)
4148 using namespace Wrapper;
4150 sq_pushstring(v, "ANCHOR_TOP", -1);
4151 sq_pushinteger(v, 16);
4152 if(SQ_FAILED(sq_createslot(v, -3))) {
4153 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
4156 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
4157 sq_pushinteger(v, 32);
4158 if(SQ_FAILED(sq_createslot(v, -3))) {
4159 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
4162 sq_pushstring(v, "ANCHOR_LEFT", -1);
4163 sq_pushinteger(v, 1);
4164 if(SQ_FAILED(sq_createslot(v, -3))) {
4165 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
4168 sq_pushstring(v, "ANCHOR_RIGHT", -1);
4169 sq_pushinteger(v, 2);
4170 if(SQ_FAILED(sq_createslot(v, -3))) {
4171 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
4174 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
4175 sq_pushinteger(v, 0);
4176 if(SQ_FAILED(sq_createslot(v, -3))) {
4177 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
4180 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
4181 sq_pushinteger(v, 17);
4182 if(SQ_FAILED(sq_createslot(v, -3))) {
4183 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
4186 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
4187 sq_pushinteger(v, 18);
4188 if(SQ_FAILED(sq_createslot(v, -3))) {
4189 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
4192 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
4193 sq_pushinteger(v, 33);
4194 if(SQ_FAILED(sq_createslot(v, -3))) {
4195 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
4198 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
4199 sq_pushinteger(v, 34);
4200 if(SQ_FAILED(sq_createslot(v, -3))) {
4201 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
4204 sq_pushstring(v, "display", -1);
4205 sq_newclosure(v, &display_wrapper, 0);
4206 if(SQ_FAILED(sq_createslot(v, -3))) {
4207 throw SquirrelError(v, "Couldn't register function 'display'");
4210 sq_pushstring(v, "print_stacktrace", -1);
4211 sq_newclosure(v, &print_stacktrace_wrapper, 0);
4212 if(SQ_FAILED(sq_createslot(v, -3))) {
4213 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
4216 sq_pushstring(v, "get_current_thread", -1);
4217 sq_newclosure(v, &get_current_thread_wrapper, 0);
4218 if(SQ_FAILED(sq_createslot(v, -3))) {
4219 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
4222 sq_pushstring(v, "display_text_file", -1);
4223 sq_newclosure(v, &display_text_file_wrapper, 0);
4224 if(SQ_FAILED(sq_createslot(v, -3))) {
4225 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
4228 sq_pushstring(v, "load_worldmap", -1);
4229 sq_newclosure(v, &load_worldmap_wrapper, 0);
4230 if(SQ_FAILED(sq_createslot(v, -3))) {
4231 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
4234 sq_pushstring(v, "load_level", -1);
4235 sq_newclosure(v, &load_level_wrapper, 0);
4236 if(SQ_FAILED(sq_createslot(v, -3))) {
4237 throw SquirrelError(v, "Couldn't register function 'load_level'");
4240 sq_pushstring(v, "wait", -1);
4241 sq_newclosure(v, &wait_wrapper, 0);
4242 if(SQ_FAILED(sq_createslot(v, -3))) {
4243 throw SquirrelError(v, "Couldn't register function 'wait'");
4246 sq_pushstring(v, "wait_for_screenswitch", -1);
4247 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
4248 if(SQ_FAILED(sq_createslot(v, -3))) {
4249 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
4252 sq_pushstring(v, "exit_screen", -1);
4253 sq_newclosure(v, &exit_screen_wrapper, 0);
4254 if(SQ_FAILED(sq_createslot(v, -3))) {
4255 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
4258 sq_pushstring(v, "fadeout_screen", -1);
4259 sq_newclosure(v, &fadeout_screen_wrapper, 0);
4260 if(SQ_FAILED(sq_createslot(v, -3))) {
4261 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
4264 sq_pushstring(v, "shrink_screen", -1);
4265 sq_newclosure(v, &shrink_screen_wrapper, 0);
4266 if(SQ_FAILED(sq_createslot(v, -3))) {
4267 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
4270 sq_pushstring(v, "abort_screenfade", -1);
4271 sq_newclosure(v, &abort_screenfade_wrapper, 0);
4272 if(SQ_FAILED(sq_createslot(v, -3))) {
4273 throw SquirrelError(v, "Couldn't register function 'abort_screenfade'");
4276 sq_pushstring(v, "translate", -1);
4277 sq_newclosure(v, &translate_wrapper, 0);
4278 if(SQ_FAILED(sq_createslot(v, -3))) {
4279 throw SquirrelError(v, "Couldn't register function 'translate'");
4282 sq_pushstring(v, "import", -1);
4283 sq_newclosure(v, &import_wrapper, 0);
4284 if(SQ_FAILED(sq_createslot(v, -3))) {
4285 throw SquirrelError(v, "Couldn't register function 'import'");
4288 sq_pushstring(v, "save_state", -1);
4289 sq_newclosure(v, &save_state_wrapper, 0);
4290 if(SQ_FAILED(sq_createslot(v, -3))) {
4291 throw SquirrelError(v, "Couldn't register function 'save_state'");
4294 sq_pushstring(v, "update_worldmap", -1);
4295 sq_newclosure(v, &update_worldmap_wrapper, 0);
4296 if(SQ_FAILED(sq_createslot(v, -3))) {
4297 throw SquirrelError(v, "Couldn't register function 'update_worldmap'");
4300 sq_pushstring(v, "debug_collrects", -1);
4301 sq_newclosure(v, &debug_collrects_wrapper, 0);
4302 if(SQ_FAILED(sq_createslot(v, -3))) {
4303 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
4306 sq_pushstring(v, "debug_show_fps", -1);
4307 sq_newclosure(v, &debug_show_fps_wrapper, 0);
4308 if(SQ_FAILED(sq_createslot(v, -3))) {
4309 throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
4312 sq_pushstring(v, "debug_draw_solids_only", -1);
4313 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
4314 if(SQ_FAILED(sq_createslot(v, -3))) {
4315 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
4318 sq_pushstring(v, "play_music", -1);
4319 sq_newclosure(v, &play_music_wrapper, 0);
4320 if(SQ_FAILED(sq_createslot(v, -3))) {
4321 throw SquirrelError(v, "Couldn't register function 'play_music'");
4324 sq_pushstring(v, "play_sound", -1);
4325 sq_newclosure(v, &play_sound_wrapper, 0);
4326 if(SQ_FAILED(sq_createslot(v, -3))) {
4327 throw SquirrelError(v, "Couldn't register function 'play_sound'");
4330 sq_pushstring(v, "grease", -1);
4331 sq_newclosure(v, &grease_wrapper, 0);
4332 if(SQ_FAILED(sq_createslot(v, -3))) {
4333 throw SquirrelError(v, "Couldn't register function 'grease'");
4336 sq_pushstring(v, "invincible", -1);
4337 sq_newclosure(v, &invincible_wrapper, 0);
4338 if(SQ_FAILED(sq_createslot(v, -3))) {
4339 throw SquirrelError(v, "Couldn't register function 'invincible'");
4342 sq_pushstring(v, "ghost", -1);
4343 sq_newclosure(v, &ghost_wrapper, 0);
4344 if(SQ_FAILED(sq_createslot(v, -3))) {
4345 throw SquirrelError(v, "Couldn't register function 'ghost'");
4348 sq_pushstring(v, "mortal", -1);
4349 sq_newclosure(v, &mortal_wrapper, 0);
4350 if(SQ_FAILED(sq_createslot(v, -3))) {
4351 throw SquirrelError(v, "Couldn't register function 'mortal'");
4354 sq_pushstring(v, "restart", -1);
4355 sq_newclosure(v, &restart_wrapper, 0);
4356 if(SQ_FAILED(sq_createslot(v, -3))) {
4357 throw SquirrelError(v, "Couldn't register function 'restart'");
4360 sq_pushstring(v, "whereami", -1);
4361 sq_newclosure(v, &whereami_wrapper, 0);
4362 if(SQ_FAILED(sq_createslot(v, -3))) {
4363 throw SquirrelError(v, "Couldn't register function 'whereami'");
4366 sq_pushstring(v, "gotoend", -1);
4367 sq_newclosure(v, &gotoend_wrapper, 0);
4368 if(SQ_FAILED(sq_createslot(v, -3))) {
4369 throw SquirrelError(v, "Couldn't register function 'gotoend'");
4372 sq_pushstring(v, "camera", -1);
4373 sq_newclosure(v, &camera_wrapper, 0);
4374 if(SQ_FAILED(sq_createslot(v, -3))) {
4375 throw SquirrelError(v, "Couldn't register function 'camera'");
4378 sq_pushstring(v, "quit", -1);
4379 sq_newclosure(v, &quit_wrapper, 0);
4380 if(SQ_FAILED(sq_createslot(v, -3))) {
4381 throw SquirrelError(v, "Couldn't register function 'quit'");
4384 sq_pushstring(v, "rand", -1);
4385 sq_newclosure(v, &rand_wrapper, 0);
4386 if(SQ_FAILED(sq_createslot(v, -3))) {
4387 throw SquirrelError(v, "Couldn't register function 'rand'");
4390 // Register class DisplayEffect
4391 sq_pushstring(v, "DisplayEffect", -1);
4392 if(sq_newclass(v, SQFalse) < 0) {
4393 std::ostringstream msg;
4394 msg << "Couldn't create new class 'DisplayEffect'";
4395 throw SquirrelError(v, msg.str());
4397 sq_pushstring(v, "fade_out", -1);
4398 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
4399 if(SQ_FAILED(sq_createslot(v, -3))) {
4400 throw SquirrelError(v, "Couldn't register function 'fade_out'");
4403 sq_pushstring(v, "fade_in", -1);
4404 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
4405 if(SQ_FAILED(sq_createslot(v, -3))) {
4406 throw SquirrelError(v, "Couldn't register function 'fade_in'");
4409 sq_pushstring(v, "set_black", -1);
4410 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
4411 if(SQ_FAILED(sq_createslot(v, -3))) {
4412 throw SquirrelError(v, "Couldn't register function 'set_black'");
4415 sq_pushstring(v, "is_black", -1);
4416 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
4417 if(SQ_FAILED(sq_createslot(v, -3))) {
4418 throw SquirrelError(v, "Couldn't register function 'is_black'");
4421 sq_pushstring(v, "sixteen_to_nine", -1);
4422 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
4423 if(SQ_FAILED(sq_createslot(v, -3))) {
4424 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
4427 sq_pushstring(v, "four_to_three", -1);
4428 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
4429 if(SQ_FAILED(sq_createslot(v, -3))) {
4430 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
4433 if(SQ_FAILED(sq_createslot(v, -3))) {
4434 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
4437 // Register class Camera
4438 sq_pushstring(v, "Camera", -1);
4439 if(sq_newclass(v, SQFalse) < 0) {
4440 std::ostringstream msg;
4441 msg << "Couldn't create new class 'Camera'";
4442 throw SquirrelError(v, msg.str());
4444 sq_pushstring(v, "reload_config", -1);
4445 sq_newclosure(v, &Camera_reload_config_wrapper, 0);
4446 if(SQ_FAILED(sq_createslot(v, -3))) {
4447 throw SquirrelError(v, "Couldn't register function 'reload_config'");
4450 sq_pushstring(v, "shake", -1);
4451 sq_newclosure(v, &Camera_shake_wrapper, 0);
4452 if(SQ_FAILED(sq_createslot(v, -3))) {
4453 throw SquirrelError(v, "Couldn't register function 'shake'");
4456 sq_pushstring(v, "set_pos", -1);
4457 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
4458 if(SQ_FAILED(sq_createslot(v, -3))) {
4459 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4462 sq_pushstring(v, "set_mode", -1);
4463 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
4464 if(SQ_FAILED(sq_createslot(v, -3))) {
4465 throw SquirrelError(v, "Couldn't register function 'set_mode'");
4468 sq_pushstring(v, "scroll_to", -1);
4469 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
4470 if(SQ_FAILED(sq_createslot(v, -3))) {
4471 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
4474 if(SQ_FAILED(sq_createslot(v, -3))) {
4475 throw SquirrelError(v, "Couldn't register class 'Camera'");
4478 // Register class Level
4479 sq_pushstring(v, "Level", -1);
4480 if(sq_newclass(v, SQFalse) < 0) {
4481 std::ostringstream msg;
4482 msg << "Couldn't create new class 'Level'";
4483 throw SquirrelError(v, msg.str());
4485 sq_pushstring(v, "finish", -1);
4486 sq_newclosure(v, &Level_finish_wrapper, 0);
4487 if(SQ_FAILED(sq_createslot(v, -3))) {
4488 throw SquirrelError(v, "Couldn't register function 'finish'");
4491 sq_pushstring(v, "spawn", -1);
4492 sq_newclosure(v, &Level_spawn_wrapper, 0);
4493 if(SQ_FAILED(sq_createslot(v, -3))) {
4494 throw SquirrelError(v, "Couldn't register function 'spawn'");
4497 sq_pushstring(v, "flip_vertically", -1);
4498 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
4499 if(SQ_FAILED(sq_createslot(v, -3))) {
4500 throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
4503 sq_pushstring(v, "toggle_pause", -1);
4504 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
4505 if(SQ_FAILED(sq_createslot(v, -3))) {
4506 throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
4509 sq_pushstring(v, "edit", -1);
4510 sq_newclosure(v, &Level_edit_wrapper, 0);
4511 if(SQ_FAILED(sq_createslot(v, -3))) {
4512 throw SquirrelError(v, "Couldn't register function 'edit'");
4515 if(SQ_FAILED(sq_createslot(v, -3))) {
4516 throw SquirrelError(v, "Couldn't register class 'Level'");
4519 // Register class ScriptedObject
4520 sq_pushstring(v, "ScriptedObject", -1);
4521 if(sq_newclass(v, SQFalse) < 0) {
4522 std::ostringstream msg;
4523 msg << "Couldn't create new class 'ScriptedObject'";
4524 throw SquirrelError(v, msg.str());
4526 sq_pushstring(v, "set_action", -1);
4527 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
4528 if(SQ_FAILED(sq_createslot(v, -3))) {
4529 throw SquirrelError(v, "Couldn't register function 'set_action'");
4532 sq_pushstring(v, "get_action", -1);
4533 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
4534 if(SQ_FAILED(sq_createslot(v, -3))) {
4535 throw SquirrelError(v, "Couldn't register function 'get_action'");
4538 sq_pushstring(v, "move", -1);
4539 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
4540 if(SQ_FAILED(sq_createslot(v, -3))) {
4541 throw SquirrelError(v, "Couldn't register function 'move'");
4544 sq_pushstring(v, "set_pos", -1);
4545 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
4546 if(SQ_FAILED(sq_createslot(v, -3))) {
4547 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4550 sq_pushstring(v, "get_pos_x", -1);
4551 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
4552 if(SQ_FAILED(sq_createslot(v, -3))) {
4553 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4556 sq_pushstring(v, "get_pos_y", -1);
4557 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
4558 if(SQ_FAILED(sq_createslot(v, -3))) {
4559 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4562 sq_pushstring(v, "set_velocity", -1);
4563 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
4564 if(SQ_FAILED(sq_createslot(v, -3))) {
4565 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
4568 sq_pushstring(v, "get_velocity_x", -1);
4569 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
4570 if(SQ_FAILED(sq_createslot(v, -3))) {
4571 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
4574 sq_pushstring(v, "get_velocity_y", -1);
4575 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
4576 if(SQ_FAILED(sq_createslot(v, -3))) {
4577 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
4580 sq_pushstring(v, "set_visible", -1);
4581 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
4582 if(SQ_FAILED(sq_createslot(v, -3))) {
4583 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4586 sq_pushstring(v, "is_visible", -1);
4587 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
4588 if(SQ_FAILED(sq_createslot(v, -3))) {
4589 throw SquirrelError(v, "Couldn't register function 'is_visible'");
4592 sq_pushstring(v, "set_solid", -1);
4593 sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
4594 if(SQ_FAILED(sq_createslot(v, -3))) {
4595 throw SquirrelError(v, "Couldn't register function 'set_solid'");
4598 sq_pushstring(v, "is_solid", -1);
4599 sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
4600 if(SQ_FAILED(sq_createslot(v, -3))) {
4601 throw SquirrelError(v, "Couldn't register function 'is_solid'");
4604 sq_pushstring(v, "get_name", -1);
4605 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
4606 if(SQ_FAILED(sq_createslot(v, -3))) {
4607 throw SquirrelError(v, "Couldn't register function 'get_name'");
4610 if(SQ_FAILED(sq_createslot(v, -3))) {
4611 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
4614 // Register class Text
4615 sq_pushstring(v, "Text", -1);
4616 if(sq_newclass(v, SQFalse) < 0) {
4617 std::ostringstream msg;
4618 msg << "Couldn't create new class 'Text'";
4619 throw SquirrelError(v, msg.str());
4621 sq_pushstring(v, "set_text", -1);
4622 sq_newclosure(v, &Text_set_text_wrapper, 0);
4623 if(SQ_FAILED(sq_createslot(v, -3))) {
4624 throw SquirrelError(v, "Couldn't register function 'set_text'");
4627 sq_pushstring(v, "set_font", -1);
4628 sq_newclosure(v, &Text_set_font_wrapper, 0);
4629 if(SQ_FAILED(sq_createslot(v, -3))) {
4630 throw SquirrelError(v, "Couldn't register function 'set_font'");
4633 sq_pushstring(v, "fade_in", -1);
4634 sq_newclosure(v, &Text_fade_in_wrapper, 0);
4635 if(SQ_FAILED(sq_createslot(v, -3))) {
4636 throw SquirrelError(v, "Couldn't register function 'fade_in'");
4639 sq_pushstring(v, "fade_out", -1);
4640 sq_newclosure(v, &Text_fade_out_wrapper, 0);
4641 if(SQ_FAILED(sq_createslot(v, -3))) {
4642 throw SquirrelError(v, "Couldn't register function 'fade_out'");
4645 sq_pushstring(v, "set_visible", -1);
4646 sq_newclosure(v, &Text_set_visible_wrapper, 0);
4647 if(SQ_FAILED(sq_createslot(v, -3))) {
4648 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4651 sq_pushstring(v, "set_centered", -1);
4652 sq_newclosure(v, &Text_set_centered_wrapper, 0);
4653 if(SQ_FAILED(sq_createslot(v, -3))) {
4654 throw SquirrelError(v, "Couldn't register function 'set_centered'");
4657 sq_pushstring(v, "set_pos", -1);
4658 sq_newclosure(v, &Text_set_pos_wrapper, 0);
4659 if(SQ_FAILED(sq_createslot(v, -3))) {
4660 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4663 sq_pushstring(v, "get_pos_x", -1);
4664 sq_newclosure(v, &Text_get_pos_x_wrapper, 0);
4665 if(SQ_FAILED(sq_createslot(v, -3))) {
4666 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4669 sq_pushstring(v, "get_pos_y", -1);
4670 sq_newclosure(v, &Text_get_pos_y_wrapper, 0);
4671 if(SQ_FAILED(sq_createslot(v, -3))) {
4672 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4675 sq_pushstring(v, "set_anchor_point", -1);
4676 sq_newclosure(v, &Text_set_anchor_point_wrapper, 0);
4677 if(SQ_FAILED(sq_createslot(v, -3))) {
4678 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4681 sq_pushstring(v, "get_anchor_point", -1);
4682 sq_newclosure(v, &Text_get_anchor_point_wrapper, 0);
4683 if(SQ_FAILED(sq_createslot(v, -3))) {
4684 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4687 if(SQ_FAILED(sq_createslot(v, -3))) {
4688 throw SquirrelError(v, "Couldn't register class 'Text'");
4691 // Register class Player
4692 sq_pushstring(v, "Player", -1);
4693 if(sq_newclass(v, SQFalse) < 0) {
4694 std::ostringstream msg;
4695 msg << "Couldn't create new class 'Player'";
4696 throw SquirrelError(v, msg.str());
4698 sq_pushstring(v, "add_bonus", -1);
4699 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
4700 if(SQ_FAILED(sq_createslot(v, -3))) {
4701 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
4704 sq_pushstring(v, "add_coins", -1);
4705 sq_newclosure(v, &Player_add_coins_wrapper, 0);
4706 if(SQ_FAILED(sq_createslot(v, -3))) {
4707 throw SquirrelError(v, "Couldn't register function 'add_coins'");
4710 sq_pushstring(v, "make_invincible", -1);
4711 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
4712 if(SQ_FAILED(sq_createslot(v, -3))) {
4713 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
4716 sq_pushstring(v, "deactivate", -1);
4717 sq_newclosure(v, &Player_deactivate_wrapper, 0);
4718 if(SQ_FAILED(sq_createslot(v, -3))) {
4719 throw SquirrelError(v, "Couldn't register function 'deactivate'");
4722 sq_pushstring(v, "activate", -1);
4723 sq_newclosure(v, &Player_activate_wrapper, 0);
4724 if(SQ_FAILED(sq_createslot(v, -3))) {
4725 throw SquirrelError(v, "Couldn't register function 'activate'");
4728 sq_pushstring(v, "walk", -1);
4729 sq_newclosure(v, &Player_walk_wrapper, 0);
4730 if(SQ_FAILED(sq_createslot(v, -3))) {
4731 throw SquirrelError(v, "Couldn't register function 'walk'");
4734 sq_pushstring(v, "set_visible", -1);
4735 sq_newclosure(v, &Player_set_visible_wrapper, 0);
4736 if(SQ_FAILED(sq_createslot(v, -3))) {
4737 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4740 sq_pushstring(v, "get_visible", -1);
4741 sq_newclosure(v, &Player_get_visible_wrapper, 0);
4742 if(SQ_FAILED(sq_createslot(v, -3))) {
4743 throw SquirrelError(v, "Couldn't register function 'get_visible'");
4746 sq_pushstring(v, "kill", -1);
4747 sq_newclosure(v, &Player_kill_wrapper, 0);
4748 if(SQ_FAILED(sq_createslot(v, -3))) {
4749 throw SquirrelError(v, "Couldn't register function 'kill'");
4752 sq_pushstring(v, "set_ghost_mode", -1);
4753 sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
4754 if(SQ_FAILED(sq_createslot(v, -3))) {
4755 throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
4758 sq_pushstring(v, "get_ghost_mode", -1);
4759 sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
4760 if(SQ_FAILED(sq_createslot(v, -3))) {
4761 throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
4764 sq_pushstring(v, "do_cheer", -1);
4765 sq_newclosure(v, &Player_do_cheer_wrapper, 0);
4766 if(SQ_FAILED(sq_createslot(v, -3))) {
4767 throw SquirrelError(v, "Couldn't register function 'do_cheer'");
4770 sq_pushstring(v, "do_duck", -1);
4771 sq_newclosure(v, &Player_do_duck_wrapper, 0);
4772 if(SQ_FAILED(sq_createslot(v, -3))) {
4773 throw SquirrelError(v, "Couldn't register function 'do_duck'");
4776 sq_pushstring(v, "do_standup", -1);
4777 sq_newclosure(v, &Player_do_standup_wrapper, 0);
4778 if(SQ_FAILED(sq_createslot(v, -3))) {
4779 throw SquirrelError(v, "Couldn't register function 'do_standup'");
4782 sq_pushstring(v, "do_backflip", -1);
4783 sq_newclosure(v, &Player_do_backflip_wrapper, 0);
4784 if(SQ_FAILED(sq_createslot(v, -3))) {
4785 throw SquirrelError(v, "Couldn't register function 'do_backflip'");
4788 sq_pushstring(v, "do_jump", -1);
4789 sq_newclosure(v, &Player_do_jump_wrapper, 0);
4790 if(SQ_FAILED(sq_createslot(v, -3))) {
4791 throw SquirrelError(v, "Couldn't register function 'do_jump'");
4794 sq_pushstring(v, "trigger_sequence", -1);
4795 sq_newclosure(v, &Player_trigger_sequence_wrapper, 0);
4796 if(SQ_FAILED(sq_createslot(v, -3))) {
4797 throw SquirrelError(v, "Couldn't register function 'trigger_sequence'");
4800 sq_pushstring(v, "use_scripting_controller", -1);
4801 sq_newclosure(v, &Player_use_scripting_controller_wrapper, 0);
4802 if(SQ_FAILED(sq_createslot(v, -3))) {
4803 throw SquirrelError(v, "Couldn't register function 'use_scripting_controller'");
4806 sq_pushstring(v, "do_scripting_controller", -1);
4807 sq_newclosure(v, &Player_do_scripting_controller_wrapper, 0);
4808 if(SQ_FAILED(sq_createslot(v, -3))) {
4809 throw SquirrelError(v, "Couldn't register function 'do_scripting_controller'");
4812 if(SQ_FAILED(sq_createslot(v, -3))) {
4813 throw SquirrelError(v, "Couldn't register class 'Player'");
4816 // Register class FloatingImage
4817 sq_pushstring(v, "FloatingImage", -1);
4818 if(sq_newclass(v, SQFalse) < 0) {
4819 std::ostringstream msg;
4820 msg << "Couldn't create new class 'FloatingImage'";
4821 throw SquirrelError(v, msg.str());
4823 sq_pushstring(v, "constructor", -1);
4824 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
4825 if(SQ_FAILED(sq_createslot(v, -3))) {
4826 throw SquirrelError(v, "Couldn't register function 'constructor'");
4829 sq_pushstring(v, "set_layer", -1);
4830 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
4831 if(SQ_FAILED(sq_createslot(v, -3))) {
4832 throw SquirrelError(v, "Couldn't register function 'set_layer'");
4835 sq_pushstring(v, "get_layer", -1);
4836 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
4837 if(SQ_FAILED(sq_createslot(v, -3))) {
4838 throw SquirrelError(v, "Couldn't register function 'get_layer'");
4841 sq_pushstring(v, "set_pos", -1);
4842 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
4843 if(SQ_FAILED(sq_createslot(v, -3))) {
4844 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4847 sq_pushstring(v, "get_pos_x", -1);
4848 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
4849 if(SQ_FAILED(sq_createslot(v, -3))) {
4850 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4853 sq_pushstring(v, "get_pos_y", -1);
4854 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
4855 if(SQ_FAILED(sq_createslot(v, -3))) {
4856 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4859 sq_pushstring(v, "set_anchor_point", -1);
4860 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
4861 if(SQ_FAILED(sq_createslot(v, -3))) {
4862 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4865 sq_pushstring(v, "get_anchor_point", -1);
4866 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
4867 if(SQ_FAILED(sq_createslot(v, -3))) {
4868 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4871 sq_pushstring(v, "set_visible", -1);
4872 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
4873 if(SQ_FAILED(sq_createslot(v, -3))) {
4874 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4877 sq_pushstring(v, "get_visible", -1);
4878 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
4879 if(SQ_FAILED(sq_createslot(v, -3))) {
4880 throw SquirrelError(v, "Couldn't register function 'get_visible'");
4883 sq_pushstring(v, "set_action", -1);
4884 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
4885 if(SQ_FAILED(sq_createslot(v, -3))) {
4886 throw SquirrelError(v, "Couldn't register function 'set_action'");
4889 sq_pushstring(v, "get_action", -1);
4890 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
4891 if(SQ_FAILED(sq_createslot(v, -3))) {
4892 throw SquirrelError(v, "Couldn't register function 'get_action'");
4895 sq_pushstring(v, "fade_in", -1);
4896 sq_newclosure(v, &FloatingImage_fade_in_wrapper, 0);
4897 if(SQ_FAILED(sq_createslot(v, -3))) {
4898 throw SquirrelError(v, "Couldn't register function 'fade_in'");
4901 sq_pushstring(v, "fade_out", -1);
4902 sq_newclosure(v, &FloatingImage_fade_out_wrapper, 0);
4903 if(SQ_FAILED(sq_createslot(v, -3))) {
4904 throw SquirrelError(v, "Couldn't register function 'fade_out'");
4907 if(SQ_FAILED(sq_createslot(v, -3))) {
4908 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
4911 // Register class Platform
4912 sq_pushstring(v, "Platform", -1);
4913 if(sq_newclass(v, SQFalse) < 0) {
4914 std::ostringstream msg;
4915 msg << "Couldn't create new class 'Platform'";
4916 throw SquirrelError(v, msg.str());
4918 sq_pushstring(v, "goto_node", -1);
4919 sq_newclosure(v, &Platform_goto_node_wrapper, 0);
4920 if(SQ_FAILED(sq_createslot(v, -3))) {
4921 throw SquirrelError(v, "Couldn't register function 'goto_node'");
4924 sq_pushstring(v, "start_moving", -1);
4925 sq_newclosure(v, &Platform_start_moving_wrapper, 0);
4926 if(SQ_FAILED(sq_createslot(v, -3))) {
4927 throw SquirrelError(v, "Couldn't register function 'start_moving'");
4930 sq_pushstring(v, "stop_moving", -1);
4931 sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
4932 if(SQ_FAILED(sq_createslot(v, -3))) {
4933 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
4936 if(SQ_FAILED(sq_createslot(v, -3))) {
4937 throw SquirrelError(v, "Couldn't register class 'Platform'");
4940 // Register class Candle
4941 sq_pushstring(v, "Candle", -1);
4942 if(sq_newclass(v, SQFalse) < 0) {
4943 std::ostringstream msg;
4944 msg << "Couldn't create new class 'Candle'";
4945 throw SquirrelError(v, msg.str());
4947 sq_pushstring(v, "get_burning", -1);
4948 sq_newclosure(v, &Candle_get_burning_wrapper, 0);
4949 if(SQ_FAILED(sq_createslot(v, -3))) {
4950 throw SquirrelError(v, "Couldn't register function 'get_burning'");
4953 sq_pushstring(v, "set_burning", -1);
4954 sq_newclosure(v, &Candle_set_burning_wrapper, 0);
4955 if(SQ_FAILED(sq_createslot(v, -3))) {
4956 throw SquirrelError(v, "Couldn't register function 'set_burning'");
4959 if(SQ_FAILED(sq_createslot(v, -3))) {
4960 throw SquirrelError(v, "Couldn't register class 'Candle'");
4963 // Register class Wind
4964 sq_pushstring(v, "Wind", -1);
4965 if(sq_newclass(v, SQFalse) < 0) {
4966 std::ostringstream msg;
4967 msg << "Couldn't create new class 'Wind'";
4968 throw SquirrelError(v, msg.str());
4970 sq_pushstring(v, "start", -1);
4971 sq_newclosure(v, &Wind_start_wrapper, 0);
4972 if(SQ_FAILED(sq_createslot(v, -3))) {
4973 throw SquirrelError(v, "Couldn't register function 'start'");
4976 sq_pushstring(v, "stop", -1);
4977 sq_newclosure(v, &Wind_stop_wrapper, 0);
4978 if(SQ_FAILED(sq_createslot(v, -3))) {
4979 throw SquirrelError(v, "Couldn't register function 'stop'");
4982 if(SQ_FAILED(sq_createslot(v, -3))) {
4983 throw SquirrelError(v, "Couldn't register class 'Wind'");
4986 // Register class AmbientSound
4987 sq_pushstring(v, "AmbientSound", -1);
4988 if(sq_newclass(v, SQFalse) < 0) {
4989 std::ostringstream msg;
4990 msg << "Couldn't create new class 'AmbientSound'";
4991 throw SquirrelError(v, msg.str());
4993 sq_pushstring(v, "set_pos", -1);
4994 sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
4995 if(SQ_FAILED(sq_createslot(v, -3))) {
4996 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4999 sq_pushstring(v, "get_pos_x", -1);
5000 sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
5001 if(SQ_FAILED(sq_createslot(v, -3))) {
5002 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5005 sq_pushstring(v, "get_pos_y", -1);
5006 sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
5007 if(SQ_FAILED(sq_createslot(v, -3))) {
5008 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5011 if(SQ_FAILED(sq_createslot(v, -3))) {
5012 throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
5015 // Register class Thunderstorm
5016 sq_pushstring(v, "Thunderstorm", -1);
5017 if(sq_newclass(v, SQFalse) < 0) {
5018 std::ostringstream msg;
5019 msg << "Couldn't create new class 'Thunderstorm'";
5020 throw SquirrelError(v, msg.str());
5022 sq_pushstring(v, "start", -1);
5023 sq_newclosure(v, &Thunderstorm_start_wrapper, 0);
5024 if(SQ_FAILED(sq_createslot(v, -3))) {
5025 throw SquirrelError(v, "Couldn't register function 'start'");
5028 sq_pushstring(v, "stop", -1);
5029 sq_newclosure(v, &Thunderstorm_stop_wrapper, 0);
5030 if(SQ_FAILED(sq_createslot(v, -3))) {
5031 throw SquirrelError(v, "Couldn't register function 'stop'");
5034 sq_pushstring(v, "thunder", -1);
5035 sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0);
5036 if(SQ_FAILED(sq_createslot(v, -3))) {
5037 throw SquirrelError(v, "Couldn't register function 'thunder'");
5040 sq_pushstring(v, "lightning", -1);
5041 sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0);
5042 if(SQ_FAILED(sq_createslot(v, -3))) {
5043 throw SquirrelError(v, "Couldn't register function 'lightning'");
5046 sq_pushstring(v, "flash", -1);
5047 sq_newclosure(v, &Thunderstorm_flash_wrapper, 0);
5048 if(SQ_FAILED(sq_createslot(v, -3))) {
5049 throw SquirrelError(v, "Couldn't register function 'flash'");
5052 sq_pushstring(v, "electrify", -1);
5053 sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0);
5054 if(SQ_FAILED(sq_createslot(v, -3))) {
5055 throw SquirrelError(v, "Couldn't register function 'electrify'");
5058 if(SQ_FAILED(sq_createslot(v, -3))) {
5059 throw SquirrelError(v, "Couldn't register class 'Thunderstorm'");
5062 // Register class TileMap
5063 sq_pushstring(v, "TileMap", -1);
5064 if(sq_newclass(v, SQFalse) < 0) {
5065 std::ostringstream msg;
5066 msg << "Couldn't create new class 'TileMap'";
5067 throw SquirrelError(v, msg.str());
5069 sq_pushstring(v, "goto_node", -1);
5070 sq_newclosure(v, &TileMap_goto_node_wrapper, 0);
5071 if(SQ_FAILED(sq_createslot(v, -3))) {
5072 throw SquirrelError(v, "Couldn't register function 'goto_node'");
5075 sq_pushstring(v, "start_moving", -1);
5076 sq_newclosure(v, &TileMap_start_moving_wrapper, 0);
5077 if(SQ_FAILED(sq_createslot(v, -3))) {
5078 throw SquirrelError(v, "Couldn't register function 'start_moving'");
5081 sq_pushstring(v, "stop_moving", -1);
5082 sq_newclosure(v, &TileMap_stop_moving_wrapper, 0);
5083 if(SQ_FAILED(sq_createslot(v, -3))) {
5084 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5087 sq_pushstring(v, "fade", -1);
5088 sq_newclosure(v, &TileMap_fade_wrapper, 0);
5089 if(SQ_FAILED(sq_createslot(v, -3))) {
5090 throw SquirrelError(v, "Couldn't register function 'fade'");
5093 sq_pushstring(v, "set_alpha", -1);
5094 sq_newclosure(v, &TileMap_set_alpha_wrapper, 0);
5095 if(SQ_FAILED(sq_createslot(v, -3))) {
5096 throw SquirrelError(v, "Couldn't register function 'set_alpha'");
5099 sq_pushstring(v, "get_alpha", -1);
5100 sq_newclosure(v, &TileMap_get_alpha_wrapper, 0);
5101 if(SQ_FAILED(sq_createslot(v, -3))) {
5102 throw SquirrelError(v, "Couldn't register function 'get_alpha'");
5105 if(SQ_FAILED(sq_createslot(v, -3))) {
5106 throw SquirrelError(v, "Couldn't register class 'TileMap'");
5109 // Register class SSector
5110 sq_pushstring(v, "SSector", -1);
5111 if(sq_newclass(v, SQFalse) < 0) {
5112 std::ostringstream msg;
5113 msg << "Couldn't create new class 'SSector'";
5114 throw SquirrelError(v, msg.str());
5116 sq_pushstring(v, "set_ambient_light", -1);
5117 sq_newclosure(v, &SSector_set_ambient_light_wrapper, 0);
5118 if(SQ_FAILED(sq_createslot(v, -3))) {
5119 throw SquirrelError(v, "Couldn't register function 'set_ambient_light'");
5122 sq_pushstring(v, "get_ambient_red", -1);
5123 sq_newclosure(v, &SSector_get_ambient_red_wrapper, 0);
5124 if(SQ_FAILED(sq_createslot(v, -3))) {
5125 throw SquirrelError(v, "Couldn't register function 'get_ambient_red'");
5128 sq_pushstring(v, "get_ambient_green", -1);
5129 sq_newclosure(v, &SSector_get_ambient_green_wrapper, 0);
5130 if(SQ_FAILED(sq_createslot(v, -3))) {
5131 throw SquirrelError(v, "Couldn't register function 'get_ambient_green'");
5134 sq_pushstring(v, "get_ambient_blue", -1);
5135 sq_newclosure(v, &SSector_get_ambient_blue_wrapper, 0);
5136 if(SQ_FAILED(sq_createslot(v, -3))) {
5137 throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'");
5140 if(SQ_FAILED(sq_createslot(v, -3))) {
5141 throw SquirrelError(v, "Couldn't register class 'SSector'");
5144 // Register class LevelTime
5145 sq_pushstring(v, "LevelTime", -1);
5146 if(sq_newclass(v, SQFalse) < 0) {
5147 std::ostringstream msg;
5148 msg << "Couldn't create new class 'LevelTime'";
5149 throw SquirrelError(v, msg.str());
5151 sq_pushstring(v, "start", -1);
5152 sq_newclosure(v, &LevelTime_start_wrapper, 0);
5153 if(SQ_FAILED(sq_createslot(v, -3))) {
5154 throw SquirrelError(v, "Couldn't register function 'start'");
5157 sq_pushstring(v, "stop", -1);
5158 sq_newclosure(v, &LevelTime_stop_wrapper, 0);
5159 if(SQ_FAILED(sq_createslot(v, -3))) {
5160 throw SquirrelError(v, "Couldn't register function 'stop'");
5163 sq_pushstring(v, "get_time", -1);
5164 sq_newclosure(v, &LevelTime_get_time_wrapper, 0);
5165 if(SQ_FAILED(sq_createslot(v, -3))) {
5166 throw SquirrelError(v, "Couldn't register function 'get_time'");
5169 sq_pushstring(v, "set_time", -1);
5170 sq_newclosure(v, &LevelTime_set_time_wrapper, 0);
5171 if(SQ_FAILED(sq_createslot(v, -3))) {
5172 throw SquirrelError(v, "Couldn't register function 'set_time'");
5175 if(SQ_FAILED(sq_createslot(v, -3))) {
5176 throw SquirrelError(v, "Couldn't register class 'LevelTime'");
5179 // Register class WillOWisp
5180 sq_pushstring(v, "WillOWisp", -1);
5181 if(sq_newclass(v, SQFalse) < 0) {
5182 std::ostringstream msg;
5183 msg << "Couldn't create new class 'WillOWisp'";
5184 throw SquirrelError(v, msg.str());
5186 sq_pushstring(v, "goto_node", -1);
5187 sq_newclosure(v, &WillOWisp_goto_node_wrapper, 0);
5188 if(SQ_FAILED(sq_createslot(v, -3))) {
5189 throw SquirrelError(v, "Couldn't register function 'goto_node'");
5192 sq_pushstring(v, "set_state", -1);
5193 sq_newclosure(v, &WillOWisp_set_state_wrapper, 0);
5194 if(SQ_FAILED(sq_createslot(v, -3))) {
5195 throw SquirrelError(v, "Couldn't register function 'set_state'");
5198 sq_pushstring(v, "start_moving", -1);
5199 sq_newclosure(v, &WillOWisp_start_moving_wrapper, 0);
5200 if(SQ_FAILED(sq_createslot(v, -3))) {
5201 throw SquirrelError(v, "Couldn't register function 'start_moving'");
5204 sq_pushstring(v, "stop_moving", -1);
5205 sq_newclosure(v, &WillOWisp_stop_moving_wrapper, 0);
5206 if(SQ_FAILED(sq_createslot(v, -3))) {
5207 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5210 if(SQ_FAILED(sq_createslot(v, -3))) {
5211 throw SquirrelError(v, "Couldn't register class 'WillOWisp'");
5216 } // end of namespace Scripting