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