fd1f5705a0810aec6675ae21e57f8007e664e8f3
[supertux.git] / src / scripting / wrapper.cpp
1 /**
2  * WARNING: This file is automatically generated from:
3  *  'src/scripting/wrapper.interface.hpp'
4  * DO NOT CHANGE
5  */
6 #include <config.h>
7
8 #include <new>
9 #include <assert.h>
10 #include <string>
11 #include <sstream>
12 #include <squirrel.h>
13 #include "squirrel_error.hpp"
14 #include "wrapper.interface.hpp"
15
16 namespace Scripting
17 {
18 namespace Wrapper
19 {
20
21 static SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger )
22 {
23   Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (ptr);
24   delete _this;
25   return 0;
26 }
27
28 static SQInteger DisplayEffect_fade_out_wrapper(HSQUIRRELVM vm)
29 {
30   Scripting::DisplayEffect* _this;
31   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
32     sq_throwerror(vm, _SC("'fade_out' called without instance"));
33     return SQ_ERROR;
34   }
35   SQFloat arg0;
36   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
37     sq_throwerror(vm, _SC("Argument 1 not a float"));
38     return SQ_ERROR;
39   }
40   
41   try {
42     _this->fade_out(static_cast<float> (arg0));
43   
44     return 0;
45   
46   } catch(std::exception& e) {
47     sq_throwerror(vm, e.what());
48     return SQ_ERROR;
49   } catch(...) {
50     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
51     return SQ_ERROR;
52   }
53   
54 }
55
56 static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm)
57 {
58   Scripting::DisplayEffect* _this;
59   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
60     sq_throwerror(vm, _SC("'fade_in' called without instance"));
61     return SQ_ERROR;
62   }
63   SQFloat arg0;
64   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
65     sq_throwerror(vm, _SC("Argument 1 not a float"));
66     return SQ_ERROR;
67   }
68   
69   try {
70     _this->fade_in(static_cast<float> (arg0));
71   
72     return 0;
73   
74   } catch(std::exception& e) {
75     sq_throwerror(vm, e.what());
76     return SQ_ERROR;
77   } catch(...) {
78     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
79     return SQ_ERROR;
80   }
81   
82 }
83
84 static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm)
85 {
86   Scripting::DisplayEffect* _this;
87   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
88     sq_throwerror(vm, _SC("'set_black' called without instance"));
89     return SQ_ERROR;
90   }
91   SQBool arg0;
92   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
93     sq_throwerror(vm, _SC("Argument 1 not a bool"));
94     return SQ_ERROR;
95   }
96   
97   try {
98     _this->set_black(arg0 == SQTrue);
99   
100     return 0;
101   
102   } catch(std::exception& e) {
103     sq_throwerror(vm, e.what());
104     return SQ_ERROR;
105   } catch(...) {
106     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_black'"));
107     return SQ_ERROR;
108   }
109   
110 }
111
112 static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm)
113 {
114   Scripting::DisplayEffect* _this;
115   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
116     sq_throwerror(vm, _SC("'is_black' called without instance"));
117     return SQ_ERROR;
118   }
119   
120   try {
121     bool return_value = _this->is_black();
122   
123     sq_pushbool(vm, return_value);
124     return 1;
125   
126   } catch(std::exception& e) {
127     sq_throwerror(vm, e.what());
128     return SQ_ERROR;
129   } catch(...) {
130     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_black'"));
131     return SQ_ERROR;
132   }
133   
134 }
135
136 static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm)
137 {
138   Scripting::DisplayEffect* _this;
139   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
140     sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance"));
141     return SQ_ERROR;
142   }
143   SQFloat arg0;
144   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
145     sq_throwerror(vm, _SC("Argument 1 not a float"));
146     return SQ_ERROR;
147   }
148   
149   try {
150     _this->sixteen_to_nine(static_cast<float> (arg0));
151   
152     return 0;
153   
154   } catch(std::exception& e) {
155     sq_throwerror(vm, e.what());
156     return SQ_ERROR;
157   } catch(...) {
158     sq_throwerror(vm, _SC("Unexpected exception while executing function 'sixteen_to_nine'"));
159     return SQ_ERROR;
160   }
161   
162 }
163
164 static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm)
165 {
166   Scripting::DisplayEffect* _this;
167   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
168     sq_throwerror(vm, _SC("'four_to_three' called without instance"));
169     return SQ_ERROR;
170   }
171   SQFloat arg0;
172   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
173     sq_throwerror(vm, _SC("Argument 1 not a float"));
174     return SQ_ERROR;
175   }
176   
177   try {
178     _this->four_to_three(static_cast<float> (arg0));
179   
180     return 0;
181   
182   } catch(std::exception& e) {
183     sq_throwerror(vm, e.what());
184     return SQ_ERROR;
185   } catch(...) {
186     sq_throwerror(vm, _SC("Unexpected exception while executing function 'four_to_three'"));
187     return SQ_ERROR;
188   }
189   
190 }
191
192 static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger )
193 {
194   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
195   delete _this;
196   return 0;
197 }
198
199 static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm)
200 {
201   Scripting::Camera* _this;
202   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
203     sq_throwerror(vm, _SC("'shake' called without instance"));
204     return SQ_ERROR;
205   }
206   SQFloat arg0;
207   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
208     sq_throwerror(vm, _SC("Argument 1 not a float"));
209     return SQ_ERROR;
210   }
211   SQFloat arg1;
212   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
213     sq_throwerror(vm, _SC("Argument 2 not a float"));
214     return SQ_ERROR;
215   }
216   SQFloat arg2;
217   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
218     sq_throwerror(vm, _SC("Argument 3 not a float"));
219     return SQ_ERROR;
220   }
221   
222   try {
223     _this->shake(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
224   
225     return 0;
226   
227   } catch(std::exception& e) {
228     sq_throwerror(vm, e.what());
229     return SQ_ERROR;
230   } catch(...) {
231     sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'"));
232     return SQ_ERROR;
233   }
234   
235 }
236
237 static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm)
238 {
239   Scripting::Camera* _this;
240   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
241     sq_throwerror(vm, _SC("'set_pos' called without instance"));
242     return SQ_ERROR;
243   }
244   SQFloat arg0;
245   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
246     sq_throwerror(vm, _SC("Argument 1 not a float"));
247     return SQ_ERROR;
248   }
249   SQFloat arg1;
250   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
251     sq_throwerror(vm, _SC("Argument 2 not a float"));
252     return SQ_ERROR;
253   }
254   
255   try {
256     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
257   
258     return 0;
259   
260   } catch(std::exception& e) {
261     sq_throwerror(vm, e.what());
262     return SQ_ERROR;
263   } catch(...) {
264     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
265     return SQ_ERROR;
266   }
267   
268 }
269
270 static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm)
271 {
272   Scripting::Camera* _this;
273   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
274     sq_throwerror(vm, _SC("'set_mode' called without instance"));
275     return SQ_ERROR;
276   }
277   const SQChar* arg0;
278   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
279     sq_throwerror(vm, _SC("Argument 1 not a string"));
280     return SQ_ERROR;
281   }
282   
283   try {
284     _this->set_mode(arg0);
285   
286     return 0;
287   
288   } catch(std::exception& e) {
289     sq_throwerror(vm, e.what());
290     return SQ_ERROR;
291   } catch(...) {
292     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_mode'"));
293     return SQ_ERROR;
294   }
295   
296 }
297
298 static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm)
299 {
300   Scripting::Camera* _this;
301   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
302     sq_throwerror(vm, _SC("'scroll_to' called without instance"));
303     return SQ_ERROR;
304   }
305   SQFloat arg0;
306   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
307     sq_throwerror(vm, _SC("Argument 1 not a float"));
308     return SQ_ERROR;
309   }
310   SQFloat arg1;
311   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
312     sq_throwerror(vm, _SC("Argument 2 not a float"));
313     return SQ_ERROR;
314   }
315   SQFloat arg2;
316   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
317     sq_throwerror(vm, _SC("Argument 3 not a float"));
318     return SQ_ERROR;
319   }
320   
321   try {
322     _this->scroll_to(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
323   
324     return 0;
325   
326   } catch(std::exception& e) {
327     sq_throwerror(vm, e.what());
328     return SQ_ERROR;
329   } catch(...) {
330     sq_throwerror(vm, _SC("Unexpected exception while executing function 'scroll_to'"));
331     return SQ_ERROR;
332   }
333   
334 }
335
336 static SQInteger Level_release_hook(SQUserPointer ptr, SQInteger )
337 {
338   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
339   delete _this;
340   return 0;
341 }
342
343 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
344 {
345   Scripting::Level* _this;
346   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
347     sq_throwerror(vm, _SC("'finish' called without instance"));
348     return SQ_ERROR;
349   }
350   SQBool arg0;
351   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
352     sq_throwerror(vm, _SC("Argument 1 not a bool"));
353     return SQ_ERROR;
354   }
355   
356   try {
357     _this->finish(arg0 == SQTrue);
358   
359     return 0;
360   
361   } catch(std::exception& e) {
362     sq_throwerror(vm, e.what());
363     return SQ_ERROR;
364   } catch(...) {
365     sq_throwerror(vm, _SC("Unexpected exception while executing function 'finish'"));
366     return SQ_ERROR;
367   }
368   
369 }
370
371 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
372 {
373   Scripting::Level* _this;
374   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
375     sq_throwerror(vm, _SC("'spawn' called without instance"));
376     return SQ_ERROR;
377   }
378   const SQChar* arg0;
379   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
380     sq_throwerror(vm, _SC("Argument 1 not a string"));
381     return SQ_ERROR;
382   }
383   const SQChar* arg1;
384   if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
385     sq_throwerror(vm, _SC("Argument 2 not a string"));
386     return SQ_ERROR;
387   }
388   
389   try {
390     _this->spawn(arg0, arg1);
391   
392     return 0;
393   
394   } catch(std::exception& e) {
395     sq_throwerror(vm, e.what());
396     return SQ_ERROR;
397   } catch(...) {
398     sq_throwerror(vm, _SC("Unexpected exception while executing function 'spawn'"));
399     return SQ_ERROR;
400   }
401   
402 }
403
404 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
405 {
406   Scripting::Level* _this;
407   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
408     sq_throwerror(vm, _SC("'flip_vertically' called without instance"));
409     return SQ_ERROR;
410   }
411   
412   try {
413     _this->flip_vertically();
414   
415     return 0;
416   
417   } catch(std::exception& e) {
418     sq_throwerror(vm, e.what());
419     return SQ_ERROR;
420   } catch(...) {
421     sq_throwerror(vm, _SC("Unexpected exception while executing function 'flip_vertically'"));
422     return SQ_ERROR;
423   }
424   
425 }
426
427 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
428 {
429   Scripting::Level* _this;
430   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
431     sq_throwerror(vm, _SC("'toggle_pause' called without instance"));
432     return SQ_ERROR;
433   }
434   
435   try {
436     _this->toggle_pause();
437   
438     return 0;
439   
440   } catch(std::exception& e) {
441     sq_throwerror(vm, e.what());
442     return SQ_ERROR;
443   } catch(...) {
444     sq_throwerror(vm, _SC("Unexpected exception while executing function 'toggle_pause'"));
445     return SQ_ERROR;
446   }
447   
448 }
449
450 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
451 {
452   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
453   delete _this;
454   return 0;
455 }
456
457 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
458 {
459   Scripting::ScriptedObject* _this;
460   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
461     sq_throwerror(vm, _SC("'set_action' called without instance"));
462     return SQ_ERROR;
463   }
464   const SQChar* arg0;
465   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
466     sq_throwerror(vm, _SC("Argument 1 not a string"));
467     return SQ_ERROR;
468   }
469   
470   try {
471     _this->set_action(arg0);
472   
473     return 0;
474   
475   } catch(std::exception& e) {
476     sq_throwerror(vm, e.what());
477     return SQ_ERROR;
478   } catch(...) {
479     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
480     return SQ_ERROR;
481   }
482   
483 }
484
485 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
486 {
487   Scripting::ScriptedObject* _this;
488   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
489     sq_throwerror(vm, _SC("'get_action' called without instance"));
490     return SQ_ERROR;
491   }
492   
493   try {
494     std::string return_value = _this->get_action();
495   
496     sq_pushstring(vm, return_value.c_str(), return_value.size());
497     return 1;
498   
499   } catch(std::exception& e) {
500     sq_throwerror(vm, e.what());
501     return SQ_ERROR;
502   } catch(...) {
503     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
504     return SQ_ERROR;
505   }
506   
507 }
508
509 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
510 {
511   Scripting::ScriptedObject* _this;
512   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
513     sq_throwerror(vm, _SC("'move' called without instance"));
514     return SQ_ERROR;
515   }
516   SQFloat arg0;
517   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
518     sq_throwerror(vm, _SC("Argument 1 not a float"));
519     return SQ_ERROR;
520   }
521   SQFloat arg1;
522   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
523     sq_throwerror(vm, _SC("Argument 2 not a float"));
524     return SQ_ERROR;
525   }
526   
527   try {
528     _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
529   
530     return 0;
531   
532   } catch(std::exception& e) {
533     sq_throwerror(vm, e.what());
534     return SQ_ERROR;
535   } catch(...) {
536     sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
537     return SQ_ERROR;
538   }
539   
540 }
541
542 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
543 {
544   Scripting::ScriptedObject* _this;
545   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
546     sq_throwerror(vm, _SC("'set_pos' called without instance"));
547     return SQ_ERROR;
548   }
549   SQFloat arg0;
550   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
551     sq_throwerror(vm, _SC("Argument 1 not a float"));
552     return SQ_ERROR;
553   }
554   SQFloat arg1;
555   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
556     sq_throwerror(vm, _SC("Argument 2 not a float"));
557     return SQ_ERROR;
558   }
559   
560   try {
561     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
562   
563     return 0;
564   
565   } catch(std::exception& e) {
566     sq_throwerror(vm, e.what());
567     return SQ_ERROR;
568   } catch(...) {
569     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
570     return SQ_ERROR;
571   }
572   
573 }
574
575 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
576 {
577   Scripting::ScriptedObject* _this;
578   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
579     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
580     return SQ_ERROR;
581   }
582   
583   try {
584     float return_value = _this->get_pos_x();
585   
586     sq_pushfloat(vm, return_value);
587     return 1;
588   
589   } catch(std::exception& e) {
590     sq_throwerror(vm, e.what());
591     return SQ_ERROR;
592   } catch(...) {
593     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
594     return SQ_ERROR;
595   }
596   
597 }
598
599 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
600 {
601   Scripting::ScriptedObject* _this;
602   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
603     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
604     return SQ_ERROR;
605   }
606   
607   try {
608     float return_value = _this->get_pos_y();
609   
610     sq_pushfloat(vm, return_value);
611     return 1;
612   
613   } catch(std::exception& e) {
614     sq_throwerror(vm, e.what());
615     return SQ_ERROR;
616   } catch(...) {
617     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
618     return SQ_ERROR;
619   }
620   
621 }
622
623 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
624 {
625   Scripting::ScriptedObject* _this;
626   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
627     sq_throwerror(vm, _SC("'set_velocity' called without instance"));
628     return SQ_ERROR;
629   }
630   SQFloat arg0;
631   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
632     sq_throwerror(vm, _SC("Argument 1 not a float"));
633     return SQ_ERROR;
634   }
635   SQFloat arg1;
636   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
637     sq_throwerror(vm, _SC("Argument 2 not a float"));
638     return SQ_ERROR;
639   }
640   
641   try {
642     _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
643   
644     return 0;
645   
646   } catch(std::exception& e) {
647     sq_throwerror(vm, e.what());
648     return SQ_ERROR;
649   } catch(...) {
650     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
651     return SQ_ERROR;
652   }
653   
654 }
655
656 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
657 {
658   Scripting::ScriptedObject* _this;
659   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
660     sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
661     return SQ_ERROR;
662   }
663   
664   try {
665     float return_value = _this->get_velocity_x();
666   
667     sq_pushfloat(vm, return_value);
668     return 1;
669   
670   } catch(std::exception& e) {
671     sq_throwerror(vm, e.what());
672     return SQ_ERROR;
673   } catch(...) {
674     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
675     return SQ_ERROR;
676   }
677   
678 }
679
680 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
681 {
682   Scripting::ScriptedObject* _this;
683   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
684     sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
685     return SQ_ERROR;
686   }
687   
688   try {
689     float return_value = _this->get_velocity_y();
690   
691     sq_pushfloat(vm, return_value);
692     return 1;
693   
694   } catch(std::exception& e) {
695     sq_throwerror(vm, e.what());
696     return SQ_ERROR;
697   } catch(...) {
698     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
699     return SQ_ERROR;
700   }
701   
702 }
703
704 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
705 {
706   Scripting::ScriptedObject* _this;
707   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
708     sq_throwerror(vm, _SC("'set_visible' called without instance"));
709     return SQ_ERROR;
710   }
711   SQBool arg0;
712   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
713     sq_throwerror(vm, _SC("Argument 1 not a bool"));
714     return SQ_ERROR;
715   }
716   
717   try {
718     _this->set_visible(arg0 == SQTrue);
719   
720     return 0;
721   
722   } catch(std::exception& e) {
723     sq_throwerror(vm, e.what());
724     return SQ_ERROR;
725   } catch(...) {
726     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
727     return SQ_ERROR;
728   }
729   
730 }
731
732 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
733 {
734   Scripting::ScriptedObject* _this;
735   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
736     sq_throwerror(vm, _SC("'is_visible' called without instance"));
737     return SQ_ERROR;
738   }
739   
740   try {
741     bool return_value = _this->is_visible();
742   
743     sq_pushbool(vm, return_value);
744     return 1;
745   
746   } catch(std::exception& e) {
747     sq_throwerror(vm, e.what());
748     return SQ_ERROR;
749   } catch(...) {
750     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
751     return SQ_ERROR;
752   }
753   
754 }
755
756 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
757 {
758   Scripting::ScriptedObject* _this;
759   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
760     sq_throwerror(vm, _SC("'get_name' called without instance"));
761     return SQ_ERROR;
762   }
763   
764   try {
765     std::string return_value = _this->get_name();
766   
767     sq_pushstring(vm, return_value.c_str(), return_value.size());
768     return 1;
769   
770   } catch(std::exception& e) {
771     sq_throwerror(vm, e.what());
772     return SQ_ERROR;
773   } catch(...) {
774     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
775     return SQ_ERROR;
776   }
777   
778 }
779
780 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
781 {
782   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
783   delete _this;
784   return 0;
785 }
786
787 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
788 {
789   Scripting::Text* _this;
790   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
791     sq_throwerror(vm, _SC("'set_text' called without instance"));
792     return SQ_ERROR;
793   }
794   const SQChar* arg0;
795   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
796     sq_throwerror(vm, _SC("Argument 1 not a string"));
797     return SQ_ERROR;
798   }
799   
800   try {
801     _this->set_text(arg0);
802   
803     return 0;
804   
805   } catch(std::exception& e) {
806     sq_throwerror(vm, e.what());
807     return SQ_ERROR;
808   } catch(...) {
809     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
810     return SQ_ERROR;
811   }
812   
813 }
814
815 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
816 {
817   Scripting::Text* _this;
818   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
819     sq_throwerror(vm, _SC("'set_font' called without instance"));
820     return SQ_ERROR;
821   }
822   const SQChar* arg0;
823   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
824     sq_throwerror(vm, _SC("Argument 1 not a string"));
825     return SQ_ERROR;
826   }
827   
828   try {
829     _this->set_font(arg0);
830   
831     return 0;
832   
833   } catch(std::exception& e) {
834     sq_throwerror(vm, e.what());
835     return SQ_ERROR;
836   } catch(...) {
837     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
838     return SQ_ERROR;
839   }
840   
841 }
842
843 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
844 {
845   Scripting::Text* _this;
846   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
847     sq_throwerror(vm, _SC("'fade_in' called without instance"));
848     return SQ_ERROR;
849   }
850   SQFloat arg0;
851   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
852     sq_throwerror(vm, _SC("Argument 1 not a float"));
853     return SQ_ERROR;
854   }
855   
856   try {
857     _this->fade_in(static_cast<float> (arg0));
858   
859     return 0;
860   
861   } catch(std::exception& e) {
862     sq_throwerror(vm, e.what());
863     return SQ_ERROR;
864   } catch(...) {
865     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
866     return SQ_ERROR;
867   }
868   
869 }
870
871 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
872 {
873   Scripting::Text* _this;
874   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
875     sq_throwerror(vm, _SC("'fade_out' called without instance"));
876     return SQ_ERROR;
877   }
878   SQFloat arg0;
879   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
880     sq_throwerror(vm, _SC("Argument 1 not a float"));
881     return SQ_ERROR;
882   }
883   
884   try {
885     _this->fade_out(static_cast<float> (arg0));
886   
887     return 0;
888   
889   } catch(std::exception& e) {
890     sq_throwerror(vm, e.what());
891     return SQ_ERROR;
892   } catch(...) {
893     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
894     return SQ_ERROR;
895   }
896   
897 }
898
899 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
900 {
901   Scripting::Text* _this;
902   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
903     sq_throwerror(vm, _SC("'set_visible' called without instance"));
904     return SQ_ERROR;
905   }
906   SQBool arg0;
907   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
908     sq_throwerror(vm, _SC("Argument 1 not a bool"));
909     return SQ_ERROR;
910   }
911   
912   try {
913     _this->set_visible(arg0 == SQTrue);
914   
915     return 0;
916   
917   } catch(std::exception& e) {
918     sq_throwerror(vm, e.what());
919     return SQ_ERROR;
920   } catch(...) {
921     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
922     return SQ_ERROR;
923   }
924   
925 }
926
927 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
928 {
929   Scripting::Text* _this;
930   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
931     sq_throwerror(vm, _SC("'set_centered' called without instance"));
932     return SQ_ERROR;
933   }
934   SQBool arg0;
935   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
936     sq_throwerror(vm, _SC("Argument 1 not a bool"));
937     return SQ_ERROR;
938   }
939   
940   try {
941     _this->set_centered(arg0 == SQTrue);
942   
943     return 0;
944   
945   } catch(std::exception& e) {
946     sq_throwerror(vm, e.what());
947     return SQ_ERROR;
948   } catch(...) {
949     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
950     return SQ_ERROR;
951   }
952   
953 }
954
955 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
956 {
957   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
958   delete _this;
959   return 0;
960 }
961
962 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
963 {
964   Scripting::Player* _this;
965   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
966     sq_throwerror(vm, _SC("'add_bonus' called without instance"));
967     return SQ_ERROR;
968   }
969   const SQChar* arg0;
970   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
971     sq_throwerror(vm, _SC("Argument 1 not a string"));
972     return SQ_ERROR;
973   }
974   
975   try {
976     _this->add_bonus(arg0);
977   
978     return 0;
979   
980   } catch(std::exception& e) {
981     sq_throwerror(vm, e.what());
982     return SQ_ERROR;
983   } catch(...) {
984     sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
985     return SQ_ERROR;
986   }
987   
988 }
989
990 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
991 {
992   Scripting::Player* _this;
993   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
994     sq_throwerror(vm, _SC("'add_coins' called without instance"));
995     return SQ_ERROR;
996   }
997   SQInteger arg0;
998   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
999     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1000     return SQ_ERROR;
1001   }
1002   
1003   try {
1004     _this->add_coins(static_cast<int> (arg0));
1005   
1006     return 0;
1007   
1008   } catch(std::exception& e) {
1009     sq_throwerror(vm, e.what());
1010     return SQ_ERROR;
1011   } catch(...) {
1012     sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1013     return SQ_ERROR;
1014   }
1015   
1016 }
1017
1018 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1019 {
1020   Scripting::Player* _this;
1021   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1022     sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1023     return SQ_ERROR;
1024   }
1025   
1026   try {
1027     _this->make_invincible();
1028   
1029     return 0;
1030   
1031   } catch(std::exception& e) {
1032     sq_throwerror(vm, e.what());
1033     return SQ_ERROR;
1034   } catch(...) {
1035     sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1036     return SQ_ERROR;
1037   }
1038   
1039 }
1040
1041 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1042 {
1043   Scripting::Player* _this;
1044   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1045     sq_throwerror(vm, _SC("'deactivate' called without instance"));
1046     return SQ_ERROR;
1047   }
1048   
1049   try {
1050     _this->deactivate();
1051   
1052     return 0;
1053   
1054   } catch(std::exception& e) {
1055     sq_throwerror(vm, e.what());
1056     return SQ_ERROR;
1057   } catch(...) {
1058     sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1059     return SQ_ERROR;
1060   }
1061   
1062 }
1063
1064 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1065 {
1066   Scripting::Player* _this;
1067   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1068     sq_throwerror(vm, _SC("'activate' called without instance"));
1069     return SQ_ERROR;
1070   }
1071   
1072   try {
1073     _this->activate();
1074   
1075     return 0;
1076   
1077   } catch(std::exception& e) {
1078     sq_throwerror(vm, e.what());
1079     return SQ_ERROR;
1080   } catch(...) {
1081     sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1082     return SQ_ERROR;
1083   }
1084   
1085 }
1086
1087 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1088 {
1089   Scripting::Player* _this;
1090   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1091     sq_throwerror(vm, _SC("'walk' called without instance"));
1092     return SQ_ERROR;
1093   }
1094   SQFloat arg0;
1095   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1096     sq_throwerror(vm, _SC("Argument 1 not a float"));
1097     return SQ_ERROR;
1098   }
1099   
1100   try {
1101     _this->walk(static_cast<float> (arg0));
1102   
1103     return 0;
1104   
1105   } catch(std::exception& e) {
1106     sq_throwerror(vm, e.what());
1107     return SQ_ERROR;
1108   } catch(...) {
1109     sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1110     return SQ_ERROR;
1111   }
1112   
1113 }
1114
1115 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1116 {
1117   Scripting::Player* _this;
1118   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1119     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1120     return SQ_ERROR;
1121   }
1122   SQBool arg0;
1123   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1124     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1125     return SQ_ERROR;
1126   }
1127   
1128   try {
1129     _this->set_visible(arg0 == SQTrue);
1130   
1131     return 0;
1132   
1133   } catch(std::exception& e) {
1134     sq_throwerror(vm, e.what());
1135     return SQ_ERROR;
1136   } catch(...) {
1137     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1138     return SQ_ERROR;
1139   }
1140   
1141 }
1142
1143 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1144 {
1145   Scripting::Player* _this;
1146   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1147     sq_throwerror(vm, _SC("'get_visible' called without instance"));
1148     return SQ_ERROR;
1149   }
1150   
1151   try {
1152     bool return_value = _this->get_visible();
1153   
1154     sq_pushbool(vm, return_value);
1155     return 1;
1156   
1157   } catch(std::exception& e) {
1158     sq_throwerror(vm, e.what());
1159     return SQ_ERROR;
1160   } catch(...) {
1161     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1162     return SQ_ERROR;
1163   }
1164   
1165 }
1166
1167 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1168 {
1169   Scripting::Player* _this;
1170   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1171     sq_throwerror(vm, _SC("'kill' called without instance"));
1172     return SQ_ERROR;
1173   }
1174   SQBool arg0;
1175   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1176     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1177     return SQ_ERROR;
1178   }
1179   
1180   try {
1181     _this->kill(arg0 == SQTrue);
1182   
1183     return 0;
1184   
1185   } catch(std::exception& e) {
1186     sq_throwerror(vm, e.what());
1187     return SQ_ERROR;
1188   } catch(...) {
1189     sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1190     return SQ_ERROR;
1191   }
1192   
1193 }
1194
1195 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1196 {
1197   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1198   delete _this;
1199   return 0;
1200 }
1201
1202 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1203 {
1204   const SQChar* arg0;
1205   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1206     sq_throwerror(vm, _SC("Argument 1 not a string"));
1207     return SQ_ERROR;
1208   }
1209   
1210   try {
1211     Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1212   if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1213     sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1214     return SQ_ERROR;
1215   }
1216   sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1217   
1218     return 0;
1219   
1220   } catch(std::exception& e) {
1221     sq_throwerror(vm, e.what());
1222     return SQ_ERROR;
1223   } catch(...) {
1224     sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1225     return SQ_ERROR;
1226   }
1227   
1228 }
1229
1230 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1231 {
1232   Scripting::FloatingImage* _this;
1233   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1234     sq_throwerror(vm, _SC("'set_layer' called without instance"));
1235     return SQ_ERROR;
1236   }
1237   SQInteger arg0;
1238   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1239     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1240     return SQ_ERROR;
1241   }
1242   
1243   try {
1244     _this->set_layer(static_cast<int> (arg0));
1245   
1246     return 0;
1247   
1248   } catch(std::exception& e) {
1249     sq_throwerror(vm, e.what());
1250     return SQ_ERROR;
1251   } catch(...) {
1252     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1253     return SQ_ERROR;
1254   }
1255   
1256 }
1257
1258 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1259 {
1260   Scripting::FloatingImage* _this;
1261   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1262     sq_throwerror(vm, _SC("'get_layer' called without instance"));
1263     return SQ_ERROR;
1264   }
1265   
1266   try {
1267     int return_value = _this->get_layer();
1268   
1269     sq_pushinteger(vm, return_value);
1270     return 1;
1271   
1272   } catch(std::exception& e) {
1273     sq_throwerror(vm, e.what());
1274     return SQ_ERROR;
1275   } catch(...) {
1276     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1277     return SQ_ERROR;
1278   }
1279   
1280 }
1281
1282 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1283 {
1284   Scripting::FloatingImage* _this;
1285   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1286     sq_throwerror(vm, _SC("'set_pos' called without instance"));
1287     return SQ_ERROR;
1288   }
1289   SQFloat arg0;
1290   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1291     sq_throwerror(vm, _SC("Argument 1 not a float"));
1292     return SQ_ERROR;
1293   }
1294   SQFloat arg1;
1295   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1296     sq_throwerror(vm, _SC("Argument 2 not a float"));
1297     return SQ_ERROR;
1298   }
1299   
1300   try {
1301     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1302   
1303     return 0;
1304   
1305   } catch(std::exception& e) {
1306     sq_throwerror(vm, e.what());
1307     return SQ_ERROR;
1308   } catch(...) {
1309     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1310     return SQ_ERROR;
1311   }
1312   
1313 }
1314
1315 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1316 {
1317   Scripting::FloatingImage* _this;
1318   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1319     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1320     return SQ_ERROR;
1321   }
1322   
1323   try {
1324     float return_value = _this->get_pos_x();
1325   
1326     sq_pushfloat(vm, return_value);
1327     return 1;
1328   
1329   } catch(std::exception& e) {
1330     sq_throwerror(vm, e.what());
1331     return SQ_ERROR;
1332   } catch(...) {
1333     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1334     return SQ_ERROR;
1335   }
1336   
1337 }
1338
1339 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1340 {
1341   Scripting::FloatingImage* _this;
1342   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1343     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1344     return SQ_ERROR;
1345   }
1346   
1347   try {
1348     float return_value = _this->get_pos_y();
1349   
1350     sq_pushfloat(vm, return_value);
1351     return 1;
1352   
1353   } catch(std::exception& e) {
1354     sq_throwerror(vm, e.what());
1355     return SQ_ERROR;
1356   } catch(...) {
1357     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1358     return SQ_ERROR;
1359   }
1360   
1361 }
1362
1363 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1364 {
1365   Scripting::FloatingImage* _this;
1366   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1367     sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1368     return SQ_ERROR;
1369   }
1370   SQInteger arg0;
1371   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1372     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1373     return SQ_ERROR;
1374   }
1375   
1376   try {
1377     _this->set_anchor_point(static_cast<int> (arg0));
1378   
1379     return 0;
1380   
1381   } catch(std::exception& e) {
1382     sq_throwerror(vm, e.what());
1383     return SQ_ERROR;
1384   } catch(...) {
1385     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1386     return SQ_ERROR;
1387   }
1388   
1389 }
1390
1391 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1392 {
1393   Scripting::FloatingImage* _this;
1394   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1395     sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1396     return SQ_ERROR;
1397   }
1398   
1399   try {
1400     int return_value = _this->get_anchor_point();
1401   
1402     sq_pushinteger(vm, return_value);
1403     return 1;
1404   
1405   } catch(std::exception& e) {
1406     sq_throwerror(vm, e.what());
1407     return SQ_ERROR;
1408   } catch(...) {
1409     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1410     return SQ_ERROR;
1411   }
1412   
1413 }
1414
1415 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1416 {
1417   Scripting::FloatingImage* _this;
1418   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1419     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1420     return SQ_ERROR;
1421   }
1422   SQBool arg0;
1423   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1424     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1425     return SQ_ERROR;
1426   }
1427   
1428   try {
1429     _this->set_visible(arg0 == SQTrue);
1430   
1431     return 0;
1432   
1433   } catch(std::exception& e) {
1434     sq_throwerror(vm, e.what());
1435     return SQ_ERROR;
1436   } catch(...) {
1437     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1438     return SQ_ERROR;
1439   }
1440   
1441 }
1442
1443 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1444 {
1445   Scripting::FloatingImage* _this;
1446   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1447     sq_throwerror(vm, _SC("'get_visible' called without instance"));
1448     return SQ_ERROR;
1449   }
1450   
1451   try {
1452     bool return_value = _this->get_visible();
1453   
1454     sq_pushbool(vm, return_value);
1455     return 1;
1456   
1457   } catch(std::exception& e) {
1458     sq_throwerror(vm, e.what());
1459     return SQ_ERROR;
1460   } catch(...) {
1461     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1462     return SQ_ERROR;
1463   }
1464   
1465 }
1466
1467 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
1468 {
1469   Scripting::FloatingImage* _this;
1470   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1471     sq_throwerror(vm, _SC("'set_action' called without instance"));
1472     return SQ_ERROR;
1473   }
1474   const SQChar* arg0;
1475   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1476     sq_throwerror(vm, _SC("Argument 1 not a string"));
1477     return SQ_ERROR;
1478   }
1479   
1480   try {
1481     _this->set_action(arg0);
1482   
1483     return 0;
1484   
1485   } catch(std::exception& e) {
1486     sq_throwerror(vm, e.what());
1487     return SQ_ERROR;
1488   } catch(...) {
1489     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1490     return SQ_ERROR;
1491   }
1492   
1493 }
1494
1495 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
1496 {
1497   Scripting::FloatingImage* _this;
1498   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1499     sq_throwerror(vm, _SC("'get_action' called without instance"));
1500     return SQ_ERROR;
1501   }
1502   
1503   try {
1504     std::string return_value = _this->get_action();
1505   
1506     sq_pushstring(vm, return_value.c_str(), return_value.size());
1507     return 1;
1508   
1509   } catch(std::exception& e) {
1510     sq_throwerror(vm, e.what());
1511     return SQ_ERROR;
1512   } catch(...) {
1513     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1514     return SQ_ERROR;
1515   }
1516   
1517 }
1518
1519 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1520 {
1521   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
1522   delete _this;
1523   return 0;
1524 }
1525
1526 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1527 {
1528   Scripting::Platform* _this;
1529   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1530     sq_throwerror(vm, _SC("'goto_node' called without instance"));
1531     return SQ_ERROR;
1532   }
1533   SQInteger arg0;
1534   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1535     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1536     return SQ_ERROR;
1537   }
1538   
1539   try {
1540     _this->goto_node(static_cast<int> (arg0));
1541   
1542     return 0;
1543   
1544   } catch(std::exception& e) {
1545     sq_throwerror(vm, e.what());
1546     return SQ_ERROR;
1547   } catch(...) {
1548     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1549     return SQ_ERROR;
1550   }
1551   
1552 }
1553
1554 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1555 {
1556   Scripting::Platform* _this;
1557   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1558     sq_throwerror(vm, _SC("'start_moving' called without instance"));
1559     return SQ_ERROR;
1560   }
1561   
1562   try {
1563     _this->start_moving();
1564   
1565     return 0;
1566   
1567   } catch(std::exception& e) {
1568     sq_throwerror(vm, e.what());
1569     return SQ_ERROR;
1570   } catch(...) {
1571     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
1572     return SQ_ERROR;
1573   }
1574   
1575 }
1576
1577 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1578 {
1579   Scripting::Platform* _this;
1580   if(SQ_FAILED(sq_getinstanceup(vm, 1, reinterpret_cast<SQUserPointer*> (&_this), 0))) {
1581     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1582     return SQ_ERROR;
1583   }
1584   
1585   try {
1586     _this->stop_moving();
1587   
1588     return 0;
1589   
1590   } catch(std::exception& e) {
1591     sq_throwerror(vm, e.what());
1592     return SQ_ERROR;
1593   } catch(...) {
1594     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1595     return SQ_ERROR;
1596   }
1597   
1598 }
1599
1600 static SQInteger display_wrapper(HSQUIRRELVM vm)
1601 {
1602   return Scripting::display(vm);
1603 }
1604
1605 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
1606 {
1607   HSQUIRRELVM arg0 = vm;
1608   
1609   try {
1610     Scripting::print_stacktrace(arg0);
1611   
1612     return 0;
1613   
1614   } catch(std::exception& e) {
1615     sq_throwerror(vm, e.what());
1616     return SQ_ERROR;
1617   } catch(...) {
1618     sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
1619     return SQ_ERROR;
1620   }
1621   
1622 }
1623
1624 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
1625 {
1626   return Scripting::get_current_thread(vm);
1627 }
1628
1629 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
1630 {
1631   const SQChar* arg0;
1632   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1633     sq_throwerror(vm, _SC("Argument 1 not a string"));
1634     return SQ_ERROR;
1635   }
1636   
1637   try {
1638     Scripting::display_text_file(arg0);
1639   
1640     return 0;
1641   
1642   } catch(std::exception& e) {
1643     sq_throwerror(vm, e.what());
1644     return SQ_ERROR;
1645   } catch(...) {
1646     sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
1647     return SQ_ERROR;
1648   }
1649   
1650 }
1651
1652 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
1653 {
1654   const SQChar* arg0;
1655   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1656     sq_throwerror(vm, _SC("Argument 1 not a string"));
1657     return SQ_ERROR;
1658   }
1659   
1660   try {
1661     Scripting::load_worldmap(arg0);
1662   
1663     return 0;
1664   
1665   } catch(std::exception& e) {
1666     sq_throwerror(vm, e.what());
1667     return SQ_ERROR;
1668   } catch(...) {
1669     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
1670     return SQ_ERROR;
1671   }
1672   
1673 }
1674
1675 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
1676 {
1677   const SQChar* arg0;
1678   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1679     sq_throwerror(vm, _SC("Argument 1 not a string"));
1680     return SQ_ERROR;
1681   }
1682   
1683   try {
1684     Scripting::load_level(arg0);
1685   
1686     return 0;
1687   
1688   } catch(std::exception& e) {
1689     sq_throwerror(vm, e.what());
1690     return SQ_ERROR;
1691   } catch(...) {
1692     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
1693     return SQ_ERROR;
1694   }
1695   
1696 }
1697
1698 static SQInteger wait_wrapper(HSQUIRRELVM vm)
1699 {
1700   HSQUIRRELVM arg0 = vm;
1701   SQFloat arg1;
1702   if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
1703     sq_throwerror(vm, _SC("Argument 1 not a float"));
1704     return SQ_ERROR;
1705   }
1706   
1707   try {
1708     Scripting::wait(arg0, static_cast<float> (arg1));
1709   
1710     return sq_suspendvm(vm);
1711   
1712   } catch(std::exception& e) {
1713     sq_throwerror(vm, e.what());
1714     return SQ_ERROR;
1715   } catch(...) {
1716     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
1717     return SQ_ERROR;
1718   }
1719   
1720 }
1721
1722 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
1723 {
1724   HSQUIRRELVM arg0 = vm;
1725   
1726   try {
1727     Scripting::wait_for_screenswitch(arg0);
1728   
1729     return sq_suspendvm(vm);
1730   
1731   } catch(std::exception& e) {
1732     sq_throwerror(vm, e.what());
1733     return SQ_ERROR;
1734   } catch(...) {
1735     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
1736     return SQ_ERROR;
1737   }
1738   
1739 }
1740
1741 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
1742 {
1743   (void) vm;
1744   
1745   try {
1746     Scripting::exit_screen();
1747   
1748     return 0;
1749   
1750   } catch(std::exception& e) {
1751     sq_throwerror(vm, e.what());
1752     return SQ_ERROR;
1753   } catch(...) {
1754     sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
1755     return SQ_ERROR;
1756   }
1757   
1758 }
1759
1760 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
1761 {
1762   SQFloat arg0;
1763   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1764     sq_throwerror(vm, _SC("Argument 1 not a float"));
1765     return SQ_ERROR;
1766   }
1767   
1768   try {
1769     Scripting::fadeout_screen(static_cast<float> (arg0));
1770   
1771     return 0;
1772   
1773   } catch(std::exception& e) {
1774     sq_throwerror(vm, e.what());
1775     return SQ_ERROR;
1776   } catch(...) {
1777     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
1778     return SQ_ERROR;
1779   }
1780   
1781 }
1782
1783 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
1784 {
1785   SQFloat arg0;
1786   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1787     sq_throwerror(vm, _SC("Argument 1 not a float"));
1788     return SQ_ERROR;
1789   }
1790   SQFloat arg1;
1791   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1792     sq_throwerror(vm, _SC("Argument 2 not a float"));
1793     return SQ_ERROR;
1794   }
1795   SQFloat arg2;
1796   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
1797     sq_throwerror(vm, _SC("Argument 3 not a float"));
1798     return SQ_ERROR;
1799   }
1800   
1801   try {
1802     Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
1803   
1804     return 0;
1805   
1806   } catch(std::exception& e) {
1807     sq_throwerror(vm, e.what());
1808     return SQ_ERROR;
1809   } catch(...) {
1810     sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
1811     return SQ_ERROR;
1812   }
1813   
1814 }
1815
1816 static SQInteger translate_wrapper(HSQUIRRELVM vm)
1817 {
1818   const SQChar* arg0;
1819   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1820     sq_throwerror(vm, _SC("Argument 1 not a string"));
1821     return SQ_ERROR;
1822   }
1823   
1824   try {
1825     std::string return_value = Scripting::translate(arg0);
1826   
1827     sq_pushstring(vm, return_value.c_str(), return_value.size());
1828     return 1;
1829   
1830   } catch(std::exception& e) {
1831     sq_throwerror(vm, e.what());
1832     return SQ_ERROR;
1833   } catch(...) {
1834     sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
1835     return SQ_ERROR;
1836   }
1837   
1838 }
1839
1840 static SQInteger import_wrapper(HSQUIRRELVM vm)
1841 {
1842   HSQUIRRELVM arg0 = vm;
1843   const SQChar* arg1;
1844   if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
1845     sq_throwerror(vm, _SC("Argument 1 not a string"));
1846     return SQ_ERROR;
1847   }
1848   
1849   try {
1850     Scripting::import(arg0, arg1);
1851   
1852     return 0;
1853   
1854   } catch(std::exception& e) {
1855     sq_throwerror(vm, e.what());
1856     return SQ_ERROR;
1857   } catch(...) {
1858     sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
1859     return SQ_ERROR;
1860   }
1861   
1862 }
1863
1864 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
1865 {
1866   (void) vm;
1867   
1868   try {
1869     Scripting::save_state();
1870   
1871     return 0;
1872   
1873   } catch(std::exception& e) {
1874     sq_throwerror(vm, e.what());
1875     return SQ_ERROR;
1876   } catch(...) {
1877     sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
1878     return SQ_ERROR;
1879   }
1880   
1881 }
1882
1883 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
1884 {
1885   SQBool arg0;
1886   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1887     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1888     return SQ_ERROR;
1889   }
1890   
1891   try {
1892     Scripting::debug_collrects(arg0 == SQTrue);
1893   
1894     return 0;
1895   
1896   } catch(std::exception& e) {
1897     sq_throwerror(vm, e.what());
1898     return SQ_ERROR;
1899   } catch(...) {
1900     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
1901     return SQ_ERROR;
1902   }
1903   
1904 }
1905
1906 static SQInteger debug_draw_fps_wrapper(HSQUIRRELVM vm)
1907 {
1908   SQBool arg0;
1909   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1910     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1911     return SQ_ERROR;
1912   }
1913   
1914   try {
1915     Scripting::debug_draw_fps(arg0 == SQTrue);
1916   
1917     return 0;
1918   
1919   } catch(std::exception& e) {
1920     sq_throwerror(vm, e.what());
1921     return SQ_ERROR;
1922   } catch(...) {
1923     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_fps'"));
1924     return SQ_ERROR;
1925   }
1926   
1927 }
1928
1929 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
1930 {
1931   SQBool arg0;
1932   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1933     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1934     return SQ_ERROR;
1935   }
1936   
1937   try {
1938     Scripting::debug_draw_solids_only(arg0 == SQTrue);
1939   
1940     return 0;
1941   
1942   } catch(std::exception& e) {
1943     sq_throwerror(vm, e.what());
1944     return SQ_ERROR;
1945   } catch(...) {
1946     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
1947     return SQ_ERROR;
1948   }
1949   
1950 }
1951
1952 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
1953 {
1954   const SQChar* arg0;
1955   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1956     sq_throwerror(vm, _SC("Argument 1 not a string"));
1957     return SQ_ERROR;
1958   }
1959   
1960   try {
1961     Scripting::play_music(arg0);
1962   
1963     return 0;
1964   
1965   } catch(std::exception& e) {
1966     sq_throwerror(vm, e.what());
1967     return SQ_ERROR;
1968   } catch(...) {
1969     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
1970     return SQ_ERROR;
1971   }
1972   
1973 }
1974
1975 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
1976 {
1977   const SQChar* arg0;
1978   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1979     sq_throwerror(vm, _SC("Argument 1 not a string"));
1980     return SQ_ERROR;
1981   }
1982   
1983   try {
1984     Scripting::play_sound(arg0);
1985   
1986     return 0;
1987   
1988   } catch(std::exception& e) {
1989     sq_throwerror(vm, e.what());
1990     return SQ_ERROR;
1991   } catch(...) {
1992     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
1993     return SQ_ERROR;
1994   }
1995   
1996 }
1997
1998 static SQInteger grease_wrapper(HSQUIRRELVM vm)
1999 {
2000   (void) vm;
2001   
2002   try {
2003     Scripting::grease();
2004   
2005     return 0;
2006   
2007   } catch(std::exception& e) {
2008     sq_throwerror(vm, e.what());
2009     return SQ_ERROR;
2010   } catch(...) {
2011     sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
2012     return SQ_ERROR;
2013   }
2014   
2015 }
2016
2017 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
2018 {
2019   (void) vm;
2020   
2021   try {
2022     Scripting::invincible();
2023   
2024     return 0;
2025   
2026   } catch(std::exception& e) {
2027     sq_throwerror(vm, e.what());
2028     return SQ_ERROR;
2029   } catch(...) {
2030     sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
2031     return SQ_ERROR;
2032   }
2033   
2034 }
2035
2036 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
2037 {
2038   (void) vm;
2039   
2040   try {
2041     Scripting::mortal();
2042   
2043     return 0;
2044   
2045   } catch(std::exception& e) {
2046     sq_throwerror(vm, e.what());
2047     return SQ_ERROR;
2048   } catch(...) {
2049     sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
2050     return SQ_ERROR;
2051   }
2052   
2053 }
2054
2055 static SQInteger restart_wrapper(HSQUIRRELVM vm)
2056 {
2057   (void) vm;
2058   
2059   try {
2060     Scripting::restart();
2061   
2062     return 0;
2063   
2064   } catch(std::exception& e) {
2065     sq_throwerror(vm, e.what());
2066     return SQ_ERROR;
2067   } catch(...) {
2068     sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
2069     return SQ_ERROR;
2070   }
2071   
2072 }
2073
2074 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
2075 {
2076   (void) vm;
2077   
2078   try {
2079     Scripting::whereami();
2080   
2081     return 0;
2082   
2083   } catch(std::exception& e) {
2084     sq_throwerror(vm, e.what());
2085     return SQ_ERROR;
2086   } catch(...) {
2087     sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
2088     return SQ_ERROR;
2089   }
2090   
2091 }
2092
2093 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
2094 {
2095   (void) vm;
2096   
2097   try {
2098     Scripting::gotoend();
2099   
2100     return 0;
2101   
2102   } catch(std::exception& e) {
2103     sq_throwerror(vm, e.what());
2104     return SQ_ERROR;
2105   } catch(...) {
2106     sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
2107     return SQ_ERROR;
2108   }
2109   
2110 }
2111
2112 static SQInteger camera_wrapper(HSQUIRRELVM vm)
2113 {
2114   (void) vm;
2115   
2116   try {
2117     Scripting::camera();
2118   
2119     return 0;
2120   
2121   } catch(std::exception& e) {
2122     sq_throwerror(vm, e.what());
2123     return SQ_ERROR;
2124   } catch(...) {
2125     sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
2126     return SQ_ERROR;
2127   }
2128   
2129 }
2130
2131 static SQInteger quit_wrapper(HSQUIRRELVM vm)
2132 {
2133   (void) vm;
2134   
2135   try {
2136     Scripting::quit();
2137   
2138     return 0;
2139   
2140   } catch(std::exception& e) {
2141     sq_throwerror(vm, e.what());
2142     return SQ_ERROR;
2143   } catch(...) {
2144     sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
2145     return SQ_ERROR;
2146   }
2147   
2148 }
2149
2150 static SQInteger rand_wrapper(HSQUIRRELVM vm)
2151 {
2152   
2153   try {
2154     int return_value = Scripting::rand();
2155   
2156     sq_pushinteger(vm, return_value);
2157     return 1;
2158   
2159   } catch(std::exception& e) {
2160     sq_throwerror(vm, e.what());
2161     return SQ_ERROR;
2162   } catch(...) {
2163     sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
2164     return SQ_ERROR;
2165   }
2166   
2167 }
2168
2169 } // end of namespace Wrapper
2170
2171 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
2172 {
2173   using namespace Wrapper;
2174
2175   sq_pushroottable(v);
2176   sq_pushstring(v, "DisplayEffect", -1);
2177   if(SQ_FAILED(sq_get(v, -2))) {
2178     std::ostringstream msg;
2179     msg << "Couldn't resolved squirrel type 'DisplayEffect'";
2180     throw SquirrelError(v, msg.str());
2181   }
2182
2183   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2184     std::ostringstream msg;
2185     msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
2186     throw SquirrelError(v, msg.str());
2187   }
2188   sq_remove(v, -2); // remove object name
2189
2190   if(setup_releasehook) {
2191     sq_setreleasehook(v, -1, DisplayEffect_release_hook);
2192   }
2193
2194   sq_remove(v, -2); // remove root table
2195 }
2196
2197 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
2198 {
2199   using namespace Wrapper;
2200
2201   sq_pushroottable(v);
2202   sq_pushstring(v, "Camera", -1);
2203   if(SQ_FAILED(sq_get(v, -2))) {
2204     std::ostringstream msg;
2205     msg << "Couldn't resolved squirrel type 'Camera'";
2206     throw SquirrelError(v, msg.str());
2207   }
2208
2209   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2210     std::ostringstream msg;
2211     msg << "Couldn't setup squirrel instance for object of type 'Camera'";
2212     throw SquirrelError(v, msg.str());
2213   }
2214   sq_remove(v, -2); // remove object name
2215
2216   if(setup_releasehook) {
2217     sq_setreleasehook(v, -1, Camera_release_hook);
2218   }
2219
2220   sq_remove(v, -2); // remove root table
2221 }
2222
2223 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
2224 {
2225   using namespace Wrapper;
2226
2227   sq_pushroottable(v);
2228   sq_pushstring(v, "Level", -1);
2229   if(SQ_FAILED(sq_get(v, -2))) {
2230     std::ostringstream msg;
2231     msg << "Couldn't resolved squirrel type 'Level'";
2232     throw SquirrelError(v, msg.str());
2233   }
2234
2235   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2236     std::ostringstream msg;
2237     msg << "Couldn't setup squirrel instance for object of type 'Level'";
2238     throw SquirrelError(v, msg.str());
2239   }
2240   sq_remove(v, -2); // remove object name
2241
2242   if(setup_releasehook) {
2243     sq_setreleasehook(v, -1, Level_release_hook);
2244   }
2245
2246   sq_remove(v, -2); // remove root table
2247 }
2248
2249 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
2250 {
2251   using namespace Wrapper;
2252
2253   sq_pushroottable(v);
2254   sq_pushstring(v, "ScriptedObject", -1);
2255   if(SQ_FAILED(sq_get(v, -2))) {
2256     std::ostringstream msg;
2257     msg << "Couldn't resolved squirrel type 'ScriptedObject'";
2258     throw SquirrelError(v, msg.str());
2259   }
2260
2261   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2262     std::ostringstream msg;
2263     msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
2264     throw SquirrelError(v, msg.str());
2265   }
2266   sq_remove(v, -2); // remove object name
2267
2268   if(setup_releasehook) {
2269     sq_setreleasehook(v, -1, ScriptedObject_release_hook);
2270   }
2271
2272   sq_remove(v, -2); // remove root table
2273 }
2274
2275 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
2276 {
2277   using namespace Wrapper;
2278
2279   sq_pushroottable(v);
2280   sq_pushstring(v, "Text", -1);
2281   if(SQ_FAILED(sq_get(v, -2))) {
2282     std::ostringstream msg;
2283     msg << "Couldn't resolved squirrel type 'Text'";
2284     throw SquirrelError(v, msg.str());
2285   }
2286
2287   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2288     std::ostringstream msg;
2289     msg << "Couldn't setup squirrel instance for object of type 'Text'";
2290     throw SquirrelError(v, msg.str());
2291   }
2292   sq_remove(v, -2); // remove object name
2293
2294   if(setup_releasehook) {
2295     sq_setreleasehook(v, -1, Text_release_hook);
2296   }
2297
2298   sq_remove(v, -2); // remove root table
2299 }
2300
2301 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
2302 {
2303   using namespace Wrapper;
2304
2305   sq_pushroottable(v);
2306   sq_pushstring(v, "Player", -1);
2307   if(SQ_FAILED(sq_get(v, -2))) {
2308     std::ostringstream msg;
2309     msg << "Couldn't resolved squirrel type 'Player'";
2310     throw SquirrelError(v, msg.str());
2311   }
2312
2313   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2314     std::ostringstream msg;
2315     msg << "Couldn't setup squirrel instance for object of type 'Player'";
2316     throw SquirrelError(v, msg.str());
2317   }
2318   sq_remove(v, -2); // remove object name
2319
2320   if(setup_releasehook) {
2321     sq_setreleasehook(v, -1, Player_release_hook);
2322   }
2323
2324   sq_remove(v, -2); // remove root table
2325 }
2326
2327 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
2328 {
2329   using namespace Wrapper;
2330
2331   sq_pushroottable(v);
2332   sq_pushstring(v, "FloatingImage", -1);
2333   if(SQ_FAILED(sq_get(v, -2))) {
2334     std::ostringstream msg;
2335     msg << "Couldn't resolved squirrel type 'FloatingImage'";
2336     throw SquirrelError(v, msg.str());
2337   }
2338
2339   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2340     std::ostringstream msg;
2341     msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
2342     throw SquirrelError(v, msg.str());
2343   }
2344   sq_remove(v, -2); // remove object name
2345
2346   if(setup_releasehook) {
2347     sq_setreleasehook(v, -1, FloatingImage_release_hook);
2348   }
2349
2350   sq_remove(v, -2); // remove root table
2351 }
2352
2353 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
2354 {
2355   using namespace Wrapper;
2356
2357   sq_pushroottable(v);
2358   sq_pushstring(v, "Platform", -1);
2359   if(SQ_FAILED(sq_get(v, -2))) {
2360     std::ostringstream msg;
2361     msg << "Couldn't resolved squirrel type 'Platform'";
2362     throw SquirrelError(v, msg.str());
2363   }
2364
2365   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
2366     std::ostringstream msg;
2367     msg << "Couldn't setup squirrel instance for object of type 'Platform'";
2368     throw SquirrelError(v, msg.str());
2369   }
2370   sq_remove(v, -2); // remove object name
2371
2372   if(setup_releasehook) {
2373     sq_setreleasehook(v, -1, Platform_release_hook);
2374   }
2375
2376   sq_remove(v, -2); // remove root table
2377 }
2378
2379 void register_supertux_wrapper(HSQUIRRELVM v)
2380 {
2381   using namespace Wrapper;
2382
2383   sq_pushstring(v, "ANCHOR_TOP", -1);
2384   sq_pushinteger(v, 16);
2385   if(SQ_FAILED(sq_createslot(v, -3))) {
2386     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
2387   }
2388
2389   sq_pushstring(v, "ANCHOR_BOTTOM", -1);
2390   sq_pushinteger(v, 32);
2391   if(SQ_FAILED(sq_createslot(v, -3))) {
2392     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
2393   }
2394
2395   sq_pushstring(v, "ANCHOR_LEFT", -1);
2396   sq_pushinteger(v, 1);
2397   if(SQ_FAILED(sq_createslot(v, -3))) {
2398     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
2399   }
2400
2401   sq_pushstring(v, "ANCHOR_RIGHT", -1);
2402   sq_pushinteger(v, 2);
2403   if(SQ_FAILED(sq_createslot(v, -3))) {
2404     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
2405   }
2406
2407   sq_pushstring(v, "ANCHOR_MIDDLE", -1);
2408   sq_pushinteger(v, 0);
2409   if(SQ_FAILED(sq_createslot(v, -3))) {
2410     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
2411   }
2412
2413   sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
2414   sq_pushinteger(v, 17);
2415   if(SQ_FAILED(sq_createslot(v, -3))) {
2416     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
2417   }
2418
2419   sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
2420   sq_pushinteger(v, 18);
2421   if(SQ_FAILED(sq_createslot(v, -3))) {
2422     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
2423   }
2424
2425   sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
2426   sq_pushinteger(v, 33);
2427   if(SQ_FAILED(sq_createslot(v, -3))) {
2428     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
2429   }
2430
2431   sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
2432   sq_pushinteger(v, 34);
2433   if(SQ_FAILED(sq_createslot(v, -3))) {
2434     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
2435   }
2436
2437   sq_pushstring(v, "display", -1);
2438   sq_newclosure(v, &display_wrapper, 0);
2439   if(SQ_FAILED(sq_createslot(v, -3))) {
2440     throw SquirrelError(v, "Couldn't register function 'display'");
2441   }
2442
2443   sq_pushstring(v, "print_stacktrace", -1);
2444   sq_newclosure(v, &print_stacktrace_wrapper, 0);
2445   if(SQ_FAILED(sq_createslot(v, -3))) {
2446     throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
2447   }
2448
2449   sq_pushstring(v, "get_current_thread", -1);
2450   sq_newclosure(v, &get_current_thread_wrapper, 0);
2451   if(SQ_FAILED(sq_createslot(v, -3))) {
2452     throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
2453   }
2454
2455   sq_pushstring(v, "display_text_file", -1);
2456   sq_newclosure(v, &display_text_file_wrapper, 0);
2457   if(SQ_FAILED(sq_createslot(v, -3))) {
2458     throw SquirrelError(v, "Couldn't register function 'display_text_file'");
2459   }
2460
2461   sq_pushstring(v, "load_worldmap", -1);
2462   sq_newclosure(v, &load_worldmap_wrapper, 0);
2463   if(SQ_FAILED(sq_createslot(v, -3))) {
2464     throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
2465   }
2466
2467   sq_pushstring(v, "load_level", -1);
2468   sq_newclosure(v, &load_level_wrapper, 0);
2469   if(SQ_FAILED(sq_createslot(v, -3))) {
2470     throw SquirrelError(v, "Couldn't register function 'load_level'");
2471   }
2472
2473   sq_pushstring(v, "wait", -1);
2474   sq_newclosure(v, &wait_wrapper, 0);
2475   if(SQ_FAILED(sq_createslot(v, -3))) {
2476     throw SquirrelError(v, "Couldn't register function 'wait'");
2477   }
2478
2479   sq_pushstring(v, "wait_for_screenswitch", -1);
2480   sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
2481   if(SQ_FAILED(sq_createslot(v, -3))) {
2482     throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
2483   }
2484
2485   sq_pushstring(v, "exit_screen", -1);
2486   sq_newclosure(v, &exit_screen_wrapper, 0);
2487   if(SQ_FAILED(sq_createslot(v, -3))) {
2488     throw SquirrelError(v, "Couldn't register function 'exit_screen'");
2489   }
2490
2491   sq_pushstring(v, "fadeout_screen", -1);
2492   sq_newclosure(v, &fadeout_screen_wrapper, 0);
2493   if(SQ_FAILED(sq_createslot(v, -3))) {
2494     throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
2495   }
2496
2497   sq_pushstring(v, "shrink_screen", -1);
2498   sq_newclosure(v, &shrink_screen_wrapper, 0);
2499   if(SQ_FAILED(sq_createslot(v, -3))) {
2500     throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
2501   }
2502
2503   sq_pushstring(v, "translate", -1);
2504   sq_newclosure(v, &translate_wrapper, 0);
2505   if(SQ_FAILED(sq_createslot(v, -3))) {
2506     throw SquirrelError(v, "Couldn't register function 'translate'");
2507   }
2508
2509   sq_pushstring(v, "import", -1);
2510   sq_newclosure(v, &import_wrapper, 0);
2511   if(SQ_FAILED(sq_createslot(v, -3))) {
2512     throw SquirrelError(v, "Couldn't register function 'import'");
2513   }
2514
2515   sq_pushstring(v, "save_state", -1);
2516   sq_newclosure(v, &save_state_wrapper, 0);
2517   if(SQ_FAILED(sq_createslot(v, -3))) {
2518     throw SquirrelError(v, "Couldn't register function 'save_state'");
2519   }
2520
2521   sq_pushstring(v, "debug_collrects", -1);
2522   sq_newclosure(v, &debug_collrects_wrapper, 0);
2523   if(SQ_FAILED(sq_createslot(v, -3))) {
2524     throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
2525   }
2526
2527   sq_pushstring(v, "debug_draw_fps", -1);
2528   sq_newclosure(v, &debug_draw_fps_wrapper, 0);
2529   if(SQ_FAILED(sq_createslot(v, -3))) {
2530     throw SquirrelError(v, "Couldn't register function 'debug_draw_fps'");
2531   }
2532
2533   sq_pushstring(v, "debug_draw_solids_only", -1);
2534   sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
2535   if(SQ_FAILED(sq_createslot(v, -3))) {
2536     throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
2537   }
2538
2539   sq_pushstring(v, "play_music", -1);
2540   sq_newclosure(v, &play_music_wrapper, 0);
2541   if(SQ_FAILED(sq_createslot(v, -3))) {
2542     throw SquirrelError(v, "Couldn't register function 'play_music'");
2543   }
2544
2545   sq_pushstring(v, "play_sound", -1);
2546   sq_newclosure(v, &play_sound_wrapper, 0);
2547   if(SQ_FAILED(sq_createslot(v, -3))) {
2548     throw SquirrelError(v, "Couldn't register function 'play_sound'");
2549   }
2550
2551   sq_pushstring(v, "grease", -1);
2552   sq_newclosure(v, &grease_wrapper, 0);
2553   if(SQ_FAILED(sq_createslot(v, -3))) {
2554     throw SquirrelError(v, "Couldn't register function 'grease'");
2555   }
2556
2557   sq_pushstring(v, "invincible", -1);
2558   sq_newclosure(v, &invincible_wrapper, 0);
2559   if(SQ_FAILED(sq_createslot(v, -3))) {
2560     throw SquirrelError(v, "Couldn't register function 'invincible'");
2561   }
2562
2563   sq_pushstring(v, "mortal", -1);
2564   sq_newclosure(v, &mortal_wrapper, 0);
2565   if(SQ_FAILED(sq_createslot(v, -3))) {
2566     throw SquirrelError(v, "Couldn't register function 'mortal'");
2567   }
2568
2569   sq_pushstring(v, "restart", -1);
2570   sq_newclosure(v, &restart_wrapper, 0);
2571   if(SQ_FAILED(sq_createslot(v, -3))) {
2572     throw SquirrelError(v, "Couldn't register function 'restart'");
2573   }
2574
2575   sq_pushstring(v, "whereami", -1);
2576   sq_newclosure(v, &whereami_wrapper, 0);
2577   if(SQ_FAILED(sq_createslot(v, -3))) {
2578     throw SquirrelError(v, "Couldn't register function 'whereami'");
2579   }
2580
2581   sq_pushstring(v, "gotoend", -1);
2582   sq_newclosure(v, &gotoend_wrapper, 0);
2583   if(SQ_FAILED(sq_createslot(v, -3))) {
2584     throw SquirrelError(v, "Couldn't register function 'gotoend'");
2585   }
2586
2587   sq_pushstring(v, "camera", -1);
2588   sq_newclosure(v, &camera_wrapper, 0);
2589   if(SQ_FAILED(sq_createslot(v, -3))) {
2590     throw SquirrelError(v, "Couldn't register function 'camera'");
2591   }
2592
2593   sq_pushstring(v, "quit", -1);
2594   sq_newclosure(v, &quit_wrapper, 0);
2595   if(SQ_FAILED(sq_createslot(v, -3))) {
2596     throw SquirrelError(v, "Couldn't register function 'quit'");
2597   }
2598
2599   sq_pushstring(v, "rand", -1);
2600   sq_newclosure(v, &rand_wrapper, 0);
2601   if(SQ_FAILED(sq_createslot(v, -3))) {
2602     throw SquirrelError(v, "Couldn't register function 'rand'");
2603   }
2604
2605   // Register class DisplayEffect
2606   sq_pushstring(v, "DisplayEffect", -1);
2607   if(sq_newclass(v, SQFalse) < 0) {
2608     std::ostringstream msg;
2609     msg << "Couldn't create new class 'DisplayEffect'";
2610     throw SquirrelError(v, msg.str());
2611   }
2612   sq_pushstring(v, "fade_out", -1);
2613   sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
2614   if(SQ_FAILED(sq_createslot(v, -3))) {
2615     throw SquirrelError(v, "Couldn't register function 'fade_out'");
2616   }
2617
2618   sq_pushstring(v, "fade_in", -1);
2619   sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
2620   if(SQ_FAILED(sq_createslot(v, -3))) {
2621     throw SquirrelError(v, "Couldn't register function 'fade_in'");
2622   }
2623
2624   sq_pushstring(v, "set_black", -1);
2625   sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
2626   if(SQ_FAILED(sq_createslot(v, -3))) {
2627     throw SquirrelError(v, "Couldn't register function 'set_black'");
2628   }
2629
2630   sq_pushstring(v, "is_black", -1);
2631   sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
2632   if(SQ_FAILED(sq_createslot(v, -3))) {
2633     throw SquirrelError(v, "Couldn't register function 'is_black'");
2634   }
2635
2636   sq_pushstring(v, "sixteen_to_nine", -1);
2637   sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
2638   if(SQ_FAILED(sq_createslot(v, -3))) {
2639     throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
2640   }
2641
2642   sq_pushstring(v, "four_to_three", -1);
2643   sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
2644   if(SQ_FAILED(sq_createslot(v, -3))) {
2645     throw SquirrelError(v, "Couldn't register function 'four_to_three'");
2646   }
2647
2648   if(SQ_FAILED(sq_createslot(v, -3))) {
2649     throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
2650   }
2651
2652   // Register class Camera
2653   sq_pushstring(v, "Camera", -1);
2654   if(sq_newclass(v, SQFalse) < 0) {
2655     std::ostringstream msg;
2656     msg << "Couldn't create new class 'Camera'";
2657     throw SquirrelError(v, msg.str());
2658   }
2659   sq_pushstring(v, "shake", -1);
2660   sq_newclosure(v, &Camera_shake_wrapper, 0);
2661   if(SQ_FAILED(sq_createslot(v, -3))) {
2662     throw SquirrelError(v, "Couldn't register function 'shake'");
2663   }
2664
2665   sq_pushstring(v, "set_pos", -1);
2666   sq_newclosure(v, &Camera_set_pos_wrapper, 0);
2667   if(SQ_FAILED(sq_createslot(v, -3))) {
2668     throw SquirrelError(v, "Couldn't register function 'set_pos'");
2669   }
2670
2671   sq_pushstring(v, "set_mode", -1);
2672   sq_newclosure(v, &Camera_set_mode_wrapper, 0);
2673   if(SQ_FAILED(sq_createslot(v, -3))) {
2674     throw SquirrelError(v, "Couldn't register function 'set_mode'");
2675   }
2676
2677   sq_pushstring(v, "scroll_to", -1);
2678   sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
2679   if(SQ_FAILED(sq_createslot(v, -3))) {
2680     throw SquirrelError(v, "Couldn't register function 'scroll_to'");
2681   }
2682
2683   if(SQ_FAILED(sq_createslot(v, -3))) {
2684     throw SquirrelError(v, "Couldn't register class 'Camera'");
2685   }
2686
2687   // Register class Level
2688   sq_pushstring(v, "Level", -1);
2689   if(sq_newclass(v, SQFalse) < 0) {
2690     std::ostringstream msg;
2691     msg << "Couldn't create new class 'Level'";
2692     throw SquirrelError(v, msg.str());
2693   }
2694   sq_pushstring(v, "finish", -1);
2695   sq_newclosure(v, &Level_finish_wrapper, 0);
2696   if(SQ_FAILED(sq_createslot(v, -3))) {
2697     throw SquirrelError(v, "Couldn't register function 'finish'");
2698   }
2699
2700   sq_pushstring(v, "spawn", -1);
2701   sq_newclosure(v, &Level_spawn_wrapper, 0);
2702   if(SQ_FAILED(sq_createslot(v, -3))) {
2703     throw SquirrelError(v, "Couldn't register function 'spawn'");
2704   }
2705
2706   sq_pushstring(v, "flip_vertically", -1);
2707   sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
2708   if(SQ_FAILED(sq_createslot(v, -3))) {
2709     throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
2710   }
2711
2712   sq_pushstring(v, "toggle_pause", -1);
2713   sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
2714   if(SQ_FAILED(sq_createslot(v, -3))) {
2715     throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
2716   }
2717
2718   if(SQ_FAILED(sq_createslot(v, -3))) {
2719     throw SquirrelError(v, "Couldn't register class 'Level'");
2720   }
2721
2722   // Register class ScriptedObject
2723   sq_pushstring(v, "ScriptedObject", -1);
2724   if(sq_newclass(v, SQFalse) < 0) {
2725     std::ostringstream msg;
2726     msg << "Couldn't create new class 'ScriptedObject'";
2727     throw SquirrelError(v, msg.str());
2728   }
2729   sq_pushstring(v, "set_action", -1);
2730   sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
2731   if(SQ_FAILED(sq_createslot(v, -3))) {
2732     throw SquirrelError(v, "Couldn't register function 'set_action'");
2733   }
2734
2735   sq_pushstring(v, "get_action", -1);
2736   sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
2737   if(SQ_FAILED(sq_createslot(v, -3))) {
2738     throw SquirrelError(v, "Couldn't register function 'get_action'");
2739   }
2740
2741   sq_pushstring(v, "move", -1);
2742   sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
2743   if(SQ_FAILED(sq_createslot(v, -3))) {
2744     throw SquirrelError(v, "Couldn't register function 'move'");
2745   }
2746
2747   sq_pushstring(v, "set_pos", -1);
2748   sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
2749   if(SQ_FAILED(sq_createslot(v, -3))) {
2750     throw SquirrelError(v, "Couldn't register function 'set_pos'");
2751   }
2752
2753   sq_pushstring(v, "get_pos_x", -1);
2754   sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
2755   if(SQ_FAILED(sq_createslot(v, -3))) {
2756     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
2757   }
2758
2759   sq_pushstring(v, "get_pos_y", -1);
2760   sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
2761   if(SQ_FAILED(sq_createslot(v, -3))) {
2762     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
2763   }
2764
2765   sq_pushstring(v, "set_velocity", -1);
2766   sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
2767   if(SQ_FAILED(sq_createslot(v, -3))) {
2768     throw SquirrelError(v, "Couldn't register function 'set_velocity'");
2769   }
2770
2771   sq_pushstring(v, "get_velocity_x", -1);
2772   sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
2773   if(SQ_FAILED(sq_createslot(v, -3))) {
2774     throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
2775   }
2776
2777   sq_pushstring(v, "get_velocity_y", -1);
2778   sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
2779   if(SQ_FAILED(sq_createslot(v, -3))) {
2780     throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
2781   }
2782
2783   sq_pushstring(v, "set_visible", -1);
2784   sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
2785   if(SQ_FAILED(sq_createslot(v, -3))) {
2786     throw SquirrelError(v, "Couldn't register function 'set_visible'");
2787   }
2788
2789   sq_pushstring(v, "is_visible", -1);
2790   sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
2791   if(SQ_FAILED(sq_createslot(v, -3))) {
2792     throw SquirrelError(v, "Couldn't register function 'is_visible'");
2793   }
2794
2795   sq_pushstring(v, "get_name", -1);
2796   sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
2797   if(SQ_FAILED(sq_createslot(v, -3))) {
2798     throw SquirrelError(v, "Couldn't register function 'get_name'");
2799   }
2800
2801   if(SQ_FAILED(sq_createslot(v, -3))) {
2802     throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
2803   }
2804
2805   // Register class Text
2806   sq_pushstring(v, "Text", -1);
2807   if(sq_newclass(v, SQFalse) < 0) {
2808     std::ostringstream msg;
2809     msg << "Couldn't create new class 'Text'";
2810     throw SquirrelError(v, msg.str());
2811   }
2812   sq_pushstring(v, "set_text", -1);
2813   sq_newclosure(v, &Text_set_text_wrapper, 0);
2814   if(SQ_FAILED(sq_createslot(v, -3))) {
2815     throw SquirrelError(v, "Couldn't register function 'set_text'");
2816   }
2817
2818   sq_pushstring(v, "set_font", -1);
2819   sq_newclosure(v, &Text_set_font_wrapper, 0);
2820   if(SQ_FAILED(sq_createslot(v, -3))) {
2821     throw SquirrelError(v, "Couldn't register function 'set_font'");
2822   }
2823
2824   sq_pushstring(v, "fade_in", -1);
2825   sq_newclosure(v, &Text_fade_in_wrapper, 0);
2826   if(SQ_FAILED(sq_createslot(v, -3))) {
2827     throw SquirrelError(v, "Couldn't register function 'fade_in'");
2828   }
2829
2830   sq_pushstring(v, "fade_out", -1);
2831   sq_newclosure(v, &Text_fade_out_wrapper, 0);
2832   if(SQ_FAILED(sq_createslot(v, -3))) {
2833     throw SquirrelError(v, "Couldn't register function 'fade_out'");
2834   }
2835
2836   sq_pushstring(v, "set_visible", -1);
2837   sq_newclosure(v, &Text_set_visible_wrapper, 0);
2838   if(SQ_FAILED(sq_createslot(v, -3))) {
2839     throw SquirrelError(v, "Couldn't register function 'set_visible'");
2840   }
2841
2842   sq_pushstring(v, "set_centered", -1);
2843   sq_newclosure(v, &Text_set_centered_wrapper, 0);
2844   if(SQ_FAILED(sq_createslot(v, -3))) {
2845     throw SquirrelError(v, "Couldn't register function 'set_centered'");
2846   }
2847
2848   if(SQ_FAILED(sq_createslot(v, -3))) {
2849     throw SquirrelError(v, "Couldn't register class 'Text'");
2850   }
2851
2852   // Register class Player
2853   sq_pushstring(v, "Player", -1);
2854   if(sq_newclass(v, SQFalse) < 0) {
2855     std::ostringstream msg;
2856     msg << "Couldn't create new class 'Player'";
2857     throw SquirrelError(v, msg.str());
2858   }
2859   sq_pushstring(v, "add_bonus", -1);
2860   sq_newclosure(v, &Player_add_bonus_wrapper, 0);
2861   if(SQ_FAILED(sq_createslot(v, -3))) {
2862     throw SquirrelError(v, "Couldn't register function 'add_bonus'");
2863   }
2864
2865   sq_pushstring(v, "add_coins", -1);
2866   sq_newclosure(v, &Player_add_coins_wrapper, 0);
2867   if(SQ_FAILED(sq_createslot(v, -3))) {
2868     throw SquirrelError(v, "Couldn't register function 'add_coins'");
2869   }
2870
2871   sq_pushstring(v, "make_invincible", -1);
2872   sq_newclosure(v, &Player_make_invincible_wrapper, 0);
2873   if(SQ_FAILED(sq_createslot(v, -3))) {
2874     throw SquirrelError(v, "Couldn't register function 'make_invincible'");
2875   }
2876
2877   sq_pushstring(v, "deactivate", -1);
2878   sq_newclosure(v, &Player_deactivate_wrapper, 0);
2879   if(SQ_FAILED(sq_createslot(v, -3))) {
2880     throw SquirrelError(v, "Couldn't register function 'deactivate'");
2881   }
2882
2883   sq_pushstring(v, "activate", -1);
2884   sq_newclosure(v, &Player_activate_wrapper, 0);
2885   if(SQ_FAILED(sq_createslot(v, -3))) {
2886     throw SquirrelError(v, "Couldn't register function 'activate'");
2887   }
2888
2889   sq_pushstring(v, "walk", -1);
2890   sq_newclosure(v, &Player_walk_wrapper, 0);
2891   if(SQ_FAILED(sq_createslot(v, -3))) {
2892     throw SquirrelError(v, "Couldn't register function 'walk'");
2893   }
2894
2895   sq_pushstring(v, "set_visible", -1);
2896   sq_newclosure(v, &Player_set_visible_wrapper, 0);
2897   if(SQ_FAILED(sq_createslot(v, -3))) {
2898     throw SquirrelError(v, "Couldn't register function 'set_visible'");
2899   }
2900
2901   sq_pushstring(v, "get_visible", -1);
2902   sq_newclosure(v, &Player_get_visible_wrapper, 0);
2903   if(SQ_FAILED(sq_createslot(v, -3))) {
2904     throw SquirrelError(v, "Couldn't register function 'get_visible'");
2905   }
2906
2907   sq_pushstring(v, "kill", -1);
2908   sq_newclosure(v, &Player_kill_wrapper, 0);
2909   if(SQ_FAILED(sq_createslot(v, -3))) {
2910     throw SquirrelError(v, "Couldn't register function 'kill'");
2911   }
2912
2913   if(SQ_FAILED(sq_createslot(v, -3))) {
2914     throw SquirrelError(v, "Couldn't register class 'Player'");
2915   }
2916
2917   // Register class FloatingImage
2918   sq_pushstring(v, "FloatingImage", -1);
2919   if(sq_newclass(v, SQFalse) < 0) {
2920     std::ostringstream msg;
2921     msg << "Couldn't create new class 'FloatingImage'";
2922     throw SquirrelError(v, msg.str());
2923   }
2924   sq_pushstring(v, "constructor", -1);
2925   sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
2926   if(SQ_FAILED(sq_createslot(v, -3))) {
2927     throw SquirrelError(v, "Couldn't register function 'constructor'");
2928   }
2929
2930   sq_pushstring(v, "set_layer", -1);
2931   sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
2932   if(SQ_FAILED(sq_createslot(v, -3))) {
2933     throw SquirrelError(v, "Couldn't register function 'set_layer'");
2934   }
2935
2936   sq_pushstring(v, "get_layer", -1);
2937   sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
2938   if(SQ_FAILED(sq_createslot(v, -3))) {
2939     throw SquirrelError(v, "Couldn't register function 'get_layer'");
2940   }
2941
2942   sq_pushstring(v, "set_pos", -1);
2943   sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
2944   if(SQ_FAILED(sq_createslot(v, -3))) {
2945     throw SquirrelError(v, "Couldn't register function 'set_pos'");
2946   }
2947
2948   sq_pushstring(v, "get_pos_x", -1);
2949   sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
2950   if(SQ_FAILED(sq_createslot(v, -3))) {
2951     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
2952   }
2953
2954   sq_pushstring(v, "get_pos_y", -1);
2955   sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
2956   if(SQ_FAILED(sq_createslot(v, -3))) {
2957     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
2958   }
2959
2960   sq_pushstring(v, "set_anchor_point", -1);
2961   sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
2962   if(SQ_FAILED(sq_createslot(v, -3))) {
2963     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
2964   }
2965
2966   sq_pushstring(v, "get_anchor_point", -1);
2967   sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
2968   if(SQ_FAILED(sq_createslot(v, -3))) {
2969     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
2970   }
2971
2972   sq_pushstring(v, "set_visible", -1);
2973   sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
2974   if(SQ_FAILED(sq_createslot(v, -3))) {
2975     throw SquirrelError(v, "Couldn't register function 'set_visible'");
2976   }
2977
2978   sq_pushstring(v, "get_visible", -1);
2979   sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
2980   if(SQ_FAILED(sq_createslot(v, -3))) {
2981     throw SquirrelError(v, "Couldn't register function 'get_visible'");
2982   }
2983
2984   sq_pushstring(v, "set_action", -1);
2985   sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
2986   if(SQ_FAILED(sq_createslot(v, -3))) {
2987     throw SquirrelError(v, "Couldn't register function 'set_action'");
2988   }
2989
2990   sq_pushstring(v, "get_action", -1);
2991   sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
2992   if(SQ_FAILED(sq_createslot(v, -3))) {
2993     throw SquirrelError(v, "Couldn't register function 'get_action'");
2994   }
2995
2996   if(SQ_FAILED(sq_createslot(v, -3))) {
2997     throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
2998   }
2999
3000   // Register class Platform
3001   sq_pushstring(v, "Platform", -1);
3002   if(sq_newclass(v, SQFalse) < 0) {
3003     std::ostringstream msg;
3004     msg << "Couldn't create new class 'Platform'";
3005     throw SquirrelError(v, msg.str());
3006   }
3007   sq_pushstring(v, "goto_node", -1);
3008   sq_newclosure(v, &Platform_goto_node_wrapper, 0);
3009   if(SQ_FAILED(sq_createslot(v, -3))) {
3010     throw SquirrelError(v, "Couldn't register function 'goto_node'");
3011   }
3012
3013   sq_pushstring(v, "start_moving", -1);
3014   sq_newclosure(v, &Platform_start_moving_wrapper, 0);
3015   if(SQ_FAILED(sq_createslot(v, -3))) {
3016     throw SquirrelError(v, "Couldn't register function 'start_moving'");
3017   }
3018
3019   sq_pushstring(v, "stop_moving", -1);
3020   sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
3021   if(SQ_FAILED(sq_createslot(v, -3))) {
3022     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
3023   }
3024
3025   if(SQ_FAILED(sq_createslot(v, -3))) {
3026     throw SquirrelError(v, "Couldn't register class 'Platform'");
3027   }
3028
3029 }
3030
3031 } // end of namespace Scripting
3032