2 * WARNING: This file is automatically generated from:
3 * 'src/scripting/wrapper.interface.hpp'
9 #include "scripting/squirrel_error.hpp"
10 #include "scripting/wrapper.interface.hpp"
15 static SQInteger AmbientSound_release_hook(SQUserPointer ptr, SQInteger )
17 scripting::AmbientSound* _this = reinterpret_cast<scripting::AmbientSound*> (ptr);
22 static SQInteger AmbientSound_set_pos_wrapper(HSQUIRRELVM vm)
25 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
26 sq_throwerror(vm, _SC("'set_pos' called without instance"));
29 scripting::AmbientSound* _this = reinterpret_cast<scripting::AmbientSound*> (data);
31 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
32 sq_throwerror(vm, _SC("Argument 1 not a float"));
36 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
37 sq_throwerror(vm, _SC("Argument 2 not a float"));
42 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
46 } catch(std::exception& e) {
47 sq_throwerror(vm, e.what());
50 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
56 static SQInteger AmbientSound_get_pos_x_wrapper(HSQUIRRELVM vm)
59 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
60 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
63 scripting::AmbientSound* _this = reinterpret_cast<scripting::AmbientSound*> (data);
66 float return_value = _this->get_pos_x();
68 sq_pushfloat(vm, return_value);
71 } catch(std::exception& e) {
72 sq_throwerror(vm, e.what());
75 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
81 static SQInteger AmbientSound_get_pos_y_wrapper(HSQUIRRELVM vm)
84 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
85 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
88 scripting::AmbientSound* _this = reinterpret_cast<scripting::AmbientSound*> (data);
91 float return_value = _this->get_pos_y();
93 sq_pushfloat(vm, return_value);
96 } catch(std::exception& e) {
97 sq_throwerror(vm, e.what());
100 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
106 static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger )
108 scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (ptr);
113 static SQInteger Camera_reload_config_wrapper(HSQUIRRELVM vm)
116 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
117 sq_throwerror(vm, _SC("'reload_config' called without instance"));
120 scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
123 _this->reload_config();
127 } catch(std::exception& e) {
128 sq_throwerror(vm, e.what());
131 sq_throwerror(vm, _SC("Unexpected exception while executing function 'reload_config'"));
137 static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm)
140 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
141 sq_throwerror(vm, _SC("'shake' called without instance"));
144 scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
146 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
147 sq_throwerror(vm, _SC("Argument 1 not a float"));
151 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
152 sq_throwerror(vm, _SC("Argument 2 not a float"));
156 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
157 sq_throwerror(vm, _SC("Argument 3 not a float"));
162 _this->shake(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
166 } catch(std::exception& e) {
167 sq_throwerror(vm, e.what());
170 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'"));
176 static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm)
179 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
180 sq_throwerror(vm, _SC("'set_pos' called without instance"));
183 scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
185 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
186 sq_throwerror(vm, _SC("Argument 1 not a float"));
190 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
191 sq_throwerror(vm, _SC("Argument 2 not a float"));
196 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
200 } catch(std::exception& e) {
201 sq_throwerror(vm, e.what());
204 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
210 static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm)
213 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
214 sq_throwerror(vm, _SC("'set_mode' called without instance"));
217 scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
219 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
220 sq_throwerror(vm, _SC("Argument 1 not a string"));
225 _this->set_mode(arg0);
229 } catch(std::exception& e) {
230 sq_throwerror(vm, e.what());
233 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_mode'"));
239 static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm)
242 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
243 sq_throwerror(vm, _SC("'scroll_to' called without instance"));
246 scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
248 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
249 sq_throwerror(vm, _SC("Argument 1 not a float"));
253 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
254 sq_throwerror(vm, _SC("Argument 2 not a float"));
258 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
259 sq_throwerror(vm, _SC("Argument 3 not a float"));
264 _this->scroll_to(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
268 } catch(std::exception& e) {
269 sq_throwerror(vm, e.what());
272 sq_throwerror(vm, _SC("Unexpected exception while executing function 'scroll_to'"));
278 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
280 scripting::Candle* _this = reinterpret_cast<scripting::Candle*> (ptr);
285 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
288 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
289 sq_throwerror(vm, _SC("'get_burning' called without instance"));
292 scripting::Candle* _this = reinterpret_cast<scripting::Candle*> (data);
295 bool return_value = _this->get_burning();
297 sq_pushbool(vm, return_value);
300 } catch(std::exception& e) {
301 sq_throwerror(vm, e.what());
304 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
310 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
313 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
314 sq_throwerror(vm, _SC("'set_burning' called without instance"));
317 scripting::Candle* _this = reinterpret_cast<scripting::Candle*> (data);
319 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
320 sq_throwerror(vm, _SC("Argument 1 not a bool"));
325 _this->set_burning(arg0 == SQTrue);
329 } catch(std::exception& e) {
330 sq_throwerror(vm, e.what());
333 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_burning'"));
339 static SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger )
341 scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (ptr);
346 static SQInteger DisplayEffect_fade_out_wrapper(HSQUIRRELVM vm)
349 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
350 sq_throwerror(vm, _SC("'fade_out' called without instance"));
353 scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
355 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
356 sq_throwerror(vm, _SC("Argument 1 not a float"));
361 _this->fade_out(static_cast<float> (arg0));
365 } catch(std::exception& e) {
366 sq_throwerror(vm, e.what());
369 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
375 static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm)
378 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
379 sq_throwerror(vm, _SC("'fade_in' called without instance"));
382 scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
384 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
385 sq_throwerror(vm, _SC("Argument 1 not a float"));
390 _this->fade_in(static_cast<float> (arg0));
394 } catch(std::exception& e) {
395 sq_throwerror(vm, e.what());
398 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
404 static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm)
407 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
408 sq_throwerror(vm, _SC("'set_black' called without instance"));
411 scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
413 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
414 sq_throwerror(vm, _SC("Argument 1 not a bool"));
419 _this->set_black(arg0 == SQTrue);
423 } catch(std::exception& e) {
424 sq_throwerror(vm, e.what());
427 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_black'"));
433 static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm)
436 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
437 sq_throwerror(vm, _SC("'is_black' called without instance"));
440 scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
443 bool return_value = _this->is_black();
445 sq_pushbool(vm, return_value);
448 } catch(std::exception& e) {
449 sq_throwerror(vm, e.what());
452 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_black'"));
458 static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm)
461 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
462 sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance"));
465 scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
467 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
468 sq_throwerror(vm, _SC("Argument 1 not a float"));
473 _this->sixteen_to_nine(static_cast<float> (arg0));
477 } catch(std::exception& e) {
478 sq_throwerror(vm, e.what());
481 sq_throwerror(vm, _SC("Unexpected exception while executing function 'sixteen_to_nine'"));
487 static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm)
490 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
491 sq_throwerror(vm, _SC("'four_to_three' called without instance"));
494 scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
496 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
497 sq_throwerror(vm, _SC("Argument 1 not a float"));
502 _this->four_to_three(static_cast<float> (arg0));
506 } catch(std::exception& e) {
507 sq_throwerror(vm, e.what());
510 sq_throwerror(vm, _SC("Unexpected exception while executing function 'four_to_three'"));
516 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
518 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (ptr);
523 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
526 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
527 sq_throwerror(vm, _SC("Argument 1 not a string"));
532 scripting::FloatingImage* _this = new scripting::FloatingImage(arg0);
533 if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
534 sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
537 sq_setreleasehook(vm, 1, FloatingImage_release_hook);
541 } catch(std::exception& e) {
542 sq_throwerror(vm, e.what());
545 sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
551 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
554 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
555 sq_throwerror(vm, _SC("'set_layer' called without instance"));
558 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
560 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
561 sq_throwerror(vm, _SC("Argument 1 not an integer"));
566 _this->set_layer(static_cast<int> (arg0));
570 } catch(std::exception& e) {
571 sq_throwerror(vm, e.what());
574 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
580 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
583 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
584 sq_throwerror(vm, _SC("'get_layer' called without instance"));
587 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
590 int return_value = _this->get_layer();
592 sq_pushinteger(vm, return_value);
595 } catch(std::exception& e) {
596 sq_throwerror(vm, e.what());
599 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
605 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
608 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
609 sq_throwerror(vm, _SC("'set_pos' called without instance"));
612 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
614 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
615 sq_throwerror(vm, _SC("Argument 1 not a float"));
619 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
620 sq_throwerror(vm, _SC("Argument 2 not a float"));
625 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
629 } catch(std::exception& e) {
630 sq_throwerror(vm, e.what());
633 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
639 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
642 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
643 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
646 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
649 float return_value = _this->get_pos_x();
651 sq_pushfloat(vm, return_value);
654 } catch(std::exception& e) {
655 sq_throwerror(vm, e.what());
658 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
664 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
667 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
668 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
671 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
674 float return_value = _this->get_pos_y();
676 sq_pushfloat(vm, return_value);
679 } catch(std::exception& e) {
680 sq_throwerror(vm, e.what());
683 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
689 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
692 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
693 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
696 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
698 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
699 sq_throwerror(vm, _SC("Argument 1 not an integer"));
704 _this->set_anchor_point(static_cast<int> (arg0));
708 } catch(std::exception& e) {
709 sq_throwerror(vm, e.what());
712 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
718 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
721 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
722 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
725 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
728 int return_value = _this->get_anchor_point();
730 sq_pushinteger(vm, return_value);
733 } catch(std::exception& e) {
734 sq_throwerror(vm, e.what());
737 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
743 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
746 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
747 sq_throwerror(vm, _SC("'set_visible' called without instance"));
750 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
752 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
753 sq_throwerror(vm, _SC("Argument 1 not a bool"));
758 _this->set_visible(arg0 == SQTrue);
762 } catch(std::exception& e) {
763 sq_throwerror(vm, e.what());
766 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
772 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
775 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
776 sq_throwerror(vm, _SC("'get_visible' called without instance"));
779 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
782 bool return_value = _this->get_visible();
784 sq_pushbool(vm, return_value);
787 } catch(std::exception& e) {
788 sq_throwerror(vm, e.what());
791 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
797 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
800 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
801 sq_throwerror(vm, _SC("'set_action' called without instance"));
804 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
806 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
807 sq_throwerror(vm, _SC("Argument 1 not a string"));
812 _this->set_action(arg0);
816 } catch(std::exception& e) {
817 sq_throwerror(vm, e.what());
820 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
826 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
829 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
830 sq_throwerror(vm, _SC("'get_action' called without instance"));
833 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
836 std::string return_value = _this->get_action();
838 sq_pushstring(vm, return_value.c_str(), return_value.size());
841 } catch(std::exception& e) {
842 sq_throwerror(vm, e.what());
845 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
851 static SQInteger FloatingImage_fade_in_wrapper(HSQUIRRELVM vm)
854 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
855 sq_throwerror(vm, _SC("'fade_in' called without instance"));
858 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
860 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
861 sq_throwerror(vm, _SC("Argument 1 not a float"));
866 _this->fade_in(static_cast<float> (arg0));
870 } catch(std::exception& e) {
871 sq_throwerror(vm, e.what());
874 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
880 static SQInteger FloatingImage_fade_out_wrapper(HSQUIRRELVM vm)
883 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
884 sq_throwerror(vm, _SC("'fade_out' called without instance"));
887 scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
889 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
890 sq_throwerror(vm, _SC("Argument 1 not a float"));
895 _this->fade_out(static_cast<float> (arg0));
899 } catch(std::exception& e) {
900 sq_throwerror(vm, e.what());
903 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
909 static SQInteger LevelTime_release_hook(SQUserPointer ptr, SQInteger )
911 scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (ptr);
916 static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm)
919 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
920 sq_throwerror(vm, _SC("'start' called without instance"));
923 scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (data);
930 } catch(std::exception& e) {
931 sq_throwerror(vm, e.what());
934 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
940 static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm)
943 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
944 sq_throwerror(vm, _SC("'stop' called without instance"));
947 scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (data);
954 } catch(std::exception& e) {
955 sq_throwerror(vm, e.what());
958 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
964 static SQInteger LevelTime_get_time_wrapper(HSQUIRRELVM vm)
967 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
968 sq_throwerror(vm, _SC("'get_time' called without instance"));
971 scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (data);
974 float return_value = _this->get_time();
976 sq_pushfloat(vm, return_value);
979 } catch(std::exception& e) {
980 sq_throwerror(vm, e.what());
983 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_time'"));
989 static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm)
992 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
993 sq_throwerror(vm, _SC("'set_time' called without instance"));
996 scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (data);
998 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
999 sq_throwerror(vm, _SC("Argument 1 not a float"));
1004 _this->set_time(static_cast<float> (arg0));
1008 } catch(std::exception& e) {
1009 sq_throwerror(vm, e.what());
1012 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_time'"));
1018 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1020 scripting::Platform* _this = reinterpret_cast<scripting::Platform*> (ptr);
1025 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1028 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1029 sq_throwerror(vm, _SC("'goto_node' called without instance"));
1032 scripting::Platform* _this = reinterpret_cast<scripting::Platform*> (data);
1034 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1035 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1040 _this->goto_node(static_cast<int> (arg0));
1044 } catch(std::exception& e) {
1045 sq_throwerror(vm, e.what());
1048 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1054 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1057 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1058 sq_throwerror(vm, _SC("'start_moving' called without instance"));
1061 scripting::Platform* _this = reinterpret_cast<scripting::Platform*> (data);
1064 _this->start_moving();
1068 } catch(std::exception& e) {
1069 sq_throwerror(vm, e.what());
1072 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
1078 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1081 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1082 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1085 scripting::Platform* _this = reinterpret_cast<scripting::Platform*> (data);
1088 _this->stop_moving();
1092 } catch(std::exception& e) {
1093 sq_throwerror(vm, e.what());
1096 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1102 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
1104 scripting::Player* _this = reinterpret_cast<scripting::Player*> (ptr);
1109 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
1112 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1113 sq_throwerror(vm, _SC("'add_bonus' called without instance"));
1116 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1118 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1119 sq_throwerror(vm, _SC("Argument 1 not a string"));
1124 bool return_value = _this->add_bonus(arg0);
1126 sq_pushbool(vm, return_value);
1129 } catch(std::exception& e) {
1130 sq_throwerror(vm, e.what());
1133 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1139 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
1142 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1143 sq_throwerror(vm, _SC("'add_coins' called without instance"));
1146 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1148 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1149 sq_throwerror(vm, _SC("Argument 1 not an integer"));
1154 _this->add_coins(static_cast<int> (arg0));
1158 } catch(std::exception& e) {
1159 sq_throwerror(vm, e.what());
1162 sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1168 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1171 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1172 sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1175 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1178 _this->make_invincible();
1182 } catch(std::exception& e) {
1183 sq_throwerror(vm, e.what());
1186 sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1192 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1195 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1196 sq_throwerror(vm, _SC("'deactivate' called without instance"));
1199 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1202 _this->deactivate();
1206 } catch(std::exception& e) {
1207 sq_throwerror(vm, e.what());
1210 sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1216 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1219 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1220 sq_throwerror(vm, _SC("'activate' called without instance"));
1223 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1230 } catch(std::exception& e) {
1231 sq_throwerror(vm, e.what());
1234 sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1240 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1243 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1244 sq_throwerror(vm, _SC("'walk' called without instance"));
1247 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1249 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1250 sq_throwerror(vm, _SC("Argument 1 not a float"));
1255 _this->walk(static_cast<float> (arg0));
1259 } catch(std::exception& e) {
1260 sq_throwerror(vm, e.what());
1263 sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1269 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1272 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1273 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1276 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1278 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1279 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1284 _this->set_visible(arg0 == SQTrue);
1288 } catch(std::exception& e) {
1289 sq_throwerror(vm, e.what());
1292 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1298 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1301 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1302 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1305 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1308 bool return_value = _this->get_visible();
1310 sq_pushbool(vm, return_value);
1313 } catch(std::exception& e) {
1314 sq_throwerror(vm, e.what());
1317 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1323 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1326 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1327 sq_throwerror(vm, _SC("'kill' called without instance"));
1330 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1332 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1333 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1338 _this->kill(arg0 == SQTrue);
1342 } catch(std::exception& e) {
1343 sq_throwerror(vm, e.what());
1346 sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1352 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1355 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1356 sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1359 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1361 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1362 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1367 _this->set_ghost_mode(arg0 == SQTrue);
1371 } catch(std::exception& e) {
1372 sq_throwerror(vm, e.what());
1375 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1381 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1384 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1385 sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1388 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1391 bool return_value = _this->get_ghost_mode();
1393 sq_pushbool(vm, return_value);
1396 } catch(std::exception& e) {
1397 sq_throwerror(vm, e.what());
1400 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1406 static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm)
1409 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1410 sq_throwerror(vm, _SC("'do_cheer' called without instance"));
1413 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1420 } catch(std::exception& e) {
1421 sq_throwerror(vm, e.what());
1424 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'"));
1430 static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm)
1433 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1434 sq_throwerror(vm, _SC("'do_duck' called without instance"));
1437 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1444 } catch(std::exception& e) {
1445 sq_throwerror(vm, e.what());
1448 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'"));
1454 static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm)
1457 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1458 sq_throwerror(vm, _SC("'do_standup' called without instance"));
1461 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1464 _this->do_standup();
1468 } catch(std::exception& e) {
1469 sq_throwerror(vm, e.what());
1472 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'"));
1478 static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm)
1481 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1482 sq_throwerror(vm, _SC("'do_backflip' called without instance"));
1485 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1488 _this->do_backflip();
1492 } catch(std::exception& e) {
1493 sq_throwerror(vm, e.what());
1496 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'"));
1502 static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm)
1505 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1506 sq_throwerror(vm, _SC("'do_jump' called without instance"));
1509 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1511 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1512 sq_throwerror(vm, _SC("Argument 1 not a float"));
1517 _this->do_jump(static_cast<float> (arg0));
1521 } catch(std::exception& e) {
1522 sq_throwerror(vm, e.what());
1525 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_jump'"));
1531 static SQInteger Player_trigger_sequence_wrapper(HSQUIRRELVM vm)
1534 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1535 sq_throwerror(vm, _SC("'trigger_sequence' called without instance"));
1538 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1540 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1541 sq_throwerror(vm, _SC("Argument 1 not a string"));
1546 _this->trigger_sequence(arg0);
1550 } catch(std::exception& e) {
1551 sq_throwerror(vm, e.what());
1554 sq_throwerror(vm, _SC("Unexpected exception while executing function 'trigger_sequence'"));
1560 static SQInteger Player_use_scripting_controller_wrapper(HSQUIRRELVM vm)
1563 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1564 sq_throwerror(vm, _SC("'use_scripting_controller' called without instance"));
1567 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1569 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1570 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1575 _this->use_scripting_controller(arg0 == SQTrue);
1579 } catch(std::exception& e) {
1580 sq_throwerror(vm, e.what());
1583 sq_throwerror(vm, _SC("Unexpected exception while executing function 'use_scripting_controller'"));
1589 static SQInteger Player_do_scripting_controller_wrapper(HSQUIRRELVM vm)
1592 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1593 sq_throwerror(vm, _SC("'do_scripting_controller' called without instance"));
1596 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1598 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1599 sq_throwerror(vm, _SC("Argument 1 not a string"));
1603 if(SQ_FAILED(sq_getbool(vm, 3, &arg1))) {
1604 sq_throwerror(vm, _SC("Argument 2 not a bool"));
1609 _this->do_scripting_controller(arg0, arg1 == SQTrue);
1613 } catch(std::exception& e) {
1614 sq_throwerror(vm, e.what());
1617 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_scripting_controller'"));
1623 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
1625 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (ptr);
1630 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
1633 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1634 sq_throwerror(vm, _SC("'set_action' called without instance"));
1637 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1639 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1640 sq_throwerror(vm, _SC("Argument 1 not a string"));
1645 _this->set_action(arg0);
1649 } catch(std::exception& e) {
1650 sq_throwerror(vm, e.what());
1653 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1659 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
1662 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1663 sq_throwerror(vm, _SC("'get_action' called without instance"));
1666 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1669 std::string return_value = _this->get_action();
1671 sq_pushstring(vm, return_value.c_str(), return_value.size());
1674 } catch(std::exception& e) {
1675 sq_throwerror(vm, e.what());
1678 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1684 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
1687 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1688 sq_throwerror(vm, _SC("'move' called without instance"));
1691 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1693 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1694 sq_throwerror(vm, _SC("Argument 1 not a float"));
1698 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1699 sq_throwerror(vm, _SC("Argument 2 not a float"));
1704 _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
1708 } catch(std::exception& e) {
1709 sq_throwerror(vm, e.what());
1712 sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
1718 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
1721 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1722 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1725 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1727 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1728 sq_throwerror(vm, _SC("Argument 1 not a float"));
1732 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1733 sq_throwerror(vm, _SC("Argument 2 not a float"));
1738 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1742 } catch(std::exception& e) {
1743 sq_throwerror(vm, e.what());
1746 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1752 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
1755 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1756 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1759 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1762 float return_value = _this->get_pos_x();
1764 sq_pushfloat(vm, return_value);
1767 } catch(std::exception& e) {
1768 sq_throwerror(vm, e.what());
1771 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1777 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
1780 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1781 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1784 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1787 float return_value = _this->get_pos_y();
1789 sq_pushfloat(vm, return_value);
1792 } catch(std::exception& e) {
1793 sq_throwerror(vm, e.what());
1796 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1802 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
1805 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1806 sq_throwerror(vm, _SC("'set_velocity' called without instance"));
1809 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1811 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1812 sq_throwerror(vm, _SC("Argument 1 not a float"));
1816 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1817 sq_throwerror(vm, _SC("Argument 2 not a float"));
1822 _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
1826 } catch(std::exception& e) {
1827 sq_throwerror(vm, e.what());
1830 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
1836 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
1839 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1840 sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
1843 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1846 float return_value = _this->get_velocity_x();
1848 sq_pushfloat(vm, return_value);
1851 } catch(std::exception& e) {
1852 sq_throwerror(vm, e.what());
1855 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
1861 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
1864 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1865 sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
1868 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1871 float return_value = _this->get_velocity_y();
1873 sq_pushfloat(vm, return_value);
1876 } catch(std::exception& e) {
1877 sq_throwerror(vm, e.what());
1880 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
1886 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
1889 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1890 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1893 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1895 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1896 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1901 _this->set_visible(arg0 == SQTrue);
1905 } catch(std::exception& e) {
1906 sq_throwerror(vm, e.what());
1909 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1915 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
1918 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1919 sq_throwerror(vm, _SC("'is_visible' called without instance"));
1922 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1925 bool return_value = _this->is_visible();
1927 sq_pushbool(vm, return_value);
1930 } catch(std::exception& e) {
1931 sq_throwerror(vm, e.what());
1934 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
1940 static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm)
1943 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1944 sq_throwerror(vm, _SC("'set_solid' called without instance"));
1947 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1949 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1950 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1955 _this->set_solid(arg0 == SQTrue);
1959 } catch(std::exception& e) {
1960 sq_throwerror(vm, e.what());
1963 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_solid'"));
1969 static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm)
1972 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1973 sq_throwerror(vm, _SC("'is_solid' called without instance"));
1976 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1979 bool return_value = _this->is_solid();
1981 sq_pushbool(vm, return_value);
1984 } catch(std::exception& e) {
1985 sq_throwerror(vm, e.what());
1988 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_solid'"));
1994 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
1997 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1998 sq_throwerror(vm, _SC("'get_name' called without instance"));
2001 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2004 std::string return_value = _this->get_name();
2006 sq_pushstring(vm, return_value.c_str(), return_value.size());
2009 } catch(std::exception& e) {
2010 sq_throwerror(vm, e.what());
2013 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
2019 static SQInteger SSector_release_hook(SQUserPointer ptr, SQInteger )
2021 scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (ptr);
2026 static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm)
2029 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2030 sq_throwerror(vm, _SC("'set_ambient_light' called without instance"));
2033 scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2035 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2036 sq_throwerror(vm, _SC("Argument 1 not a float"));
2040 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2041 sq_throwerror(vm, _SC("Argument 2 not a float"));
2045 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2046 sq_throwerror(vm, _SC("Argument 3 not a float"));
2051 _this->set_ambient_light(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2055 } catch(std::exception& e) {
2056 sq_throwerror(vm, e.what());
2059 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ambient_light'"));
2065 static SQInteger SSector_get_ambient_red_wrapper(HSQUIRRELVM vm)
2068 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2069 sq_throwerror(vm, _SC("'get_ambient_red' called without instance"));
2072 scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2075 float return_value = _this->get_ambient_red();
2077 sq_pushfloat(vm, return_value);
2080 } catch(std::exception& e) {
2081 sq_throwerror(vm, e.what());
2084 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_red'"));
2090 static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm)
2093 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2094 sq_throwerror(vm, _SC("'get_ambient_green' called without instance"));
2097 scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2100 float return_value = _this->get_ambient_green();
2102 sq_pushfloat(vm, return_value);
2105 } catch(std::exception& e) {
2106 sq_throwerror(vm, e.what());
2109 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_green'"));
2115 static SQInteger SSector_get_ambient_blue_wrapper(HSQUIRRELVM vm)
2118 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2119 sq_throwerror(vm, _SC("'get_ambient_blue' called without instance"));
2122 scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2125 float return_value = _this->get_ambient_blue();
2127 sq_pushfloat(vm, return_value);
2130 } catch(std::exception& e) {
2131 sq_throwerror(vm, e.what());
2134 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_blue'"));
2140 static SQInteger SSector_set_gravity_wrapper(HSQUIRRELVM vm)
2143 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2144 sq_throwerror(vm, _SC("'set_gravity' called without instance"));
2147 scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2149 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2150 sq_throwerror(vm, _SC("Argument 1 not a float"));
2155 _this->set_gravity(static_cast<float> (arg0));
2159 } catch(std::exception& e) {
2160 sq_throwerror(vm, e.what());
2163 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_gravity'"));
2169 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
2171 scripting::Text* _this = reinterpret_cast<scripting::Text*> (ptr);
2176 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
2179 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2180 sq_throwerror(vm, _SC("'set_text' called without instance"));
2183 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2185 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2186 sq_throwerror(vm, _SC("Argument 1 not a string"));
2191 _this->set_text(arg0);
2195 } catch(std::exception& e) {
2196 sq_throwerror(vm, e.what());
2199 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
2205 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
2208 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2209 sq_throwerror(vm, _SC("'set_font' called without instance"));
2212 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2214 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2215 sq_throwerror(vm, _SC("Argument 1 not a string"));
2220 _this->set_font(arg0);
2224 } catch(std::exception& e) {
2225 sq_throwerror(vm, e.what());
2228 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
2234 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
2237 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2238 sq_throwerror(vm, _SC("'fade_in' called without instance"));
2241 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2243 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2244 sq_throwerror(vm, _SC("Argument 1 not a float"));
2249 _this->fade_in(static_cast<float> (arg0));
2253 } catch(std::exception& e) {
2254 sq_throwerror(vm, e.what());
2257 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
2263 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
2266 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2267 sq_throwerror(vm, _SC("'fade_out' called without instance"));
2270 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2272 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2273 sq_throwerror(vm, _SC("Argument 1 not a float"));
2278 _this->fade_out(static_cast<float> (arg0));
2282 } catch(std::exception& e) {
2283 sq_throwerror(vm, e.what());
2286 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
2292 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
2295 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2296 sq_throwerror(vm, _SC("'set_visible' called without instance"));
2299 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2301 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2302 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2307 _this->set_visible(arg0 == SQTrue);
2311 } catch(std::exception& e) {
2312 sq_throwerror(vm, e.what());
2315 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
2321 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
2324 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2325 sq_throwerror(vm, _SC("'set_centered' called without instance"));
2328 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2330 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2331 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2336 _this->set_centered(arg0 == SQTrue);
2340 } catch(std::exception& e) {
2341 sq_throwerror(vm, e.what());
2344 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
2350 static SQInteger Text_set_pos_wrapper(HSQUIRRELVM vm)
2353 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2354 sq_throwerror(vm, _SC("'set_pos' called without instance"));
2357 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2359 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2360 sq_throwerror(vm, _SC("Argument 1 not a float"));
2364 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2365 sq_throwerror(vm, _SC("Argument 2 not a float"));
2370 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
2374 } catch(std::exception& e) {
2375 sq_throwerror(vm, e.what());
2378 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
2384 static SQInteger Text_get_pos_x_wrapper(HSQUIRRELVM vm)
2387 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2388 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
2391 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2394 float return_value = _this->get_pos_x();
2396 sq_pushfloat(vm, return_value);
2399 } catch(std::exception& e) {
2400 sq_throwerror(vm, e.what());
2403 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
2409 static SQInteger Text_get_pos_y_wrapper(HSQUIRRELVM vm)
2412 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2413 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
2416 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2419 float return_value = _this->get_pos_y();
2421 sq_pushfloat(vm, return_value);
2424 } catch(std::exception& e) {
2425 sq_throwerror(vm, e.what());
2428 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
2434 static SQInteger Text_set_anchor_point_wrapper(HSQUIRRELVM vm)
2437 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2438 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
2441 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2443 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2444 sq_throwerror(vm, _SC("Argument 1 not an integer"));
2449 _this->set_anchor_point(static_cast<int> (arg0));
2453 } catch(std::exception& e) {
2454 sq_throwerror(vm, e.what());
2457 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
2463 static SQInteger Text_get_anchor_point_wrapper(HSQUIRRELVM vm)
2466 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2467 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
2470 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2473 int return_value = _this->get_anchor_point();
2475 sq_pushinteger(vm, return_value);
2478 } catch(std::exception& e) {
2479 sq_throwerror(vm, e.what());
2482 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
2488 static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger )
2490 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (ptr);
2495 static SQInteger Thunderstorm_start_wrapper(HSQUIRRELVM vm)
2498 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2499 sq_throwerror(vm, _SC("'start' called without instance"));
2502 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2509 } catch(std::exception& e) {
2510 sq_throwerror(vm, e.what());
2513 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2519 static SQInteger Thunderstorm_stop_wrapper(HSQUIRRELVM vm)
2522 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2523 sq_throwerror(vm, _SC("'stop' called without instance"));
2526 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2533 } catch(std::exception& e) {
2534 sq_throwerror(vm, e.what());
2537 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2543 static SQInteger Thunderstorm_thunder_wrapper(HSQUIRRELVM vm)
2546 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2547 sq_throwerror(vm, _SC("'thunder' called without instance"));
2550 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2557 } catch(std::exception& e) {
2558 sq_throwerror(vm, e.what());
2561 sq_throwerror(vm, _SC("Unexpected exception while executing function 'thunder'"));
2567 static SQInteger Thunderstorm_lightning_wrapper(HSQUIRRELVM vm)
2570 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2571 sq_throwerror(vm, _SC("'lightning' called without instance"));
2574 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2581 } catch(std::exception& e) {
2582 sq_throwerror(vm, e.what());
2585 sq_throwerror(vm, _SC("Unexpected exception while executing function 'lightning'"));
2591 static SQInteger Thunderstorm_flash_wrapper(HSQUIRRELVM vm)
2594 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2595 sq_throwerror(vm, _SC("'flash' called without instance"));
2598 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2605 } catch(std::exception& e) {
2606 sq_throwerror(vm, e.what());
2609 sq_throwerror(vm, _SC("Unexpected exception while executing function 'flash'"));
2615 static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm)
2618 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2619 sq_throwerror(vm, _SC("'electrify' called without instance"));
2622 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2629 } catch(std::exception& e) {
2630 sq_throwerror(vm, e.what());
2633 sq_throwerror(vm, _SC("Unexpected exception while executing function 'electrify'"));
2639 static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger )
2641 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (ptr);
2646 static SQInteger TileMap_goto_node_wrapper(HSQUIRRELVM vm)
2649 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2650 sq_throwerror(vm, _SC("'goto_node' called without instance"));
2653 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2655 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2656 sq_throwerror(vm, _SC("Argument 1 not an integer"));
2661 _this->goto_node(static_cast<int> (arg0));
2665 } catch(std::exception& e) {
2666 sq_throwerror(vm, e.what());
2669 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2675 static SQInteger TileMap_start_moving_wrapper(HSQUIRRELVM vm)
2678 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2679 sq_throwerror(vm, _SC("'start_moving' called without instance"));
2682 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2685 _this->start_moving();
2689 } catch(std::exception& e) {
2690 sq_throwerror(vm, e.what());
2693 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2699 static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm)
2702 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2703 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2706 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2709 _this->stop_moving();
2713 } catch(std::exception& e) {
2714 sq_throwerror(vm, e.what());
2717 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2723 static SQInteger TileMap_fade_wrapper(HSQUIRRELVM vm)
2726 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2727 sq_throwerror(vm, _SC("'fade' called without instance"));
2730 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2732 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2733 sq_throwerror(vm, _SC("Argument 1 not a float"));
2737 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2738 sq_throwerror(vm, _SC("Argument 2 not a float"));
2743 _this->fade(static_cast<float> (arg0), static_cast<float> (arg1));
2747 } catch(std::exception& e) {
2748 sq_throwerror(vm, e.what());
2751 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade'"));
2757 static SQInteger TileMap_set_alpha_wrapper(HSQUIRRELVM vm)
2760 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2761 sq_throwerror(vm, _SC("'set_alpha' called without instance"));
2764 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2766 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2767 sq_throwerror(vm, _SC("Argument 1 not a float"));
2772 _this->set_alpha(static_cast<float> (arg0));
2776 } catch(std::exception& e) {
2777 sq_throwerror(vm, e.what());
2780 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_alpha'"));
2786 static SQInteger TileMap_get_alpha_wrapper(HSQUIRRELVM vm)
2789 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2790 sq_throwerror(vm, _SC("'get_alpha' called without instance"));
2793 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2796 float return_value = _this->get_alpha();
2798 sq_pushfloat(vm, return_value);
2801 } catch(std::exception& e) {
2802 sq_throwerror(vm, e.what());
2805 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_alpha'"));
2811 static SQInteger WillOWisp_release_hook(SQUserPointer ptr, SQInteger )
2813 scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (ptr);
2818 static SQInteger WillOWisp_goto_node_wrapper(HSQUIRRELVM vm)
2821 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2822 sq_throwerror(vm, _SC("'goto_node' called without instance"));
2825 scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2827 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2828 sq_throwerror(vm, _SC("Argument 1 not an integer"));
2833 _this->goto_node(static_cast<int> (arg0));
2837 } catch(std::exception& e) {
2838 sq_throwerror(vm, e.what());
2841 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2847 static SQInteger WillOWisp_set_state_wrapper(HSQUIRRELVM vm)
2850 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2851 sq_throwerror(vm, _SC("'set_state' called without instance"));
2854 scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2856 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2857 sq_throwerror(vm, _SC("Argument 1 not a string"));
2862 _this->set_state(arg0);
2866 } catch(std::exception& e) {
2867 sq_throwerror(vm, e.what());
2870 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_state'"));
2876 static SQInteger WillOWisp_start_moving_wrapper(HSQUIRRELVM vm)
2879 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2880 sq_throwerror(vm, _SC("'start_moving' called without instance"));
2883 scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2886 _this->start_moving();
2890 } catch(std::exception& e) {
2891 sq_throwerror(vm, e.what());
2894 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2900 static SQInteger WillOWisp_stop_moving_wrapper(HSQUIRRELVM vm)
2903 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2904 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2907 scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2910 _this->stop_moving();
2914 } catch(std::exception& e) {
2915 sq_throwerror(vm, e.what());
2918 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2924 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
2926 scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (ptr);
2931 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
2934 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2935 sq_throwerror(vm, _SC("'start' called without instance"));
2938 scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (data);
2945 } catch(std::exception& e) {
2946 sq_throwerror(vm, e.what());
2949 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2955 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
2958 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2959 sq_throwerror(vm, _SC("'stop' called without instance"));
2962 scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (data);
2969 } catch(std::exception& e) {
2970 sq_throwerror(vm, e.what());
2973 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2979 static SQInteger display_wrapper(HSQUIRRELVM vm)
2981 return scripting::display(vm);
2984 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
2986 HSQUIRRELVM arg0 = vm;
2989 scripting::print_stacktrace(arg0);
2993 } catch(std::exception& e) {
2994 sq_throwerror(vm, e.what());
2997 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
3003 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
3005 return scripting::get_current_thread(vm);
3008 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
3011 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3012 sq_throwerror(vm, _SC("Argument 1 not a string"));
3017 scripting::display_text_file(arg0);
3021 } catch(std::exception& e) {
3022 sq_throwerror(vm, e.what());
3025 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
3031 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
3034 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3035 sq_throwerror(vm, _SC("Argument 1 not a string"));
3040 scripting::load_worldmap(arg0);
3044 } catch(std::exception& e) {
3045 sq_throwerror(vm, e.what());
3048 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
3054 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
3057 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3058 sq_throwerror(vm, _SC("Argument 1 not a string"));
3063 scripting::load_level(arg0);
3067 } catch(std::exception& e) {
3068 sq_throwerror(vm, e.what());
3071 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
3077 static SQInteger wait_wrapper(HSQUIRRELVM vm)
3079 HSQUIRRELVM arg0 = vm;
3081 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
3082 sq_throwerror(vm, _SC("Argument 1 not a float"));
3087 scripting::wait(arg0, static_cast<float> (arg1));
3089 return sq_suspendvm(vm);
3091 } catch(std::exception& e) {
3092 sq_throwerror(vm, e.what());
3095 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
3101 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
3103 HSQUIRRELVM arg0 = vm;
3106 scripting::wait_for_screenswitch(arg0);
3108 return sq_suspendvm(vm);
3110 } catch(std::exception& e) {
3111 sq_throwerror(vm, e.what());
3114 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
3120 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
3125 scripting::exit_screen();
3129 } catch(std::exception& e) {
3130 sq_throwerror(vm, e.what());
3133 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
3139 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
3142 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3143 sq_throwerror(vm, _SC("Argument 1 not a float"));
3148 scripting::fadeout_screen(static_cast<float> (arg0));
3152 } catch(std::exception& e) {
3153 sq_throwerror(vm, e.what());
3156 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
3162 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
3165 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3166 sq_throwerror(vm, _SC("Argument 1 not a float"));
3170 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
3171 sq_throwerror(vm, _SC("Argument 2 not a float"));
3175 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
3176 sq_throwerror(vm, _SC("Argument 3 not a float"));
3181 scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
3185 } catch(std::exception& e) {
3186 sq_throwerror(vm, e.what());
3189 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
3195 static SQInteger abort_screenfade_wrapper(HSQUIRRELVM vm)
3200 scripting::abort_screenfade();
3204 } catch(std::exception& e) {
3205 sq_throwerror(vm, e.what());
3208 sq_throwerror(vm, _SC("Unexpected exception while executing function 'abort_screenfade'"));
3214 static SQInteger translate_wrapper(HSQUIRRELVM vm)
3217 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3218 sq_throwerror(vm, _SC("Argument 1 not a string"));
3223 std::string return_value = scripting::translate(arg0);
3225 sq_pushstring(vm, return_value.c_str(), return_value.size());
3228 } catch(std::exception& e) {
3229 sq_throwerror(vm, e.what());
3232 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
3238 static SQInteger import_wrapper(HSQUIRRELVM vm)
3240 HSQUIRRELVM arg0 = vm;
3242 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
3243 sq_throwerror(vm, _SC("Argument 1 not a string"));
3248 scripting::import(arg0, arg1);
3252 } catch(std::exception& e) {
3253 sq_throwerror(vm, e.what());
3256 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
3262 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
3267 scripting::save_state();
3271 } catch(std::exception& e) {
3272 sq_throwerror(vm, e.what());
3275 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
3281 static SQInteger update_worldmap_wrapper(HSQUIRRELVM vm)
3286 scripting::update_worldmap();
3290 } catch(std::exception& e) {
3291 sq_throwerror(vm, e.what());
3294 sq_throwerror(vm, _SC("Unexpected exception while executing function 'update_worldmap'"));
3300 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
3303 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3304 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3309 scripting::debug_collrects(arg0 == SQTrue);
3313 } catch(std::exception& e) {
3314 sq_throwerror(vm, e.what());
3317 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
3323 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
3326 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3327 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3332 scripting::debug_show_fps(arg0 == SQTrue);
3336 } catch(std::exception& e) {
3337 sq_throwerror(vm, e.what());
3340 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
3346 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
3349 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3350 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3355 scripting::debug_draw_solids_only(arg0 == SQTrue);
3359 } catch(std::exception& e) {
3360 sq_throwerror(vm, e.what());
3363 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
3369 static SQInteger debug_worldmap_ghost_wrapper(HSQUIRRELVM vm)
3372 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3373 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3378 scripting::debug_worldmap_ghost(arg0 == SQTrue);
3382 } catch(std::exception& e) {
3383 sq_throwerror(vm, e.what());
3386 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_worldmap_ghost'"));
3392 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
3395 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3396 sq_throwerror(vm, _SC("Argument 1 not a string"));
3401 scripting::play_music(arg0);
3405 } catch(std::exception& e) {
3406 sq_throwerror(vm, e.what());
3409 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
3415 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
3418 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3419 sq_throwerror(vm, _SC("Argument 1 not a string"));
3424 scripting::play_sound(arg0);
3428 } catch(std::exception& e) {
3429 sq_throwerror(vm, e.what());
3432 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
3438 static SQInteger set_game_speed_wrapper(HSQUIRRELVM vm)
3441 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3442 sq_throwerror(vm, _SC("Argument 1 not a float"));
3447 scripting::set_game_speed(static_cast<float> (arg0));
3451 } catch(std::exception& e) {
3452 sq_throwerror(vm, e.what());
3455 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_game_speed'"));
3461 static SQInteger grease_wrapper(HSQUIRRELVM vm)
3466 scripting::grease();
3470 } catch(std::exception& e) {
3471 sq_throwerror(vm, e.what());
3474 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
3480 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
3485 scripting::invincible();
3489 } catch(std::exception& e) {
3490 sq_throwerror(vm, e.what());
3493 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
3499 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
3508 } catch(std::exception& e) {
3509 sq_throwerror(vm, e.what());
3512 sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
3518 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
3523 scripting::mortal();
3527 } catch(std::exception& e) {
3528 sq_throwerror(vm, e.what());
3531 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
3537 static SQInteger restart_wrapper(HSQUIRRELVM vm)
3542 scripting::restart();
3546 } catch(std::exception& e) {
3547 sq_throwerror(vm, e.what());
3550 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
3556 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
3561 scripting::whereami();
3565 } catch(std::exception& e) {
3566 sq_throwerror(vm, e.what());
3569 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
3575 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
3580 scripting::gotoend();
3584 } catch(std::exception& e) {
3585 sq_throwerror(vm, e.what());
3588 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
3594 static SQInteger camera_wrapper(HSQUIRRELVM vm)
3599 scripting::camera();
3603 } catch(std::exception& e) {
3604 sq_throwerror(vm, e.what());
3607 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
3613 static SQInteger set_gamma_wrapper(HSQUIRRELVM vm)
3616 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3617 sq_throwerror(vm, _SC("Argument 1 not a float"));
3622 scripting::set_gamma(static_cast<float> (arg0));
3626 } catch(std::exception& e) {
3627 sq_throwerror(vm, e.what());
3630 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_gamma'"));
3636 static SQInteger quit_wrapper(HSQUIRRELVM vm)
3645 } catch(std::exception& e) {
3646 sq_throwerror(vm, e.what());
3649 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
3655 static SQInteger rand_wrapper(HSQUIRRELVM vm)
3659 int return_value = scripting::rand();
3661 sq_pushinteger(vm, return_value);
3664 } catch(std::exception& e) {
3665 sq_throwerror(vm, e.what());
3668 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
3674 static SQInteger record_demo_wrapper(HSQUIRRELVM vm)
3677 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3678 sq_throwerror(vm, _SC("Argument 1 not a string"));
3683 scripting::record_demo(arg0);
3687 } catch(std::exception& e) {
3688 sq_throwerror(vm, e.what());
3691 sq_throwerror(vm, _SC("Unexpected exception while executing function 'record_demo'"));
3697 static SQInteger play_demo_wrapper(HSQUIRRELVM vm)
3700 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3701 sq_throwerror(vm, _SC("Argument 1 not a string"));
3706 scripting::play_demo(arg0);
3710 } catch(std::exception& e) {
3711 sq_throwerror(vm, e.what());
3714 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_demo'"));
3720 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
3723 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3724 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3729 scripting::Level_finish(arg0 == SQTrue);
3733 } catch(std::exception& e) {
3734 sq_throwerror(vm, e.what());
3737 sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_finish'"));
3743 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
3746 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3747 sq_throwerror(vm, _SC("Argument 1 not a string"));
3751 if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
3752 sq_throwerror(vm, _SC("Argument 2 not a string"));
3757 scripting::Level_spawn(arg0, arg1);
3761 } catch(std::exception& e) {
3762 sq_throwerror(vm, e.what());
3765 sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_spawn'"));
3771 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
3776 scripting::Level_flip_vertically();
3780 } catch(std::exception& e) {
3781 sq_throwerror(vm, e.what());
3784 sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_flip_vertically'"));
3790 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
3795 scripting::Level_toggle_pause();
3799 } catch(std::exception& e) {
3800 sq_throwerror(vm, e.what());
3803 sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_toggle_pause'"));
3809 static SQInteger Level_edit_wrapper(HSQUIRRELVM vm)
3812 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3813 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3818 scripting::Level_edit(arg0 == SQTrue);
3822 } catch(std::exception& e) {
3823 sq_throwerror(vm, e.what());
3826 sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_edit'"));
3832 } // namespace wrapper
3833 void create_squirrel_instance(HSQUIRRELVM v, scripting::AmbientSound* object, bool setup_releasehook)
3835 using namespace wrapper;
3837 sq_pushroottable(v);
3838 sq_pushstring(v, "AmbientSound", -1);
3839 if(SQ_FAILED(sq_get(v, -2))) {
3840 std::ostringstream msg;
3841 msg << "Couldn't resolved squirrel type 'AmbientSound'";
3842 throw SquirrelError(v, msg.str());
3845 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3846 std::ostringstream msg;
3847 msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'";
3848 throw SquirrelError(v, msg.str());
3850 sq_remove(v, -2); // remove object name
3852 if(setup_releasehook) {
3853 sq_setreleasehook(v, -1, AmbientSound_release_hook);
3856 sq_remove(v, -2); // remove root table
3859 void create_squirrel_instance(HSQUIRRELVM v, scripting::Camera* object, bool setup_releasehook)
3861 using namespace wrapper;
3863 sq_pushroottable(v);
3864 sq_pushstring(v, "Camera", -1);
3865 if(SQ_FAILED(sq_get(v, -2))) {
3866 std::ostringstream msg;
3867 msg << "Couldn't resolved squirrel type 'Camera'";
3868 throw SquirrelError(v, msg.str());
3871 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3872 std::ostringstream msg;
3873 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
3874 throw SquirrelError(v, msg.str());
3876 sq_remove(v, -2); // remove object name
3878 if(setup_releasehook) {
3879 sq_setreleasehook(v, -1, Camera_release_hook);
3882 sq_remove(v, -2); // remove root table
3885 void create_squirrel_instance(HSQUIRRELVM v, scripting::Candle* object, bool setup_releasehook)
3887 using namespace wrapper;
3889 sq_pushroottable(v);
3890 sq_pushstring(v, "Candle", -1);
3891 if(SQ_FAILED(sq_get(v, -2))) {
3892 std::ostringstream msg;
3893 msg << "Couldn't resolved squirrel type 'Candle'";
3894 throw SquirrelError(v, msg.str());
3897 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3898 std::ostringstream msg;
3899 msg << "Couldn't setup squirrel instance for object of type 'Candle'";
3900 throw SquirrelError(v, msg.str());
3902 sq_remove(v, -2); // remove object name
3904 if(setup_releasehook) {
3905 sq_setreleasehook(v, -1, Candle_release_hook);
3908 sq_remove(v, -2); // remove root table
3911 void create_squirrel_instance(HSQUIRRELVM v, scripting::DisplayEffect* object, bool setup_releasehook)
3913 using namespace wrapper;
3915 sq_pushroottable(v);
3916 sq_pushstring(v, "DisplayEffect", -1);
3917 if(SQ_FAILED(sq_get(v, -2))) {
3918 std::ostringstream msg;
3919 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
3920 throw SquirrelError(v, msg.str());
3923 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3924 std::ostringstream msg;
3925 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
3926 throw SquirrelError(v, msg.str());
3928 sq_remove(v, -2); // remove object name
3930 if(setup_releasehook) {
3931 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
3934 sq_remove(v, -2); // remove root table
3937 void create_squirrel_instance(HSQUIRRELVM v, scripting::FloatingImage* object, bool setup_releasehook)
3939 using namespace wrapper;
3941 sq_pushroottable(v);
3942 sq_pushstring(v, "FloatingImage", -1);
3943 if(SQ_FAILED(sq_get(v, -2))) {
3944 std::ostringstream msg;
3945 msg << "Couldn't resolved squirrel type 'FloatingImage'";
3946 throw SquirrelError(v, msg.str());
3949 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3950 std::ostringstream msg;
3951 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
3952 throw SquirrelError(v, msg.str());
3954 sq_remove(v, -2); // remove object name
3956 if(setup_releasehook) {
3957 sq_setreleasehook(v, -1, FloatingImage_release_hook);
3960 sq_remove(v, -2); // remove root table
3963 void create_squirrel_instance(HSQUIRRELVM v, scripting::LevelTime* object, bool setup_releasehook)
3965 using namespace wrapper;
3967 sq_pushroottable(v);
3968 sq_pushstring(v, "LevelTime", -1);
3969 if(SQ_FAILED(sq_get(v, -2))) {
3970 std::ostringstream msg;
3971 msg << "Couldn't resolved squirrel type 'LevelTime'";
3972 throw SquirrelError(v, msg.str());
3975 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3976 std::ostringstream msg;
3977 msg << "Couldn't setup squirrel instance for object of type 'LevelTime'";
3978 throw SquirrelError(v, msg.str());
3980 sq_remove(v, -2); // remove object name
3982 if(setup_releasehook) {
3983 sq_setreleasehook(v, -1, LevelTime_release_hook);
3986 sq_remove(v, -2); // remove root table
3989 void create_squirrel_instance(HSQUIRRELVM v, scripting::Platform* object, bool setup_releasehook)
3991 using namespace wrapper;
3993 sq_pushroottable(v);
3994 sq_pushstring(v, "Platform", -1);
3995 if(SQ_FAILED(sq_get(v, -2))) {
3996 std::ostringstream msg;
3997 msg << "Couldn't resolved squirrel type 'Platform'";
3998 throw SquirrelError(v, msg.str());
4001 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4002 std::ostringstream msg;
4003 msg << "Couldn't setup squirrel instance for object of type 'Platform'";
4004 throw SquirrelError(v, msg.str());
4006 sq_remove(v, -2); // remove object name
4008 if(setup_releasehook) {
4009 sq_setreleasehook(v, -1, Platform_release_hook);
4012 sq_remove(v, -2); // remove root table
4015 void create_squirrel_instance(HSQUIRRELVM v, scripting::Player* object, bool setup_releasehook)
4017 using namespace wrapper;
4019 sq_pushroottable(v);
4020 sq_pushstring(v, "Player", -1);
4021 if(SQ_FAILED(sq_get(v, -2))) {
4022 std::ostringstream msg;
4023 msg << "Couldn't resolved squirrel type 'Player'";
4024 throw SquirrelError(v, msg.str());
4027 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4028 std::ostringstream msg;
4029 msg << "Couldn't setup squirrel instance for object of type 'Player'";
4030 throw SquirrelError(v, msg.str());
4032 sq_remove(v, -2); // remove object name
4034 if(setup_releasehook) {
4035 sq_setreleasehook(v, -1, Player_release_hook);
4038 sq_remove(v, -2); // remove root table
4041 void create_squirrel_instance(HSQUIRRELVM v, scripting::ScriptedObject* object, bool setup_releasehook)
4043 using namespace wrapper;
4045 sq_pushroottable(v);
4046 sq_pushstring(v, "ScriptedObject", -1);
4047 if(SQ_FAILED(sq_get(v, -2))) {
4048 std::ostringstream msg;
4049 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
4050 throw SquirrelError(v, msg.str());
4053 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4054 std::ostringstream msg;
4055 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
4056 throw SquirrelError(v, msg.str());
4058 sq_remove(v, -2); // remove object name
4060 if(setup_releasehook) {
4061 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
4064 sq_remove(v, -2); // remove root table
4067 void create_squirrel_instance(HSQUIRRELVM v, scripting::SSector* object, bool setup_releasehook)
4069 using namespace wrapper;
4071 sq_pushroottable(v);
4072 sq_pushstring(v, "SSector", -1);
4073 if(SQ_FAILED(sq_get(v, -2))) {
4074 std::ostringstream msg;
4075 msg << "Couldn't resolved squirrel type 'SSector'";
4076 throw SquirrelError(v, msg.str());
4079 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4080 std::ostringstream msg;
4081 msg << "Couldn't setup squirrel instance for object of type 'SSector'";
4082 throw SquirrelError(v, msg.str());
4084 sq_remove(v, -2); // remove object name
4086 if(setup_releasehook) {
4087 sq_setreleasehook(v, -1, SSector_release_hook);
4090 sq_remove(v, -2); // remove root table
4093 void create_squirrel_instance(HSQUIRRELVM v, scripting::Text* object, bool setup_releasehook)
4095 using namespace wrapper;
4097 sq_pushroottable(v);
4098 sq_pushstring(v, "Text", -1);
4099 if(SQ_FAILED(sq_get(v, -2))) {
4100 std::ostringstream msg;
4101 msg << "Couldn't resolved squirrel type 'Text'";
4102 throw SquirrelError(v, msg.str());
4105 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4106 std::ostringstream msg;
4107 msg << "Couldn't setup squirrel instance for object of type 'Text'";
4108 throw SquirrelError(v, msg.str());
4110 sq_remove(v, -2); // remove object name
4112 if(setup_releasehook) {
4113 sq_setreleasehook(v, -1, Text_release_hook);
4116 sq_remove(v, -2); // remove root table
4119 void create_squirrel_instance(HSQUIRRELVM v, scripting::Thunderstorm* object, bool setup_releasehook)
4121 using namespace wrapper;
4123 sq_pushroottable(v);
4124 sq_pushstring(v, "Thunderstorm", -1);
4125 if(SQ_FAILED(sq_get(v, -2))) {
4126 std::ostringstream msg;
4127 msg << "Couldn't resolved squirrel type 'Thunderstorm'";
4128 throw SquirrelError(v, msg.str());
4131 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4132 std::ostringstream msg;
4133 msg << "Couldn't setup squirrel instance for object of type 'Thunderstorm'";
4134 throw SquirrelError(v, msg.str());
4136 sq_remove(v, -2); // remove object name
4138 if(setup_releasehook) {
4139 sq_setreleasehook(v, -1, Thunderstorm_release_hook);
4142 sq_remove(v, -2); // remove root table
4145 void create_squirrel_instance(HSQUIRRELVM v, scripting::TileMap* object, bool setup_releasehook)
4147 using namespace wrapper;
4149 sq_pushroottable(v);
4150 sq_pushstring(v, "TileMap", -1);
4151 if(SQ_FAILED(sq_get(v, -2))) {
4152 std::ostringstream msg;
4153 msg << "Couldn't resolved squirrel type 'TileMap'";
4154 throw SquirrelError(v, msg.str());
4157 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4158 std::ostringstream msg;
4159 msg << "Couldn't setup squirrel instance for object of type 'TileMap'";
4160 throw SquirrelError(v, msg.str());
4162 sq_remove(v, -2); // remove object name
4164 if(setup_releasehook) {
4165 sq_setreleasehook(v, -1, TileMap_release_hook);
4168 sq_remove(v, -2); // remove root table
4171 void create_squirrel_instance(HSQUIRRELVM v, scripting::WillOWisp* object, bool setup_releasehook)
4173 using namespace wrapper;
4175 sq_pushroottable(v);
4176 sq_pushstring(v, "WillOWisp", -1);
4177 if(SQ_FAILED(sq_get(v, -2))) {
4178 std::ostringstream msg;
4179 msg << "Couldn't resolved squirrel type 'WillOWisp'";
4180 throw SquirrelError(v, msg.str());
4183 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4184 std::ostringstream msg;
4185 msg << "Couldn't setup squirrel instance for object of type 'WillOWisp'";
4186 throw SquirrelError(v, msg.str());
4188 sq_remove(v, -2); // remove object name
4190 if(setup_releasehook) {
4191 sq_setreleasehook(v, -1, WillOWisp_release_hook);
4194 sq_remove(v, -2); // remove root table
4197 void create_squirrel_instance(HSQUIRRELVM v, scripting::Wind* object, bool setup_releasehook)
4199 using namespace wrapper;
4201 sq_pushroottable(v);
4202 sq_pushstring(v, "Wind", -1);
4203 if(SQ_FAILED(sq_get(v, -2))) {
4204 std::ostringstream msg;
4205 msg << "Couldn't resolved squirrel type 'Wind'";
4206 throw SquirrelError(v, msg.str());
4209 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4210 std::ostringstream msg;
4211 msg << "Couldn't setup squirrel instance for object of type 'Wind'";
4212 throw SquirrelError(v, msg.str());
4214 sq_remove(v, -2); // remove object name
4216 if(setup_releasehook) {
4217 sq_setreleasehook(v, -1, Wind_release_hook);
4220 sq_remove(v, -2); // remove root table
4223 void register_supertux_wrapper(HSQUIRRELVM v)
4225 using namespace wrapper;
4227 sq_pushstring(v, "ANCHOR_TOP", -1);
4228 sq_pushinteger(v, 16);
4229 if(SQ_FAILED(sq_createslot(v, -3))) {
4230 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
4233 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
4234 sq_pushinteger(v, 32);
4235 if(SQ_FAILED(sq_createslot(v, -3))) {
4236 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
4239 sq_pushstring(v, "ANCHOR_LEFT", -1);
4240 sq_pushinteger(v, 1);
4241 if(SQ_FAILED(sq_createslot(v, -3))) {
4242 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
4245 sq_pushstring(v, "ANCHOR_RIGHT", -1);
4246 sq_pushinteger(v, 2);
4247 if(SQ_FAILED(sq_createslot(v, -3))) {
4248 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
4251 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
4252 sq_pushinteger(v, 0);
4253 if(SQ_FAILED(sq_createslot(v, -3))) {
4254 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
4257 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
4258 sq_pushinteger(v, 17);
4259 if(SQ_FAILED(sq_createslot(v, -3))) {
4260 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
4263 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
4264 sq_pushinteger(v, 18);
4265 if(SQ_FAILED(sq_createslot(v, -3))) {
4266 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
4269 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
4270 sq_pushinteger(v, 33);
4271 if(SQ_FAILED(sq_createslot(v, -3))) {
4272 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
4275 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
4276 sq_pushinteger(v, 34);
4277 if(SQ_FAILED(sq_createslot(v, -3))) {
4278 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
4281 sq_pushstring(v, "display", -1);
4282 sq_newclosure(v, &display_wrapper, 0);
4283 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t.");
4284 if(SQ_FAILED(sq_createslot(v, -3))) {
4285 throw SquirrelError(v, "Couldn't register function 'display'");
4288 sq_pushstring(v, "print_stacktrace", -1);
4289 sq_newclosure(v, &print_stacktrace_wrapper, 0);
4290 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4291 if(SQ_FAILED(sq_createslot(v, -3))) {
4292 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
4295 sq_pushstring(v, "get_current_thread", -1);
4296 sq_newclosure(v, &get_current_thread_wrapper, 0);
4297 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t");
4298 if(SQ_FAILED(sq_createslot(v, -3))) {
4299 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
4302 sq_pushstring(v, "display_text_file", -1);
4303 sq_newclosure(v, &display_text_file_wrapper, 0);
4304 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4305 if(SQ_FAILED(sq_createslot(v, -3))) {
4306 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
4309 sq_pushstring(v, "load_worldmap", -1);
4310 sq_newclosure(v, &load_worldmap_wrapper, 0);
4311 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4312 if(SQ_FAILED(sq_createslot(v, -3))) {
4313 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
4316 sq_pushstring(v, "load_level", -1);
4317 sq_newclosure(v, &load_level_wrapper, 0);
4318 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4319 if(SQ_FAILED(sq_createslot(v, -3))) {
4320 throw SquirrelError(v, "Couldn't register function 'load_level'");
4323 sq_pushstring(v, "wait", -1);
4324 sq_newclosure(v, &wait_wrapper, 0);
4325 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4326 if(SQ_FAILED(sq_createslot(v, -3))) {
4327 throw SquirrelError(v, "Couldn't register function 'wait'");
4330 sq_pushstring(v, "wait_for_screenswitch", -1);
4331 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
4332 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4333 if(SQ_FAILED(sq_createslot(v, -3))) {
4334 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
4337 sq_pushstring(v, "exit_screen", -1);
4338 sq_newclosure(v, &exit_screen_wrapper, 0);
4339 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4340 if(SQ_FAILED(sq_createslot(v, -3))) {
4341 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
4344 sq_pushstring(v, "fadeout_screen", -1);
4345 sq_newclosure(v, &fadeout_screen_wrapper, 0);
4346 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4347 if(SQ_FAILED(sq_createslot(v, -3))) {
4348 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
4351 sq_pushstring(v, "shrink_screen", -1);
4352 sq_newclosure(v, &shrink_screen_wrapper, 0);
4353 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4354 if(SQ_FAILED(sq_createslot(v, -3))) {
4355 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
4358 sq_pushstring(v, "abort_screenfade", -1);
4359 sq_newclosure(v, &abort_screenfade_wrapper, 0);
4360 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4361 if(SQ_FAILED(sq_createslot(v, -3))) {
4362 throw SquirrelError(v, "Couldn't register function 'abort_screenfade'");
4365 sq_pushstring(v, "translate", -1);
4366 sq_newclosure(v, &translate_wrapper, 0);
4367 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4368 if(SQ_FAILED(sq_createslot(v, -3))) {
4369 throw SquirrelError(v, "Couldn't register function 'translate'");
4372 sq_pushstring(v, "import", -1);
4373 sq_newclosure(v, &import_wrapper, 0);
4374 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4375 if(SQ_FAILED(sq_createslot(v, -3))) {
4376 throw SquirrelError(v, "Couldn't register function 'import'");
4379 sq_pushstring(v, "save_state", -1);
4380 sq_newclosure(v, &save_state_wrapper, 0);
4381 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4382 if(SQ_FAILED(sq_createslot(v, -3))) {
4383 throw SquirrelError(v, "Couldn't register function 'save_state'");
4386 sq_pushstring(v, "update_worldmap", -1);
4387 sq_newclosure(v, &update_worldmap_wrapper, 0);
4388 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4389 if(SQ_FAILED(sq_createslot(v, -3))) {
4390 throw SquirrelError(v, "Couldn't register function 'update_worldmap'");
4393 sq_pushstring(v, "debug_collrects", -1);
4394 sq_newclosure(v, &debug_collrects_wrapper, 0);
4395 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4396 if(SQ_FAILED(sq_createslot(v, -3))) {
4397 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
4400 sq_pushstring(v, "debug_show_fps", -1);
4401 sq_newclosure(v, &debug_show_fps_wrapper, 0);
4402 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4403 if(SQ_FAILED(sq_createslot(v, -3))) {
4404 throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
4407 sq_pushstring(v, "debug_draw_solids_only", -1);
4408 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
4409 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4410 if(SQ_FAILED(sq_createslot(v, -3))) {
4411 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
4414 sq_pushstring(v, "debug_worldmap_ghost", -1);
4415 sq_newclosure(v, &debug_worldmap_ghost_wrapper, 0);
4416 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4417 if(SQ_FAILED(sq_createslot(v, -3))) {
4418 throw SquirrelError(v, "Couldn't register function 'debug_worldmap_ghost'");
4421 sq_pushstring(v, "play_music", -1);
4422 sq_newclosure(v, &play_music_wrapper, 0);
4423 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4424 if(SQ_FAILED(sq_createslot(v, -3))) {
4425 throw SquirrelError(v, "Couldn't register function 'play_music'");
4428 sq_pushstring(v, "play_sound", -1);
4429 sq_newclosure(v, &play_sound_wrapper, 0);
4430 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4431 if(SQ_FAILED(sq_createslot(v, -3))) {
4432 throw SquirrelError(v, "Couldn't register function 'play_sound'");
4435 sq_pushstring(v, "set_game_speed", -1);
4436 sq_newclosure(v, &set_game_speed_wrapper, 0);
4437 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4438 if(SQ_FAILED(sq_createslot(v, -3))) {
4439 throw SquirrelError(v, "Couldn't register function 'set_game_speed'");
4442 sq_pushstring(v, "grease", -1);
4443 sq_newclosure(v, &grease_wrapper, 0);
4444 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4445 if(SQ_FAILED(sq_createslot(v, -3))) {
4446 throw SquirrelError(v, "Couldn't register function 'grease'");
4449 sq_pushstring(v, "invincible", -1);
4450 sq_newclosure(v, &invincible_wrapper, 0);
4451 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4452 if(SQ_FAILED(sq_createslot(v, -3))) {
4453 throw SquirrelError(v, "Couldn't register function 'invincible'");
4456 sq_pushstring(v, "ghost", -1);
4457 sq_newclosure(v, &ghost_wrapper, 0);
4458 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4459 if(SQ_FAILED(sq_createslot(v, -3))) {
4460 throw SquirrelError(v, "Couldn't register function 'ghost'");
4463 sq_pushstring(v, "mortal", -1);
4464 sq_newclosure(v, &mortal_wrapper, 0);
4465 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4466 if(SQ_FAILED(sq_createslot(v, -3))) {
4467 throw SquirrelError(v, "Couldn't register function 'mortal'");
4470 sq_pushstring(v, "restart", -1);
4471 sq_newclosure(v, &restart_wrapper, 0);
4472 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4473 if(SQ_FAILED(sq_createslot(v, -3))) {
4474 throw SquirrelError(v, "Couldn't register function 'restart'");
4477 sq_pushstring(v, "whereami", -1);
4478 sq_newclosure(v, &whereami_wrapper, 0);
4479 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4480 if(SQ_FAILED(sq_createslot(v, -3))) {
4481 throw SquirrelError(v, "Couldn't register function 'whereami'");
4484 sq_pushstring(v, "gotoend", -1);
4485 sq_newclosure(v, &gotoend_wrapper, 0);
4486 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4487 if(SQ_FAILED(sq_createslot(v, -3))) {
4488 throw SquirrelError(v, "Couldn't register function 'gotoend'");
4491 sq_pushstring(v, "camera", -1);
4492 sq_newclosure(v, &camera_wrapper, 0);
4493 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4494 if(SQ_FAILED(sq_createslot(v, -3))) {
4495 throw SquirrelError(v, "Couldn't register function 'camera'");
4498 sq_pushstring(v, "set_gamma", -1);
4499 sq_newclosure(v, &set_gamma_wrapper, 0);
4500 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4501 if(SQ_FAILED(sq_createslot(v, -3))) {
4502 throw SquirrelError(v, "Couldn't register function 'set_gamma'");
4505 sq_pushstring(v, "quit", -1);
4506 sq_newclosure(v, &quit_wrapper, 0);
4507 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4508 if(SQ_FAILED(sq_createslot(v, -3))) {
4509 throw SquirrelError(v, "Couldn't register function 'quit'");
4512 sq_pushstring(v, "rand", -1);
4513 sq_newclosure(v, &rand_wrapper, 0);
4514 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4515 if(SQ_FAILED(sq_createslot(v, -3))) {
4516 throw SquirrelError(v, "Couldn't register function 'rand'");
4519 sq_pushstring(v, "record_demo", -1);
4520 sq_newclosure(v, &record_demo_wrapper, 0);
4521 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4522 if(SQ_FAILED(sq_createslot(v, -3))) {
4523 throw SquirrelError(v, "Couldn't register function 'record_demo'");
4526 sq_pushstring(v, "play_demo", -1);
4527 sq_newclosure(v, &play_demo_wrapper, 0);
4528 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4529 if(SQ_FAILED(sq_createslot(v, -3))) {
4530 throw SquirrelError(v, "Couldn't register function 'play_demo'");
4533 sq_pushstring(v, "Level_finish", -1);
4534 sq_newclosure(v, &Level_finish_wrapper, 0);
4535 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4536 if(SQ_FAILED(sq_createslot(v, -3))) {
4537 throw SquirrelError(v, "Couldn't register function 'Level_finish'");
4540 sq_pushstring(v, "Level_spawn", -1);
4541 sq_newclosure(v, &Level_spawn_wrapper, 0);
4542 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tss");
4543 if(SQ_FAILED(sq_createslot(v, -3))) {
4544 throw SquirrelError(v, "Couldn't register function 'Level_spawn'");
4547 sq_pushstring(v, "Level_flip_vertically", -1);
4548 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
4549 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4550 if(SQ_FAILED(sq_createslot(v, -3))) {
4551 throw SquirrelError(v, "Couldn't register function 'Level_flip_vertically'");
4554 sq_pushstring(v, "Level_toggle_pause", -1);
4555 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
4556 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4557 if(SQ_FAILED(sq_createslot(v, -3))) {
4558 throw SquirrelError(v, "Couldn't register function 'Level_toggle_pause'");
4561 sq_pushstring(v, "Level_edit", -1);
4562 sq_newclosure(v, &Level_edit_wrapper, 0);
4563 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4564 if(SQ_FAILED(sq_createslot(v, -3))) {
4565 throw SquirrelError(v, "Couldn't register function 'Level_edit'");
4568 // Register class AmbientSound
4569 sq_pushstring(v, "AmbientSound", -1);
4570 if(sq_newclass(v, SQFalse) < 0) {
4571 std::ostringstream msg;
4572 msg << "Couldn't create new class 'AmbientSound'";
4573 throw SquirrelError(v, msg.str());
4575 sq_pushstring(v, "set_pos", -1);
4576 sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
4577 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4578 if(SQ_FAILED(sq_createslot(v, -3))) {
4579 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4582 sq_pushstring(v, "get_pos_x", -1);
4583 sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
4584 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4585 if(SQ_FAILED(sq_createslot(v, -3))) {
4586 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4589 sq_pushstring(v, "get_pos_y", -1);
4590 sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
4591 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4592 if(SQ_FAILED(sq_createslot(v, -3))) {
4593 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4596 if(SQ_FAILED(sq_createslot(v, -3))) {
4597 throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
4600 // Register class Camera
4601 sq_pushstring(v, "Camera", -1);
4602 if(sq_newclass(v, SQFalse) < 0) {
4603 std::ostringstream msg;
4604 msg << "Couldn't create new class 'Camera'";
4605 throw SquirrelError(v, msg.str());
4607 sq_pushstring(v, "reload_config", -1);
4608 sq_newclosure(v, &Camera_reload_config_wrapper, 0);
4609 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4610 if(SQ_FAILED(sq_createslot(v, -3))) {
4611 throw SquirrelError(v, "Couldn't register function 'reload_config'");
4614 sq_pushstring(v, "shake", -1);
4615 sq_newclosure(v, &Camera_shake_wrapper, 0);
4616 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4617 if(SQ_FAILED(sq_createslot(v, -3))) {
4618 throw SquirrelError(v, "Couldn't register function 'shake'");
4621 sq_pushstring(v, "set_pos", -1);
4622 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
4623 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4624 if(SQ_FAILED(sq_createslot(v, -3))) {
4625 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4628 sq_pushstring(v, "set_mode", -1);
4629 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
4630 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4631 if(SQ_FAILED(sq_createslot(v, -3))) {
4632 throw SquirrelError(v, "Couldn't register function 'set_mode'");
4635 sq_pushstring(v, "scroll_to", -1);
4636 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
4637 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4638 if(SQ_FAILED(sq_createslot(v, -3))) {
4639 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
4642 if(SQ_FAILED(sq_createslot(v, -3))) {
4643 throw SquirrelError(v, "Couldn't register class 'Camera'");
4646 // Register class Candle
4647 sq_pushstring(v, "Candle", -1);
4648 if(sq_newclass(v, SQFalse) < 0) {
4649 std::ostringstream msg;
4650 msg << "Couldn't create new class 'Candle'";
4651 throw SquirrelError(v, msg.str());
4653 sq_pushstring(v, "get_burning", -1);
4654 sq_newclosure(v, &Candle_get_burning_wrapper, 0);
4655 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4656 if(SQ_FAILED(sq_createslot(v, -3))) {
4657 throw SquirrelError(v, "Couldn't register function 'get_burning'");
4660 sq_pushstring(v, "set_burning", -1);
4661 sq_newclosure(v, &Candle_set_burning_wrapper, 0);
4662 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4663 if(SQ_FAILED(sq_createslot(v, -3))) {
4664 throw SquirrelError(v, "Couldn't register function 'set_burning'");
4667 if(SQ_FAILED(sq_createslot(v, -3))) {
4668 throw SquirrelError(v, "Couldn't register class 'Candle'");
4671 // Register class DisplayEffect
4672 sq_pushstring(v, "DisplayEffect", -1);
4673 if(sq_newclass(v, SQFalse) < 0) {
4674 std::ostringstream msg;
4675 msg << "Couldn't create new class 'DisplayEffect'";
4676 throw SquirrelError(v, msg.str());
4678 sq_pushstring(v, "fade_out", -1);
4679 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
4680 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4681 if(SQ_FAILED(sq_createslot(v, -3))) {
4682 throw SquirrelError(v, "Couldn't register function 'fade_out'");
4685 sq_pushstring(v, "fade_in", -1);
4686 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
4687 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4688 if(SQ_FAILED(sq_createslot(v, -3))) {
4689 throw SquirrelError(v, "Couldn't register function 'fade_in'");
4692 sq_pushstring(v, "set_black", -1);
4693 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
4694 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4695 if(SQ_FAILED(sq_createslot(v, -3))) {
4696 throw SquirrelError(v, "Couldn't register function 'set_black'");
4699 sq_pushstring(v, "is_black", -1);
4700 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
4701 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4702 if(SQ_FAILED(sq_createslot(v, -3))) {
4703 throw SquirrelError(v, "Couldn't register function 'is_black'");
4706 sq_pushstring(v, "sixteen_to_nine", -1);
4707 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
4708 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4709 if(SQ_FAILED(sq_createslot(v, -3))) {
4710 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
4713 sq_pushstring(v, "four_to_three", -1);
4714 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
4715 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4716 if(SQ_FAILED(sq_createslot(v, -3))) {
4717 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
4720 if(SQ_FAILED(sq_createslot(v, -3))) {
4721 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
4724 // Register class FloatingImage
4725 sq_pushstring(v, "FloatingImage", -1);
4726 if(sq_newclass(v, SQFalse) < 0) {
4727 std::ostringstream msg;
4728 msg << "Couldn't create new class 'FloatingImage'";
4729 throw SquirrelError(v, msg.str());
4731 sq_pushstring(v, "constructor", -1);
4732 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
4733 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4734 if(SQ_FAILED(sq_createslot(v, -3))) {
4735 throw SquirrelError(v, "Couldn't register function 'constructor'");
4738 sq_pushstring(v, "set_layer", -1);
4739 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
4740 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4741 if(SQ_FAILED(sq_createslot(v, -3))) {
4742 throw SquirrelError(v, "Couldn't register function 'set_layer'");
4745 sq_pushstring(v, "get_layer", -1);
4746 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
4747 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4748 if(SQ_FAILED(sq_createslot(v, -3))) {
4749 throw SquirrelError(v, "Couldn't register function 'get_layer'");
4752 sq_pushstring(v, "set_pos", -1);
4753 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
4754 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4755 if(SQ_FAILED(sq_createslot(v, -3))) {
4756 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4759 sq_pushstring(v, "get_pos_x", -1);
4760 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
4761 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4762 if(SQ_FAILED(sq_createslot(v, -3))) {
4763 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4766 sq_pushstring(v, "get_pos_y", -1);
4767 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
4768 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4769 if(SQ_FAILED(sq_createslot(v, -3))) {
4770 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4773 sq_pushstring(v, "set_anchor_point", -1);
4774 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
4775 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4776 if(SQ_FAILED(sq_createslot(v, -3))) {
4777 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4780 sq_pushstring(v, "get_anchor_point", -1);
4781 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
4782 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4783 if(SQ_FAILED(sq_createslot(v, -3))) {
4784 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4787 sq_pushstring(v, "set_visible", -1);
4788 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
4789 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4790 if(SQ_FAILED(sq_createslot(v, -3))) {
4791 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4794 sq_pushstring(v, "get_visible", -1);
4795 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
4796 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4797 if(SQ_FAILED(sq_createslot(v, -3))) {
4798 throw SquirrelError(v, "Couldn't register function 'get_visible'");
4801 sq_pushstring(v, "set_action", -1);
4802 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
4803 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4804 if(SQ_FAILED(sq_createslot(v, -3))) {
4805 throw SquirrelError(v, "Couldn't register function 'set_action'");
4808 sq_pushstring(v, "get_action", -1);
4809 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
4810 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4811 if(SQ_FAILED(sq_createslot(v, -3))) {
4812 throw SquirrelError(v, "Couldn't register function 'get_action'");
4815 sq_pushstring(v, "fade_in", -1);
4816 sq_newclosure(v, &FloatingImage_fade_in_wrapper, 0);
4817 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4818 if(SQ_FAILED(sq_createslot(v, -3))) {
4819 throw SquirrelError(v, "Couldn't register function 'fade_in'");
4822 sq_pushstring(v, "fade_out", -1);
4823 sq_newclosure(v, &FloatingImage_fade_out_wrapper, 0);
4824 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4825 if(SQ_FAILED(sq_createslot(v, -3))) {
4826 throw SquirrelError(v, "Couldn't register function 'fade_out'");
4829 if(SQ_FAILED(sq_createslot(v, -3))) {
4830 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
4833 // Register class LevelTime
4834 sq_pushstring(v, "LevelTime", -1);
4835 if(sq_newclass(v, SQFalse) < 0) {
4836 std::ostringstream msg;
4837 msg << "Couldn't create new class 'LevelTime'";
4838 throw SquirrelError(v, msg.str());
4840 sq_pushstring(v, "start", -1);
4841 sq_newclosure(v, &LevelTime_start_wrapper, 0);
4842 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4843 if(SQ_FAILED(sq_createslot(v, -3))) {
4844 throw SquirrelError(v, "Couldn't register function 'start'");
4847 sq_pushstring(v, "stop", -1);
4848 sq_newclosure(v, &LevelTime_stop_wrapper, 0);
4849 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4850 if(SQ_FAILED(sq_createslot(v, -3))) {
4851 throw SquirrelError(v, "Couldn't register function 'stop'");
4854 sq_pushstring(v, "get_time", -1);
4855 sq_newclosure(v, &LevelTime_get_time_wrapper, 0);
4856 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4857 if(SQ_FAILED(sq_createslot(v, -3))) {
4858 throw SquirrelError(v, "Couldn't register function 'get_time'");
4861 sq_pushstring(v, "set_time", -1);
4862 sq_newclosure(v, &LevelTime_set_time_wrapper, 0);
4863 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4864 if(SQ_FAILED(sq_createslot(v, -3))) {
4865 throw SquirrelError(v, "Couldn't register function 'set_time'");
4868 if(SQ_FAILED(sq_createslot(v, -3))) {
4869 throw SquirrelError(v, "Couldn't register class 'LevelTime'");
4872 // Register class Platform
4873 sq_pushstring(v, "Platform", -1);
4874 if(sq_newclass(v, SQFalse) < 0) {
4875 std::ostringstream msg;
4876 msg << "Couldn't create new class 'Platform'";
4877 throw SquirrelError(v, msg.str());
4879 sq_pushstring(v, "goto_node", -1);
4880 sq_newclosure(v, &Platform_goto_node_wrapper, 0);
4881 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4882 if(SQ_FAILED(sq_createslot(v, -3))) {
4883 throw SquirrelError(v, "Couldn't register function 'goto_node'");
4886 sq_pushstring(v, "start_moving", -1);
4887 sq_newclosure(v, &Platform_start_moving_wrapper, 0);
4888 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4889 if(SQ_FAILED(sq_createslot(v, -3))) {
4890 throw SquirrelError(v, "Couldn't register function 'start_moving'");
4893 sq_pushstring(v, "stop_moving", -1);
4894 sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
4895 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4896 if(SQ_FAILED(sq_createslot(v, -3))) {
4897 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
4900 if(SQ_FAILED(sq_createslot(v, -3))) {
4901 throw SquirrelError(v, "Couldn't register class 'Platform'");
4904 // Register class Player
4905 sq_pushstring(v, "Player", -1);
4906 if(sq_newclass(v, SQFalse) < 0) {
4907 std::ostringstream msg;
4908 msg << "Couldn't create new class 'Player'";
4909 throw SquirrelError(v, msg.str());
4911 sq_pushstring(v, "add_bonus", -1);
4912 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
4913 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4914 if(SQ_FAILED(sq_createslot(v, -3))) {
4915 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
4918 sq_pushstring(v, "add_coins", -1);
4919 sq_newclosure(v, &Player_add_coins_wrapper, 0);
4920 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4921 if(SQ_FAILED(sq_createslot(v, -3))) {
4922 throw SquirrelError(v, "Couldn't register function 'add_coins'");
4925 sq_pushstring(v, "make_invincible", -1);
4926 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
4927 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4928 if(SQ_FAILED(sq_createslot(v, -3))) {
4929 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
4932 sq_pushstring(v, "deactivate", -1);
4933 sq_newclosure(v, &Player_deactivate_wrapper, 0);
4934 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4935 if(SQ_FAILED(sq_createslot(v, -3))) {
4936 throw SquirrelError(v, "Couldn't register function 'deactivate'");
4939 sq_pushstring(v, "activate", -1);
4940 sq_newclosure(v, &Player_activate_wrapper, 0);
4941 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4942 if(SQ_FAILED(sq_createslot(v, -3))) {
4943 throw SquirrelError(v, "Couldn't register function 'activate'");
4946 sq_pushstring(v, "walk", -1);
4947 sq_newclosure(v, &Player_walk_wrapper, 0);
4948 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4949 if(SQ_FAILED(sq_createslot(v, -3))) {
4950 throw SquirrelError(v, "Couldn't register function 'walk'");
4953 sq_pushstring(v, "set_visible", -1);
4954 sq_newclosure(v, &Player_set_visible_wrapper, 0);
4955 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4956 if(SQ_FAILED(sq_createslot(v, -3))) {
4957 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4960 sq_pushstring(v, "get_visible", -1);
4961 sq_newclosure(v, &Player_get_visible_wrapper, 0);
4962 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4963 if(SQ_FAILED(sq_createslot(v, -3))) {
4964 throw SquirrelError(v, "Couldn't register function 'get_visible'");
4967 sq_pushstring(v, "kill", -1);
4968 sq_newclosure(v, &Player_kill_wrapper, 0);
4969 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4970 if(SQ_FAILED(sq_createslot(v, -3))) {
4971 throw SquirrelError(v, "Couldn't register function 'kill'");
4974 sq_pushstring(v, "set_ghost_mode", -1);
4975 sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
4976 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4977 if(SQ_FAILED(sq_createslot(v, -3))) {
4978 throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
4981 sq_pushstring(v, "get_ghost_mode", -1);
4982 sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
4983 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4984 if(SQ_FAILED(sq_createslot(v, -3))) {
4985 throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
4988 sq_pushstring(v, "do_cheer", -1);
4989 sq_newclosure(v, &Player_do_cheer_wrapper, 0);
4990 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4991 if(SQ_FAILED(sq_createslot(v, -3))) {
4992 throw SquirrelError(v, "Couldn't register function 'do_cheer'");
4995 sq_pushstring(v, "do_duck", -1);
4996 sq_newclosure(v, &Player_do_duck_wrapper, 0);
4997 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4998 if(SQ_FAILED(sq_createslot(v, -3))) {
4999 throw SquirrelError(v, "Couldn't register function 'do_duck'");
5002 sq_pushstring(v, "do_standup", -1);
5003 sq_newclosure(v, &Player_do_standup_wrapper, 0);
5004 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5005 if(SQ_FAILED(sq_createslot(v, -3))) {
5006 throw SquirrelError(v, "Couldn't register function 'do_standup'");
5009 sq_pushstring(v, "do_backflip", -1);
5010 sq_newclosure(v, &Player_do_backflip_wrapper, 0);
5011 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5012 if(SQ_FAILED(sq_createslot(v, -3))) {
5013 throw SquirrelError(v, "Couldn't register function 'do_backflip'");
5016 sq_pushstring(v, "do_jump", -1);
5017 sq_newclosure(v, &Player_do_jump_wrapper, 0);
5018 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5019 if(SQ_FAILED(sq_createslot(v, -3))) {
5020 throw SquirrelError(v, "Couldn't register function 'do_jump'");
5023 sq_pushstring(v, "trigger_sequence", -1);
5024 sq_newclosure(v, &Player_trigger_sequence_wrapper, 0);
5025 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5026 if(SQ_FAILED(sq_createslot(v, -3))) {
5027 throw SquirrelError(v, "Couldn't register function 'trigger_sequence'");
5030 sq_pushstring(v, "use_scripting_controller", -1);
5031 sq_newclosure(v, &Player_use_scripting_controller_wrapper, 0);
5032 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5033 if(SQ_FAILED(sq_createslot(v, -3))) {
5034 throw SquirrelError(v, "Couldn't register function 'use_scripting_controller'");
5037 sq_pushstring(v, "do_scripting_controller", -1);
5038 sq_newclosure(v, &Player_do_scripting_controller_wrapper, 0);
5039 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tsb");
5040 if(SQ_FAILED(sq_createslot(v, -3))) {
5041 throw SquirrelError(v, "Couldn't register function 'do_scripting_controller'");
5044 if(SQ_FAILED(sq_createslot(v, -3))) {
5045 throw SquirrelError(v, "Couldn't register class 'Player'");
5048 // Register class ScriptedObject
5049 sq_pushstring(v, "ScriptedObject", -1);
5050 if(sq_newclass(v, SQFalse) < 0) {
5051 std::ostringstream msg;
5052 msg << "Couldn't create new class 'ScriptedObject'";
5053 throw SquirrelError(v, msg.str());
5055 sq_pushstring(v, "set_action", -1);
5056 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
5057 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5058 if(SQ_FAILED(sq_createslot(v, -3))) {
5059 throw SquirrelError(v, "Couldn't register function 'set_action'");
5062 sq_pushstring(v, "get_action", -1);
5063 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
5064 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5065 if(SQ_FAILED(sq_createslot(v, -3))) {
5066 throw SquirrelError(v, "Couldn't register function 'get_action'");
5069 sq_pushstring(v, "move", -1);
5070 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
5071 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5072 if(SQ_FAILED(sq_createslot(v, -3))) {
5073 throw SquirrelError(v, "Couldn't register function 'move'");
5076 sq_pushstring(v, "set_pos", -1);
5077 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
5078 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5079 if(SQ_FAILED(sq_createslot(v, -3))) {
5080 throw SquirrelError(v, "Couldn't register function 'set_pos'");
5083 sq_pushstring(v, "get_pos_x", -1);
5084 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
5085 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5086 if(SQ_FAILED(sq_createslot(v, -3))) {
5087 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5090 sq_pushstring(v, "get_pos_y", -1);
5091 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
5092 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5093 if(SQ_FAILED(sq_createslot(v, -3))) {
5094 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5097 sq_pushstring(v, "set_velocity", -1);
5098 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
5099 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5100 if(SQ_FAILED(sq_createslot(v, -3))) {
5101 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
5104 sq_pushstring(v, "get_velocity_x", -1);
5105 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
5106 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5107 if(SQ_FAILED(sq_createslot(v, -3))) {
5108 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
5111 sq_pushstring(v, "get_velocity_y", -1);
5112 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
5113 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5114 if(SQ_FAILED(sq_createslot(v, -3))) {
5115 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
5118 sq_pushstring(v, "set_visible", -1);
5119 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
5120 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5121 if(SQ_FAILED(sq_createslot(v, -3))) {
5122 throw SquirrelError(v, "Couldn't register function 'set_visible'");
5125 sq_pushstring(v, "is_visible", -1);
5126 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
5127 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5128 if(SQ_FAILED(sq_createslot(v, -3))) {
5129 throw SquirrelError(v, "Couldn't register function 'is_visible'");
5132 sq_pushstring(v, "set_solid", -1);
5133 sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
5134 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5135 if(SQ_FAILED(sq_createslot(v, -3))) {
5136 throw SquirrelError(v, "Couldn't register function 'set_solid'");
5139 sq_pushstring(v, "is_solid", -1);
5140 sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
5141 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5142 if(SQ_FAILED(sq_createslot(v, -3))) {
5143 throw SquirrelError(v, "Couldn't register function 'is_solid'");
5146 sq_pushstring(v, "get_name", -1);
5147 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
5148 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5149 if(SQ_FAILED(sq_createslot(v, -3))) {
5150 throw SquirrelError(v, "Couldn't register function 'get_name'");
5153 if(SQ_FAILED(sq_createslot(v, -3))) {
5154 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
5157 // Register class SSector
5158 sq_pushstring(v, "SSector", -1);
5159 if(sq_newclass(v, SQFalse) < 0) {
5160 std::ostringstream msg;
5161 msg << "Couldn't create new class 'SSector'";
5162 throw SquirrelError(v, msg.str());
5164 sq_pushstring(v, "set_ambient_light", -1);
5165 sq_newclosure(v, &SSector_set_ambient_light_wrapper, 0);
5166 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
5167 if(SQ_FAILED(sq_createslot(v, -3))) {
5168 throw SquirrelError(v, "Couldn't register function 'set_ambient_light'");
5171 sq_pushstring(v, "get_ambient_red", -1);
5172 sq_newclosure(v, &SSector_get_ambient_red_wrapper, 0);
5173 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5174 if(SQ_FAILED(sq_createslot(v, -3))) {
5175 throw SquirrelError(v, "Couldn't register function 'get_ambient_red'");
5178 sq_pushstring(v, "get_ambient_green", -1);
5179 sq_newclosure(v, &SSector_get_ambient_green_wrapper, 0);
5180 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5181 if(SQ_FAILED(sq_createslot(v, -3))) {
5182 throw SquirrelError(v, "Couldn't register function 'get_ambient_green'");
5185 sq_pushstring(v, "get_ambient_blue", -1);
5186 sq_newclosure(v, &SSector_get_ambient_blue_wrapper, 0);
5187 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5188 if(SQ_FAILED(sq_createslot(v, -3))) {
5189 throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'");
5192 sq_pushstring(v, "set_gravity", -1);
5193 sq_newclosure(v, &SSector_set_gravity_wrapper, 0);
5194 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5195 if(SQ_FAILED(sq_createslot(v, -3))) {
5196 throw SquirrelError(v, "Couldn't register function 'set_gravity'");
5199 if(SQ_FAILED(sq_createslot(v, -3))) {
5200 throw SquirrelError(v, "Couldn't register class 'SSector'");
5203 // Register class Text
5204 sq_pushstring(v, "Text", -1);
5205 if(sq_newclass(v, SQFalse) < 0) {
5206 std::ostringstream msg;
5207 msg << "Couldn't create new class 'Text'";
5208 throw SquirrelError(v, msg.str());
5210 sq_pushstring(v, "set_text", -1);
5211 sq_newclosure(v, &Text_set_text_wrapper, 0);
5212 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5213 if(SQ_FAILED(sq_createslot(v, -3))) {
5214 throw SquirrelError(v, "Couldn't register function 'set_text'");
5217 sq_pushstring(v, "set_font", -1);
5218 sq_newclosure(v, &Text_set_font_wrapper, 0);
5219 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5220 if(SQ_FAILED(sq_createslot(v, -3))) {
5221 throw SquirrelError(v, "Couldn't register function 'set_font'");
5224 sq_pushstring(v, "fade_in", -1);
5225 sq_newclosure(v, &Text_fade_in_wrapper, 0);
5226 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5227 if(SQ_FAILED(sq_createslot(v, -3))) {
5228 throw SquirrelError(v, "Couldn't register function 'fade_in'");
5231 sq_pushstring(v, "fade_out", -1);
5232 sq_newclosure(v, &Text_fade_out_wrapper, 0);
5233 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5234 if(SQ_FAILED(sq_createslot(v, -3))) {
5235 throw SquirrelError(v, "Couldn't register function 'fade_out'");
5238 sq_pushstring(v, "set_visible", -1);
5239 sq_newclosure(v, &Text_set_visible_wrapper, 0);
5240 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5241 if(SQ_FAILED(sq_createslot(v, -3))) {
5242 throw SquirrelError(v, "Couldn't register function 'set_visible'");
5245 sq_pushstring(v, "set_centered", -1);
5246 sq_newclosure(v, &Text_set_centered_wrapper, 0);
5247 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5248 if(SQ_FAILED(sq_createslot(v, -3))) {
5249 throw SquirrelError(v, "Couldn't register function 'set_centered'");
5252 sq_pushstring(v, "set_pos", -1);
5253 sq_newclosure(v, &Text_set_pos_wrapper, 0);
5254 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5255 if(SQ_FAILED(sq_createslot(v, -3))) {
5256 throw SquirrelError(v, "Couldn't register function 'set_pos'");
5259 sq_pushstring(v, "get_pos_x", -1);
5260 sq_newclosure(v, &Text_get_pos_x_wrapper, 0);
5261 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5262 if(SQ_FAILED(sq_createslot(v, -3))) {
5263 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5266 sq_pushstring(v, "get_pos_y", -1);
5267 sq_newclosure(v, &Text_get_pos_y_wrapper, 0);
5268 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5269 if(SQ_FAILED(sq_createslot(v, -3))) {
5270 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5273 sq_pushstring(v, "set_anchor_point", -1);
5274 sq_newclosure(v, &Text_set_anchor_point_wrapper, 0);
5275 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5276 if(SQ_FAILED(sq_createslot(v, -3))) {
5277 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
5280 sq_pushstring(v, "get_anchor_point", -1);
5281 sq_newclosure(v, &Text_get_anchor_point_wrapper, 0);
5282 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5283 if(SQ_FAILED(sq_createslot(v, -3))) {
5284 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
5287 if(SQ_FAILED(sq_createslot(v, -3))) {
5288 throw SquirrelError(v, "Couldn't register class 'Text'");
5291 // Register class Thunderstorm
5292 sq_pushstring(v, "Thunderstorm", -1);
5293 if(sq_newclass(v, SQFalse) < 0) {
5294 std::ostringstream msg;
5295 msg << "Couldn't create new class 'Thunderstorm'";
5296 throw SquirrelError(v, msg.str());
5298 sq_pushstring(v, "start", -1);
5299 sq_newclosure(v, &Thunderstorm_start_wrapper, 0);
5300 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5301 if(SQ_FAILED(sq_createslot(v, -3))) {
5302 throw SquirrelError(v, "Couldn't register function 'start'");
5305 sq_pushstring(v, "stop", -1);
5306 sq_newclosure(v, &Thunderstorm_stop_wrapper, 0);
5307 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5308 if(SQ_FAILED(sq_createslot(v, -3))) {
5309 throw SquirrelError(v, "Couldn't register function 'stop'");
5312 sq_pushstring(v, "thunder", -1);
5313 sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0);
5314 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5315 if(SQ_FAILED(sq_createslot(v, -3))) {
5316 throw SquirrelError(v, "Couldn't register function 'thunder'");
5319 sq_pushstring(v, "lightning", -1);
5320 sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0);
5321 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5322 if(SQ_FAILED(sq_createslot(v, -3))) {
5323 throw SquirrelError(v, "Couldn't register function 'lightning'");
5326 sq_pushstring(v, "flash", -1);
5327 sq_newclosure(v, &Thunderstorm_flash_wrapper, 0);
5328 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5329 if(SQ_FAILED(sq_createslot(v, -3))) {
5330 throw SquirrelError(v, "Couldn't register function 'flash'");
5333 sq_pushstring(v, "electrify", -1);
5334 sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0);
5335 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5336 if(SQ_FAILED(sq_createslot(v, -3))) {
5337 throw SquirrelError(v, "Couldn't register function 'electrify'");
5340 if(SQ_FAILED(sq_createslot(v, -3))) {
5341 throw SquirrelError(v, "Couldn't register class 'Thunderstorm'");
5344 // Register class TileMap
5345 sq_pushstring(v, "TileMap", -1);
5346 if(sq_newclass(v, SQFalse) < 0) {
5347 std::ostringstream msg;
5348 msg << "Couldn't create new class 'TileMap'";
5349 throw SquirrelError(v, msg.str());
5351 sq_pushstring(v, "goto_node", -1);
5352 sq_newclosure(v, &TileMap_goto_node_wrapper, 0);
5353 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5354 if(SQ_FAILED(sq_createslot(v, -3))) {
5355 throw SquirrelError(v, "Couldn't register function 'goto_node'");
5358 sq_pushstring(v, "start_moving", -1);
5359 sq_newclosure(v, &TileMap_start_moving_wrapper, 0);
5360 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5361 if(SQ_FAILED(sq_createslot(v, -3))) {
5362 throw SquirrelError(v, "Couldn't register function 'start_moving'");
5365 sq_pushstring(v, "stop_moving", -1);
5366 sq_newclosure(v, &TileMap_stop_moving_wrapper, 0);
5367 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5368 if(SQ_FAILED(sq_createslot(v, -3))) {
5369 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5372 sq_pushstring(v, "fade", -1);
5373 sq_newclosure(v, &TileMap_fade_wrapper, 0);
5374 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5375 if(SQ_FAILED(sq_createslot(v, -3))) {
5376 throw SquirrelError(v, "Couldn't register function 'fade'");
5379 sq_pushstring(v, "set_alpha", -1);
5380 sq_newclosure(v, &TileMap_set_alpha_wrapper, 0);
5381 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5382 if(SQ_FAILED(sq_createslot(v, -3))) {
5383 throw SquirrelError(v, "Couldn't register function 'set_alpha'");
5386 sq_pushstring(v, "get_alpha", -1);
5387 sq_newclosure(v, &TileMap_get_alpha_wrapper, 0);
5388 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5389 if(SQ_FAILED(sq_createslot(v, -3))) {
5390 throw SquirrelError(v, "Couldn't register function 'get_alpha'");
5393 if(SQ_FAILED(sq_createslot(v, -3))) {
5394 throw SquirrelError(v, "Couldn't register class 'TileMap'");
5397 // Register class WillOWisp
5398 sq_pushstring(v, "WillOWisp", -1);
5399 if(sq_newclass(v, SQFalse) < 0) {
5400 std::ostringstream msg;
5401 msg << "Couldn't create new class 'WillOWisp'";
5402 throw SquirrelError(v, msg.str());
5404 sq_pushstring(v, "goto_node", -1);
5405 sq_newclosure(v, &WillOWisp_goto_node_wrapper, 0);
5406 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5407 if(SQ_FAILED(sq_createslot(v, -3))) {
5408 throw SquirrelError(v, "Couldn't register function 'goto_node'");
5411 sq_pushstring(v, "set_state", -1);
5412 sq_newclosure(v, &WillOWisp_set_state_wrapper, 0);
5413 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5414 if(SQ_FAILED(sq_createslot(v, -3))) {
5415 throw SquirrelError(v, "Couldn't register function 'set_state'");
5418 sq_pushstring(v, "start_moving", -1);
5419 sq_newclosure(v, &WillOWisp_start_moving_wrapper, 0);
5420 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5421 if(SQ_FAILED(sq_createslot(v, -3))) {
5422 throw SquirrelError(v, "Couldn't register function 'start_moving'");
5425 sq_pushstring(v, "stop_moving", -1);
5426 sq_newclosure(v, &WillOWisp_stop_moving_wrapper, 0);
5427 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5428 if(SQ_FAILED(sq_createslot(v, -3))) {
5429 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5432 if(SQ_FAILED(sq_createslot(v, -3))) {
5433 throw SquirrelError(v, "Couldn't register class 'WillOWisp'");
5436 // Register class Wind
5437 sq_pushstring(v, "Wind", -1);
5438 if(sq_newclass(v, SQFalse) < 0) {
5439 std::ostringstream msg;
5440 msg << "Couldn't create new class 'Wind'";
5441 throw SquirrelError(v, msg.str());
5443 sq_pushstring(v, "start", -1);
5444 sq_newclosure(v, &Wind_start_wrapper, 0);
5445 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5446 if(SQ_FAILED(sq_createslot(v, -3))) {
5447 throw SquirrelError(v, "Couldn't register function 'start'");
5450 sq_pushstring(v, "stop", -1);
5451 sq_newclosure(v, &Wind_stop_wrapper, 0);
5452 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5453 if(SQ_FAILED(sq_createslot(v, -3))) {
5454 throw SquirrelError(v, "Couldn't register function 'stop'");
5457 if(SQ_FAILED(sq_createslot(v, -3))) {
5458 throw SquirrelError(v, "Couldn't register class 'Wind'");
5463 } // namespace scripting