2 * WARNING: This file is automatically generated from:
3 * 'src/scripting/wrapper.interface.hpp'
12 #include "wrapper_util.hpp"
13 #include "wrapper.interface.hpp"
15 using namespace Scripting;
17 static int DisplayEffect_fade_out_wrapper(HSQUIRRELVM v)
19 Scripting::DisplayEffect* _this;
20 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
22 sq_getfloat(v, 2, &arg0);
24 _this->fade_out(arg0);
29 static int DisplayEffect_fade_in_wrapper(HSQUIRRELVM v)
31 Scripting::DisplayEffect* _this;
32 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
34 sq_getfloat(v, 2, &arg0);
41 static int DisplayEffect_set_black_wrapper(HSQUIRRELVM v)
43 Scripting::DisplayEffect* _this;
44 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
46 sq_getbool(v, 2, &arg0);
48 _this->set_black(arg0);
53 static int DisplayEffect_is_black_wrapper(HSQUIRRELVM v)
55 Scripting::DisplayEffect* _this;
56 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
58 bool return_value = _this->is_black();
60 sq_pushbool(v, return_value);
64 static int Camera_shake_wrapper(HSQUIRRELVM v)
66 Scripting::Camera* _this;
67 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
69 sq_getfloat(v, 2, &arg0);
71 sq_getfloat(v, 3, &arg1);
73 sq_getfloat(v, 4, &arg2);
75 _this->shake(arg0, arg1, arg2);
80 static int Camera_set_pos_wrapper(HSQUIRRELVM v)
82 Scripting::Camera* _this;
83 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
85 sq_getfloat(v, 2, &arg0);
87 sq_getfloat(v, 3, &arg1);
89 _this->set_pos(arg0, arg1);
94 static int Camera_set_mode_wrapper(HSQUIRRELVM v)
96 Scripting::Camera* _this;
97 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
99 sq_getstring(v, 2, &arg0);
101 _this->set_mode(arg0);
106 static int Level_finish_wrapper(HSQUIRRELVM v)
108 Scripting::Level* _this;
109 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
116 static int Level_spawn_wrapper(HSQUIRRELVM v)
118 Scripting::Level* _this;
119 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
121 sq_getstring(v, 2, &arg0);
123 sq_getstring(v, 3, &arg1);
125 _this->spawn(arg0, arg1);
130 static int Level_flip_vertically_wrapper(HSQUIRRELVM v)
132 Scripting::Level* _this;
133 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
135 _this->flip_vertically();
140 static int ScriptedObject_set_animation_wrapper(HSQUIRRELVM v)
142 Scripting::ScriptedObject* _this;
143 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
145 sq_getstring(v, 2, &arg0);
147 _this->set_animation(arg0);
152 static int ScriptedObject_get_animation_wrapper(HSQUIRRELVM v)
154 Scripting::ScriptedObject* _this;
155 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
157 std::string return_value = _this->get_animation();
159 sq_pushstring(v, return_value.c_str(), return_value.size());
163 static int ScriptedObject_move_wrapper(HSQUIRRELVM v)
165 Scripting::ScriptedObject* _this;
166 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
168 sq_getfloat(v, 2, &arg0);
170 sq_getfloat(v, 3, &arg1);
172 _this->move(arg0, arg1);
177 static int ScriptedObject_set_pos_wrapper(HSQUIRRELVM v)
179 Scripting::ScriptedObject* _this;
180 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
182 sq_getfloat(v, 2, &arg0);
184 sq_getfloat(v, 3, &arg1);
186 _this->set_pos(arg0, arg1);
191 static int ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM v)
193 Scripting::ScriptedObject* _this;
194 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
196 float return_value = _this->get_pos_x();
198 sq_pushfloat(v, return_value);
202 static int ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM v)
204 Scripting::ScriptedObject* _this;
205 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
207 float return_value = _this->get_pos_y();
209 sq_pushfloat(v, return_value);
213 static int ScriptedObject_set_velocity_wrapper(HSQUIRRELVM v)
215 Scripting::ScriptedObject* _this;
216 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
218 sq_getfloat(v, 2, &arg0);
220 sq_getfloat(v, 3, &arg1);
222 _this->set_velocity(arg0, arg1);
227 static int ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM v)
229 Scripting::ScriptedObject* _this;
230 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
232 float return_value = _this->get_velocity_x();
234 sq_pushfloat(v, return_value);
238 static int ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM v)
240 Scripting::ScriptedObject* _this;
241 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
243 float return_value = _this->get_velocity_y();
245 sq_pushfloat(v, return_value);
249 static int ScriptedObject_set_visible_wrapper(HSQUIRRELVM v)
251 Scripting::ScriptedObject* _this;
252 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
254 sq_getbool(v, 2, &arg0);
256 _this->set_visible(arg0);
261 static int ScriptedObject_is_visible_wrapper(HSQUIRRELVM v)
263 Scripting::ScriptedObject* _this;
264 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
266 bool return_value = _this->is_visible();
268 sq_pushbool(v, return_value);
272 static int ScriptedObject_get_name_wrapper(HSQUIRRELVM v)
274 Scripting::ScriptedObject* _this;
275 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
277 std::string return_value = _this->get_name();
279 sq_pushstring(v, return_value.c_str(), return_value.size());
283 static int Sound_play_music_wrapper(HSQUIRRELVM v)
285 Scripting::Sound* _this;
286 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
288 sq_getstring(v, 2, &arg0);
290 _this->play_music(arg0);
295 static int Sound_play_wrapper(HSQUIRRELVM v)
297 Scripting::Sound* _this;
298 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
300 sq_getstring(v, 2, &arg0);
307 static int Text_set_text_wrapper(HSQUIRRELVM v)
309 Scripting::Text* _this;
310 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
312 sq_getstring(v, 2, &arg0);
314 _this->set_text(arg0);
319 static int Text_set_font_wrapper(HSQUIRRELVM v)
321 Scripting::Text* _this;
322 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
324 sq_getstring(v, 2, &arg0);
326 _this->set_font(arg0);
331 static int Text_fade_in_wrapper(HSQUIRRELVM v)
333 Scripting::Text* _this;
334 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
336 sq_getfloat(v, 2, &arg0);
338 _this->fade_in(arg0);
343 static int Text_fade_out_wrapper(HSQUIRRELVM v)
345 Scripting::Text* _this;
346 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
348 sq_getfloat(v, 2, &arg0);
350 _this->fade_out(arg0);
355 static int Text_set_visible_wrapper(HSQUIRRELVM v)
357 Scripting::Text* _this;
358 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
360 sq_getbool(v, 2, &arg0);
362 _this->set_visible(arg0);
367 static int Player_set_bonus_wrapper(HSQUIRRELVM v)
369 Scripting::Player* _this;
370 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
372 sq_getstring(v, 2, &arg0);
374 _this->set_bonus(arg0);
379 static int Player_make_invincible_wrapper(HSQUIRRELVM v)
381 Scripting::Player* _this;
382 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
384 _this->make_invincible();
389 static int Player_add_life_wrapper(HSQUIRRELVM v)
391 Scripting::Player* _this;
392 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
399 static int Player_add_coins_wrapper(HSQUIRRELVM v)
401 Scripting::Player* _this;
402 sq_getinstanceup(v, 1, (SQUserPointer*) &_this, 0);
404 sq_getinteger(v, 2, &arg0);
406 _this->add_coins(arg0);
411 static int display_text_file_wrapper(HSQUIRRELVM v)
414 sq_getstring(v, 2, &arg0);
416 Scripting::display_text_file(arg0);
421 static int wait_wrapper(HSQUIRRELVM v)
424 sq_getfloat(v, 2, &arg0);
426 Scripting::wait(arg0);
428 return sq_suspendvm(v);
431 static int translate_wrapper(HSQUIRRELVM v)
434 sq_getstring(v, 2, &arg0);
436 std::string return_value = Scripting::translate(arg0);
438 sq_pushstring(v, return_value.c_str(), return_value.size());
442 static int import_wrapper(HSQUIRRELVM v)
444 HSQUIRRELVM arg0 = v;
446 sq_getstring(v, 2, &arg1);
448 Scripting::import(arg0, arg1);
453 void register_supertux_wrapper(HSQUIRRELVM v)
456 sq_pushstring(v, "display_text_file", -1);
457 sq_newclosure(v, &display_text_file_wrapper, 0);
458 if(sq_createslot(v, -3) < 0) {
459 std::stringstream msg;
460 msg << "Couldn't register function'display_text_file'";
461 throw SquirrelError(v, msg.str());
464 sq_pushstring(v, "wait", -1);
465 sq_newclosure(v, &wait_wrapper, 0);
466 if(sq_createslot(v, -3) < 0) {
467 std::stringstream msg;
468 msg << "Couldn't register function'wait'";
469 throw SquirrelError(v, msg.str());
472 sq_pushstring(v, "translate", -1);
473 sq_newclosure(v, &translate_wrapper, 0);
474 if(sq_createslot(v, -3) < 0) {
475 std::stringstream msg;
476 msg << "Couldn't register function'translate'";
477 throw SquirrelError(v, msg.str());
480 sq_pushstring(v, "import", -1);
481 sq_newclosure(v, &import_wrapper, 0);
482 if(sq_createslot(v, -3) < 0) {
483 std::stringstream msg;
484 msg << "Couldn't register function'import'";
485 throw SquirrelError(v, msg.str());
488 // Register class DisplayEffect
489 sq_pushstring(v, "DisplayEffect", -1);
490 if(sq_newclass(v, SQFalse) < 0) {
491 std::stringstream msg;
492 msg << "Couldn't create new class 'DisplayEffect'";
493 throw SquirrelError(v, msg.str());
495 sq_pushstring(v, "fade_out", -1);
496 sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
497 if(sq_createslot(v, -3) < 0) {
498 std::stringstream msg;
499 msg << "Couldn't register function'fade_out'";
500 throw SquirrelError(v, msg.str());
503 sq_pushstring(v, "fade_in", -1);
504 sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
505 if(sq_createslot(v, -3) < 0) {
506 std::stringstream msg;
507 msg << "Couldn't register function'fade_in'";
508 throw SquirrelError(v, msg.str());
511 sq_pushstring(v, "set_black", -1);
512 sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
513 if(sq_createslot(v, -3) < 0) {
514 std::stringstream msg;
515 msg << "Couldn't register function'set_black'";
516 throw SquirrelError(v, msg.str());
519 sq_pushstring(v, "is_black", -1);
520 sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
521 if(sq_createslot(v, -3) < 0) {
522 std::stringstream msg;
523 msg << "Couldn't register function'is_black'";
524 throw SquirrelError(v, msg.str());
527 if(sq_createslot(v, -3) < 0) {
528 std::stringstream msg;
529 msg << "Couldn't register class'DisplayEffect'";
530 throw SquirrelError(v, msg.str());
533 // Register class Camera
534 sq_pushstring(v, "Camera", -1);
535 if(sq_newclass(v, SQFalse) < 0) {
536 std::stringstream msg;
537 msg << "Couldn't create new class 'Camera'";
538 throw SquirrelError(v, msg.str());
540 sq_pushstring(v, "shake", -1);
541 sq_newclosure(v, &Camera_shake_wrapper, 0);
542 if(sq_createslot(v, -3) < 0) {
543 std::stringstream msg;
544 msg << "Couldn't register function'shake'";
545 throw SquirrelError(v, msg.str());
548 sq_pushstring(v, "set_pos", -1);
549 sq_newclosure(v, &Camera_set_pos_wrapper, 0);
550 if(sq_createslot(v, -3) < 0) {
551 std::stringstream msg;
552 msg << "Couldn't register function'set_pos'";
553 throw SquirrelError(v, msg.str());
556 sq_pushstring(v, "set_mode", -1);
557 sq_newclosure(v, &Camera_set_mode_wrapper, 0);
558 if(sq_createslot(v, -3) < 0) {
559 std::stringstream msg;
560 msg << "Couldn't register function'set_mode'";
561 throw SquirrelError(v, msg.str());
564 if(sq_createslot(v, -3) < 0) {
565 std::stringstream msg;
566 msg << "Couldn't register class'Camera'";
567 throw SquirrelError(v, msg.str());
570 // Register class Level
571 sq_pushstring(v, "Level", -1);
572 if(sq_newclass(v, SQFalse) < 0) {
573 std::stringstream msg;
574 msg << "Couldn't create new class 'Level'";
575 throw SquirrelError(v, msg.str());
577 sq_pushstring(v, "finish", -1);
578 sq_newclosure(v, &Level_finish_wrapper, 0);
579 if(sq_createslot(v, -3) < 0) {
580 std::stringstream msg;
581 msg << "Couldn't register function'finish'";
582 throw SquirrelError(v, msg.str());
585 sq_pushstring(v, "spawn", -1);
586 sq_newclosure(v, &Level_spawn_wrapper, 0);
587 if(sq_createslot(v, -3) < 0) {
588 std::stringstream msg;
589 msg << "Couldn't register function'spawn'";
590 throw SquirrelError(v, msg.str());
593 sq_pushstring(v, "flip_vertically", -1);
594 sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
595 if(sq_createslot(v, -3) < 0) {
596 std::stringstream msg;
597 msg << "Couldn't register function'flip_vertically'";
598 throw SquirrelError(v, msg.str());
601 if(sq_createslot(v, -3) < 0) {
602 std::stringstream msg;
603 msg << "Couldn't register class'Level'";
604 throw SquirrelError(v, msg.str());
607 // Register class ScriptedObject
608 sq_pushstring(v, "ScriptedObject", -1);
609 if(sq_newclass(v, SQFalse) < 0) {
610 std::stringstream msg;
611 msg << "Couldn't create new class 'ScriptedObject'";
612 throw SquirrelError(v, msg.str());
614 sq_pushstring(v, "set_animation", -1);
615 sq_newclosure(v, &ScriptedObject_set_animation_wrapper, 0);
616 if(sq_createslot(v, -3) < 0) {
617 std::stringstream msg;
618 msg << "Couldn't register function'set_animation'";
619 throw SquirrelError(v, msg.str());
622 sq_pushstring(v, "get_animation", -1);
623 sq_newclosure(v, &ScriptedObject_get_animation_wrapper, 0);
624 if(sq_createslot(v, -3) < 0) {
625 std::stringstream msg;
626 msg << "Couldn't register function'get_animation'";
627 throw SquirrelError(v, msg.str());
630 sq_pushstring(v, "move", -1);
631 sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
632 if(sq_createslot(v, -3) < 0) {
633 std::stringstream msg;
634 msg << "Couldn't register function'move'";
635 throw SquirrelError(v, msg.str());
638 sq_pushstring(v, "set_pos", -1);
639 sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
640 if(sq_createslot(v, -3) < 0) {
641 std::stringstream msg;
642 msg << "Couldn't register function'set_pos'";
643 throw SquirrelError(v, msg.str());
646 sq_pushstring(v, "get_pos_x", -1);
647 sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
648 if(sq_createslot(v, -3) < 0) {
649 std::stringstream msg;
650 msg << "Couldn't register function'get_pos_x'";
651 throw SquirrelError(v, msg.str());
654 sq_pushstring(v, "get_pos_y", -1);
655 sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
656 if(sq_createslot(v, -3) < 0) {
657 std::stringstream msg;
658 msg << "Couldn't register function'get_pos_y'";
659 throw SquirrelError(v, msg.str());
662 sq_pushstring(v, "set_velocity", -1);
663 sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
664 if(sq_createslot(v, -3) < 0) {
665 std::stringstream msg;
666 msg << "Couldn't register function'set_velocity'";
667 throw SquirrelError(v, msg.str());
670 sq_pushstring(v, "get_velocity_x", -1);
671 sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
672 if(sq_createslot(v, -3) < 0) {
673 std::stringstream msg;
674 msg << "Couldn't register function'get_velocity_x'";
675 throw SquirrelError(v, msg.str());
678 sq_pushstring(v, "get_velocity_y", -1);
679 sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
680 if(sq_createslot(v, -3) < 0) {
681 std::stringstream msg;
682 msg << "Couldn't register function'get_velocity_y'";
683 throw SquirrelError(v, msg.str());
686 sq_pushstring(v, "set_visible", -1);
687 sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
688 if(sq_createslot(v, -3) < 0) {
689 std::stringstream msg;
690 msg << "Couldn't register function'set_visible'";
691 throw SquirrelError(v, msg.str());
694 sq_pushstring(v, "is_visible", -1);
695 sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
696 if(sq_createslot(v, -3) < 0) {
697 std::stringstream msg;
698 msg << "Couldn't register function'is_visible'";
699 throw SquirrelError(v, msg.str());
702 sq_pushstring(v, "get_name", -1);
703 sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
704 if(sq_createslot(v, -3) < 0) {
705 std::stringstream msg;
706 msg << "Couldn't register function'get_name'";
707 throw SquirrelError(v, msg.str());
710 if(sq_createslot(v, -3) < 0) {
711 std::stringstream msg;
712 msg << "Couldn't register class'ScriptedObject'";
713 throw SquirrelError(v, msg.str());
716 // Register class Sound
717 sq_pushstring(v, "Sound", -1);
718 if(sq_newclass(v, SQFalse) < 0) {
719 std::stringstream msg;
720 msg << "Couldn't create new class 'Sound'";
721 throw SquirrelError(v, msg.str());
723 sq_pushstring(v, "play_music", -1);
724 sq_newclosure(v, &Sound_play_music_wrapper, 0);
725 if(sq_createslot(v, -3) < 0) {
726 std::stringstream msg;
727 msg << "Couldn't register function'play_music'";
728 throw SquirrelError(v, msg.str());
731 sq_pushstring(v, "play", -1);
732 sq_newclosure(v, &Sound_play_wrapper, 0);
733 if(sq_createslot(v, -3) < 0) {
734 std::stringstream msg;
735 msg << "Couldn't register function'play'";
736 throw SquirrelError(v, msg.str());
739 if(sq_createslot(v, -3) < 0) {
740 std::stringstream msg;
741 msg << "Couldn't register class'Sound'";
742 throw SquirrelError(v, msg.str());
745 // Register class Text
746 sq_pushstring(v, "Text", -1);
747 if(sq_newclass(v, SQFalse) < 0) {
748 std::stringstream msg;
749 msg << "Couldn't create new class 'Text'";
750 throw SquirrelError(v, msg.str());
752 sq_pushstring(v, "set_text", -1);
753 sq_newclosure(v, &Text_set_text_wrapper, 0);
754 if(sq_createslot(v, -3) < 0) {
755 std::stringstream msg;
756 msg << "Couldn't register function'set_text'";
757 throw SquirrelError(v, msg.str());
760 sq_pushstring(v, "set_font", -1);
761 sq_newclosure(v, &Text_set_font_wrapper, 0);
762 if(sq_createslot(v, -3) < 0) {
763 std::stringstream msg;
764 msg << "Couldn't register function'set_font'";
765 throw SquirrelError(v, msg.str());
768 sq_pushstring(v, "fade_in", -1);
769 sq_newclosure(v, &Text_fade_in_wrapper, 0);
770 if(sq_createslot(v, -3) < 0) {
771 std::stringstream msg;
772 msg << "Couldn't register function'fade_in'";
773 throw SquirrelError(v, msg.str());
776 sq_pushstring(v, "fade_out", -1);
777 sq_newclosure(v, &Text_fade_out_wrapper, 0);
778 if(sq_createslot(v, -3) < 0) {
779 std::stringstream msg;
780 msg << "Couldn't register function'fade_out'";
781 throw SquirrelError(v, msg.str());
784 sq_pushstring(v, "set_visible", -1);
785 sq_newclosure(v, &Text_set_visible_wrapper, 0);
786 if(sq_createslot(v, -3) < 0) {
787 std::stringstream msg;
788 msg << "Couldn't register function'set_visible'";
789 throw SquirrelError(v, msg.str());
792 if(sq_createslot(v, -3) < 0) {
793 std::stringstream msg;
794 msg << "Couldn't register class'Text'";
795 throw SquirrelError(v, msg.str());
799 sq_pushstring(v, "A", -1);
800 if(sq_newclass(v, SQFalse) < 0) {
801 std::stringstream msg;
802 msg << "Couldn't create new class 'A'";
803 throw SquirrelError(v, msg.str());
805 if(sq_createslot(v, -3) < 0) {
806 std::stringstream msg;
807 msg << "Couldn't register class'A'";
808 throw SquirrelError(v, msg.str());
812 sq_pushstring(v, "B", -1);
813 sq_pushstring(v, "A", -1);
815 if(sq_newclass(v, SQTrue) < 0) {
816 std::stringstream msg;
817 msg << "Couldn't create new class 'B'";
818 throw SquirrelError(v, msg.str());
820 if(sq_createslot(v, -3) < 0) {
821 std::stringstream msg;
822 msg << "Couldn't register class'B'";
823 throw SquirrelError(v, msg.str());
826 // Register class Player
827 sq_pushstring(v, "Player", -1);
828 if(sq_newclass(v, SQFalse) < 0) {
829 std::stringstream msg;
830 msg << "Couldn't create new class 'Player'";
831 throw SquirrelError(v, msg.str());
833 sq_pushstring(v, "set_bonus", -1);
834 sq_newclosure(v, &Player_set_bonus_wrapper, 0);
835 if(sq_createslot(v, -3) < 0) {
836 std::stringstream msg;
837 msg << "Couldn't register function'set_bonus'";
838 throw SquirrelError(v, msg.str());
841 sq_pushstring(v, "make_invincible", -1);
842 sq_newclosure(v, &Player_make_invincible_wrapper, 0);
843 if(sq_createslot(v, -3) < 0) {
844 std::stringstream msg;
845 msg << "Couldn't register function'make_invincible'";
846 throw SquirrelError(v, msg.str());
849 sq_pushstring(v, "add_life", -1);
850 sq_newclosure(v, &Player_add_life_wrapper, 0);
851 if(sq_createslot(v, -3) < 0) {
852 std::stringstream msg;
853 msg << "Couldn't register function'add_life'";
854 throw SquirrelError(v, msg.str());
857 sq_pushstring(v, "add_coins", -1);
858 sq_newclosure(v, &Player_add_coins_wrapper, 0);
859 if(sq_createslot(v, -3) < 0) {
860 std::stringstream msg;
861 msg << "Couldn't register function'add_coins'";
862 throw SquirrelError(v, msg.str());
865 if(sq_createslot(v, -3) < 0) {
866 std::stringstream msg;
867 msg << "Couldn't register class'Player'";
868 throw SquirrelError(v, msg.str());