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