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_dir_wrapper(HSQUIRRELVM vm)
1272 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1273 sq_throwerror(vm, _SC("'set_dir' 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_dir(arg0 == SQTrue);
1288 } catch(std::exception& e) {
1289 sq_throwerror(vm, e.what());
1292 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_dir'"));
1298 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1301 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1302 sq_throwerror(vm, _SC("'set_visible' called without instance"));
1305 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1307 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1308 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1313 _this->set_visible(arg0 == SQTrue);
1317 } catch(std::exception& e) {
1318 sq_throwerror(vm, e.what());
1321 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1327 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1330 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1331 sq_throwerror(vm, _SC("'get_visible' called without instance"));
1334 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1337 bool return_value = _this->get_visible();
1339 sq_pushbool(vm, return_value);
1342 } catch(std::exception& e) {
1343 sq_throwerror(vm, e.what());
1346 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1352 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1355 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1356 sq_throwerror(vm, _SC("'kill' 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->kill(arg0 == SQTrue);
1371 } catch(std::exception& e) {
1372 sq_throwerror(vm, e.what());
1375 sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1381 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1384 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1385 sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1388 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1390 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1391 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1396 _this->set_ghost_mode(arg0 == SQTrue);
1400 } catch(std::exception& e) {
1401 sq_throwerror(vm, e.what());
1404 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1410 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1413 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1414 sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1417 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1420 bool return_value = _this->get_ghost_mode();
1422 sq_pushbool(vm, return_value);
1425 } catch(std::exception& e) {
1426 sq_throwerror(vm, e.what());
1429 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1435 static SQInteger Player_kick_wrapper(HSQUIRRELVM vm)
1438 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1439 sq_throwerror(vm, _SC("'kick' called without instance"));
1442 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1449 } catch(std::exception& e) {
1450 sq_throwerror(vm, e.what());
1453 sq_throwerror(vm, _SC("Unexpected exception while executing function 'kick'"));
1459 static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm)
1462 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1463 sq_throwerror(vm, _SC("'do_cheer' called without instance"));
1466 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1473 } catch(std::exception& e) {
1474 sq_throwerror(vm, e.what());
1477 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'"));
1483 static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm)
1486 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1487 sq_throwerror(vm, _SC("'do_duck' called without instance"));
1490 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1497 } catch(std::exception& e) {
1498 sq_throwerror(vm, e.what());
1501 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'"));
1507 static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm)
1510 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1511 sq_throwerror(vm, _SC("'do_standup' called without instance"));
1514 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1517 _this->do_standup();
1521 } catch(std::exception& e) {
1522 sq_throwerror(vm, e.what());
1525 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'"));
1531 static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm)
1534 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1535 sq_throwerror(vm, _SC("'do_backflip' called without instance"));
1538 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1541 _this->do_backflip();
1545 } catch(std::exception& e) {
1546 sq_throwerror(vm, e.what());
1549 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'"));
1555 static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm)
1558 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1559 sq_throwerror(vm, _SC("'do_jump' called without instance"));
1562 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1564 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1565 sq_throwerror(vm, _SC("Argument 1 not a float"));
1570 _this->do_jump(static_cast<float> (arg0));
1574 } catch(std::exception& e) {
1575 sq_throwerror(vm, e.what());
1578 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_jump'"));
1584 static SQInteger Player_trigger_sequence_wrapper(HSQUIRRELVM vm)
1587 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1588 sq_throwerror(vm, _SC("'trigger_sequence' called without instance"));
1591 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1593 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1594 sq_throwerror(vm, _SC("Argument 1 not a string"));
1599 _this->trigger_sequence(arg0);
1603 } catch(std::exception& e) {
1604 sq_throwerror(vm, e.what());
1607 sq_throwerror(vm, _SC("Unexpected exception while executing function 'trigger_sequence'"));
1613 static SQInteger Player_use_scripting_controller_wrapper(HSQUIRRELVM vm)
1616 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1617 sq_throwerror(vm, _SC("'use_scripting_controller' called without instance"));
1620 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1622 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1623 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1628 _this->use_scripting_controller(arg0 == SQTrue);
1632 } catch(std::exception& e) {
1633 sq_throwerror(vm, e.what());
1636 sq_throwerror(vm, _SC("Unexpected exception while executing function 'use_scripting_controller'"));
1642 static SQInteger Player_do_scripting_controller_wrapper(HSQUIRRELVM vm)
1645 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1646 sq_throwerror(vm, _SC("'do_scripting_controller' called without instance"));
1649 scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1651 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1652 sq_throwerror(vm, _SC("Argument 1 not a string"));
1656 if(SQ_FAILED(sq_getbool(vm, 3, &arg1))) {
1657 sq_throwerror(vm, _SC("Argument 2 not a bool"));
1662 _this->do_scripting_controller(arg0, arg1 == SQTrue);
1666 } catch(std::exception& e) {
1667 sq_throwerror(vm, e.what());
1670 sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_scripting_controller'"));
1676 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
1678 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (ptr);
1683 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
1686 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1687 sq_throwerror(vm, _SC("'set_action' called without instance"));
1690 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1692 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1693 sq_throwerror(vm, _SC("Argument 1 not a string"));
1698 _this->set_action(arg0);
1702 } catch(std::exception& e) {
1703 sq_throwerror(vm, e.what());
1706 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1712 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
1715 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1716 sq_throwerror(vm, _SC("'get_action' called without instance"));
1719 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1722 std::string return_value = _this->get_action();
1724 sq_pushstring(vm, return_value.c_str(), return_value.size());
1727 } catch(std::exception& e) {
1728 sq_throwerror(vm, e.what());
1731 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1737 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
1740 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1741 sq_throwerror(vm, _SC("'move' called without instance"));
1744 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1746 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1747 sq_throwerror(vm, _SC("Argument 1 not a float"));
1751 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1752 sq_throwerror(vm, _SC("Argument 2 not a float"));
1757 _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
1761 } catch(std::exception& e) {
1762 sq_throwerror(vm, e.what());
1765 sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
1771 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
1774 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1775 sq_throwerror(vm, _SC("'set_pos' called without instance"));
1778 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1780 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1781 sq_throwerror(vm, _SC("Argument 1 not a float"));
1785 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1786 sq_throwerror(vm, _SC("Argument 2 not a float"));
1791 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1795 } catch(std::exception& e) {
1796 sq_throwerror(vm, e.what());
1799 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1805 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
1808 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1809 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1812 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1815 float return_value = _this->get_pos_x();
1817 sq_pushfloat(vm, return_value);
1820 } catch(std::exception& e) {
1821 sq_throwerror(vm, e.what());
1824 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1830 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
1833 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1834 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1837 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1840 float return_value = _this->get_pos_y();
1842 sq_pushfloat(vm, return_value);
1845 } catch(std::exception& e) {
1846 sq_throwerror(vm, e.what());
1849 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1855 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
1858 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1859 sq_throwerror(vm, _SC("'set_velocity' called without instance"));
1862 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1864 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1865 sq_throwerror(vm, _SC("Argument 1 not a float"));
1869 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1870 sq_throwerror(vm, _SC("Argument 2 not a float"));
1875 _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
1879 } catch(std::exception& e) {
1880 sq_throwerror(vm, e.what());
1883 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
1889 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
1892 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1893 sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
1896 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1899 float return_value = _this->get_velocity_x();
1901 sq_pushfloat(vm, return_value);
1904 } catch(std::exception& e) {
1905 sq_throwerror(vm, e.what());
1908 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
1914 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
1917 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1918 sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
1921 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1924 float return_value = _this->get_velocity_y();
1926 sq_pushfloat(vm, return_value);
1929 } catch(std::exception& e) {
1930 sq_throwerror(vm, e.what());
1933 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
1939 static SQInteger ScriptedObject_enable_gravity_wrapper(HSQUIRRELVM vm)
1942 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1943 sq_throwerror(vm, _SC("'enable_gravity' called without instance"));
1946 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1948 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1949 sq_throwerror(vm, _SC("Argument 1 not a bool"));
1954 _this->enable_gravity(arg0 == SQTrue);
1958 } catch(std::exception& e) {
1959 sq_throwerror(vm, e.what());
1962 sq_throwerror(vm, _SC("Unexpected exception while executing function 'enable_gravity'"));
1968 static SQInteger ScriptedObject_gravity_enabled_wrapper(HSQUIRRELVM vm)
1971 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1972 sq_throwerror(vm, _SC("'gravity_enabled' called without instance"));
1975 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1978 bool return_value = _this->gravity_enabled();
1980 sq_pushbool(vm, return_value);
1983 } catch(std::exception& e) {
1984 sq_throwerror(vm, e.what());
1987 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gravity_enabled'"));
1993 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
1996 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1997 sq_throwerror(vm, _SC("'set_visible' called without instance"));
2000 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2002 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2003 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2008 _this->set_visible(arg0 == SQTrue);
2012 } catch(std::exception& e) {
2013 sq_throwerror(vm, e.what());
2016 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
2022 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
2025 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2026 sq_throwerror(vm, _SC("'is_visible' called without instance"));
2029 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2032 bool return_value = _this->is_visible();
2034 sq_pushbool(vm, return_value);
2037 } catch(std::exception& e) {
2038 sq_throwerror(vm, e.what());
2041 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
2047 static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm)
2050 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2051 sq_throwerror(vm, _SC("'set_solid' called without instance"));
2054 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2056 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2057 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2062 _this->set_solid(arg0 == SQTrue);
2066 } catch(std::exception& e) {
2067 sq_throwerror(vm, e.what());
2070 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_solid'"));
2076 static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm)
2079 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2080 sq_throwerror(vm, _SC("'is_solid' called without instance"));
2083 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2086 bool return_value = _this->is_solid();
2088 sq_pushbool(vm, return_value);
2091 } catch(std::exception& e) {
2092 sq_throwerror(vm, e.what());
2095 sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_solid'"));
2101 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
2104 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2105 sq_throwerror(vm, _SC("'get_name' called without instance"));
2108 scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2111 std::string return_value = _this->get_name();
2113 sq_pushstring(vm, return_value.c_str(), return_value.size());
2116 } catch(std::exception& e) {
2117 sq_throwerror(vm, e.what());
2120 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
2126 static SQInteger SSector_release_hook(SQUserPointer ptr, SQInteger )
2128 scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (ptr);
2133 static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm)
2136 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2137 sq_throwerror(vm, _SC("'set_ambient_light' called without instance"));
2140 scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2142 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2143 sq_throwerror(vm, _SC("Argument 1 not a float"));
2147 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2148 sq_throwerror(vm, _SC("Argument 2 not a float"));
2152 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2153 sq_throwerror(vm, _SC("Argument 3 not a float"));
2158 _this->set_ambient_light(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2162 } catch(std::exception& e) {
2163 sq_throwerror(vm, e.what());
2166 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ambient_light'"));
2172 static SQInteger SSector_get_ambient_red_wrapper(HSQUIRRELVM vm)
2175 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2176 sq_throwerror(vm, _SC("'get_ambient_red' called without instance"));
2179 scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2182 float return_value = _this->get_ambient_red();
2184 sq_pushfloat(vm, return_value);
2187 } catch(std::exception& e) {
2188 sq_throwerror(vm, e.what());
2191 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_red'"));
2197 static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm)
2200 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2201 sq_throwerror(vm, _SC("'get_ambient_green' called without instance"));
2204 scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2207 float return_value = _this->get_ambient_green();
2209 sq_pushfloat(vm, return_value);
2212 } catch(std::exception& e) {
2213 sq_throwerror(vm, e.what());
2216 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_green'"));
2222 static SQInteger SSector_get_ambient_blue_wrapper(HSQUIRRELVM vm)
2225 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2226 sq_throwerror(vm, _SC("'get_ambient_blue' called without instance"));
2229 scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2232 float return_value = _this->get_ambient_blue();
2234 sq_pushfloat(vm, return_value);
2237 } catch(std::exception& e) {
2238 sq_throwerror(vm, e.what());
2241 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_blue'"));
2247 static SQInteger SSector_set_gravity_wrapper(HSQUIRRELVM vm)
2250 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2251 sq_throwerror(vm, _SC("'set_gravity' called without instance"));
2254 scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2256 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2257 sq_throwerror(vm, _SC("Argument 1 not a float"));
2262 _this->set_gravity(static_cast<float> (arg0));
2266 } catch(std::exception& e) {
2267 sq_throwerror(vm, e.what());
2270 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_gravity'"));
2276 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
2278 scripting::Text* _this = reinterpret_cast<scripting::Text*> (ptr);
2283 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
2286 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2287 sq_throwerror(vm, _SC("'set_text' called without instance"));
2290 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2292 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2293 sq_throwerror(vm, _SC("Argument 1 not a string"));
2298 _this->set_text(arg0);
2302 } catch(std::exception& e) {
2303 sq_throwerror(vm, e.what());
2306 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
2312 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
2315 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2316 sq_throwerror(vm, _SC("'set_font' called without instance"));
2319 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2321 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2322 sq_throwerror(vm, _SC("Argument 1 not a string"));
2327 _this->set_font(arg0);
2331 } catch(std::exception& e) {
2332 sq_throwerror(vm, e.what());
2335 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
2341 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
2344 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2345 sq_throwerror(vm, _SC("'fade_in' called without instance"));
2348 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2350 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2351 sq_throwerror(vm, _SC("Argument 1 not a float"));
2356 _this->fade_in(static_cast<float> (arg0));
2360 } catch(std::exception& e) {
2361 sq_throwerror(vm, e.what());
2364 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
2370 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
2373 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2374 sq_throwerror(vm, _SC("'fade_out' called without instance"));
2377 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2379 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2380 sq_throwerror(vm, _SC("Argument 1 not a float"));
2385 _this->fade_out(static_cast<float> (arg0));
2389 } catch(std::exception& e) {
2390 sq_throwerror(vm, e.what());
2393 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
2399 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
2402 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2403 sq_throwerror(vm, _SC("'set_visible' called without instance"));
2406 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2408 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2409 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2414 _this->set_visible(arg0 == SQTrue);
2418 } catch(std::exception& e) {
2419 sq_throwerror(vm, e.what());
2422 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
2428 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
2431 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2432 sq_throwerror(vm, _SC("'set_centered' called without instance"));
2435 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2437 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2438 sq_throwerror(vm, _SC("Argument 1 not a bool"));
2443 _this->set_centered(arg0 == SQTrue);
2447 } catch(std::exception& e) {
2448 sq_throwerror(vm, e.what());
2451 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
2457 static SQInteger Text_set_pos_wrapper(HSQUIRRELVM vm)
2460 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2461 sq_throwerror(vm, _SC("'set_pos' called without instance"));
2464 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2466 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2467 sq_throwerror(vm, _SC("Argument 1 not a float"));
2471 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2472 sq_throwerror(vm, _SC("Argument 2 not a float"));
2477 _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
2481 } catch(std::exception& e) {
2482 sq_throwerror(vm, e.what());
2485 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
2491 static SQInteger Text_get_pos_x_wrapper(HSQUIRRELVM vm)
2494 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2495 sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
2498 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2501 float return_value = _this->get_pos_x();
2503 sq_pushfloat(vm, return_value);
2506 } catch(std::exception& e) {
2507 sq_throwerror(vm, e.what());
2510 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
2516 static SQInteger Text_get_pos_y_wrapper(HSQUIRRELVM vm)
2519 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2520 sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
2523 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2526 float return_value = _this->get_pos_y();
2528 sq_pushfloat(vm, return_value);
2531 } catch(std::exception& e) {
2532 sq_throwerror(vm, e.what());
2535 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
2541 static SQInteger Text_set_anchor_point_wrapper(HSQUIRRELVM vm)
2544 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2545 sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
2548 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2550 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2551 sq_throwerror(vm, _SC("Argument 1 not an integer"));
2556 _this->set_anchor_point(static_cast<int> (arg0));
2560 } catch(std::exception& e) {
2561 sq_throwerror(vm, e.what());
2564 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
2570 static SQInteger Text_get_anchor_point_wrapper(HSQUIRRELVM vm)
2573 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2574 sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
2577 scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2580 int return_value = _this->get_anchor_point();
2582 sq_pushinteger(vm, return_value);
2585 } catch(std::exception& e) {
2586 sq_throwerror(vm, e.what());
2589 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
2595 static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger )
2597 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (ptr);
2602 static SQInteger Thunderstorm_start_wrapper(HSQUIRRELVM vm)
2605 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2606 sq_throwerror(vm, _SC("'start' called without instance"));
2609 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2616 } catch(std::exception& e) {
2617 sq_throwerror(vm, e.what());
2620 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2626 static SQInteger Thunderstorm_stop_wrapper(HSQUIRRELVM vm)
2629 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2630 sq_throwerror(vm, _SC("'stop' called without instance"));
2633 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2640 } catch(std::exception& e) {
2641 sq_throwerror(vm, e.what());
2644 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2650 static SQInteger Thunderstorm_thunder_wrapper(HSQUIRRELVM vm)
2653 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2654 sq_throwerror(vm, _SC("'thunder' called without instance"));
2657 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2664 } catch(std::exception& e) {
2665 sq_throwerror(vm, e.what());
2668 sq_throwerror(vm, _SC("Unexpected exception while executing function 'thunder'"));
2674 static SQInteger Thunderstorm_lightning_wrapper(HSQUIRRELVM vm)
2677 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2678 sq_throwerror(vm, _SC("'lightning' called without instance"));
2681 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2688 } catch(std::exception& e) {
2689 sq_throwerror(vm, e.what());
2692 sq_throwerror(vm, _SC("Unexpected exception while executing function 'lightning'"));
2698 static SQInteger Thunderstorm_flash_wrapper(HSQUIRRELVM vm)
2701 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2702 sq_throwerror(vm, _SC("'flash' called without instance"));
2705 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2712 } catch(std::exception& e) {
2713 sq_throwerror(vm, e.what());
2716 sq_throwerror(vm, _SC("Unexpected exception while executing function 'flash'"));
2722 static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm)
2725 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2726 sq_throwerror(vm, _SC("'electrify' called without instance"));
2729 scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2736 } catch(std::exception& e) {
2737 sq_throwerror(vm, e.what());
2740 sq_throwerror(vm, _SC("Unexpected exception while executing function 'electrify'"));
2746 static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger )
2748 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (ptr);
2753 static SQInteger TileMap_goto_node_wrapper(HSQUIRRELVM vm)
2756 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2757 sq_throwerror(vm, _SC("'goto_node' called without instance"));
2760 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2762 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2763 sq_throwerror(vm, _SC("Argument 1 not an integer"));
2768 _this->goto_node(static_cast<int> (arg0));
2772 } catch(std::exception& e) {
2773 sq_throwerror(vm, e.what());
2776 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2782 static SQInteger TileMap_start_moving_wrapper(HSQUIRRELVM vm)
2785 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2786 sq_throwerror(vm, _SC("'start_moving' called without instance"));
2789 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2792 _this->start_moving();
2796 } catch(std::exception& e) {
2797 sq_throwerror(vm, e.what());
2800 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2806 static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm)
2809 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2810 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2813 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2816 _this->stop_moving();
2820 } catch(std::exception& e) {
2821 sq_throwerror(vm, e.what());
2824 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2830 static SQInteger TileMap_fade_wrapper(HSQUIRRELVM vm)
2833 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2834 sq_throwerror(vm, _SC("'fade' called without instance"));
2837 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2839 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2840 sq_throwerror(vm, _SC("Argument 1 not a float"));
2844 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2845 sq_throwerror(vm, _SC("Argument 2 not a float"));
2850 _this->fade(static_cast<float> (arg0), static_cast<float> (arg1));
2854 } catch(std::exception& e) {
2855 sq_throwerror(vm, e.what());
2858 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade'"));
2864 static SQInteger TileMap_set_alpha_wrapper(HSQUIRRELVM vm)
2867 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2868 sq_throwerror(vm, _SC("'set_alpha' called without instance"));
2871 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2873 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2874 sq_throwerror(vm, _SC("Argument 1 not a float"));
2879 _this->set_alpha(static_cast<float> (arg0));
2883 } catch(std::exception& e) {
2884 sq_throwerror(vm, e.what());
2887 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_alpha'"));
2893 static SQInteger TileMap_get_alpha_wrapper(HSQUIRRELVM vm)
2896 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2897 sq_throwerror(vm, _SC("'get_alpha' called without instance"));
2900 scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2903 float return_value = _this->get_alpha();
2905 sq_pushfloat(vm, return_value);
2908 } catch(std::exception& e) {
2909 sq_throwerror(vm, e.what());
2912 sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_alpha'"));
2918 static SQInteger WillOWisp_release_hook(SQUserPointer ptr, SQInteger )
2920 scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (ptr);
2925 static SQInteger WillOWisp_goto_node_wrapper(HSQUIRRELVM vm)
2928 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2929 sq_throwerror(vm, _SC("'goto_node' called without instance"));
2932 scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2934 if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2935 sq_throwerror(vm, _SC("Argument 1 not an integer"));
2940 _this->goto_node(static_cast<int> (arg0));
2944 } catch(std::exception& e) {
2945 sq_throwerror(vm, e.what());
2948 sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2954 static SQInteger WillOWisp_set_state_wrapper(HSQUIRRELVM vm)
2957 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2958 sq_throwerror(vm, _SC("'set_state' called without instance"));
2961 scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2963 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2964 sq_throwerror(vm, _SC("Argument 1 not a string"));
2969 _this->set_state(arg0);
2973 } catch(std::exception& e) {
2974 sq_throwerror(vm, e.what());
2977 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_state'"));
2983 static SQInteger WillOWisp_start_moving_wrapper(HSQUIRRELVM vm)
2986 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2987 sq_throwerror(vm, _SC("'start_moving' called without instance"));
2990 scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2993 _this->start_moving();
2997 } catch(std::exception& e) {
2998 sq_throwerror(vm, e.what());
3001 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
3007 static SQInteger WillOWisp_stop_moving_wrapper(HSQUIRRELVM vm)
3010 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
3011 sq_throwerror(vm, _SC("'stop_moving' called without instance"));
3014 scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
3017 _this->stop_moving();
3021 } catch(std::exception& e) {
3022 sq_throwerror(vm, e.what());
3025 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
3031 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
3033 scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (ptr);
3038 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
3041 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
3042 sq_throwerror(vm, _SC("'start' called without instance"));
3045 scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (data);
3052 } catch(std::exception& e) {
3053 sq_throwerror(vm, e.what());
3056 sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
3062 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
3065 if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
3066 sq_throwerror(vm, _SC("'stop' called without instance"));
3069 scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (data);
3076 } catch(std::exception& e) {
3077 sq_throwerror(vm, e.what());
3080 sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
3086 static SQInteger display_wrapper(HSQUIRRELVM vm)
3088 return scripting::display(vm);
3091 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
3093 HSQUIRRELVM arg0 = vm;
3096 scripting::print_stacktrace(arg0);
3100 } catch(std::exception& e) {
3101 sq_throwerror(vm, e.what());
3104 sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
3110 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
3112 return scripting::get_current_thread(vm);
3115 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
3118 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3119 sq_throwerror(vm, _SC("Argument 1 not a string"));
3124 scripting::display_text_file(arg0);
3128 } catch(std::exception& e) {
3129 sq_throwerror(vm, e.what());
3132 sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
3138 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
3141 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3142 sq_throwerror(vm, _SC("Argument 1 not a string"));
3147 scripting::load_worldmap(arg0);
3151 } catch(std::exception& e) {
3152 sq_throwerror(vm, e.what());
3155 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
3161 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
3164 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3165 sq_throwerror(vm, _SC("Argument 1 not a string"));
3170 scripting::load_level(arg0);
3174 } catch(std::exception& e) {
3175 sq_throwerror(vm, e.what());
3178 sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
3184 static SQInteger wait_wrapper(HSQUIRRELVM vm)
3186 HSQUIRRELVM arg0 = vm;
3188 if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
3189 sq_throwerror(vm, _SC("Argument 1 not a float"));
3194 scripting::wait(arg0, static_cast<float> (arg1));
3196 return sq_suspendvm(vm);
3198 } catch(std::exception& e) {
3199 sq_throwerror(vm, e.what());
3202 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
3208 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
3210 HSQUIRRELVM arg0 = vm;
3213 scripting::wait_for_screenswitch(arg0);
3215 return sq_suspendvm(vm);
3217 } catch(std::exception& e) {
3218 sq_throwerror(vm, e.what());
3221 sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
3227 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
3232 scripting::exit_screen();
3236 } catch(std::exception& e) {
3237 sq_throwerror(vm, e.what());
3240 sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
3246 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
3249 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3250 sq_throwerror(vm, _SC("Argument 1 not a float"));
3255 scripting::fadeout_screen(static_cast<float> (arg0));
3259 } catch(std::exception& e) {
3260 sq_throwerror(vm, e.what());
3263 sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
3269 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
3272 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3273 sq_throwerror(vm, _SC("Argument 1 not a float"));
3277 if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
3278 sq_throwerror(vm, _SC("Argument 2 not a float"));
3282 if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
3283 sq_throwerror(vm, _SC("Argument 3 not a float"));
3288 scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
3292 } catch(std::exception& e) {
3293 sq_throwerror(vm, e.what());
3296 sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
3302 static SQInteger abort_screenfade_wrapper(HSQUIRRELVM vm)
3307 scripting::abort_screenfade();
3311 } catch(std::exception& e) {
3312 sq_throwerror(vm, e.what());
3315 sq_throwerror(vm, _SC("Unexpected exception while executing function 'abort_screenfade'"));
3321 static SQInteger translate_wrapper(HSQUIRRELVM vm)
3324 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3325 sq_throwerror(vm, _SC("Argument 1 not a string"));
3330 std::string return_value = scripting::translate(arg0);
3332 sq_pushstring(vm, return_value.c_str(), return_value.size());
3335 } catch(std::exception& e) {
3336 sq_throwerror(vm, e.what());
3339 sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
3345 static SQInteger import_wrapper(HSQUIRRELVM vm)
3347 HSQUIRRELVM arg0 = vm;
3349 if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
3350 sq_throwerror(vm, _SC("Argument 1 not a string"));
3355 scripting::import(arg0, arg1);
3359 } catch(std::exception& e) {
3360 sq_throwerror(vm, e.what());
3363 sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
3369 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
3374 scripting::save_state();
3378 } catch(std::exception& e) {
3379 sq_throwerror(vm, e.what());
3382 sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
3388 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
3391 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3392 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3397 scripting::debug_collrects(arg0 == SQTrue);
3401 } catch(std::exception& e) {
3402 sq_throwerror(vm, e.what());
3405 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
3411 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
3414 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3415 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3420 scripting::debug_show_fps(arg0 == SQTrue);
3424 } catch(std::exception& e) {
3425 sq_throwerror(vm, e.what());
3428 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
3434 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
3437 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3438 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3443 scripting::debug_draw_solids_only(arg0 == SQTrue);
3447 } catch(std::exception& e) {
3448 sq_throwerror(vm, e.what());
3451 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
3457 static SQInteger debug_draw_editor_images_wrapper(HSQUIRRELVM vm)
3460 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3461 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3466 scripting::debug_draw_editor_images(arg0 == SQTrue);
3470 } catch(std::exception& e) {
3471 sq_throwerror(vm, e.what());
3474 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_editor_images'"));
3480 static SQInteger debug_worldmap_ghost_wrapper(HSQUIRRELVM vm)
3483 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3484 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3489 scripting::debug_worldmap_ghost(arg0 == SQTrue);
3493 } catch(std::exception& e) {
3494 sq_throwerror(vm, e.what());
3497 sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_worldmap_ghost'"));
3503 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
3506 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3507 sq_throwerror(vm, _SC("Argument 1 not a string"));
3512 scripting::play_music(arg0);
3516 } catch(std::exception& e) {
3517 sq_throwerror(vm, e.what());
3520 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
3526 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
3529 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3530 sq_throwerror(vm, _SC("Argument 1 not a string"));
3535 scripting::play_sound(arg0);
3539 } catch(std::exception& e) {
3540 sq_throwerror(vm, e.what());
3543 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
3549 static SQInteger set_game_speed_wrapper(HSQUIRRELVM vm)
3552 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3553 sq_throwerror(vm, _SC("Argument 1 not a float"));
3558 scripting::set_game_speed(static_cast<float> (arg0));
3562 } catch(std::exception& e) {
3563 sq_throwerror(vm, e.what());
3566 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_game_speed'"));
3572 static SQInteger grease_wrapper(HSQUIRRELVM vm)
3577 scripting::grease();
3581 } catch(std::exception& e) {
3582 sq_throwerror(vm, e.what());
3585 sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
3591 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
3596 scripting::invincible();
3600 } catch(std::exception& e) {
3601 sq_throwerror(vm, e.what());
3604 sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
3610 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
3619 } catch(std::exception& e) {
3620 sq_throwerror(vm, e.what());
3623 sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
3629 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
3634 scripting::mortal();
3638 } catch(std::exception& e) {
3639 sq_throwerror(vm, e.what());
3642 sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
3648 static SQInteger restart_wrapper(HSQUIRRELVM vm)
3653 scripting::restart();
3657 } catch(std::exception& e) {
3658 sq_throwerror(vm, e.what());
3661 sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
3667 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
3672 scripting::whereami();
3676 } catch(std::exception& e) {
3677 sq_throwerror(vm, e.what());
3680 sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
3686 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
3691 scripting::gotoend();
3695 } catch(std::exception& e) {
3696 sq_throwerror(vm, e.what());
3699 sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
3705 static SQInteger camera_wrapper(HSQUIRRELVM vm)
3710 scripting::camera();
3714 } catch(std::exception& e) {
3715 sq_throwerror(vm, e.what());
3718 sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
3724 static SQInteger set_gamma_wrapper(HSQUIRRELVM vm)
3727 if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3728 sq_throwerror(vm, _SC("Argument 1 not a float"));
3733 scripting::set_gamma(static_cast<float> (arg0));
3737 } catch(std::exception& e) {
3738 sq_throwerror(vm, e.what());
3741 sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_gamma'"));
3747 static SQInteger quit_wrapper(HSQUIRRELVM vm)
3756 } catch(std::exception& e) {
3757 sq_throwerror(vm, e.what());
3760 sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
3766 static SQInteger rand_wrapper(HSQUIRRELVM vm)
3770 int return_value = scripting::rand();
3772 sq_pushinteger(vm, return_value);
3775 } catch(std::exception& e) {
3776 sq_throwerror(vm, e.what());
3779 sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
3785 static SQInteger record_demo_wrapper(HSQUIRRELVM vm)
3788 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3789 sq_throwerror(vm, _SC("Argument 1 not a string"));
3794 scripting::record_demo(arg0);
3798 } catch(std::exception& e) {
3799 sq_throwerror(vm, e.what());
3802 sq_throwerror(vm, _SC("Unexpected exception while executing function 'record_demo'"));
3808 static SQInteger play_demo_wrapper(HSQUIRRELVM vm)
3811 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3812 sq_throwerror(vm, _SC("Argument 1 not a string"));
3817 scripting::play_demo(arg0);
3821 } catch(std::exception& e) {
3822 sq_throwerror(vm, e.what());
3825 sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_demo'"));
3831 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
3834 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3835 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3840 scripting::Level_finish(arg0 == SQTrue);
3844 } catch(std::exception& e) {
3845 sq_throwerror(vm, e.what());
3848 sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_finish'"));
3854 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
3857 if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3858 sq_throwerror(vm, _SC("Argument 1 not a string"));
3862 if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
3863 sq_throwerror(vm, _SC("Argument 2 not a string"));
3868 scripting::Level_spawn(arg0, arg1);
3872 } catch(std::exception& e) {
3873 sq_throwerror(vm, e.what());
3876 sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_spawn'"));
3882 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
3887 scripting::Level_flip_vertically();
3891 } catch(std::exception& e) {
3892 sq_throwerror(vm, e.what());
3895 sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_flip_vertically'"));
3901 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
3906 scripting::Level_toggle_pause();
3910 } catch(std::exception& e) {
3911 sq_throwerror(vm, e.what());
3914 sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_toggle_pause'"));
3920 static SQInteger Level_edit_wrapper(HSQUIRRELVM vm)
3923 if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3924 sq_throwerror(vm, _SC("Argument 1 not a bool"));
3929 scripting::Level_edit(arg0 == SQTrue);
3933 } catch(std::exception& e) {
3934 sq_throwerror(vm, e.what());
3937 sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_edit'"));
3943 } // namespace wrapper
3944 void create_squirrel_instance(HSQUIRRELVM v, scripting::AmbientSound* object, bool setup_releasehook)
3946 using namespace wrapper;
3948 sq_pushroottable(v);
3949 sq_pushstring(v, "AmbientSound", -1);
3950 if(SQ_FAILED(sq_get(v, -2))) {
3951 std::ostringstream msg;
3952 msg << "Couldn't resolved squirrel type 'AmbientSound'";
3953 throw SquirrelError(v, msg.str());
3956 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3957 std::ostringstream msg;
3958 msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'";
3959 throw SquirrelError(v, msg.str());
3961 sq_remove(v, -2); // remove object name
3963 if(setup_releasehook) {
3964 sq_setreleasehook(v, -1, AmbientSound_release_hook);
3967 sq_remove(v, -2); // remove root table
3970 void create_squirrel_instance(HSQUIRRELVM v, scripting::Camera* object, bool setup_releasehook)
3972 using namespace wrapper;
3974 sq_pushroottable(v);
3975 sq_pushstring(v, "Camera", -1);
3976 if(SQ_FAILED(sq_get(v, -2))) {
3977 std::ostringstream msg;
3978 msg << "Couldn't resolved squirrel type 'Camera'";
3979 throw SquirrelError(v, msg.str());
3982 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3983 std::ostringstream msg;
3984 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
3985 throw SquirrelError(v, msg.str());
3987 sq_remove(v, -2); // remove object name
3989 if(setup_releasehook) {
3990 sq_setreleasehook(v, -1, Camera_release_hook);
3993 sq_remove(v, -2); // remove root table
3996 void create_squirrel_instance(HSQUIRRELVM v, scripting::Candle* object, bool setup_releasehook)
3998 using namespace wrapper;
4000 sq_pushroottable(v);
4001 sq_pushstring(v, "Candle", -1);
4002 if(SQ_FAILED(sq_get(v, -2))) {
4003 std::ostringstream msg;
4004 msg << "Couldn't resolved squirrel type 'Candle'";
4005 throw SquirrelError(v, msg.str());
4008 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4009 std::ostringstream msg;
4010 msg << "Couldn't setup squirrel instance for object of type 'Candle'";
4011 throw SquirrelError(v, msg.str());
4013 sq_remove(v, -2); // remove object name
4015 if(setup_releasehook) {
4016 sq_setreleasehook(v, -1, Candle_release_hook);
4019 sq_remove(v, -2); // remove root table
4022 void create_squirrel_instance(HSQUIRRELVM v, scripting::DisplayEffect* object, bool setup_releasehook)
4024 using namespace wrapper;
4026 sq_pushroottable(v);
4027 sq_pushstring(v, "DisplayEffect", -1);
4028 if(SQ_FAILED(sq_get(v, -2))) {
4029 std::ostringstream msg;
4030 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
4031 throw SquirrelError(v, msg.str());
4034 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4035 std::ostringstream msg;
4036 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
4037 throw SquirrelError(v, msg.str());
4039 sq_remove(v, -2); // remove object name
4041 if(setup_releasehook) {
4042 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
4045 sq_remove(v, -2); // remove root table
4048 void create_squirrel_instance(HSQUIRRELVM v, scripting::FloatingImage* object, bool setup_releasehook)
4050 using namespace wrapper;
4052 sq_pushroottable(v);
4053 sq_pushstring(v, "FloatingImage", -1);
4054 if(SQ_FAILED(sq_get(v, -2))) {
4055 std::ostringstream msg;
4056 msg << "Couldn't resolved squirrel type 'FloatingImage'";
4057 throw SquirrelError(v, msg.str());
4060 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4061 std::ostringstream msg;
4062 msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
4063 throw SquirrelError(v, msg.str());
4065 sq_remove(v, -2); // remove object name
4067 if(setup_releasehook) {
4068 sq_setreleasehook(v, -1, FloatingImage_release_hook);
4071 sq_remove(v, -2); // remove root table
4074 void create_squirrel_instance(HSQUIRRELVM v, scripting::LevelTime* object, bool setup_releasehook)
4076 using namespace wrapper;
4078 sq_pushroottable(v);
4079 sq_pushstring(v, "LevelTime", -1);
4080 if(SQ_FAILED(sq_get(v, -2))) {
4081 std::ostringstream msg;
4082 msg << "Couldn't resolved squirrel type 'LevelTime'";
4083 throw SquirrelError(v, msg.str());
4086 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4087 std::ostringstream msg;
4088 msg << "Couldn't setup squirrel instance for object of type 'LevelTime'";
4089 throw SquirrelError(v, msg.str());
4091 sq_remove(v, -2); // remove object name
4093 if(setup_releasehook) {
4094 sq_setreleasehook(v, -1, LevelTime_release_hook);
4097 sq_remove(v, -2); // remove root table
4100 void create_squirrel_instance(HSQUIRRELVM v, scripting::Platform* object, bool setup_releasehook)
4102 using namespace wrapper;
4104 sq_pushroottable(v);
4105 sq_pushstring(v, "Platform", -1);
4106 if(SQ_FAILED(sq_get(v, -2))) {
4107 std::ostringstream msg;
4108 msg << "Couldn't resolved squirrel type 'Platform'";
4109 throw SquirrelError(v, msg.str());
4112 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4113 std::ostringstream msg;
4114 msg << "Couldn't setup squirrel instance for object of type 'Platform'";
4115 throw SquirrelError(v, msg.str());
4117 sq_remove(v, -2); // remove object name
4119 if(setup_releasehook) {
4120 sq_setreleasehook(v, -1, Platform_release_hook);
4123 sq_remove(v, -2); // remove root table
4126 void create_squirrel_instance(HSQUIRRELVM v, scripting::Player* object, bool setup_releasehook)
4128 using namespace wrapper;
4130 sq_pushroottable(v);
4131 sq_pushstring(v, "Player", -1);
4132 if(SQ_FAILED(sq_get(v, -2))) {
4133 std::ostringstream msg;
4134 msg << "Couldn't resolved squirrel type 'Player'";
4135 throw SquirrelError(v, msg.str());
4138 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4139 std::ostringstream msg;
4140 msg << "Couldn't setup squirrel instance for object of type 'Player'";
4141 throw SquirrelError(v, msg.str());
4143 sq_remove(v, -2); // remove object name
4145 if(setup_releasehook) {
4146 sq_setreleasehook(v, -1, Player_release_hook);
4149 sq_remove(v, -2); // remove root table
4152 void create_squirrel_instance(HSQUIRRELVM v, scripting::ScriptedObject* object, bool setup_releasehook)
4154 using namespace wrapper;
4156 sq_pushroottable(v);
4157 sq_pushstring(v, "ScriptedObject", -1);
4158 if(SQ_FAILED(sq_get(v, -2))) {
4159 std::ostringstream msg;
4160 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
4161 throw SquirrelError(v, msg.str());
4164 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4165 std::ostringstream msg;
4166 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
4167 throw SquirrelError(v, msg.str());
4169 sq_remove(v, -2); // remove object name
4171 if(setup_releasehook) {
4172 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
4175 sq_remove(v, -2); // remove root table
4178 void create_squirrel_instance(HSQUIRRELVM v, scripting::SSector* object, bool setup_releasehook)
4180 using namespace wrapper;
4182 sq_pushroottable(v);
4183 sq_pushstring(v, "SSector", -1);
4184 if(SQ_FAILED(sq_get(v, -2))) {
4185 std::ostringstream msg;
4186 msg << "Couldn't resolved squirrel type 'SSector'";
4187 throw SquirrelError(v, msg.str());
4190 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4191 std::ostringstream msg;
4192 msg << "Couldn't setup squirrel instance for object of type 'SSector'";
4193 throw SquirrelError(v, msg.str());
4195 sq_remove(v, -2); // remove object name
4197 if(setup_releasehook) {
4198 sq_setreleasehook(v, -1, SSector_release_hook);
4201 sq_remove(v, -2); // remove root table
4204 void create_squirrel_instance(HSQUIRRELVM v, scripting::Text* object, bool setup_releasehook)
4206 using namespace wrapper;
4208 sq_pushroottable(v);
4209 sq_pushstring(v, "Text", -1);
4210 if(SQ_FAILED(sq_get(v, -2))) {
4211 std::ostringstream msg;
4212 msg << "Couldn't resolved squirrel type 'Text'";
4213 throw SquirrelError(v, msg.str());
4216 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4217 std::ostringstream msg;
4218 msg << "Couldn't setup squirrel instance for object of type 'Text'";
4219 throw SquirrelError(v, msg.str());
4221 sq_remove(v, -2); // remove object name
4223 if(setup_releasehook) {
4224 sq_setreleasehook(v, -1, Text_release_hook);
4227 sq_remove(v, -2); // remove root table
4230 void create_squirrel_instance(HSQUIRRELVM v, scripting::Thunderstorm* object, bool setup_releasehook)
4232 using namespace wrapper;
4234 sq_pushroottable(v);
4235 sq_pushstring(v, "Thunderstorm", -1);
4236 if(SQ_FAILED(sq_get(v, -2))) {
4237 std::ostringstream msg;
4238 msg << "Couldn't resolved squirrel type 'Thunderstorm'";
4239 throw SquirrelError(v, msg.str());
4242 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4243 std::ostringstream msg;
4244 msg << "Couldn't setup squirrel instance for object of type 'Thunderstorm'";
4245 throw SquirrelError(v, msg.str());
4247 sq_remove(v, -2); // remove object name
4249 if(setup_releasehook) {
4250 sq_setreleasehook(v, -1, Thunderstorm_release_hook);
4253 sq_remove(v, -2); // remove root table
4256 void create_squirrel_instance(HSQUIRRELVM v, scripting::TileMap* object, bool setup_releasehook)
4258 using namespace wrapper;
4260 sq_pushroottable(v);
4261 sq_pushstring(v, "TileMap", -1);
4262 if(SQ_FAILED(sq_get(v, -2))) {
4263 std::ostringstream msg;
4264 msg << "Couldn't resolved squirrel type 'TileMap'";
4265 throw SquirrelError(v, msg.str());
4268 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4269 std::ostringstream msg;
4270 msg << "Couldn't setup squirrel instance for object of type 'TileMap'";
4271 throw SquirrelError(v, msg.str());
4273 sq_remove(v, -2); // remove object name
4275 if(setup_releasehook) {
4276 sq_setreleasehook(v, -1, TileMap_release_hook);
4279 sq_remove(v, -2); // remove root table
4282 void create_squirrel_instance(HSQUIRRELVM v, scripting::WillOWisp* object, bool setup_releasehook)
4284 using namespace wrapper;
4286 sq_pushroottable(v);
4287 sq_pushstring(v, "WillOWisp", -1);
4288 if(SQ_FAILED(sq_get(v, -2))) {
4289 std::ostringstream msg;
4290 msg << "Couldn't resolved squirrel type 'WillOWisp'";
4291 throw SquirrelError(v, msg.str());
4294 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4295 std::ostringstream msg;
4296 msg << "Couldn't setup squirrel instance for object of type 'WillOWisp'";
4297 throw SquirrelError(v, msg.str());
4299 sq_remove(v, -2); // remove object name
4301 if(setup_releasehook) {
4302 sq_setreleasehook(v, -1, WillOWisp_release_hook);
4305 sq_remove(v, -2); // remove root table
4308 void create_squirrel_instance(HSQUIRRELVM v, scripting::Wind* object, bool setup_releasehook)
4310 using namespace wrapper;
4312 sq_pushroottable(v);
4313 sq_pushstring(v, "Wind", -1);
4314 if(SQ_FAILED(sq_get(v, -2))) {
4315 std::ostringstream msg;
4316 msg << "Couldn't resolved squirrel type 'Wind'";
4317 throw SquirrelError(v, msg.str());
4320 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4321 std::ostringstream msg;
4322 msg << "Couldn't setup squirrel instance for object of type 'Wind'";
4323 throw SquirrelError(v, msg.str());
4325 sq_remove(v, -2); // remove object name
4327 if(setup_releasehook) {
4328 sq_setreleasehook(v, -1, Wind_release_hook);
4331 sq_remove(v, -2); // remove root table
4334 void register_supertux_wrapper(HSQUIRRELVM v)
4336 using namespace wrapper;
4338 sq_pushstring(v, "ANCHOR_TOP", -1);
4339 sq_pushinteger(v, 16);
4340 if(SQ_FAILED(sq_createslot(v, -3))) {
4341 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
4344 sq_pushstring(v, "ANCHOR_BOTTOM", -1);
4345 sq_pushinteger(v, 32);
4346 if(SQ_FAILED(sq_createslot(v, -3))) {
4347 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
4350 sq_pushstring(v, "ANCHOR_LEFT", -1);
4351 sq_pushinteger(v, 1);
4352 if(SQ_FAILED(sq_createslot(v, -3))) {
4353 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
4356 sq_pushstring(v, "ANCHOR_RIGHT", -1);
4357 sq_pushinteger(v, 2);
4358 if(SQ_FAILED(sq_createslot(v, -3))) {
4359 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
4362 sq_pushstring(v, "ANCHOR_MIDDLE", -1);
4363 sq_pushinteger(v, 0);
4364 if(SQ_FAILED(sq_createslot(v, -3))) {
4365 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
4368 sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
4369 sq_pushinteger(v, 17);
4370 if(SQ_FAILED(sq_createslot(v, -3))) {
4371 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
4374 sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
4375 sq_pushinteger(v, 18);
4376 if(SQ_FAILED(sq_createslot(v, -3))) {
4377 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
4380 sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
4381 sq_pushinteger(v, 33);
4382 if(SQ_FAILED(sq_createslot(v, -3))) {
4383 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
4386 sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
4387 sq_pushinteger(v, 34);
4388 if(SQ_FAILED(sq_createslot(v, -3))) {
4389 throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
4392 sq_pushstring(v, "display", -1);
4393 sq_newclosure(v, &display_wrapper, 0);
4394 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t.");
4395 if(SQ_FAILED(sq_createslot(v, -3))) {
4396 throw SquirrelError(v, "Couldn't register function 'display'");
4399 sq_pushstring(v, "print_stacktrace", -1);
4400 sq_newclosure(v, &print_stacktrace_wrapper, 0);
4401 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4402 if(SQ_FAILED(sq_createslot(v, -3))) {
4403 throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
4406 sq_pushstring(v, "get_current_thread", -1);
4407 sq_newclosure(v, &get_current_thread_wrapper, 0);
4408 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t");
4409 if(SQ_FAILED(sq_createslot(v, -3))) {
4410 throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
4413 sq_pushstring(v, "display_text_file", -1);
4414 sq_newclosure(v, &display_text_file_wrapper, 0);
4415 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4416 if(SQ_FAILED(sq_createslot(v, -3))) {
4417 throw SquirrelError(v, "Couldn't register function 'display_text_file'");
4420 sq_pushstring(v, "load_worldmap", -1);
4421 sq_newclosure(v, &load_worldmap_wrapper, 0);
4422 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4423 if(SQ_FAILED(sq_createslot(v, -3))) {
4424 throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
4427 sq_pushstring(v, "load_level", -1);
4428 sq_newclosure(v, &load_level_wrapper, 0);
4429 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4430 if(SQ_FAILED(sq_createslot(v, -3))) {
4431 throw SquirrelError(v, "Couldn't register function 'load_level'");
4434 sq_pushstring(v, "wait", -1);
4435 sq_newclosure(v, &wait_wrapper, 0);
4436 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4437 if(SQ_FAILED(sq_createslot(v, -3))) {
4438 throw SquirrelError(v, "Couldn't register function 'wait'");
4441 sq_pushstring(v, "wait_for_screenswitch", -1);
4442 sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
4443 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4444 if(SQ_FAILED(sq_createslot(v, -3))) {
4445 throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
4448 sq_pushstring(v, "exit_screen", -1);
4449 sq_newclosure(v, &exit_screen_wrapper, 0);
4450 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4451 if(SQ_FAILED(sq_createslot(v, -3))) {
4452 throw SquirrelError(v, "Couldn't register function 'exit_screen'");
4455 sq_pushstring(v, "fadeout_screen", -1);
4456 sq_newclosure(v, &fadeout_screen_wrapper, 0);
4457 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4458 if(SQ_FAILED(sq_createslot(v, -3))) {
4459 throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
4462 sq_pushstring(v, "shrink_screen", -1);
4463 sq_newclosure(v, &shrink_screen_wrapper, 0);
4464 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4465 if(SQ_FAILED(sq_createslot(v, -3))) {
4466 throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
4469 sq_pushstring(v, "abort_screenfade", -1);
4470 sq_newclosure(v, &abort_screenfade_wrapper, 0);
4471 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4472 if(SQ_FAILED(sq_createslot(v, -3))) {
4473 throw SquirrelError(v, "Couldn't register function 'abort_screenfade'");
4476 sq_pushstring(v, "translate", -1);
4477 sq_newclosure(v, &translate_wrapper, 0);
4478 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4479 if(SQ_FAILED(sq_createslot(v, -3))) {
4480 throw SquirrelError(v, "Couldn't register function 'translate'");
4483 sq_pushstring(v, "import", -1);
4484 sq_newclosure(v, &import_wrapper, 0);
4485 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4486 if(SQ_FAILED(sq_createslot(v, -3))) {
4487 throw SquirrelError(v, "Couldn't register function 'import'");
4490 sq_pushstring(v, "save_state", -1);
4491 sq_newclosure(v, &save_state_wrapper, 0);
4492 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4493 if(SQ_FAILED(sq_createslot(v, -3))) {
4494 throw SquirrelError(v, "Couldn't register function 'save_state'");
4497 sq_pushstring(v, "debug_collrects", -1);
4498 sq_newclosure(v, &debug_collrects_wrapper, 0);
4499 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4500 if(SQ_FAILED(sq_createslot(v, -3))) {
4501 throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
4504 sq_pushstring(v, "debug_show_fps", -1);
4505 sq_newclosure(v, &debug_show_fps_wrapper, 0);
4506 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4507 if(SQ_FAILED(sq_createslot(v, -3))) {
4508 throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
4511 sq_pushstring(v, "debug_draw_solids_only", -1);
4512 sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
4513 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4514 if(SQ_FAILED(sq_createslot(v, -3))) {
4515 throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
4518 sq_pushstring(v, "debug_draw_editor_images", -1);
4519 sq_newclosure(v, &debug_draw_editor_images_wrapper, 0);
4520 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4521 if(SQ_FAILED(sq_createslot(v, -3))) {
4522 throw SquirrelError(v, "Couldn't register function 'debug_draw_editor_images'");
4525 sq_pushstring(v, "debug_worldmap_ghost", -1);
4526 sq_newclosure(v, &debug_worldmap_ghost_wrapper, 0);
4527 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4528 if(SQ_FAILED(sq_createslot(v, -3))) {
4529 throw SquirrelError(v, "Couldn't register function 'debug_worldmap_ghost'");
4532 sq_pushstring(v, "play_music", -1);
4533 sq_newclosure(v, &play_music_wrapper, 0);
4534 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4535 if(SQ_FAILED(sq_createslot(v, -3))) {
4536 throw SquirrelError(v, "Couldn't register function 'play_music'");
4539 sq_pushstring(v, "play_sound", -1);
4540 sq_newclosure(v, &play_sound_wrapper, 0);
4541 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4542 if(SQ_FAILED(sq_createslot(v, -3))) {
4543 throw SquirrelError(v, "Couldn't register function 'play_sound'");
4546 sq_pushstring(v, "set_game_speed", -1);
4547 sq_newclosure(v, &set_game_speed_wrapper, 0);
4548 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4549 if(SQ_FAILED(sq_createslot(v, -3))) {
4550 throw SquirrelError(v, "Couldn't register function 'set_game_speed'");
4553 sq_pushstring(v, "grease", -1);
4554 sq_newclosure(v, &grease_wrapper, 0);
4555 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4556 if(SQ_FAILED(sq_createslot(v, -3))) {
4557 throw SquirrelError(v, "Couldn't register function 'grease'");
4560 sq_pushstring(v, "invincible", -1);
4561 sq_newclosure(v, &invincible_wrapper, 0);
4562 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4563 if(SQ_FAILED(sq_createslot(v, -3))) {
4564 throw SquirrelError(v, "Couldn't register function 'invincible'");
4567 sq_pushstring(v, "ghost", -1);
4568 sq_newclosure(v, &ghost_wrapper, 0);
4569 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4570 if(SQ_FAILED(sq_createslot(v, -3))) {
4571 throw SquirrelError(v, "Couldn't register function 'ghost'");
4574 sq_pushstring(v, "mortal", -1);
4575 sq_newclosure(v, &mortal_wrapper, 0);
4576 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4577 if(SQ_FAILED(sq_createslot(v, -3))) {
4578 throw SquirrelError(v, "Couldn't register function 'mortal'");
4581 sq_pushstring(v, "restart", -1);
4582 sq_newclosure(v, &restart_wrapper, 0);
4583 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4584 if(SQ_FAILED(sq_createslot(v, -3))) {
4585 throw SquirrelError(v, "Couldn't register function 'restart'");
4588 sq_pushstring(v, "whereami", -1);
4589 sq_newclosure(v, &whereami_wrapper, 0);
4590 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4591 if(SQ_FAILED(sq_createslot(v, -3))) {
4592 throw SquirrelError(v, "Couldn't register function 'whereami'");
4595 sq_pushstring(v, "gotoend", -1);
4596 sq_newclosure(v, &gotoend_wrapper, 0);
4597 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4598 if(SQ_FAILED(sq_createslot(v, -3))) {
4599 throw SquirrelError(v, "Couldn't register function 'gotoend'");
4602 sq_pushstring(v, "camera", -1);
4603 sq_newclosure(v, &camera_wrapper, 0);
4604 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4605 if(SQ_FAILED(sq_createslot(v, -3))) {
4606 throw SquirrelError(v, "Couldn't register function 'camera'");
4609 sq_pushstring(v, "set_gamma", -1);
4610 sq_newclosure(v, &set_gamma_wrapper, 0);
4611 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4612 if(SQ_FAILED(sq_createslot(v, -3))) {
4613 throw SquirrelError(v, "Couldn't register function 'set_gamma'");
4616 sq_pushstring(v, "quit", -1);
4617 sq_newclosure(v, &quit_wrapper, 0);
4618 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4619 if(SQ_FAILED(sq_createslot(v, -3))) {
4620 throw SquirrelError(v, "Couldn't register function 'quit'");
4623 sq_pushstring(v, "rand", -1);
4624 sq_newclosure(v, &rand_wrapper, 0);
4625 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4626 if(SQ_FAILED(sq_createslot(v, -3))) {
4627 throw SquirrelError(v, "Couldn't register function 'rand'");
4630 sq_pushstring(v, "record_demo", -1);
4631 sq_newclosure(v, &record_demo_wrapper, 0);
4632 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4633 if(SQ_FAILED(sq_createslot(v, -3))) {
4634 throw SquirrelError(v, "Couldn't register function 'record_demo'");
4637 sq_pushstring(v, "play_demo", -1);
4638 sq_newclosure(v, &play_demo_wrapper, 0);
4639 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4640 if(SQ_FAILED(sq_createslot(v, -3))) {
4641 throw SquirrelError(v, "Couldn't register function 'play_demo'");
4644 sq_pushstring(v, "Level_finish", -1);
4645 sq_newclosure(v, &Level_finish_wrapper, 0);
4646 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4647 if(SQ_FAILED(sq_createslot(v, -3))) {
4648 throw SquirrelError(v, "Couldn't register function 'Level_finish'");
4651 sq_pushstring(v, "Level_spawn", -1);
4652 sq_newclosure(v, &Level_spawn_wrapper, 0);
4653 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tss");
4654 if(SQ_FAILED(sq_createslot(v, -3))) {
4655 throw SquirrelError(v, "Couldn't register function 'Level_spawn'");
4658 sq_pushstring(v, "Level_flip_vertically", -1);
4659 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
4660 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4661 if(SQ_FAILED(sq_createslot(v, -3))) {
4662 throw SquirrelError(v, "Couldn't register function 'Level_flip_vertically'");
4665 sq_pushstring(v, "Level_toggle_pause", -1);
4666 sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
4667 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4668 if(SQ_FAILED(sq_createslot(v, -3))) {
4669 throw SquirrelError(v, "Couldn't register function 'Level_toggle_pause'");
4672 sq_pushstring(v, "Level_edit", -1);
4673 sq_newclosure(v, &Level_edit_wrapper, 0);
4674 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4675 if(SQ_FAILED(sq_createslot(v, -3))) {
4676 throw SquirrelError(v, "Couldn't register function 'Level_edit'");
4679 // Register class AmbientSound
4680 sq_pushstring(v, "AmbientSound", -1);
4681 if(sq_newclass(v, SQFalse) < 0) {
4682 std::ostringstream msg;
4683 msg << "Couldn't create new class 'AmbientSound'";
4684 throw SquirrelError(v, msg.str());
4686 sq_pushstring(v, "set_pos", -1);
4687 sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
4688 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4689 if(SQ_FAILED(sq_createslot(v, -3))) {
4690 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4693 sq_pushstring(v, "get_pos_x", -1);
4694 sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
4695 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4696 if(SQ_FAILED(sq_createslot(v, -3))) {
4697 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4700 sq_pushstring(v, "get_pos_y", -1);
4701 sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
4702 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4703 if(SQ_FAILED(sq_createslot(v, -3))) {
4704 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4707 if(SQ_FAILED(sq_createslot(v, -3))) {
4708 throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
4711 // Register class Camera
4712 sq_pushstring(v, "Camera", -1);
4713 if(sq_newclass(v, SQFalse) < 0) {
4714 std::ostringstream msg;
4715 msg << "Couldn't create new class 'Camera'";
4716 throw SquirrelError(v, msg.str());
4718 sq_pushstring(v, "reload_config", -1);
4719 sq_newclosure(v, &Camera_reload_config_wrapper, 0);
4720 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4721 if(SQ_FAILED(sq_createslot(v, -3))) {
4722 throw SquirrelError(v, "Couldn't register function 'reload_config'");
4725 sq_pushstring(v, "shake", -1);
4726 sq_newclosure(v, &Camera_shake_wrapper, 0);
4727 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4728 if(SQ_FAILED(sq_createslot(v, -3))) {
4729 throw SquirrelError(v, "Couldn't register function 'shake'");
4732 sq_pushstring(v, "set_pos", -1);
4733 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
4734 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4735 if(SQ_FAILED(sq_createslot(v, -3))) {
4736 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4739 sq_pushstring(v, "set_mode", -1);
4740 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
4741 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4742 if(SQ_FAILED(sq_createslot(v, -3))) {
4743 throw SquirrelError(v, "Couldn't register function 'set_mode'");
4746 sq_pushstring(v, "scroll_to", -1);
4747 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
4748 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4749 if(SQ_FAILED(sq_createslot(v, -3))) {
4750 throw SquirrelError(v, "Couldn't register function 'scroll_to'");
4753 if(SQ_FAILED(sq_createslot(v, -3))) {
4754 throw SquirrelError(v, "Couldn't register class 'Camera'");
4757 // Register class Candle
4758 sq_pushstring(v, "Candle", -1);
4759 if(sq_newclass(v, SQFalse) < 0) {
4760 std::ostringstream msg;
4761 msg << "Couldn't create new class 'Candle'";
4762 throw SquirrelError(v, msg.str());
4764 sq_pushstring(v, "get_burning", -1);
4765 sq_newclosure(v, &Candle_get_burning_wrapper, 0);
4766 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4767 if(SQ_FAILED(sq_createslot(v, -3))) {
4768 throw SquirrelError(v, "Couldn't register function 'get_burning'");
4771 sq_pushstring(v, "set_burning", -1);
4772 sq_newclosure(v, &Candle_set_burning_wrapper, 0);
4773 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4774 if(SQ_FAILED(sq_createslot(v, -3))) {
4775 throw SquirrelError(v, "Couldn't register function 'set_burning'");
4778 if(SQ_FAILED(sq_createslot(v, -3))) {
4779 throw SquirrelError(v, "Couldn't register class 'Candle'");
4782 // Register class DisplayEffect
4783 sq_pushstring(v, "DisplayEffect", -1);
4784 if(sq_newclass(v, SQFalse) < 0) {
4785 std::ostringstream msg;
4786 msg << "Couldn't create new class 'DisplayEffect'";
4787 throw SquirrelError(v, msg.str());
4789 sq_pushstring(v, "fade_out", -1);
4790 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
4791 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4792 if(SQ_FAILED(sq_createslot(v, -3))) {
4793 throw SquirrelError(v, "Couldn't register function 'fade_out'");
4796 sq_pushstring(v, "fade_in", -1);
4797 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
4798 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4799 if(SQ_FAILED(sq_createslot(v, -3))) {
4800 throw SquirrelError(v, "Couldn't register function 'fade_in'");
4803 sq_pushstring(v, "set_black", -1);
4804 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
4805 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4806 if(SQ_FAILED(sq_createslot(v, -3))) {
4807 throw SquirrelError(v, "Couldn't register function 'set_black'");
4810 sq_pushstring(v, "is_black", -1);
4811 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
4812 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4813 if(SQ_FAILED(sq_createslot(v, -3))) {
4814 throw SquirrelError(v, "Couldn't register function 'is_black'");
4817 sq_pushstring(v, "sixteen_to_nine", -1);
4818 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
4819 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4820 if(SQ_FAILED(sq_createslot(v, -3))) {
4821 throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
4824 sq_pushstring(v, "four_to_three", -1);
4825 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
4826 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4827 if(SQ_FAILED(sq_createslot(v, -3))) {
4828 throw SquirrelError(v, "Couldn't register function 'four_to_three'");
4831 if(SQ_FAILED(sq_createslot(v, -3))) {
4832 throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
4835 // Register class FloatingImage
4836 sq_pushstring(v, "FloatingImage", -1);
4837 if(sq_newclass(v, SQFalse) < 0) {
4838 std::ostringstream msg;
4839 msg << "Couldn't create new class 'FloatingImage'";
4840 throw SquirrelError(v, msg.str());
4842 sq_pushstring(v, "constructor", -1);
4843 sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
4844 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4845 if(SQ_FAILED(sq_createslot(v, -3))) {
4846 throw SquirrelError(v, "Couldn't register function 'constructor'");
4849 sq_pushstring(v, "set_layer", -1);
4850 sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
4851 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4852 if(SQ_FAILED(sq_createslot(v, -3))) {
4853 throw SquirrelError(v, "Couldn't register function 'set_layer'");
4856 sq_pushstring(v, "get_layer", -1);
4857 sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
4858 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4859 if(SQ_FAILED(sq_createslot(v, -3))) {
4860 throw SquirrelError(v, "Couldn't register function 'get_layer'");
4863 sq_pushstring(v, "set_pos", -1);
4864 sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
4865 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4866 if(SQ_FAILED(sq_createslot(v, -3))) {
4867 throw SquirrelError(v, "Couldn't register function 'set_pos'");
4870 sq_pushstring(v, "get_pos_x", -1);
4871 sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
4872 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4873 if(SQ_FAILED(sq_createslot(v, -3))) {
4874 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4877 sq_pushstring(v, "get_pos_y", -1);
4878 sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
4879 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4880 if(SQ_FAILED(sq_createslot(v, -3))) {
4881 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4884 sq_pushstring(v, "set_anchor_point", -1);
4885 sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
4886 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4887 if(SQ_FAILED(sq_createslot(v, -3))) {
4888 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4891 sq_pushstring(v, "get_anchor_point", -1);
4892 sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
4893 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4894 if(SQ_FAILED(sq_createslot(v, -3))) {
4895 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4898 sq_pushstring(v, "set_visible", -1);
4899 sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
4900 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4901 if(SQ_FAILED(sq_createslot(v, -3))) {
4902 throw SquirrelError(v, "Couldn't register function 'set_visible'");
4905 sq_pushstring(v, "get_visible", -1);
4906 sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
4907 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4908 if(SQ_FAILED(sq_createslot(v, -3))) {
4909 throw SquirrelError(v, "Couldn't register function 'get_visible'");
4912 sq_pushstring(v, "set_action", -1);
4913 sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
4914 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4915 if(SQ_FAILED(sq_createslot(v, -3))) {
4916 throw SquirrelError(v, "Couldn't register function 'set_action'");
4919 sq_pushstring(v, "get_action", -1);
4920 sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
4921 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4922 if(SQ_FAILED(sq_createslot(v, -3))) {
4923 throw SquirrelError(v, "Couldn't register function 'get_action'");
4926 sq_pushstring(v, "fade_in", -1);
4927 sq_newclosure(v, &FloatingImage_fade_in_wrapper, 0);
4928 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4929 if(SQ_FAILED(sq_createslot(v, -3))) {
4930 throw SquirrelError(v, "Couldn't register function 'fade_in'");
4933 sq_pushstring(v, "fade_out", -1);
4934 sq_newclosure(v, &FloatingImage_fade_out_wrapper, 0);
4935 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4936 if(SQ_FAILED(sq_createslot(v, -3))) {
4937 throw SquirrelError(v, "Couldn't register function 'fade_out'");
4940 if(SQ_FAILED(sq_createslot(v, -3))) {
4941 throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
4944 // Register class LevelTime
4945 sq_pushstring(v, "LevelTime", -1);
4946 if(sq_newclass(v, SQFalse) < 0) {
4947 std::ostringstream msg;
4948 msg << "Couldn't create new class 'LevelTime'";
4949 throw SquirrelError(v, msg.str());
4951 sq_pushstring(v, "start", -1);
4952 sq_newclosure(v, &LevelTime_start_wrapper, 0);
4953 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4954 if(SQ_FAILED(sq_createslot(v, -3))) {
4955 throw SquirrelError(v, "Couldn't register function 'start'");
4958 sq_pushstring(v, "stop", -1);
4959 sq_newclosure(v, &LevelTime_stop_wrapper, 0);
4960 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4961 if(SQ_FAILED(sq_createslot(v, -3))) {
4962 throw SquirrelError(v, "Couldn't register function 'stop'");
4965 sq_pushstring(v, "get_time", -1);
4966 sq_newclosure(v, &LevelTime_get_time_wrapper, 0);
4967 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4968 if(SQ_FAILED(sq_createslot(v, -3))) {
4969 throw SquirrelError(v, "Couldn't register function 'get_time'");
4972 sq_pushstring(v, "set_time", -1);
4973 sq_newclosure(v, &LevelTime_set_time_wrapper, 0);
4974 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4975 if(SQ_FAILED(sq_createslot(v, -3))) {
4976 throw SquirrelError(v, "Couldn't register function 'set_time'");
4979 if(SQ_FAILED(sq_createslot(v, -3))) {
4980 throw SquirrelError(v, "Couldn't register class 'LevelTime'");
4983 // Register class Platform
4984 sq_pushstring(v, "Platform", -1);
4985 if(sq_newclass(v, SQFalse) < 0) {
4986 std::ostringstream msg;
4987 msg << "Couldn't create new class 'Platform'";
4988 throw SquirrelError(v, msg.str());
4990 sq_pushstring(v, "goto_node", -1);
4991 sq_newclosure(v, &Platform_goto_node_wrapper, 0);
4992 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4993 if(SQ_FAILED(sq_createslot(v, -3))) {
4994 throw SquirrelError(v, "Couldn't register function 'goto_node'");
4997 sq_pushstring(v, "start_moving", -1);
4998 sq_newclosure(v, &Platform_start_moving_wrapper, 0);
4999 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5000 if(SQ_FAILED(sq_createslot(v, -3))) {
5001 throw SquirrelError(v, "Couldn't register function 'start_moving'");
5004 sq_pushstring(v, "stop_moving", -1);
5005 sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
5006 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5007 if(SQ_FAILED(sq_createslot(v, -3))) {
5008 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5011 if(SQ_FAILED(sq_createslot(v, -3))) {
5012 throw SquirrelError(v, "Couldn't register class 'Platform'");
5015 // Register class Player
5016 sq_pushstring(v, "Player", -1);
5017 if(sq_newclass(v, SQFalse) < 0) {
5018 std::ostringstream msg;
5019 msg << "Couldn't create new class 'Player'";
5020 throw SquirrelError(v, msg.str());
5022 sq_pushstring(v, "add_bonus", -1);
5023 sq_newclosure(v, &Player_add_bonus_wrapper, 0);
5024 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5025 if(SQ_FAILED(sq_createslot(v, -3))) {
5026 throw SquirrelError(v, "Couldn't register function 'add_bonus'");
5029 sq_pushstring(v, "add_coins", -1);
5030 sq_newclosure(v, &Player_add_coins_wrapper, 0);
5031 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5032 if(SQ_FAILED(sq_createslot(v, -3))) {
5033 throw SquirrelError(v, "Couldn't register function 'add_coins'");
5036 sq_pushstring(v, "make_invincible", -1);
5037 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
5038 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5039 if(SQ_FAILED(sq_createslot(v, -3))) {
5040 throw SquirrelError(v, "Couldn't register function 'make_invincible'");
5043 sq_pushstring(v, "deactivate", -1);
5044 sq_newclosure(v, &Player_deactivate_wrapper, 0);
5045 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5046 if(SQ_FAILED(sq_createslot(v, -3))) {
5047 throw SquirrelError(v, "Couldn't register function 'deactivate'");
5050 sq_pushstring(v, "activate", -1);
5051 sq_newclosure(v, &Player_activate_wrapper, 0);
5052 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5053 if(SQ_FAILED(sq_createslot(v, -3))) {
5054 throw SquirrelError(v, "Couldn't register function 'activate'");
5057 sq_pushstring(v, "walk", -1);
5058 sq_newclosure(v, &Player_walk_wrapper, 0);
5059 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5060 if(SQ_FAILED(sq_createslot(v, -3))) {
5061 throw SquirrelError(v, "Couldn't register function 'walk'");
5064 sq_pushstring(v, "set_dir", -1);
5065 sq_newclosure(v, &Player_set_dir_wrapper, 0);
5066 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5067 if(SQ_FAILED(sq_createslot(v, -3))) {
5068 throw SquirrelError(v, "Couldn't register function 'set_dir'");
5071 sq_pushstring(v, "set_visible", -1);
5072 sq_newclosure(v, &Player_set_visible_wrapper, 0);
5073 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5074 if(SQ_FAILED(sq_createslot(v, -3))) {
5075 throw SquirrelError(v, "Couldn't register function 'set_visible'");
5078 sq_pushstring(v, "get_visible", -1);
5079 sq_newclosure(v, &Player_get_visible_wrapper, 0);
5080 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5081 if(SQ_FAILED(sq_createslot(v, -3))) {
5082 throw SquirrelError(v, "Couldn't register function 'get_visible'");
5085 sq_pushstring(v, "kill", -1);
5086 sq_newclosure(v, &Player_kill_wrapper, 0);
5087 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5088 if(SQ_FAILED(sq_createslot(v, -3))) {
5089 throw SquirrelError(v, "Couldn't register function 'kill'");
5092 sq_pushstring(v, "set_ghost_mode", -1);
5093 sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
5094 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5095 if(SQ_FAILED(sq_createslot(v, -3))) {
5096 throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
5099 sq_pushstring(v, "get_ghost_mode", -1);
5100 sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
5101 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5102 if(SQ_FAILED(sq_createslot(v, -3))) {
5103 throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
5106 sq_pushstring(v, "kick", -1);
5107 sq_newclosure(v, &Player_kick_wrapper, 0);
5108 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5109 if(SQ_FAILED(sq_createslot(v, -3))) {
5110 throw SquirrelError(v, "Couldn't register function 'kick'");
5113 sq_pushstring(v, "do_cheer", -1);
5114 sq_newclosure(v, &Player_do_cheer_wrapper, 0);
5115 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5116 if(SQ_FAILED(sq_createslot(v, -3))) {
5117 throw SquirrelError(v, "Couldn't register function 'do_cheer'");
5120 sq_pushstring(v, "do_duck", -1);
5121 sq_newclosure(v, &Player_do_duck_wrapper, 0);
5122 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5123 if(SQ_FAILED(sq_createslot(v, -3))) {
5124 throw SquirrelError(v, "Couldn't register function 'do_duck'");
5127 sq_pushstring(v, "do_standup", -1);
5128 sq_newclosure(v, &Player_do_standup_wrapper, 0);
5129 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5130 if(SQ_FAILED(sq_createslot(v, -3))) {
5131 throw SquirrelError(v, "Couldn't register function 'do_standup'");
5134 sq_pushstring(v, "do_backflip", -1);
5135 sq_newclosure(v, &Player_do_backflip_wrapper, 0);
5136 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5137 if(SQ_FAILED(sq_createslot(v, -3))) {
5138 throw SquirrelError(v, "Couldn't register function 'do_backflip'");
5141 sq_pushstring(v, "do_jump", -1);
5142 sq_newclosure(v, &Player_do_jump_wrapper, 0);
5143 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5144 if(SQ_FAILED(sq_createslot(v, -3))) {
5145 throw SquirrelError(v, "Couldn't register function 'do_jump'");
5148 sq_pushstring(v, "trigger_sequence", -1);
5149 sq_newclosure(v, &Player_trigger_sequence_wrapper, 0);
5150 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5151 if(SQ_FAILED(sq_createslot(v, -3))) {
5152 throw SquirrelError(v, "Couldn't register function 'trigger_sequence'");
5155 sq_pushstring(v, "use_scripting_controller", -1);
5156 sq_newclosure(v, &Player_use_scripting_controller_wrapper, 0);
5157 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5158 if(SQ_FAILED(sq_createslot(v, -3))) {
5159 throw SquirrelError(v, "Couldn't register function 'use_scripting_controller'");
5162 sq_pushstring(v, "do_scripting_controller", -1);
5163 sq_newclosure(v, &Player_do_scripting_controller_wrapper, 0);
5164 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tsb");
5165 if(SQ_FAILED(sq_createslot(v, -3))) {
5166 throw SquirrelError(v, "Couldn't register function 'do_scripting_controller'");
5169 if(SQ_FAILED(sq_createslot(v, -3))) {
5170 throw SquirrelError(v, "Couldn't register class 'Player'");
5173 // Register class ScriptedObject
5174 sq_pushstring(v, "ScriptedObject", -1);
5175 if(sq_newclass(v, SQFalse) < 0) {
5176 std::ostringstream msg;
5177 msg << "Couldn't create new class 'ScriptedObject'";
5178 throw SquirrelError(v, msg.str());
5180 sq_pushstring(v, "set_action", -1);
5181 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
5182 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5183 if(SQ_FAILED(sq_createslot(v, -3))) {
5184 throw SquirrelError(v, "Couldn't register function 'set_action'");
5187 sq_pushstring(v, "get_action", -1);
5188 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
5189 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5190 if(SQ_FAILED(sq_createslot(v, -3))) {
5191 throw SquirrelError(v, "Couldn't register function 'get_action'");
5194 sq_pushstring(v, "move", -1);
5195 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
5196 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5197 if(SQ_FAILED(sq_createslot(v, -3))) {
5198 throw SquirrelError(v, "Couldn't register function 'move'");
5201 sq_pushstring(v, "set_pos", -1);
5202 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
5203 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5204 if(SQ_FAILED(sq_createslot(v, -3))) {
5205 throw SquirrelError(v, "Couldn't register function 'set_pos'");
5208 sq_pushstring(v, "get_pos_x", -1);
5209 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
5210 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5211 if(SQ_FAILED(sq_createslot(v, -3))) {
5212 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5215 sq_pushstring(v, "get_pos_y", -1);
5216 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
5217 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5218 if(SQ_FAILED(sq_createslot(v, -3))) {
5219 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5222 sq_pushstring(v, "set_velocity", -1);
5223 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
5224 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5225 if(SQ_FAILED(sq_createslot(v, -3))) {
5226 throw SquirrelError(v, "Couldn't register function 'set_velocity'");
5229 sq_pushstring(v, "get_velocity_x", -1);
5230 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
5231 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5232 if(SQ_FAILED(sq_createslot(v, -3))) {
5233 throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
5236 sq_pushstring(v, "get_velocity_y", -1);
5237 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
5238 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5239 if(SQ_FAILED(sq_createslot(v, -3))) {
5240 throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
5243 sq_pushstring(v, "enable_gravity", -1);
5244 sq_newclosure(v, &ScriptedObject_enable_gravity_wrapper, 0);
5245 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5246 if(SQ_FAILED(sq_createslot(v, -3))) {
5247 throw SquirrelError(v, "Couldn't register function 'enable_gravity'");
5250 sq_pushstring(v, "gravity_enabled", -1);
5251 sq_newclosure(v, &ScriptedObject_gravity_enabled_wrapper, 0);
5252 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5253 if(SQ_FAILED(sq_createslot(v, -3))) {
5254 throw SquirrelError(v, "Couldn't register function 'gravity_enabled'");
5257 sq_pushstring(v, "set_visible", -1);
5258 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
5259 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5260 if(SQ_FAILED(sq_createslot(v, -3))) {
5261 throw SquirrelError(v, "Couldn't register function 'set_visible'");
5264 sq_pushstring(v, "is_visible", -1);
5265 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
5266 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5267 if(SQ_FAILED(sq_createslot(v, -3))) {
5268 throw SquirrelError(v, "Couldn't register function 'is_visible'");
5271 sq_pushstring(v, "set_solid", -1);
5272 sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
5273 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5274 if(SQ_FAILED(sq_createslot(v, -3))) {
5275 throw SquirrelError(v, "Couldn't register function 'set_solid'");
5278 sq_pushstring(v, "is_solid", -1);
5279 sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
5280 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5281 if(SQ_FAILED(sq_createslot(v, -3))) {
5282 throw SquirrelError(v, "Couldn't register function 'is_solid'");
5285 sq_pushstring(v, "get_name", -1);
5286 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
5287 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5288 if(SQ_FAILED(sq_createslot(v, -3))) {
5289 throw SquirrelError(v, "Couldn't register function 'get_name'");
5292 if(SQ_FAILED(sq_createslot(v, -3))) {
5293 throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
5296 // Register class SSector
5297 sq_pushstring(v, "SSector", -1);
5298 if(sq_newclass(v, SQFalse) < 0) {
5299 std::ostringstream msg;
5300 msg << "Couldn't create new class 'SSector'";
5301 throw SquirrelError(v, msg.str());
5303 sq_pushstring(v, "set_ambient_light", -1);
5304 sq_newclosure(v, &SSector_set_ambient_light_wrapper, 0);
5305 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
5306 if(SQ_FAILED(sq_createslot(v, -3))) {
5307 throw SquirrelError(v, "Couldn't register function 'set_ambient_light'");
5310 sq_pushstring(v, "get_ambient_red", -1);
5311 sq_newclosure(v, &SSector_get_ambient_red_wrapper, 0);
5312 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5313 if(SQ_FAILED(sq_createslot(v, -3))) {
5314 throw SquirrelError(v, "Couldn't register function 'get_ambient_red'");
5317 sq_pushstring(v, "get_ambient_green", -1);
5318 sq_newclosure(v, &SSector_get_ambient_green_wrapper, 0);
5319 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5320 if(SQ_FAILED(sq_createslot(v, -3))) {
5321 throw SquirrelError(v, "Couldn't register function 'get_ambient_green'");
5324 sq_pushstring(v, "get_ambient_blue", -1);
5325 sq_newclosure(v, &SSector_get_ambient_blue_wrapper, 0);
5326 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5327 if(SQ_FAILED(sq_createslot(v, -3))) {
5328 throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'");
5331 sq_pushstring(v, "set_gravity", -1);
5332 sq_newclosure(v, &SSector_set_gravity_wrapper, 0);
5333 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5334 if(SQ_FAILED(sq_createslot(v, -3))) {
5335 throw SquirrelError(v, "Couldn't register function 'set_gravity'");
5338 if(SQ_FAILED(sq_createslot(v, -3))) {
5339 throw SquirrelError(v, "Couldn't register class 'SSector'");
5342 // Register class Text
5343 sq_pushstring(v, "Text", -1);
5344 if(sq_newclass(v, SQFalse) < 0) {
5345 std::ostringstream msg;
5346 msg << "Couldn't create new class 'Text'";
5347 throw SquirrelError(v, msg.str());
5349 sq_pushstring(v, "set_text", -1);
5350 sq_newclosure(v, &Text_set_text_wrapper, 0);
5351 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5352 if(SQ_FAILED(sq_createslot(v, -3))) {
5353 throw SquirrelError(v, "Couldn't register function 'set_text'");
5356 sq_pushstring(v, "set_font", -1);
5357 sq_newclosure(v, &Text_set_font_wrapper, 0);
5358 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5359 if(SQ_FAILED(sq_createslot(v, -3))) {
5360 throw SquirrelError(v, "Couldn't register function 'set_font'");
5363 sq_pushstring(v, "fade_in", -1);
5364 sq_newclosure(v, &Text_fade_in_wrapper, 0);
5365 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5366 if(SQ_FAILED(sq_createslot(v, -3))) {
5367 throw SquirrelError(v, "Couldn't register function 'fade_in'");
5370 sq_pushstring(v, "fade_out", -1);
5371 sq_newclosure(v, &Text_fade_out_wrapper, 0);
5372 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5373 if(SQ_FAILED(sq_createslot(v, -3))) {
5374 throw SquirrelError(v, "Couldn't register function 'fade_out'");
5377 sq_pushstring(v, "set_visible", -1);
5378 sq_newclosure(v, &Text_set_visible_wrapper, 0);
5379 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5380 if(SQ_FAILED(sq_createslot(v, -3))) {
5381 throw SquirrelError(v, "Couldn't register function 'set_visible'");
5384 sq_pushstring(v, "set_centered", -1);
5385 sq_newclosure(v, &Text_set_centered_wrapper, 0);
5386 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5387 if(SQ_FAILED(sq_createslot(v, -3))) {
5388 throw SquirrelError(v, "Couldn't register function 'set_centered'");
5391 sq_pushstring(v, "set_pos", -1);
5392 sq_newclosure(v, &Text_set_pos_wrapper, 0);
5393 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5394 if(SQ_FAILED(sq_createslot(v, -3))) {
5395 throw SquirrelError(v, "Couldn't register function 'set_pos'");
5398 sq_pushstring(v, "get_pos_x", -1);
5399 sq_newclosure(v, &Text_get_pos_x_wrapper, 0);
5400 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5401 if(SQ_FAILED(sq_createslot(v, -3))) {
5402 throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5405 sq_pushstring(v, "get_pos_y", -1);
5406 sq_newclosure(v, &Text_get_pos_y_wrapper, 0);
5407 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5408 if(SQ_FAILED(sq_createslot(v, -3))) {
5409 throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5412 sq_pushstring(v, "set_anchor_point", -1);
5413 sq_newclosure(v, &Text_set_anchor_point_wrapper, 0);
5414 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5415 if(SQ_FAILED(sq_createslot(v, -3))) {
5416 throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
5419 sq_pushstring(v, "get_anchor_point", -1);
5420 sq_newclosure(v, &Text_get_anchor_point_wrapper, 0);
5421 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5422 if(SQ_FAILED(sq_createslot(v, -3))) {
5423 throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
5426 if(SQ_FAILED(sq_createslot(v, -3))) {
5427 throw SquirrelError(v, "Couldn't register class 'Text'");
5430 // Register class Thunderstorm
5431 sq_pushstring(v, "Thunderstorm", -1);
5432 if(sq_newclass(v, SQFalse) < 0) {
5433 std::ostringstream msg;
5434 msg << "Couldn't create new class 'Thunderstorm'";
5435 throw SquirrelError(v, msg.str());
5437 sq_pushstring(v, "start", -1);
5438 sq_newclosure(v, &Thunderstorm_start_wrapper, 0);
5439 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5440 if(SQ_FAILED(sq_createslot(v, -3))) {
5441 throw SquirrelError(v, "Couldn't register function 'start'");
5444 sq_pushstring(v, "stop", -1);
5445 sq_newclosure(v, &Thunderstorm_stop_wrapper, 0);
5446 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5447 if(SQ_FAILED(sq_createslot(v, -3))) {
5448 throw SquirrelError(v, "Couldn't register function 'stop'");
5451 sq_pushstring(v, "thunder", -1);
5452 sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0);
5453 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5454 if(SQ_FAILED(sq_createslot(v, -3))) {
5455 throw SquirrelError(v, "Couldn't register function 'thunder'");
5458 sq_pushstring(v, "lightning", -1);
5459 sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0);
5460 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5461 if(SQ_FAILED(sq_createslot(v, -3))) {
5462 throw SquirrelError(v, "Couldn't register function 'lightning'");
5465 sq_pushstring(v, "flash", -1);
5466 sq_newclosure(v, &Thunderstorm_flash_wrapper, 0);
5467 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5468 if(SQ_FAILED(sq_createslot(v, -3))) {
5469 throw SquirrelError(v, "Couldn't register function 'flash'");
5472 sq_pushstring(v, "electrify", -1);
5473 sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0);
5474 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5475 if(SQ_FAILED(sq_createslot(v, -3))) {
5476 throw SquirrelError(v, "Couldn't register function 'electrify'");
5479 if(SQ_FAILED(sq_createslot(v, -3))) {
5480 throw SquirrelError(v, "Couldn't register class 'Thunderstorm'");
5483 // Register class TileMap
5484 sq_pushstring(v, "TileMap", -1);
5485 if(sq_newclass(v, SQFalse) < 0) {
5486 std::ostringstream msg;
5487 msg << "Couldn't create new class 'TileMap'";
5488 throw SquirrelError(v, msg.str());
5490 sq_pushstring(v, "goto_node", -1);
5491 sq_newclosure(v, &TileMap_goto_node_wrapper, 0);
5492 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5493 if(SQ_FAILED(sq_createslot(v, -3))) {
5494 throw SquirrelError(v, "Couldn't register function 'goto_node'");
5497 sq_pushstring(v, "start_moving", -1);
5498 sq_newclosure(v, &TileMap_start_moving_wrapper, 0);
5499 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5500 if(SQ_FAILED(sq_createslot(v, -3))) {
5501 throw SquirrelError(v, "Couldn't register function 'start_moving'");
5504 sq_pushstring(v, "stop_moving", -1);
5505 sq_newclosure(v, &TileMap_stop_moving_wrapper, 0);
5506 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5507 if(SQ_FAILED(sq_createslot(v, -3))) {
5508 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5511 sq_pushstring(v, "fade", -1);
5512 sq_newclosure(v, &TileMap_fade_wrapper, 0);
5513 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5514 if(SQ_FAILED(sq_createslot(v, -3))) {
5515 throw SquirrelError(v, "Couldn't register function 'fade'");
5518 sq_pushstring(v, "set_alpha", -1);
5519 sq_newclosure(v, &TileMap_set_alpha_wrapper, 0);
5520 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5521 if(SQ_FAILED(sq_createslot(v, -3))) {
5522 throw SquirrelError(v, "Couldn't register function 'set_alpha'");
5525 sq_pushstring(v, "get_alpha", -1);
5526 sq_newclosure(v, &TileMap_get_alpha_wrapper, 0);
5527 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5528 if(SQ_FAILED(sq_createslot(v, -3))) {
5529 throw SquirrelError(v, "Couldn't register function 'get_alpha'");
5532 if(SQ_FAILED(sq_createslot(v, -3))) {
5533 throw SquirrelError(v, "Couldn't register class 'TileMap'");
5536 // Register class WillOWisp
5537 sq_pushstring(v, "WillOWisp", -1);
5538 if(sq_newclass(v, SQFalse) < 0) {
5539 std::ostringstream msg;
5540 msg << "Couldn't create new class 'WillOWisp'";
5541 throw SquirrelError(v, msg.str());
5543 sq_pushstring(v, "goto_node", -1);
5544 sq_newclosure(v, &WillOWisp_goto_node_wrapper, 0);
5545 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5546 if(SQ_FAILED(sq_createslot(v, -3))) {
5547 throw SquirrelError(v, "Couldn't register function 'goto_node'");
5550 sq_pushstring(v, "set_state", -1);
5551 sq_newclosure(v, &WillOWisp_set_state_wrapper, 0);
5552 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5553 if(SQ_FAILED(sq_createslot(v, -3))) {
5554 throw SquirrelError(v, "Couldn't register function 'set_state'");
5557 sq_pushstring(v, "start_moving", -1);
5558 sq_newclosure(v, &WillOWisp_start_moving_wrapper, 0);
5559 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5560 if(SQ_FAILED(sq_createslot(v, -3))) {
5561 throw SquirrelError(v, "Couldn't register function 'start_moving'");
5564 sq_pushstring(v, "stop_moving", -1);
5565 sq_newclosure(v, &WillOWisp_stop_moving_wrapper, 0);
5566 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5567 if(SQ_FAILED(sq_createslot(v, -3))) {
5568 throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5571 if(SQ_FAILED(sq_createslot(v, -3))) {
5572 throw SquirrelError(v, "Couldn't register class 'WillOWisp'");
5575 // Register class Wind
5576 sq_pushstring(v, "Wind", -1);
5577 if(sq_newclass(v, SQFalse) < 0) {
5578 std::ostringstream msg;
5579 msg << "Couldn't create new class 'Wind'";
5580 throw SquirrelError(v, msg.str());
5582 sq_pushstring(v, "start", -1);
5583 sq_newclosure(v, &Wind_start_wrapper, 0);
5584 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5585 if(SQ_FAILED(sq_createslot(v, -3))) {
5586 throw SquirrelError(v, "Couldn't register function 'start'");
5589 sq_pushstring(v, "stop", -1);
5590 sq_newclosure(v, &Wind_stop_wrapper, 0);
5591 sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5592 if(SQ_FAILED(sq_createslot(v, -3))) {
5593 throw SquirrelError(v, "Couldn't register function 'stop'");
5596 if(SQ_FAILED(sq_createslot(v, -3))) {
5597 throw SquirrelError(v, "Couldn't register class 'Wind'");
5602 } // namespace scripting