2 * WARNING: This file is automatically generated from:
3 * 'src/scripting/wrapper.interface.hpp'
13 #include "squirrel_error.hpp"
14 #include "wrapper.interface.hpp"
21 static int DisplayEffect_release_hook(SQUserPointer ptr, int )
23 Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (ptr);
28 static int DisplayEffect_fade_out_wrapper(HSQUIRRELVM v)
30 Scripting::DisplayEffect* _this;
31 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
33 sq_getfloat(v, 2, &arg0);
35 _this->fade_out(arg0);
40 static int DisplayEffect_fade_in_wrapper(HSQUIRRELVM v)
42 Scripting::DisplayEffect* _this;
43 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
45 sq_getfloat(v, 2, &arg0);
52 static int DisplayEffect_set_black_wrapper(HSQUIRRELVM v)
54 Scripting::DisplayEffect* _this;
55 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
57 sq_getbool(v, 2, &arg0);
59 _this->set_black(arg0);
64 static int DisplayEffect_is_black_wrapper(HSQUIRRELVM v)
66 Scripting::DisplayEffect* _this;
67 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
69 bool return_value = _this->is_black();
71 sq_pushbool(v, return_value);
75 static int DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM v)
77 Scripting::DisplayEffect* _this;
78 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
80 sq_getfloat(v, 2, &arg0);
82 _this->sixteen_to_nine(arg0);
87 static int DisplayEffect_four_to_three_wrapper(HSQUIRRELVM v)
89 Scripting::DisplayEffect* _this;
90 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
92 sq_getfloat(v, 2, &arg0);
94 _this->four_to_three(arg0);
99 static int Camera_release_hook(SQUserPointer ptr, int )
101 Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
106 static int Camera_shake_wrapper(HSQUIRRELVM v)
108 Scripting::Camera* _this;
109 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
111 sq_getfloat(v, 2, &arg0);
113 sq_getfloat(v, 3, &arg1);
115 sq_getfloat(v, 4, &arg2);
117 _this->shake(arg0, arg1, arg2);
122 static int Camera_set_pos_wrapper(HSQUIRRELVM v)
124 Scripting::Camera* _this;
125 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
127 sq_getfloat(v, 2, &arg0);
129 sq_getfloat(v, 3, &arg1);
131 _this->set_pos(arg0, arg1);
136 static int Camera_set_mode_wrapper(HSQUIRRELVM v)
138 Scripting::Camera* _this;
139 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
141 sq_getstring(v, 2, &arg0);
143 _this->set_mode(arg0);
148 static int Camera_scroll_to_wrapper(HSQUIRRELVM v)
150 Scripting::Camera* _this;
151 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
153 sq_getfloat(v, 2, &arg0);
155 sq_getfloat(v, 3, &arg1);
157 sq_getfloat(v, 4, &arg2);
159 _this->scroll_to(arg0, arg1, arg2);
164 static int Level_release_hook(SQUserPointer ptr, int )
166 Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
171 static int Level_finish_wrapper(HSQUIRRELVM v)
173 Scripting::Level* _this;
174 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
181 static int Level_spawn_wrapper(HSQUIRRELVM v)
183 Scripting::Level* _this;
184 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
186 sq_getstring(v, 2, &arg0);
188 sq_getstring(v, 3, &arg1);
190 _this->spawn(arg0, arg1);
195 static int Level_flip_vertically_wrapper(HSQUIRRELVM v)
197 Scripting::Level* _this;
198 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
200 _this->flip_vertically();
205 static int ScriptedObject_release_hook(SQUserPointer ptr, int )
207 Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
212 static int ScriptedObject_set_action_wrapper(HSQUIRRELVM v)
214 Scripting::ScriptedObject* _this;
215 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
217 sq_getstring(v, 2, &arg0);
219 _this->set_action(arg0);
224 static int ScriptedObject_get_action_wrapper(HSQUIRRELVM v)
226 Scripting::ScriptedObject* _this;
227 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
229 std::string return_value = _this->get_action();
231 sq_pushstring(v, return_value.c_str(), return_value.size());
235 static int ScriptedObject_move_wrapper(HSQUIRRELVM v)
237 Scripting::ScriptedObject* _this;
238 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
240 sq_getfloat(v, 2, &arg0);
242 sq_getfloat(v, 3, &arg1);
244 _this->move(arg0, arg1);
249 static int ScriptedObject_set_pos_wrapper(HSQUIRRELVM v)
251 Scripting::ScriptedObject* _this;
252 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
254 sq_getfloat(v, 2, &arg0);
256 sq_getfloat(v, 3, &arg1);
258 _this->set_pos(arg0, arg1);
263 static int ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM v)
265 Scripting::ScriptedObject* _this;
266 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
268 float return_value = _this->get_pos_x();
270 sq_pushfloat(v, return_value);
274 static int ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM v)
276 Scripting::ScriptedObject* _this;
277 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
279 float return_value = _this->get_pos_y();
281 sq_pushfloat(v, return_value);
285 static int ScriptedObject_set_velocity_wrapper(HSQUIRRELVM v)
287 Scripting::ScriptedObject* _this;
288 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
290 sq_getfloat(v, 2, &arg0);
292 sq_getfloat(v, 3, &arg1);
294 _this->set_velocity(arg0, arg1);
299 static int ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM v)
301 Scripting::ScriptedObject* _this;
302 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
304 float return_value = _this->get_velocity_x();
306 sq_pushfloat(v, return_value);
310 static int ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM v)
312 Scripting::ScriptedObject* _this;
313 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
315 float return_value = _this->get_velocity_y();
317 sq_pushfloat(v, return_value);
321 static int ScriptedObject_set_visible_wrapper(HSQUIRRELVM v)
323 Scripting::ScriptedObject* _this;
324 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
326 sq_getbool(v, 2, &arg0);
328 _this->set_visible(arg0);
333 static int ScriptedObject_is_visible_wrapper(HSQUIRRELVM v)
335 Scripting::ScriptedObject* _this;
336 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
338 bool return_value = _this->is_visible();
340 sq_pushbool(v, return_value);
344 static int ScriptedObject_get_name_wrapper(HSQUIRRELVM v)
346 Scripting::ScriptedObject* _this;
347 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
349 std::string return_value = _this->get_name();
351 sq_pushstring(v, return_value.c_str(), return_value.size());
355 static int Sound_release_hook(SQUserPointer ptr, int )
357 Scripting::Sound* _this = reinterpret_cast<Scripting::Sound*> (ptr);
362 static int Sound_play_music_wrapper(HSQUIRRELVM v)
364 Scripting::Sound* _this;
365 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
367 sq_getstring(v, 2, &arg0);
369 _this->play_music(arg0);
374 static int Sound_play_wrapper(HSQUIRRELVM v)
376 Scripting::Sound* _this;
377 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
379 sq_getstring(v, 2, &arg0);
386 static int Text_release_hook(SQUserPointer ptr, int )
388 Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
393 static int Text_set_text_wrapper(HSQUIRRELVM v)
395 Scripting::Text* _this;
396 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
398 sq_getstring(v, 2, &arg0);
400 _this->set_text(arg0);
405 static int Text_set_font_wrapper(HSQUIRRELVM v)
407 Scripting::Text* _this;
408 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
410 sq_getstring(v, 2, &arg0);
412 _this->set_font(arg0);
417 static int Text_fade_in_wrapper(HSQUIRRELVM v)
419 Scripting::Text* _this;
420 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
422 sq_getfloat(v, 2, &arg0);
424 _this->fade_in(arg0);
429 static int Text_fade_out_wrapper(HSQUIRRELVM v)
431 Scripting::Text* _this;
432 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
434 sq_getfloat(v, 2, &arg0);
436 _this->fade_out(arg0);
441 static int Text_set_visible_wrapper(HSQUIRRELVM v)
443 Scripting::Text* _this;
444 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
446 sq_getbool(v, 2, &arg0);
448 _this->set_visible(arg0);
453 static int Text_set_centered_wrapper(HSQUIRRELVM v)
455 Scripting::Text* _this;
456 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
458 sq_getbool(v, 2, &arg0);
460 _this->set_centered(arg0);
465 static int Player_release_hook(SQUserPointer ptr, int )
467 Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
472 static int Player_make_invincible_wrapper(HSQUIRRELVM v)
474 Scripting::Player* _this;
475 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
477 _this->make_invincible();
482 static int Player_deactivate_wrapper(HSQUIRRELVM v)
484 Scripting::Player* _this;
485 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
492 static int Player_activate_wrapper(HSQUIRRELVM v)
494 Scripting::Player* _this;
495 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
502 static int Player_walk_wrapper(HSQUIRRELVM v)
504 Scripting::Player* _this;
505 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
507 sq_getfloat(v, 2, &arg0);
514 static int Player_set_visible_wrapper(HSQUIRRELVM v)
516 Scripting::Player* _this;
517 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
519 sq_getbool(v, 2, &arg0);
521 _this->set_visible(arg0);
526 static int Player_get_visible_wrapper(HSQUIRRELVM v)
528 Scripting::Player* _this;
529 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
531 bool return_value = _this->get_visible();
533 sq_pushbool(v, return_value);
537 static int display_text_file_wrapper(HSQUIRRELVM v)
540 sq_getstring(v, 2, &arg0);
542 Scripting::display_text_file(arg0);
547 static int wait_wrapper(HSQUIRRELVM v)
550 sq_getfloat(v, 2, &arg0);
552 Scripting::wait(arg0);
554 return sq_suspendvm(v);
557 static int translate_wrapper(HSQUIRRELVM v)
560 sq_getstring(v, 2, &arg0);
562 std::string return_value = Scripting::translate(arg0);
564 sq_pushstring(v, return_value.c_str(), return_value.size());
568 static int import_wrapper(HSQUIRRELVM v)
570 HSQUIRRELVM arg0 = v;
572 sq_getstring(v, 2, &arg1);
574 Scripting::import(arg0, arg1);
579 static int add_key_wrapper(HSQUIRRELVM v)
582 sq_getinteger(v, 2, &arg0);
584 Scripting::add_key(arg0);
589 } // end of namespace Wrapper
591 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
593 using namespace Wrapper;
596 sq_pushstring(v, "DisplayEffect", -1);
597 if(SQ_FAILED(sq_get(v, -2))) {
598 std::ostringstream msg;
599 msg << "Couldn't resolved squirrel type 'DisplayEffect'";
600 throw SquirrelError(v, msg.str());
603 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
604 std::ostringstream msg;
605 msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
606 throw SquirrelError(v, msg.str());
608 sq_remove(v, -2); // remove object name
610 if(setup_releasehook) {
611 sq_setreleasehook(v, -1, DisplayEffect_release_hook);
614 sq_remove(v, -2); // remove root table
617 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
619 using namespace Wrapper;
622 sq_pushstring(v, "Camera", -1);
623 if(SQ_FAILED(sq_get(v, -2))) {
624 std::ostringstream msg;
625 msg << "Couldn't resolved squirrel type 'Camera'";
626 throw SquirrelError(v, msg.str());
629 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
630 std::ostringstream msg;
631 msg << "Couldn't setup squirrel instance for object of type 'Camera'";
632 throw SquirrelError(v, msg.str());
634 sq_remove(v, -2); // remove object name
636 if(setup_releasehook) {
637 sq_setreleasehook(v, -1, Camera_release_hook);
640 sq_remove(v, -2); // remove root table
643 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
645 using namespace Wrapper;
648 sq_pushstring(v, "Level", -1);
649 if(SQ_FAILED(sq_get(v, -2))) {
650 std::ostringstream msg;
651 msg << "Couldn't resolved squirrel type 'Level'";
652 throw SquirrelError(v, msg.str());
655 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
656 std::ostringstream msg;
657 msg << "Couldn't setup squirrel instance for object of type 'Level'";
658 throw SquirrelError(v, msg.str());
660 sq_remove(v, -2); // remove object name
662 if(setup_releasehook) {
663 sq_setreleasehook(v, -1, Level_release_hook);
666 sq_remove(v, -2); // remove root table
669 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
671 using namespace Wrapper;
674 sq_pushstring(v, "ScriptedObject", -1);
675 if(SQ_FAILED(sq_get(v, -2))) {
676 std::ostringstream msg;
677 msg << "Couldn't resolved squirrel type 'ScriptedObject'";
678 throw SquirrelError(v, msg.str());
681 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
682 std::ostringstream msg;
683 msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
684 throw SquirrelError(v, msg.str());
686 sq_remove(v, -2); // remove object name
688 if(setup_releasehook) {
689 sq_setreleasehook(v, -1, ScriptedObject_release_hook);
692 sq_remove(v, -2); // remove root table
695 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Sound* object, bool setup_releasehook)
697 using namespace Wrapper;
700 sq_pushstring(v, "Sound", -1);
701 if(SQ_FAILED(sq_get(v, -2))) {
702 std::ostringstream msg;
703 msg << "Couldn't resolved squirrel type 'Sound'";
704 throw SquirrelError(v, msg.str());
707 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
708 std::ostringstream msg;
709 msg << "Couldn't setup squirrel instance for object of type 'Sound'";
710 throw SquirrelError(v, msg.str());
712 sq_remove(v, -2); // remove object name
714 if(setup_releasehook) {
715 sq_setreleasehook(v, -1, Sound_release_hook);
718 sq_remove(v, -2); // remove root table
721 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
723 using namespace Wrapper;
726 sq_pushstring(v, "Text", -1);
727 if(SQ_FAILED(sq_get(v, -2))) {
728 std::ostringstream msg;
729 msg << "Couldn't resolved squirrel type 'Text'";
730 throw SquirrelError(v, msg.str());
733 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
734 std::ostringstream msg;
735 msg << "Couldn't setup squirrel instance for object of type 'Text'";
736 throw SquirrelError(v, msg.str());
738 sq_remove(v, -2); // remove object name
740 if(setup_releasehook) {
741 sq_setreleasehook(v, -1, Text_release_hook);
744 sq_remove(v, -2); // remove root table
747 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
749 using namespace Wrapper;
752 sq_pushstring(v, "Player", -1);
753 if(SQ_FAILED(sq_get(v, -2))) {
754 std::ostringstream msg;
755 msg << "Couldn't resolved squirrel type 'Player'";
756 throw SquirrelError(v, msg.str());
759 if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
760 std::ostringstream msg;
761 msg << "Couldn't setup squirrel instance for object of type 'Player'";
762 throw SquirrelError(v, msg.str());
764 sq_remove(v, -2); // remove object name
766 if(setup_releasehook) {
767 sq_setreleasehook(v, -1, Player_release_hook);
770 sq_remove(v, -2); // remove root table
773 void register_supertux_wrapper(HSQUIRRELVM v)
775 using namespace Wrapper;
778 sq_pushstring(v, "KEY_BRASS", -1);
779 sq_pushinteger(v, 1);
780 if(SQ_FAILED(sq_createslot(v, -3))) {
781 std::ostringstream msg;
782 msg << "Couldn't register constant'KEY_BRASS'";
783 throw SquirrelError(v, msg.str());
786 sq_pushstring(v, "KEY_IRON", -1);
787 sq_pushinteger(v, 2);
788 if(SQ_FAILED(sq_createslot(v, -3))) {
789 std::ostringstream msg;
790 msg << "Couldn't register constant'KEY_IRON'";
791 throw SquirrelError(v, msg.str());
794 sq_pushstring(v, "KEY_BRONZE", -1);
795 sq_pushinteger(v, 4);
796 if(SQ_FAILED(sq_createslot(v, -3))) {
797 std::ostringstream msg;
798 msg << "Couldn't register constant'KEY_BRONZE'";
799 throw SquirrelError(v, msg.str());
802 sq_pushstring(v, "KEY_SILVER", -1);
803 sq_pushinteger(v, 8);
804 if(SQ_FAILED(sq_createslot(v, -3))) {
805 std::ostringstream msg;
806 msg << "Couldn't register constant'KEY_SILVER'";
807 throw SquirrelError(v, msg.str());
810 sq_pushstring(v, "KEY_GOLD", -1);
811 sq_pushinteger(v, 16);
812 if(SQ_FAILED(sq_createslot(v, -3))) {
813 std::ostringstream msg;
814 msg << "Couldn't register constant'KEY_GOLD'";
815 throw SquirrelError(v, msg.str());
818 sq_pushstring(v, "display_text_file", -1);
819 sq_newclosure(v, &display_text_file_wrapper, 0);
820 if(SQ_FAILED(sq_createslot(v, -3))) {
821 std::ostringstream msg;
822 msg << "Couldn't register function'display_text_file'";
823 throw SquirrelError(v, msg.str());
826 sq_pushstring(v, "wait", -1);
827 sq_newclosure(v, &wait_wrapper, 0);
828 if(SQ_FAILED(sq_createslot(v, -3))) {
829 std::ostringstream msg;
830 msg << "Couldn't register function'wait'";
831 throw SquirrelError(v, msg.str());
834 sq_pushstring(v, "translate", -1);
835 sq_newclosure(v, &translate_wrapper, 0);
836 if(SQ_FAILED(sq_createslot(v, -3))) {
837 std::ostringstream msg;
838 msg << "Couldn't register function'translate'";
839 throw SquirrelError(v, msg.str());
842 sq_pushstring(v, "import", -1);
843 sq_newclosure(v, &import_wrapper, 0);
844 if(SQ_FAILED(sq_createslot(v, -3))) {
845 std::ostringstream msg;
846 msg << "Couldn't register function'import'";
847 throw SquirrelError(v, msg.str());
850 sq_pushstring(v, "add_key", -1);
851 sq_newclosure(v, &add_key_wrapper, 0);
852 if(SQ_FAILED(sq_createslot(v, -3))) {
853 std::ostringstream msg;
854 msg << "Couldn't register function'add_key'";
855 throw SquirrelError(v, msg.str());
858 // Register class DisplayEffect
859 sq_pushstring(v, "DisplayEffect", -1);
860 if(sq_newclass(v, SQFalse) < 0) {
861 std::ostringstream msg;
862 msg << "Couldn't create new class 'DisplayEffect'";
863 throw SquirrelError(v, msg.str());
865 sq_pushstring(v, "fade_out", -1);
866 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
867 if(SQ_FAILED(sq_createslot(v, -3))) {
868 std::ostringstream msg;
869 msg << "Couldn't register function'fade_out'";
870 throw SquirrelError(v, msg.str());
873 sq_pushstring(v, "fade_in", -1);
874 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
875 if(SQ_FAILED(sq_createslot(v, -3))) {
876 std::ostringstream msg;
877 msg << "Couldn't register function'fade_in'";
878 throw SquirrelError(v, msg.str());
881 sq_pushstring(v, "set_black", -1);
882 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
883 if(SQ_FAILED(sq_createslot(v, -3))) {
884 std::ostringstream msg;
885 msg << "Couldn't register function'set_black'";
886 throw SquirrelError(v, msg.str());
889 sq_pushstring(v, "is_black", -1);
890 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
891 if(SQ_FAILED(sq_createslot(v, -3))) {
892 std::ostringstream msg;
893 msg << "Couldn't register function'is_black'";
894 throw SquirrelError(v, msg.str());
897 sq_pushstring(v, "sixteen_to_nine", -1);
898 sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
899 if(SQ_FAILED(sq_createslot(v, -3))) {
900 std::ostringstream msg;
901 msg << "Couldn't register function'sixteen_to_nine'";
902 throw SquirrelError(v, msg.str());
905 sq_pushstring(v, "four_to_three", -1);
906 sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
907 if(SQ_FAILED(sq_createslot(v, -3))) {
908 std::ostringstream msg;
909 msg << "Couldn't register function'four_to_three'";
910 throw SquirrelError(v, msg.str());
913 if(SQ_FAILED(sq_createslot(v, -3))) {
914 std::ostringstream msg;
915 msg << "Couldn't register class'DisplayEffect'";
916 throw SquirrelError(v, msg.str());
919 // Register class Camera
920 sq_pushstring(v, "Camera", -1);
921 if(sq_newclass(v, SQFalse) < 0) {
922 std::ostringstream msg;
923 msg << "Couldn't create new class 'Camera'";
924 throw SquirrelError(v, msg.str());
926 sq_pushstring(v, "shake", -1);
927 sq_newclosure(v, &Camera_shake_wrapper, 0);
928 if(SQ_FAILED(sq_createslot(v, -3))) {
929 std::ostringstream msg;
930 msg << "Couldn't register function'shake'";
931 throw SquirrelError(v, msg.str());
934 sq_pushstring(v, "set_pos", -1);
935 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
936 if(SQ_FAILED(sq_createslot(v, -3))) {
937 std::ostringstream msg;
938 msg << "Couldn't register function'set_pos'";
939 throw SquirrelError(v, msg.str());
942 sq_pushstring(v, "set_mode", -1);
943 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
944 if(SQ_FAILED(sq_createslot(v, -3))) {
945 std::ostringstream msg;
946 msg << "Couldn't register function'set_mode'";
947 throw SquirrelError(v, msg.str());
950 sq_pushstring(v, "scroll_to", -1);
951 sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
952 if(SQ_FAILED(sq_createslot(v, -3))) {
953 std::ostringstream msg;
954 msg << "Couldn't register function'scroll_to'";
955 throw SquirrelError(v, msg.str());
958 if(SQ_FAILED(sq_createslot(v, -3))) {
959 std::ostringstream msg;
960 msg << "Couldn't register class'Camera'";
961 throw SquirrelError(v, msg.str());
964 // Register class Level
965 sq_pushstring(v, "Level", -1);
966 if(sq_newclass(v, SQFalse) < 0) {
967 std::ostringstream msg;
968 msg << "Couldn't create new class 'Level'";
969 throw SquirrelError(v, msg.str());
971 sq_pushstring(v, "finish", -1);
972 sq_newclosure(v, &Level_finish_wrapper, 0);
973 if(SQ_FAILED(sq_createslot(v, -3))) {
974 std::ostringstream msg;
975 msg << "Couldn't register function'finish'";
976 throw SquirrelError(v, msg.str());
979 sq_pushstring(v, "spawn", -1);
980 sq_newclosure(v, &Level_spawn_wrapper, 0);
981 if(SQ_FAILED(sq_createslot(v, -3))) {
982 std::ostringstream msg;
983 msg << "Couldn't register function'spawn'";
984 throw SquirrelError(v, msg.str());
987 sq_pushstring(v, "flip_vertically", -1);
988 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
989 if(SQ_FAILED(sq_createslot(v, -3))) {
990 std::ostringstream msg;
991 msg << "Couldn't register function'flip_vertically'";
992 throw SquirrelError(v, msg.str());
995 if(SQ_FAILED(sq_createslot(v, -3))) {
996 std::ostringstream msg;
997 msg << "Couldn't register class'Level'";
998 throw SquirrelError(v, msg.str());
1001 // Register class ScriptedObject
1002 sq_pushstring(v, "ScriptedObject", -1);
1003 if(sq_newclass(v, SQFalse) < 0) {
1004 std::ostringstream msg;
1005 msg << "Couldn't create new class 'ScriptedObject'";
1006 throw SquirrelError(v, msg.str());
1008 sq_pushstring(v, "set_action", -1);
1009 sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
1010 if(SQ_FAILED(sq_createslot(v, -3))) {
1011 std::ostringstream msg;
1012 msg << "Couldn't register function'set_action'";
1013 throw SquirrelError(v, msg.str());
1016 sq_pushstring(v, "get_action", -1);
1017 sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
1018 if(SQ_FAILED(sq_createslot(v, -3))) {
1019 std::ostringstream msg;
1020 msg << "Couldn't register function'get_action'";
1021 throw SquirrelError(v, msg.str());
1024 sq_pushstring(v, "move", -1);
1025 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
1026 if(SQ_FAILED(sq_createslot(v, -3))) {
1027 std::ostringstream msg;
1028 msg << "Couldn't register function'move'";
1029 throw SquirrelError(v, msg.str());
1032 sq_pushstring(v, "set_pos", -1);
1033 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
1034 if(SQ_FAILED(sq_createslot(v, -3))) {
1035 std::ostringstream msg;
1036 msg << "Couldn't register function'set_pos'";
1037 throw SquirrelError(v, msg.str());
1040 sq_pushstring(v, "get_pos_x", -1);
1041 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
1042 if(SQ_FAILED(sq_createslot(v, -3))) {
1043 std::ostringstream msg;
1044 msg << "Couldn't register function'get_pos_x'";
1045 throw SquirrelError(v, msg.str());
1048 sq_pushstring(v, "get_pos_y", -1);
1049 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
1050 if(SQ_FAILED(sq_createslot(v, -3))) {
1051 std::ostringstream msg;
1052 msg << "Couldn't register function'get_pos_y'";
1053 throw SquirrelError(v, msg.str());
1056 sq_pushstring(v, "set_velocity", -1);
1057 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
1058 if(SQ_FAILED(sq_createslot(v, -3))) {
1059 std::ostringstream msg;
1060 msg << "Couldn't register function'set_velocity'";
1061 throw SquirrelError(v, msg.str());
1064 sq_pushstring(v, "get_velocity_x", -1);
1065 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
1066 if(SQ_FAILED(sq_createslot(v, -3))) {
1067 std::ostringstream msg;
1068 msg << "Couldn't register function'get_velocity_x'";
1069 throw SquirrelError(v, msg.str());
1072 sq_pushstring(v, "get_velocity_y", -1);
1073 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
1074 if(SQ_FAILED(sq_createslot(v, -3))) {
1075 std::ostringstream msg;
1076 msg << "Couldn't register function'get_velocity_y'";
1077 throw SquirrelError(v, msg.str());
1080 sq_pushstring(v, "set_visible", -1);
1081 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
1082 if(SQ_FAILED(sq_createslot(v, -3))) {
1083 std::ostringstream msg;
1084 msg << "Couldn't register function'set_visible'";
1085 throw SquirrelError(v, msg.str());
1088 sq_pushstring(v, "is_visible", -1);
1089 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
1090 if(SQ_FAILED(sq_createslot(v, -3))) {
1091 std::ostringstream msg;
1092 msg << "Couldn't register function'is_visible'";
1093 throw SquirrelError(v, msg.str());
1096 sq_pushstring(v, "get_name", -1);
1097 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
1098 if(SQ_FAILED(sq_createslot(v, -3))) {
1099 std::ostringstream msg;
1100 msg << "Couldn't register function'get_name'";
1101 throw SquirrelError(v, msg.str());
1104 if(SQ_FAILED(sq_createslot(v, -3))) {
1105 std::ostringstream msg;
1106 msg << "Couldn't register class'ScriptedObject'";
1107 throw SquirrelError(v, msg.str());
1110 // Register class Sound
1111 sq_pushstring(v, "Sound", -1);
1112 if(sq_newclass(v, SQFalse) < 0) {
1113 std::ostringstream msg;
1114 msg << "Couldn't create new class 'Sound'";
1115 throw SquirrelError(v, msg.str());
1117 sq_pushstring(v, "play_music", -1);
1118 sq_newclosure(v, &Sound_play_music_wrapper, 0);
1119 if(SQ_FAILED(sq_createslot(v, -3))) {
1120 std::ostringstream msg;
1121 msg << "Couldn't register function'play_music'";
1122 throw SquirrelError(v, msg.str());
1125 sq_pushstring(v, "play", -1);
1126 sq_newclosure(v, &Sound_play_wrapper, 0);
1127 if(SQ_FAILED(sq_createslot(v, -3))) {
1128 std::ostringstream msg;
1129 msg << "Couldn't register function'play'";
1130 throw SquirrelError(v, msg.str());
1133 if(SQ_FAILED(sq_createslot(v, -3))) {
1134 std::ostringstream msg;
1135 msg << "Couldn't register class'Sound'";
1136 throw SquirrelError(v, msg.str());
1139 // Register class Text
1140 sq_pushstring(v, "Text", -1);
1141 if(sq_newclass(v, SQFalse) < 0) {
1142 std::ostringstream msg;
1143 msg << "Couldn't create new class 'Text'";
1144 throw SquirrelError(v, msg.str());
1146 sq_pushstring(v, "set_text", -1);
1147 sq_newclosure(v, &Text_set_text_wrapper, 0);
1148 if(SQ_FAILED(sq_createslot(v, -3))) {
1149 std::ostringstream msg;
1150 msg << "Couldn't register function'set_text'";
1151 throw SquirrelError(v, msg.str());
1154 sq_pushstring(v, "set_font", -1);
1155 sq_newclosure(v, &Text_set_font_wrapper, 0);
1156 if(SQ_FAILED(sq_createslot(v, -3))) {
1157 std::ostringstream msg;
1158 msg << "Couldn't register function'set_font'";
1159 throw SquirrelError(v, msg.str());
1162 sq_pushstring(v, "fade_in", -1);
1163 sq_newclosure(v, &Text_fade_in_wrapper, 0);
1164 if(SQ_FAILED(sq_createslot(v, -3))) {
1165 std::ostringstream msg;
1166 msg << "Couldn't register function'fade_in'";
1167 throw SquirrelError(v, msg.str());
1170 sq_pushstring(v, "fade_out", -1);
1171 sq_newclosure(v, &Text_fade_out_wrapper, 0);
1172 if(SQ_FAILED(sq_createslot(v, -3))) {
1173 std::ostringstream msg;
1174 msg << "Couldn't register function'fade_out'";
1175 throw SquirrelError(v, msg.str());
1178 sq_pushstring(v, "set_visible", -1);
1179 sq_newclosure(v, &Text_set_visible_wrapper, 0);
1180 if(SQ_FAILED(sq_createslot(v, -3))) {
1181 std::ostringstream msg;
1182 msg << "Couldn't register function'set_visible'";
1183 throw SquirrelError(v, msg.str());
1186 sq_pushstring(v, "set_centered", -1);
1187 sq_newclosure(v, &Text_set_centered_wrapper, 0);
1188 if(SQ_FAILED(sq_createslot(v, -3))) {
1189 std::ostringstream msg;
1190 msg << "Couldn't register function'set_centered'";
1191 throw SquirrelError(v, msg.str());
1194 if(SQ_FAILED(sq_createslot(v, -3))) {
1195 std::ostringstream msg;
1196 msg << "Couldn't register class'Text'";
1197 throw SquirrelError(v, msg.str());
1200 // Register class Player
1201 sq_pushstring(v, "Player", -1);
1202 if(sq_newclass(v, SQFalse) < 0) {
1203 std::ostringstream msg;
1204 msg << "Couldn't create new class 'Player'";
1205 throw SquirrelError(v, msg.str());
1207 sq_pushstring(v, "make_invincible", -1);
1208 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
1209 if(SQ_FAILED(sq_createslot(v, -3))) {
1210 std::ostringstream msg;
1211 msg << "Couldn't register function'make_invincible'";
1212 throw SquirrelError(v, msg.str());
1215 sq_pushstring(v, "deactivate", -1);
1216 sq_newclosure(v, &Player_deactivate_wrapper, 0);
1217 if(SQ_FAILED(sq_createslot(v, -3))) {
1218 std::ostringstream msg;
1219 msg << "Couldn't register function'deactivate'";
1220 throw SquirrelError(v, msg.str());
1223 sq_pushstring(v, "activate", -1);
1224 sq_newclosure(v, &Player_activate_wrapper, 0);
1225 if(SQ_FAILED(sq_createslot(v, -3))) {
1226 std::ostringstream msg;
1227 msg << "Couldn't register function'activate'";
1228 throw SquirrelError(v, msg.str());
1231 sq_pushstring(v, "walk", -1);
1232 sq_newclosure(v, &Player_walk_wrapper, 0);
1233 if(SQ_FAILED(sq_createslot(v, -3))) {
1234 std::ostringstream msg;
1235 msg << "Couldn't register function'walk'";
1236 throw SquirrelError(v, msg.str());
1239 sq_pushstring(v, "set_visible", -1);
1240 sq_newclosure(v, &Player_set_visible_wrapper, 0);
1241 if(SQ_FAILED(sq_createslot(v, -3))) {
1242 std::ostringstream msg;
1243 msg << "Couldn't register function'set_visible'";
1244 throw SquirrelError(v, msg.str());
1247 sq_pushstring(v, "get_visible", -1);
1248 sq_newclosure(v, &Player_get_visible_wrapper, 0);
1249 if(SQ_FAILED(sq_createslot(v, -3))) {
1250 std::ostringstream msg;
1251 msg << "Couldn't register function'get_visible'";
1252 throw SquirrelError(v, msg.str());
1255 if(SQ_FAILED(sq_createslot(v, -3))) {
1256 std::ostringstream msg;
1257 msg << "Couldn't register class'Player'";
1258 throw SquirrelError(v, msg.str());
1264 } // end of namespace Scripting