experimental code to influence camera, adjusted some parameters, tried to improve...
[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_reload_config_wrapper(HSQUIRRELVM vm)
206 {
207   SQUserPointer data;
208   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
209     sq_throwerror(vm, _SC("'reload_config' called without instance"));
210     return SQ_ERROR;
211   }
212   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
213
214   try {
215     _this->reload_config();
216
217     return 0;
218
219   } catch(std::exception& e) {
220     sq_throwerror(vm, e.what());
221     return SQ_ERROR;
222   } catch(...) {
223     sq_throwerror(vm, _SC("Unexpected exception while executing function 'reload_config'"));
224     return SQ_ERROR;
225   }
226
227 }
228
229 static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm)
230 {
231   SQUserPointer data;
232   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
233     sq_throwerror(vm, _SC("'shake' called without instance"));
234     return SQ_ERROR;
235   }
236   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
237   SQFloat arg0;
238   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
239     sq_throwerror(vm, _SC("Argument 1 not a float"));
240     return SQ_ERROR;
241   }
242   SQFloat arg1;
243   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
244     sq_throwerror(vm, _SC("Argument 2 not a float"));
245     return SQ_ERROR;
246   }
247   SQFloat arg2;
248   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
249     sq_throwerror(vm, _SC("Argument 3 not a float"));
250     return SQ_ERROR;
251   }
252
253   try {
254     _this->shake(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
255
256     return 0;
257
258   } catch(std::exception& e) {
259     sq_throwerror(vm, e.what());
260     return SQ_ERROR;
261   } catch(...) {
262     sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'"));
263     return SQ_ERROR;
264   }
265
266 }
267
268 static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm)
269 {
270   SQUserPointer data;
271   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
272     sq_throwerror(vm, _SC("'set_pos' called without instance"));
273     return SQ_ERROR;
274   }
275   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
276   SQFloat arg0;
277   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
278     sq_throwerror(vm, _SC("Argument 1 not a float"));
279     return SQ_ERROR;
280   }
281   SQFloat arg1;
282   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
283     sq_throwerror(vm, _SC("Argument 2 not a float"));
284     return SQ_ERROR;
285   }
286
287   try {
288     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
289
290     return 0;
291
292   } catch(std::exception& e) {
293     sq_throwerror(vm, e.what());
294     return SQ_ERROR;
295   } catch(...) {
296     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
297     return SQ_ERROR;
298   }
299
300 }
301
302 static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm)
303 {
304   SQUserPointer data;
305   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
306     sq_throwerror(vm, _SC("'set_mode' called without instance"));
307     return SQ_ERROR;
308   }
309   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
310   const SQChar* arg0;
311   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
312     sq_throwerror(vm, _SC("Argument 1 not a string"));
313     return SQ_ERROR;
314   }
315
316   try {
317     _this->set_mode(arg0);
318
319     return 0;
320
321   } catch(std::exception& e) {
322     sq_throwerror(vm, e.what());
323     return SQ_ERROR;
324   } catch(...) {
325     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_mode'"));
326     return SQ_ERROR;
327   }
328
329 }
330
331 static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm)
332 {
333   SQUserPointer data;
334   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
335     sq_throwerror(vm, _SC("'scroll_to' called without instance"));
336     return SQ_ERROR;
337   }
338   Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
339   SQFloat arg0;
340   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
341     sq_throwerror(vm, _SC("Argument 1 not a float"));
342     return SQ_ERROR;
343   }
344   SQFloat arg1;
345   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
346     sq_throwerror(vm, _SC("Argument 2 not a float"));
347     return SQ_ERROR;
348   }
349   SQFloat arg2;
350   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
351     sq_throwerror(vm, _SC("Argument 3 not a float"));
352     return SQ_ERROR;
353   }
354
355   try {
356     _this->scroll_to(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
357
358     return 0;
359
360   } catch(std::exception& e) {
361     sq_throwerror(vm, e.what());
362     return SQ_ERROR;
363   } catch(...) {
364     sq_throwerror(vm, _SC("Unexpected exception while executing function 'scroll_to'"));
365     return SQ_ERROR;
366   }
367
368 }
369
370 static SQInteger Level_release_hook(SQUserPointer ptr, SQInteger )
371 {
372   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (ptr);
373   delete _this;
374   return 0;
375 }
376
377 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
378 {
379   SQUserPointer data;
380   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
381     sq_throwerror(vm, _SC("'finish' called without instance"));
382     return SQ_ERROR;
383   }
384   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
385   SQBool arg0;
386   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
387     sq_throwerror(vm, _SC("Argument 1 not a bool"));
388     return SQ_ERROR;
389   }
390
391   try {
392     _this->finish(arg0 == SQTrue);
393
394     return 0;
395
396   } catch(std::exception& e) {
397     sq_throwerror(vm, e.what());
398     return SQ_ERROR;
399   } catch(...) {
400     sq_throwerror(vm, _SC("Unexpected exception while executing function 'finish'"));
401     return SQ_ERROR;
402   }
403
404 }
405
406 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
407 {
408   SQUserPointer data;
409   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
410     sq_throwerror(vm, _SC("'spawn' called without instance"));
411     return SQ_ERROR;
412   }
413   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
414   const SQChar* arg0;
415   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
416     sq_throwerror(vm, _SC("Argument 1 not a string"));
417     return SQ_ERROR;
418   }
419   const SQChar* arg1;
420   if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
421     sq_throwerror(vm, _SC("Argument 2 not a string"));
422     return SQ_ERROR;
423   }
424
425   try {
426     _this->spawn(arg0, arg1);
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 'spawn'"));
435     return SQ_ERROR;
436   }
437
438 }
439
440 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
441 {
442   SQUserPointer data;
443   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
444     sq_throwerror(vm, _SC("'flip_vertically' called without instance"));
445     return SQ_ERROR;
446   }
447   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
448
449   try {
450     _this->flip_vertically();
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 'flip_vertically'"));
459     return SQ_ERROR;
460   }
461
462 }
463
464 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
465 {
466   SQUserPointer data;
467   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
468     sq_throwerror(vm, _SC("'toggle_pause' called without instance"));
469     return SQ_ERROR;
470   }
471   Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
472
473   try {
474     _this->toggle_pause();
475
476     return 0;
477
478   } catch(std::exception& e) {
479     sq_throwerror(vm, e.what());
480     return SQ_ERROR;
481   } catch(...) {
482     sq_throwerror(vm, _SC("Unexpected exception while executing function 'toggle_pause'"));
483     return SQ_ERROR;
484   }
485
486 }
487
488 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
489 {
490   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
491   delete _this;
492   return 0;
493 }
494
495 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
496 {
497   SQUserPointer data;
498   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
499     sq_throwerror(vm, _SC("'set_action' called without instance"));
500     return SQ_ERROR;
501   }
502   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
503   const SQChar* arg0;
504   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
505     sq_throwerror(vm, _SC("Argument 1 not a string"));
506     return SQ_ERROR;
507   }
508
509   try {
510     _this->set_action(arg0);
511
512     return 0;
513
514   } catch(std::exception& e) {
515     sq_throwerror(vm, e.what());
516     return SQ_ERROR;
517   } catch(...) {
518     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
519     return SQ_ERROR;
520   }
521
522 }
523
524 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
525 {
526   SQUserPointer data;
527   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
528     sq_throwerror(vm, _SC("'get_action' called without instance"));
529     return SQ_ERROR;
530   }
531   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
532
533   try {
534     std::string return_value = _this->get_action();
535
536     sq_pushstring(vm, return_value.c_str(), return_value.size());
537     return 1;
538
539   } catch(std::exception& e) {
540     sq_throwerror(vm, e.what());
541     return SQ_ERROR;
542   } catch(...) {
543     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
544     return SQ_ERROR;
545   }
546
547 }
548
549 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
550 {
551   SQUserPointer data;
552   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
553     sq_throwerror(vm, _SC("'move' called without instance"));
554     return SQ_ERROR;
555   }
556   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
557   SQFloat arg0;
558   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
559     sq_throwerror(vm, _SC("Argument 1 not a float"));
560     return SQ_ERROR;
561   }
562   SQFloat arg1;
563   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
564     sq_throwerror(vm, _SC("Argument 2 not a float"));
565     return SQ_ERROR;
566   }
567
568   try {
569     _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
570
571     return 0;
572
573   } catch(std::exception& e) {
574     sq_throwerror(vm, e.what());
575     return SQ_ERROR;
576   } catch(...) {
577     sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
578     return SQ_ERROR;
579   }
580
581 }
582
583 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
584 {
585   SQUserPointer data;
586   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
587     sq_throwerror(vm, _SC("'set_pos' called without instance"));
588     return SQ_ERROR;
589   }
590   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
591   SQFloat arg0;
592   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
593     sq_throwerror(vm, _SC("Argument 1 not a float"));
594     return SQ_ERROR;
595   }
596   SQFloat arg1;
597   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
598     sq_throwerror(vm, _SC("Argument 2 not a float"));
599     return SQ_ERROR;
600   }
601
602   try {
603     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
604
605     return 0;
606
607   } catch(std::exception& e) {
608     sq_throwerror(vm, e.what());
609     return SQ_ERROR;
610   } catch(...) {
611     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
612     return SQ_ERROR;
613   }
614
615 }
616
617 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
618 {
619   SQUserPointer data;
620   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
621     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
622     return SQ_ERROR;
623   }
624   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
625
626   try {
627     float return_value = _this->get_pos_x();
628
629     sq_pushfloat(vm, return_value);
630     return 1;
631
632   } catch(std::exception& e) {
633     sq_throwerror(vm, e.what());
634     return SQ_ERROR;
635   } catch(...) {
636     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
637     return SQ_ERROR;
638   }
639
640 }
641
642 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
643 {
644   SQUserPointer data;
645   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
646     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
647     return SQ_ERROR;
648   }
649   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
650
651   try {
652     float return_value = _this->get_pos_y();
653
654     sq_pushfloat(vm, return_value);
655     return 1;
656
657   } catch(std::exception& e) {
658     sq_throwerror(vm, e.what());
659     return SQ_ERROR;
660   } catch(...) {
661     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
662     return SQ_ERROR;
663   }
664
665 }
666
667 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
668 {
669   SQUserPointer data;
670   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
671     sq_throwerror(vm, _SC("'set_velocity' called without instance"));
672     return SQ_ERROR;
673   }
674   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
675   SQFloat arg0;
676   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
677     sq_throwerror(vm, _SC("Argument 1 not a float"));
678     return SQ_ERROR;
679   }
680   SQFloat arg1;
681   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
682     sq_throwerror(vm, _SC("Argument 2 not a float"));
683     return SQ_ERROR;
684   }
685
686   try {
687     _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
688
689     return 0;
690
691   } catch(std::exception& e) {
692     sq_throwerror(vm, e.what());
693     return SQ_ERROR;
694   } catch(...) {
695     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_velocity'"));
696     return SQ_ERROR;
697   }
698
699 }
700
701 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
702 {
703   SQUserPointer data;
704   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
705     sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
706     return SQ_ERROR;
707   }
708   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
709
710   try {
711     float return_value = _this->get_velocity_x();
712
713     sq_pushfloat(vm, return_value);
714     return 1;
715
716   } catch(std::exception& e) {
717     sq_throwerror(vm, e.what());
718     return SQ_ERROR;
719   } catch(...) {
720     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
721     return SQ_ERROR;
722   }
723
724 }
725
726 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
727 {
728   SQUserPointer data;
729   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
730     sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
731     return SQ_ERROR;
732   }
733   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
734
735   try {
736     float return_value = _this->get_velocity_y();
737
738     sq_pushfloat(vm, return_value);
739     return 1;
740
741   } catch(std::exception& e) {
742     sq_throwerror(vm, e.what());
743     return SQ_ERROR;
744   } catch(...) {
745     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
746     return SQ_ERROR;
747   }
748
749 }
750
751 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
752 {
753   SQUserPointer data;
754   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
755     sq_throwerror(vm, _SC("'set_visible' called without instance"));
756     return SQ_ERROR;
757   }
758   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
759   SQBool arg0;
760   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
761     sq_throwerror(vm, _SC("Argument 1 not a bool"));
762     return SQ_ERROR;
763   }
764
765   try {
766     _this->set_visible(arg0 == SQTrue);
767
768     return 0;
769
770   } catch(std::exception& e) {
771     sq_throwerror(vm, e.what());
772     return SQ_ERROR;
773   } catch(...) {
774     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
775     return SQ_ERROR;
776   }
777
778 }
779
780 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
781 {
782   SQUserPointer data;
783   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
784     sq_throwerror(vm, _SC("'is_visible' called without instance"));
785     return SQ_ERROR;
786   }
787   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
788
789   try {
790     bool return_value = _this->is_visible();
791
792     sq_pushbool(vm, return_value);
793     return 1;
794
795   } catch(std::exception& e) {
796     sq_throwerror(vm, e.what());
797     return SQ_ERROR;
798   } catch(...) {
799     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
800     return SQ_ERROR;
801   }
802
803 }
804
805 static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm)
806 {
807   SQUserPointer data;
808   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
809     sq_throwerror(vm, _SC("'set_solid' called without instance"));
810     return SQ_ERROR;
811   }
812   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
813   SQBool arg0;
814   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
815     sq_throwerror(vm, _SC("Argument 1 not a bool"));
816     return SQ_ERROR;
817   }
818
819   try {
820     _this->set_solid(arg0 == SQTrue);
821
822     return 0;
823
824   } catch(std::exception& e) {
825     sq_throwerror(vm, e.what());
826     return SQ_ERROR;
827   } catch(...) {
828     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_solid'"));
829     return SQ_ERROR;
830   }
831
832 }
833
834 static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm)
835 {
836   SQUserPointer data;
837   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
838     sq_throwerror(vm, _SC("'is_solid' called without instance"));
839     return SQ_ERROR;
840   }
841   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
842
843   try {
844     bool return_value = _this->is_solid();
845
846     sq_pushbool(vm, return_value);
847     return 1;
848
849   } catch(std::exception& e) {
850     sq_throwerror(vm, e.what());
851     return SQ_ERROR;
852   } catch(...) {
853     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_solid'"));
854     return SQ_ERROR;
855   }
856
857 }
858
859 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
860 {
861   SQUserPointer data;
862   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
863     sq_throwerror(vm, _SC("'get_name' called without instance"));
864     return SQ_ERROR;
865   }
866   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
867
868   try {
869     std::string return_value = _this->get_name();
870
871     sq_pushstring(vm, return_value.c_str(), return_value.size());
872     return 1;
873
874   } catch(std::exception& e) {
875     sq_throwerror(vm, e.what());
876     return SQ_ERROR;
877   } catch(...) {
878     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
879     return SQ_ERROR;
880   }
881
882 }
883
884 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
885 {
886   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
887   delete _this;
888   return 0;
889 }
890
891 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
892 {
893   SQUserPointer data;
894   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
895     sq_throwerror(vm, _SC("'set_text' called without instance"));
896     return SQ_ERROR;
897   }
898   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
899   const SQChar* arg0;
900   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
901     sq_throwerror(vm, _SC("Argument 1 not a string"));
902     return SQ_ERROR;
903   }
904
905   try {
906     _this->set_text(arg0);
907
908     return 0;
909
910   } catch(std::exception& e) {
911     sq_throwerror(vm, e.what());
912     return SQ_ERROR;
913   } catch(...) {
914     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
915     return SQ_ERROR;
916   }
917
918 }
919
920 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
921 {
922   SQUserPointer data;
923   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
924     sq_throwerror(vm, _SC("'set_font' called without instance"));
925     return SQ_ERROR;
926   }
927   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
928   const SQChar* arg0;
929   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
930     sq_throwerror(vm, _SC("Argument 1 not a string"));
931     return SQ_ERROR;
932   }
933
934   try {
935     _this->set_font(arg0);
936
937     return 0;
938
939   } catch(std::exception& e) {
940     sq_throwerror(vm, e.what());
941     return SQ_ERROR;
942   } catch(...) {
943     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
944     return SQ_ERROR;
945   }
946
947 }
948
949 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
950 {
951   SQUserPointer data;
952   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
953     sq_throwerror(vm, _SC("'fade_in' called without instance"));
954     return SQ_ERROR;
955   }
956   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
957   SQFloat arg0;
958   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
959     sq_throwerror(vm, _SC("Argument 1 not a float"));
960     return SQ_ERROR;
961   }
962
963   try {
964     _this->fade_in(static_cast<float> (arg0));
965
966     return 0;
967
968   } catch(std::exception& e) {
969     sq_throwerror(vm, e.what());
970     return SQ_ERROR;
971   } catch(...) {
972     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
973     return SQ_ERROR;
974   }
975
976 }
977
978 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
979 {
980   SQUserPointer data;
981   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
982     sq_throwerror(vm, _SC("'fade_out' called without instance"));
983     return SQ_ERROR;
984   }
985   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
986   SQFloat arg0;
987   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
988     sq_throwerror(vm, _SC("Argument 1 not a float"));
989     return SQ_ERROR;
990   }
991
992   try {
993     _this->fade_out(static_cast<float> (arg0));
994
995     return 0;
996
997   } catch(std::exception& e) {
998     sq_throwerror(vm, e.what());
999     return SQ_ERROR;
1000   } catch(...) {
1001     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
1002     return SQ_ERROR;
1003   }
1004
1005 }
1006
1007 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
1008 {
1009   SQUserPointer data;
1010   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1011     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1012     return SQ_ERROR;
1013   }
1014   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1015   SQBool arg0;
1016   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1017     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1018     return SQ_ERROR;
1019   }
1020
1021   try {
1022     _this->set_visible(arg0 == SQTrue);
1023
1024     return 0;
1025
1026   } catch(std::exception& e) {
1027     sq_throwerror(vm, e.what());
1028     return SQ_ERROR;
1029   } catch(...) {
1030     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1031     return SQ_ERROR;
1032   }
1033
1034 }
1035
1036 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
1037 {
1038   SQUserPointer data;
1039   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1040     sq_throwerror(vm, _SC("'set_centered' called without instance"));
1041     return SQ_ERROR;
1042   }
1043   Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
1044   SQBool arg0;
1045   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1046     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1047     return SQ_ERROR;
1048   }
1049
1050   try {
1051     _this->set_centered(arg0 == SQTrue);
1052
1053     return 0;
1054
1055   } catch(std::exception& e) {
1056     sq_throwerror(vm, e.what());
1057     return SQ_ERROR;
1058   } catch(...) {
1059     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
1060     return SQ_ERROR;
1061   }
1062
1063 }
1064
1065 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
1066 {
1067   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
1068   delete _this;
1069   return 0;
1070 }
1071
1072 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
1073 {
1074   SQUserPointer data;
1075   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1076     sq_throwerror(vm, _SC("'add_bonus' called without instance"));
1077     return SQ_ERROR;
1078   }
1079   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1080   const SQChar* arg0;
1081   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1082     sq_throwerror(vm, _SC("Argument 1 not a string"));
1083     return SQ_ERROR;
1084   }
1085
1086   try {
1087     bool return_value = _this->add_bonus(arg0);
1088
1089     sq_pushbool(vm, return_value);
1090     return 1;
1091
1092   } catch(std::exception& e) {
1093     sq_throwerror(vm, e.what());
1094     return SQ_ERROR;
1095   } catch(...) {
1096     sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1097     return SQ_ERROR;
1098   }
1099
1100 }
1101
1102 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
1103 {
1104   SQUserPointer data;
1105   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1106     sq_throwerror(vm, _SC("'add_coins' called without instance"));
1107     return SQ_ERROR;
1108   }
1109   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1110   SQInteger arg0;
1111   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1112     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1113     return SQ_ERROR;
1114   }
1115
1116   try {
1117     _this->add_coins(static_cast<int> (arg0));
1118
1119     return 0;
1120
1121   } catch(std::exception& e) {
1122     sq_throwerror(vm, e.what());
1123     return SQ_ERROR;
1124   } catch(...) {
1125     sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1126     return SQ_ERROR;
1127   }
1128
1129 }
1130
1131 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1132 {
1133   SQUserPointer data;
1134   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1135     sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1136     return SQ_ERROR;
1137   }
1138   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1139
1140   try {
1141     _this->make_invincible();
1142
1143     return 0;
1144
1145   } catch(std::exception& e) {
1146     sq_throwerror(vm, e.what());
1147     return SQ_ERROR;
1148   } catch(...) {
1149     sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1150     return SQ_ERROR;
1151   }
1152
1153 }
1154
1155 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1156 {
1157   SQUserPointer data;
1158   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1159     sq_throwerror(vm, _SC("'deactivate' called without instance"));
1160     return SQ_ERROR;
1161   }
1162   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1163
1164   try {
1165     _this->deactivate();
1166
1167     return 0;
1168
1169   } catch(std::exception& e) {
1170     sq_throwerror(vm, e.what());
1171     return SQ_ERROR;
1172   } catch(...) {
1173     sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1174     return SQ_ERROR;
1175   }
1176
1177 }
1178
1179 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1180 {
1181   SQUserPointer data;
1182   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1183     sq_throwerror(vm, _SC("'activate' called without instance"));
1184     return SQ_ERROR;
1185   }
1186   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1187
1188   try {
1189     _this->activate();
1190
1191     return 0;
1192
1193   } catch(std::exception& e) {
1194     sq_throwerror(vm, e.what());
1195     return SQ_ERROR;
1196   } catch(...) {
1197     sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1198     return SQ_ERROR;
1199   }
1200
1201 }
1202
1203 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1204 {
1205   SQUserPointer data;
1206   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1207     sq_throwerror(vm, _SC("'walk' called without instance"));
1208     return SQ_ERROR;
1209   }
1210   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1211   SQFloat arg0;
1212   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1213     sq_throwerror(vm, _SC("Argument 1 not a float"));
1214     return SQ_ERROR;
1215   }
1216
1217   try {
1218     _this->walk(static_cast<float> (arg0));
1219
1220     return 0;
1221
1222   } catch(std::exception& e) {
1223     sq_throwerror(vm, e.what());
1224     return SQ_ERROR;
1225   } catch(...) {
1226     sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1227     return SQ_ERROR;
1228   }
1229
1230 }
1231
1232 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1233 {
1234   SQUserPointer data;
1235   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1236     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1237     return SQ_ERROR;
1238   }
1239   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1240   SQBool arg0;
1241   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1242     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1243     return SQ_ERROR;
1244   }
1245
1246   try {
1247     _this->set_visible(arg0 == SQTrue);
1248
1249     return 0;
1250
1251   } catch(std::exception& e) {
1252     sq_throwerror(vm, e.what());
1253     return SQ_ERROR;
1254   } catch(...) {
1255     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1256     return SQ_ERROR;
1257   }
1258
1259 }
1260
1261 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1262 {
1263   SQUserPointer data;
1264   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1265     sq_throwerror(vm, _SC("'get_visible' called without instance"));
1266     return SQ_ERROR;
1267   }
1268   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1269
1270   try {
1271     bool return_value = _this->get_visible();
1272
1273     sq_pushbool(vm, return_value);
1274     return 1;
1275
1276   } catch(std::exception& e) {
1277     sq_throwerror(vm, e.what());
1278     return SQ_ERROR;
1279   } catch(...) {
1280     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1281     return SQ_ERROR;
1282   }
1283
1284 }
1285
1286 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1287 {
1288   SQUserPointer data;
1289   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1290     sq_throwerror(vm, _SC("'kill' called without instance"));
1291     return SQ_ERROR;
1292   }
1293   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1294   SQBool arg0;
1295   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1296     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1297     return SQ_ERROR;
1298   }
1299
1300   try {
1301     _this->kill(arg0 == SQTrue);
1302
1303     return 0;
1304
1305   } catch(std::exception& e) {
1306     sq_throwerror(vm, e.what());
1307     return SQ_ERROR;
1308   } catch(...) {
1309     sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1310     return SQ_ERROR;
1311   }
1312
1313 }
1314
1315 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1316 {
1317   SQUserPointer data;
1318   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1319     sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1320     return SQ_ERROR;
1321   }
1322   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1323   SQBool arg0;
1324   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1325     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1326     return SQ_ERROR;
1327   }
1328
1329   try {
1330     _this->set_ghost_mode(arg0 == SQTrue);
1331
1332     return 0;
1333
1334   } catch(std::exception& e) {
1335     sq_throwerror(vm, e.what());
1336     return SQ_ERROR;
1337   } catch(...) {
1338     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1339     return SQ_ERROR;
1340   }
1341
1342 }
1343
1344 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1345 {
1346   SQUserPointer data;
1347   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1348     sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1349     return SQ_ERROR;
1350   }
1351   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1352
1353   try {
1354     bool return_value = _this->get_ghost_mode();
1355
1356     sq_pushbool(vm, return_value);
1357     return 1;
1358
1359   } catch(std::exception& e) {
1360     sq_throwerror(vm, e.what());
1361     return SQ_ERROR;
1362   } catch(...) {
1363     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1364     return SQ_ERROR;
1365   }
1366
1367 }
1368
1369 static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm)
1370 {
1371   SQUserPointer data;
1372   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1373     sq_throwerror(vm, _SC("'do_cheer' called without instance"));
1374     return SQ_ERROR;
1375   }
1376   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1377
1378   try {
1379     _this->do_cheer();
1380
1381     return 0;
1382
1383   } catch(std::exception& e) {
1384     sq_throwerror(vm, e.what());
1385     return SQ_ERROR;
1386   } catch(...) {
1387     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'"));
1388     return SQ_ERROR;
1389   }
1390
1391 }
1392
1393 static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm)
1394 {
1395   SQUserPointer data;
1396   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1397     sq_throwerror(vm, _SC("'do_duck' called without instance"));
1398     return SQ_ERROR;
1399   }
1400   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1401
1402   try {
1403     _this->do_duck();
1404
1405     return 0;
1406
1407   } catch(std::exception& e) {
1408     sq_throwerror(vm, e.what());
1409     return SQ_ERROR;
1410   } catch(...) {
1411     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'"));
1412     return SQ_ERROR;
1413   }
1414
1415 }
1416
1417 static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm)
1418 {
1419   SQUserPointer data;
1420   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1421     sq_throwerror(vm, _SC("'do_standup' called without instance"));
1422     return SQ_ERROR;
1423   }
1424   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1425
1426   try {
1427     _this->do_standup();
1428
1429     return 0;
1430
1431   } catch(std::exception& e) {
1432     sq_throwerror(vm, e.what());
1433     return SQ_ERROR;
1434   } catch(...) {
1435     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'"));
1436     return SQ_ERROR;
1437   }
1438
1439 }
1440
1441 static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm)
1442 {
1443   SQUserPointer data;
1444   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1445     sq_throwerror(vm, _SC("'do_backflip' called without instance"));
1446     return SQ_ERROR;
1447   }
1448   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1449
1450   try {
1451     _this->do_backflip();
1452
1453     return 0;
1454
1455   } catch(std::exception& e) {
1456     sq_throwerror(vm, e.what());
1457     return SQ_ERROR;
1458   } catch(...) {
1459     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'"));
1460     return SQ_ERROR;
1461   }
1462
1463 }
1464
1465 static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm)
1466 {
1467   SQUserPointer data;
1468   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1469     sq_throwerror(vm, _SC("'do_jump' called without instance"));
1470     return SQ_ERROR;
1471   }
1472   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1473   SQFloat arg0;
1474   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1475     sq_throwerror(vm, _SC("Argument 1 not a float"));
1476     return SQ_ERROR;
1477   }
1478
1479   try {
1480     _this->do_jump(static_cast<float> (arg0));
1481
1482     return 0;
1483
1484   } catch(std::exception& e) {
1485     sq_throwerror(vm, e.what());
1486     return SQ_ERROR;
1487   } catch(...) {
1488     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_jump'"));
1489     return SQ_ERROR;
1490   }
1491
1492 }
1493
1494 static SQInteger Player_trigger_sequence_wrapper(HSQUIRRELVM vm)
1495 {
1496   SQUserPointer data;
1497   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1498     sq_throwerror(vm, _SC("'trigger_sequence' called without instance"));
1499     return SQ_ERROR;
1500   }
1501   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
1502   const SQChar* arg0;
1503   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1504     sq_throwerror(vm, _SC("Argument 1 not a string"));
1505     return SQ_ERROR;
1506   }
1507
1508   try {
1509     _this->trigger_sequence(arg0);
1510
1511     return 0;
1512
1513   } catch(std::exception& e) {
1514     sq_throwerror(vm, e.what());
1515     return SQ_ERROR;
1516   } catch(...) {
1517     sq_throwerror(vm, _SC("Unexpected exception while executing function 'trigger_sequence'"));
1518     return SQ_ERROR;
1519   }
1520
1521 }
1522
1523 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
1524 {
1525   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
1526   delete _this;
1527   return 0;
1528 }
1529
1530 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
1531 {
1532   const SQChar* arg0;
1533   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1534     sq_throwerror(vm, _SC("Argument 1 not a string"));
1535     return SQ_ERROR;
1536   }
1537
1538   try {
1539     Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
1540   if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
1541     sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
1542     return SQ_ERROR;
1543   }
1544   sq_setreleasehook(vm, 1, FloatingImage_release_hook);
1545
1546     return 0;
1547
1548   } catch(std::exception& e) {
1549     sq_throwerror(vm, e.what());
1550     return SQ_ERROR;
1551   } catch(...) {
1552     sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
1553     return SQ_ERROR;
1554   }
1555
1556 }
1557
1558 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
1559 {
1560   SQUserPointer data;
1561   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1562     sq_throwerror(vm, _SC("'set_layer' called without instance"));
1563     return SQ_ERROR;
1564   }
1565   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1566   SQInteger arg0;
1567   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1568     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1569     return SQ_ERROR;
1570   }
1571
1572   try {
1573     _this->set_layer(static_cast<int> (arg0));
1574
1575     return 0;
1576
1577   } catch(std::exception& e) {
1578     sq_throwerror(vm, e.what());
1579     return SQ_ERROR;
1580   } catch(...) {
1581     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
1582     return SQ_ERROR;
1583   }
1584
1585 }
1586
1587 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
1588 {
1589   SQUserPointer data;
1590   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1591     sq_throwerror(vm, _SC("'get_layer' called without instance"));
1592     return SQ_ERROR;
1593   }
1594   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1595
1596   try {
1597     int return_value = _this->get_layer();
1598
1599     sq_pushinteger(vm, return_value);
1600     return 1;
1601
1602   } catch(std::exception& e) {
1603     sq_throwerror(vm, e.what());
1604     return SQ_ERROR;
1605   } catch(...) {
1606     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
1607     return SQ_ERROR;
1608   }
1609
1610 }
1611
1612 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
1613 {
1614   SQUserPointer data;
1615   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1616     sq_throwerror(vm, _SC("'set_pos' called without instance"));
1617     return SQ_ERROR;
1618   }
1619   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1620   SQFloat arg0;
1621   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1622     sq_throwerror(vm, _SC("Argument 1 not a float"));
1623     return SQ_ERROR;
1624   }
1625   SQFloat arg1;
1626   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1627     sq_throwerror(vm, _SC("Argument 2 not a float"));
1628     return SQ_ERROR;
1629   }
1630
1631   try {
1632     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1633
1634     return 0;
1635
1636   } catch(std::exception& e) {
1637     sq_throwerror(vm, e.what());
1638     return SQ_ERROR;
1639   } catch(...) {
1640     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
1641     return SQ_ERROR;
1642   }
1643
1644 }
1645
1646 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
1647 {
1648   SQUserPointer data;
1649   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1650     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1651     return SQ_ERROR;
1652   }
1653   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1654
1655   try {
1656     float return_value = _this->get_pos_x();
1657
1658     sq_pushfloat(vm, return_value);
1659     return 1;
1660
1661   } catch(std::exception& e) {
1662     sq_throwerror(vm, e.what());
1663     return SQ_ERROR;
1664   } catch(...) {
1665     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1666     return SQ_ERROR;
1667   }
1668
1669 }
1670
1671 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
1672 {
1673   SQUserPointer data;
1674   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1675     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1676     return SQ_ERROR;
1677   }
1678   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1679
1680   try {
1681     float return_value = _this->get_pos_y();
1682
1683     sq_pushfloat(vm, return_value);
1684     return 1;
1685
1686   } catch(std::exception& e) {
1687     sq_throwerror(vm, e.what());
1688     return SQ_ERROR;
1689   } catch(...) {
1690     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1691     return SQ_ERROR;
1692   }
1693
1694 }
1695
1696 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
1697 {
1698   SQUserPointer data;
1699   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1700     sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
1701     return SQ_ERROR;
1702   }
1703   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1704   SQInteger arg0;
1705   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1706     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1707     return SQ_ERROR;
1708   }
1709
1710   try {
1711     _this->set_anchor_point(static_cast<int> (arg0));
1712
1713     return 0;
1714
1715   } catch(std::exception& e) {
1716     sq_throwerror(vm, e.what());
1717     return SQ_ERROR;
1718   } catch(...) {
1719     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
1720     return SQ_ERROR;
1721   }
1722
1723 }
1724
1725 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
1726 {
1727   SQUserPointer data;
1728   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1729     sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
1730     return SQ_ERROR;
1731   }
1732   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1733
1734   try {
1735     int return_value = _this->get_anchor_point();
1736
1737     sq_pushinteger(vm, return_value);
1738     return 1;
1739
1740   } catch(std::exception& e) {
1741     sq_throwerror(vm, e.what());
1742     return SQ_ERROR;
1743   } catch(...) {
1744     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
1745     return SQ_ERROR;
1746   }
1747
1748 }
1749
1750 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
1751 {
1752   SQUserPointer data;
1753   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1754     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1755     return SQ_ERROR;
1756   }
1757   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1758   SQBool arg0;
1759   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1760     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1761     return SQ_ERROR;
1762   }
1763
1764   try {
1765     _this->set_visible(arg0 == SQTrue);
1766
1767     return 0;
1768
1769   } catch(std::exception& e) {
1770     sq_throwerror(vm, e.what());
1771     return SQ_ERROR;
1772   } catch(...) {
1773     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1774     return SQ_ERROR;
1775   }
1776
1777 }
1778
1779 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
1780 {
1781   SQUserPointer data;
1782   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1783     sq_throwerror(vm, _SC("'get_visible' called without instance"));
1784     return SQ_ERROR;
1785   }
1786   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1787
1788   try {
1789     bool return_value = _this->get_visible();
1790
1791     sq_pushbool(vm, return_value);
1792     return 1;
1793
1794   } catch(std::exception& e) {
1795     sq_throwerror(vm, e.what());
1796     return SQ_ERROR;
1797   } catch(...) {
1798     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1799     return SQ_ERROR;
1800   }
1801
1802 }
1803
1804 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
1805 {
1806   SQUserPointer data;
1807   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1808     sq_throwerror(vm, _SC("'set_action' called without instance"));
1809     return SQ_ERROR;
1810   }
1811   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1812   const SQChar* arg0;
1813   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1814     sq_throwerror(vm, _SC("Argument 1 not a string"));
1815     return SQ_ERROR;
1816   }
1817
1818   try {
1819     _this->set_action(arg0);
1820
1821     return 0;
1822
1823   } catch(std::exception& e) {
1824     sq_throwerror(vm, e.what());
1825     return SQ_ERROR;
1826   } catch(...) {
1827     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1828     return SQ_ERROR;
1829   }
1830
1831 }
1832
1833 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
1834 {
1835   SQUserPointer data;
1836   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1837     sq_throwerror(vm, _SC("'get_action' called without instance"));
1838     return SQ_ERROR;
1839   }
1840   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1841
1842   try {
1843     std::string return_value = _this->get_action();
1844
1845     sq_pushstring(vm, return_value.c_str(), return_value.size());
1846     return 1;
1847
1848   } catch(std::exception& e) {
1849     sq_throwerror(vm, e.what());
1850     return SQ_ERROR;
1851   } catch(...) {
1852     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1853     return SQ_ERROR;
1854   }
1855
1856 }
1857
1858 static SQInteger FloatingImage_fade_in_wrapper(HSQUIRRELVM vm)
1859 {
1860   SQUserPointer data;
1861   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1862     sq_throwerror(vm, _SC("'fade_in' called without instance"));
1863     return SQ_ERROR;
1864   }
1865   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1866   SQFloat arg0;
1867   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1868     sq_throwerror(vm, _SC("Argument 1 not a float"));
1869     return SQ_ERROR;
1870   }
1871
1872   try {
1873     _this->fade_in(static_cast<float> (arg0));
1874
1875     return 0;
1876
1877   } catch(std::exception& e) {
1878     sq_throwerror(vm, e.what());
1879     return SQ_ERROR;
1880   } catch(...) {
1881     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
1882     return SQ_ERROR;
1883   }
1884
1885 }
1886
1887 static SQInteger FloatingImage_fade_out_wrapper(HSQUIRRELVM vm)
1888 {
1889   SQUserPointer data;
1890   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1891     sq_throwerror(vm, _SC("'fade_out' called without instance"));
1892     return SQ_ERROR;
1893   }
1894   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
1895   SQFloat arg0;
1896   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1897     sq_throwerror(vm, _SC("Argument 1 not a float"));
1898     return SQ_ERROR;
1899   }
1900
1901   try {
1902     _this->fade_out(static_cast<float> (arg0));
1903
1904     return 0;
1905
1906   } catch(std::exception& e) {
1907     sq_throwerror(vm, e.what());
1908     return SQ_ERROR;
1909   } catch(...) {
1910     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
1911     return SQ_ERROR;
1912   }
1913
1914 }
1915
1916 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1917 {
1918   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
1919   delete _this;
1920   return 0;
1921 }
1922
1923 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1924 {
1925   SQUserPointer data;
1926   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1927     sq_throwerror(vm, _SC("'goto_node' called without instance"));
1928     return SQ_ERROR;
1929   }
1930   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1931   SQInteger arg0;
1932   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1933     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1934     return SQ_ERROR;
1935   }
1936
1937   try {
1938     _this->goto_node(static_cast<int> (arg0));
1939
1940     return 0;
1941
1942   } catch(std::exception& e) {
1943     sq_throwerror(vm, e.what());
1944     return SQ_ERROR;
1945   } catch(...) {
1946     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1947     return SQ_ERROR;
1948   }
1949
1950 }
1951
1952 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1953 {
1954   SQUserPointer data;
1955   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1956     sq_throwerror(vm, _SC("'start_moving' called without instance"));
1957     return SQ_ERROR;
1958   }
1959   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1960
1961   try {
1962     _this->start_moving();
1963
1964     return 0;
1965
1966   } catch(std::exception& e) {
1967     sq_throwerror(vm, e.what());
1968     return SQ_ERROR;
1969   } catch(...) {
1970     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
1971     return SQ_ERROR;
1972   }
1973
1974 }
1975
1976 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1977 {
1978   SQUserPointer data;
1979   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
1980     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1981     return SQ_ERROR;
1982   }
1983   Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
1984
1985   try {
1986     _this->stop_moving();
1987
1988     return 0;
1989
1990   } catch(std::exception& e) {
1991     sq_throwerror(vm, e.what());
1992     return SQ_ERROR;
1993   } catch(...) {
1994     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1995     return SQ_ERROR;
1996   }
1997
1998 }
1999
2000 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
2001 {
2002   Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (ptr);
2003   delete _this;
2004   return 0;
2005 }
2006
2007 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
2008 {
2009   SQUserPointer data;
2010   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2011     sq_throwerror(vm, _SC("'get_burning' called without instance"));
2012     return SQ_ERROR;
2013   }
2014   Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
2015
2016   try {
2017     bool return_value = _this->get_burning();
2018
2019     sq_pushbool(vm, return_value);
2020     return 1;
2021
2022   } catch(std::exception& e) {
2023     sq_throwerror(vm, e.what());
2024     return SQ_ERROR;
2025   } catch(...) {
2026     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
2027     return SQ_ERROR;
2028   }
2029
2030 }
2031
2032 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
2033 {
2034   SQUserPointer data;
2035   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2036     sq_throwerror(vm, _SC("'set_burning' called without instance"));
2037     return SQ_ERROR;
2038   }
2039   Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
2040   SQBool arg0;
2041   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2042     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2043     return SQ_ERROR;
2044   }
2045
2046   try {
2047     _this->set_burning(arg0 == SQTrue);
2048
2049     return 0;
2050
2051   } catch(std::exception& e) {
2052     sq_throwerror(vm, e.what());
2053     return SQ_ERROR;
2054   } catch(...) {
2055     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_burning'"));
2056     return SQ_ERROR;
2057   }
2058
2059 }
2060
2061 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
2062 {
2063   Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (ptr);
2064   delete _this;
2065   return 0;
2066 }
2067
2068 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
2069 {
2070   SQUserPointer data;
2071   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2072     sq_throwerror(vm, _SC("'start' called without instance"));
2073     return SQ_ERROR;
2074   }
2075   Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
2076
2077   try {
2078     _this->start();
2079
2080     return 0;
2081
2082   } catch(std::exception& e) {
2083     sq_throwerror(vm, e.what());
2084     return SQ_ERROR;
2085   } catch(...) {
2086     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2087     return SQ_ERROR;
2088   }
2089
2090 }
2091
2092 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
2093 {
2094   SQUserPointer data;
2095   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2096     sq_throwerror(vm, _SC("'stop' called without instance"));
2097     return SQ_ERROR;
2098   }
2099   Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
2100
2101   try {
2102     _this->stop();
2103
2104     return 0;
2105
2106   } catch(std::exception& e) {
2107     sq_throwerror(vm, e.what());
2108     return SQ_ERROR;
2109   } catch(...) {
2110     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2111     return SQ_ERROR;
2112   }
2113
2114 }
2115
2116 static SQInteger AmbientSound_release_hook(SQUserPointer ptr, SQInteger )
2117 {
2118   Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (ptr);
2119   delete _this;
2120   return 0;
2121 }
2122
2123 static SQInteger AmbientSound_set_pos_wrapper(HSQUIRRELVM vm)
2124 {
2125   SQUserPointer data;
2126   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2127     sq_throwerror(vm, _SC("'set_pos' called without instance"));
2128     return SQ_ERROR;
2129   }
2130   Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2131   SQFloat arg0;
2132   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2133     sq_throwerror(vm, _SC("Argument 1 not a float"));
2134     return SQ_ERROR;
2135   }
2136   SQFloat arg1;
2137   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2138     sq_throwerror(vm, _SC("Argument 2 not a float"));
2139     return SQ_ERROR;
2140   }
2141
2142   try {
2143     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
2144
2145     return 0;
2146
2147   } catch(std::exception& e) {
2148     sq_throwerror(vm, e.what());
2149     return SQ_ERROR;
2150   } catch(...) {
2151     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
2152     return SQ_ERROR;
2153   }
2154
2155 }
2156
2157 static SQInteger AmbientSound_get_pos_x_wrapper(HSQUIRRELVM vm)
2158 {
2159   SQUserPointer data;
2160   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2161     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
2162     return SQ_ERROR;
2163   }
2164   Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2165
2166   try {
2167     float return_value = _this->get_pos_x();
2168
2169     sq_pushfloat(vm, return_value);
2170     return 1;
2171
2172   } catch(std::exception& e) {
2173     sq_throwerror(vm, e.what());
2174     return SQ_ERROR;
2175   } catch(...) {
2176     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
2177     return SQ_ERROR;
2178   }
2179
2180 }
2181
2182 static SQInteger AmbientSound_get_pos_y_wrapper(HSQUIRRELVM vm)
2183 {
2184   SQUserPointer data;
2185   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2186     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
2187     return SQ_ERROR;
2188   }
2189   Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
2190
2191   try {
2192     float return_value = _this->get_pos_y();
2193
2194     sq_pushfloat(vm, return_value);
2195     return 1;
2196
2197   } catch(std::exception& e) {
2198     sq_throwerror(vm, e.what());
2199     return SQ_ERROR;
2200   } catch(...) {
2201     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
2202     return SQ_ERROR;
2203   }
2204
2205 }
2206
2207 static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger )
2208 {
2209   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (ptr);
2210   delete _this;
2211   return 0;
2212 }
2213
2214 static SQInteger Thunderstorm_start_wrapper(HSQUIRRELVM vm)
2215 {
2216   SQUserPointer data;
2217   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2218     sq_throwerror(vm, _SC("'start' called without instance"));
2219     return SQ_ERROR;
2220   }
2221   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2222
2223   try {
2224     _this->start();
2225
2226     return 0;
2227
2228   } catch(std::exception& e) {
2229     sq_throwerror(vm, e.what());
2230     return SQ_ERROR;
2231   } catch(...) {
2232     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2233     return SQ_ERROR;
2234   }
2235
2236 }
2237
2238 static SQInteger Thunderstorm_stop_wrapper(HSQUIRRELVM vm)
2239 {
2240   SQUserPointer data;
2241   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2242     sq_throwerror(vm, _SC("'stop' called without instance"));
2243     return SQ_ERROR;
2244   }
2245   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2246
2247   try {
2248     _this->stop();
2249
2250     return 0;
2251
2252   } catch(std::exception& e) {
2253     sq_throwerror(vm, e.what());
2254     return SQ_ERROR;
2255   } catch(...) {
2256     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2257     return SQ_ERROR;
2258   }
2259
2260 }
2261
2262 static SQInteger Thunderstorm_thunder_wrapper(HSQUIRRELVM vm)
2263 {
2264   SQUserPointer data;
2265   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2266     sq_throwerror(vm, _SC("'thunder' called without instance"));
2267     return SQ_ERROR;
2268   }
2269   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2270
2271   try {
2272     _this->thunder();
2273
2274     return 0;
2275
2276   } catch(std::exception& e) {
2277     sq_throwerror(vm, e.what());
2278     return SQ_ERROR;
2279   } catch(...) {
2280     sq_throwerror(vm, _SC("Unexpected exception while executing function 'thunder'"));
2281     return SQ_ERROR;
2282   }
2283
2284 }
2285
2286 static SQInteger Thunderstorm_lightning_wrapper(HSQUIRRELVM vm)
2287 {
2288   SQUserPointer data;
2289   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2290     sq_throwerror(vm, _SC("'lightning' called without instance"));
2291     return SQ_ERROR;
2292   }
2293   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2294
2295   try {
2296     _this->lightning();
2297
2298     return 0;
2299
2300   } catch(std::exception& e) {
2301     sq_throwerror(vm, e.what());
2302     return SQ_ERROR;
2303   } catch(...) {
2304     sq_throwerror(vm, _SC("Unexpected exception while executing function 'lightning'"));
2305     return SQ_ERROR;
2306   }
2307
2308 }
2309
2310 static SQInteger Thunderstorm_flash_wrapper(HSQUIRRELVM vm)
2311 {
2312   SQUserPointer data;
2313   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2314     sq_throwerror(vm, _SC("'flash' called without instance"));
2315     return SQ_ERROR;
2316   }
2317   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2318
2319   try {
2320     _this->flash();
2321
2322     return 0;
2323
2324   } catch(std::exception& e) {
2325     sq_throwerror(vm, e.what());
2326     return SQ_ERROR;
2327   } catch(...) {
2328     sq_throwerror(vm, _SC("Unexpected exception while executing function 'flash'"));
2329     return SQ_ERROR;
2330   }
2331
2332 }
2333
2334 static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm)
2335 {
2336   SQUserPointer data;
2337   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2338     sq_throwerror(vm, _SC("'electrify' called without instance"));
2339     return SQ_ERROR;
2340   }
2341   Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
2342
2343   try {
2344     _this->electrify();
2345
2346     return 0;
2347
2348   } catch(std::exception& e) {
2349     sq_throwerror(vm, e.what());
2350     return SQ_ERROR;
2351   } catch(...) {
2352     sq_throwerror(vm, _SC("Unexpected exception while executing function 'electrify'"));
2353     return SQ_ERROR;
2354   }
2355
2356 }
2357
2358 static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger )
2359 {
2360   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (ptr);
2361   delete _this;
2362   return 0;
2363 }
2364
2365 static SQInteger TileMap_goto_node_wrapper(HSQUIRRELVM vm)
2366 {
2367   SQUserPointer data;
2368   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2369     sq_throwerror(vm, _SC("'goto_node' called without instance"));
2370     return SQ_ERROR;
2371   }
2372   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2373   SQInteger arg0;
2374   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2375     sq_throwerror(vm, _SC("Argument 1 not an integer"));
2376     return SQ_ERROR;
2377   }
2378
2379   try {
2380     _this->goto_node(static_cast<int> (arg0));
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 'goto_node'"));
2389     return SQ_ERROR;
2390   }
2391
2392 }
2393
2394 static SQInteger TileMap_start_moving_wrapper(HSQUIRRELVM vm)
2395 {
2396   SQUserPointer data;
2397   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2398     sq_throwerror(vm, _SC("'start_moving' called without instance"));
2399     return SQ_ERROR;
2400   }
2401   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2402
2403   try {
2404     _this->start_moving();
2405
2406     return 0;
2407
2408   } catch(std::exception& e) {
2409     sq_throwerror(vm, e.what());
2410     return SQ_ERROR;
2411   } catch(...) {
2412     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2413     return SQ_ERROR;
2414   }
2415
2416 }
2417
2418 static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm)
2419 {
2420   SQUserPointer data;
2421   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2422     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2423     return SQ_ERROR;
2424   }
2425   Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
2426
2427   try {
2428     _this->stop_moving();
2429
2430     return 0;
2431
2432   } catch(std::exception& e) {
2433     sq_throwerror(vm, e.what());
2434     return SQ_ERROR;
2435   } catch(...) {
2436     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2437     return SQ_ERROR;
2438   }
2439
2440 }
2441
2442 static SQInteger SSector_release_hook(SQUserPointer ptr, SQInteger )
2443 {
2444   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (ptr);
2445   delete _this;
2446   return 0;
2447 }
2448
2449 static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm)
2450 {
2451   SQUserPointer data;
2452   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2453     sq_throwerror(vm, _SC("'set_ambient_light' called without instance"));
2454     return SQ_ERROR;
2455   }
2456   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2457   SQFloat arg0;
2458   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2459     sq_throwerror(vm, _SC("Argument 1 not a float"));
2460     return SQ_ERROR;
2461   }
2462   SQFloat arg1;
2463   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2464     sq_throwerror(vm, _SC("Argument 2 not a float"));
2465     return SQ_ERROR;
2466   }
2467   SQFloat arg2;
2468   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2469     sq_throwerror(vm, _SC("Argument 3 not a float"));
2470     return SQ_ERROR;
2471   }
2472
2473   try {
2474     _this->set_ambient_light(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2475
2476     return 0;
2477
2478   } catch(std::exception& e) {
2479     sq_throwerror(vm, e.what());
2480     return SQ_ERROR;
2481   } catch(...) {
2482     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ambient_light'"));
2483     return SQ_ERROR;
2484   }
2485
2486 }
2487
2488 static SQInteger SSector_get_ambient_red_wrapper(HSQUIRRELVM vm)
2489 {
2490   SQUserPointer data;
2491   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2492     sq_throwerror(vm, _SC("'get_ambient_red' called without instance"));
2493     return SQ_ERROR;
2494   }
2495   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2496
2497   try {
2498     float return_value = _this->get_ambient_red();
2499
2500     sq_pushfloat(vm, return_value);
2501     return 1;
2502
2503   } catch(std::exception& e) {
2504     sq_throwerror(vm, e.what());
2505     return SQ_ERROR;
2506   } catch(...) {
2507     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_red'"));
2508     return SQ_ERROR;
2509   }
2510
2511 }
2512
2513 static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm)
2514 {
2515   SQUserPointer data;
2516   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2517     sq_throwerror(vm, _SC("'get_ambient_green' called without instance"));
2518     return SQ_ERROR;
2519   }
2520   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2521
2522   try {
2523     float return_value = _this->get_ambient_green();
2524
2525     sq_pushfloat(vm, return_value);
2526     return 1;
2527
2528   } catch(std::exception& e) {
2529     sq_throwerror(vm, e.what());
2530     return SQ_ERROR;
2531   } catch(...) {
2532     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_green'"));
2533     return SQ_ERROR;
2534   }
2535
2536 }
2537
2538 static SQInteger SSector_get_ambient_blue_wrapper(HSQUIRRELVM vm)
2539 {
2540   SQUserPointer data;
2541   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2542     sq_throwerror(vm, _SC("'get_ambient_blue' called without instance"));
2543     return SQ_ERROR;
2544   }
2545   Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
2546
2547   try {
2548     float return_value = _this->get_ambient_blue();
2549
2550     sq_pushfloat(vm, return_value);
2551     return 1;
2552
2553   } catch(std::exception& e) {
2554     sq_throwerror(vm, e.what());
2555     return SQ_ERROR;
2556   } catch(...) {
2557     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_blue'"));
2558     return SQ_ERROR;
2559   }
2560
2561 }
2562
2563 static SQInteger LevelTime_release_hook(SQUserPointer ptr, SQInteger )
2564 {
2565   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (ptr);
2566   delete _this;
2567   return 0;
2568 }
2569
2570 static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm)
2571 {
2572   SQUserPointer data;
2573   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2574     sq_throwerror(vm, _SC("'start' called without instance"));
2575     return SQ_ERROR;
2576   }
2577   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2578
2579   try {
2580     _this->start();
2581
2582     return 0;
2583
2584   } catch(std::exception& e) {
2585     sq_throwerror(vm, e.what());
2586     return SQ_ERROR;
2587   } catch(...) {
2588     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2589     return SQ_ERROR;
2590   }
2591
2592 }
2593
2594 static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm)
2595 {
2596   SQUserPointer data;
2597   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2598     sq_throwerror(vm, _SC("'stop' called without instance"));
2599     return SQ_ERROR;
2600   }
2601   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2602
2603   try {
2604     _this->stop();
2605
2606     return 0;
2607
2608   } catch(std::exception& e) {
2609     sq_throwerror(vm, e.what());
2610     return SQ_ERROR;
2611   } catch(...) {
2612     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2613     return SQ_ERROR;
2614   }
2615
2616 }
2617
2618 static SQInteger LevelTime_get_time_wrapper(HSQUIRRELVM vm)
2619 {
2620   SQUserPointer data;
2621   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2622     sq_throwerror(vm, _SC("'get_time' called without instance"));
2623     return SQ_ERROR;
2624   }
2625   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2626
2627   try {
2628     float return_value = _this->get_time();
2629
2630     sq_pushfloat(vm, return_value);
2631     return 1;
2632
2633   } catch(std::exception& e) {
2634     sq_throwerror(vm, e.what());
2635     return SQ_ERROR;
2636   } catch(...) {
2637     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_time'"));
2638     return SQ_ERROR;
2639   }
2640
2641 }
2642
2643 static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm)
2644 {
2645   SQUserPointer data;
2646   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
2647     sq_throwerror(vm, _SC("'set_time' called without instance"));
2648     return SQ_ERROR;
2649   }
2650   Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
2651   SQFloat arg0;
2652   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2653     sq_throwerror(vm, _SC("Argument 1 not a float"));
2654     return SQ_ERROR;
2655   }
2656
2657   try {
2658     _this->set_time(static_cast<float> (arg0));
2659
2660     return 0;
2661
2662   } catch(std::exception& e) {
2663     sq_throwerror(vm, e.what());
2664     return SQ_ERROR;
2665   } catch(...) {
2666     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_time'"));
2667     return SQ_ERROR;
2668   }
2669
2670 }
2671
2672 static SQInteger display_wrapper(HSQUIRRELVM vm)
2673 {
2674   return Scripting::display(vm);
2675 }
2676
2677 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
2678 {
2679   HSQUIRRELVM arg0 = vm;
2680
2681   try {
2682     Scripting::print_stacktrace(arg0);
2683
2684     return 0;
2685
2686   } catch(std::exception& e) {
2687     sq_throwerror(vm, e.what());
2688     return SQ_ERROR;
2689   } catch(...) {
2690     sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
2691     return SQ_ERROR;
2692   }
2693
2694 }
2695
2696 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
2697 {
2698   return Scripting::get_current_thread(vm);
2699 }
2700
2701 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
2702 {
2703   const SQChar* arg0;
2704   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2705     sq_throwerror(vm, _SC("Argument 1 not a string"));
2706     return SQ_ERROR;
2707   }
2708
2709   try {
2710     Scripting::display_text_file(arg0);
2711
2712     return 0;
2713
2714   } catch(std::exception& e) {
2715     sq_throwerror(vm, e.what());
2716     return SQ_ERROR;
2717   } catch(...) {
2718     sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
2719     return SQ_ERROR;
2720   }
2721
2722 }
2723
2724 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
2725 {
2726   const SQChar* arg0;
2727   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2728     sq_throwerror(vm, _SC("Argument 1 not a string"));
2729     return SQ_ERROR;
2730   }
2731
2732   try {
2733     Scripting::load_worldmap(arg0);
2734
2735     return 0;
2736
2737   } catch(std::exception& e) {
2738     sq_throwerror(vm, e.what());
2739     return SQ_ERROR;
2740   } catch(...) {
2741     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
2742     return SQ_ERROR;
2743   }
2744
2745 }
2746
2747 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
2748 {
2749   const SQChar* arg0;
2750   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2751     sq_throwerror(vm, _SC("Argument 1 not a string"));
2752     return SQ_ERROR;
2753   }
2754
2755   try {
2756     Scripting::load_level(arg0);
2757
2758     return 0;
2759
2760   } catch(std::exception& e) {
2761     sq_throwerror(vm, e.what());
2762     return SQ_ERROR;
2763   } catch(...) {
2764     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
2765     return SQ_ERROR;
2766   }
2767
2768 }
2769
2770 static SQInteger wait_wrapper(HSQUIRRELVM vm)
2771 {
2772   HSQUIRRELVM arg0 = vm;
2773   SQFloat arg1;
2774   if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
2775     sq_throwerror(vm, _SC("Argument 1 not a float"));
2776     return SQ_ERROR;
2777   }
2778
2779   try {
2780     Scripting::wait(arg0, static_cast<float> (arg1));
2781
2782     return sq_suspendvm(vm);
2783
2784   } catch(std::exception& e) {
2785     sq_throwerror(vm, e.what());
2786     return SQ_ERROR;
2787   } catch(...) {
2788     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
2789     return SQ_ERROR;
2790   }
2791
2792 }
2793
2794 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
2795 {
2796   HSQUIRRELVM arg0 = vm;
2797
2798   try {
2799     Scripting::wait_for_screenswitch(arg0);
2800
2801     return sq_suspendvm(vm);
2802
2803   } catch(std::exception& e) {
2804     sq_throwerror(vm, e.what());
2805     return SQ_ERROR;
2806   } catch(...) {
2807     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
2808     return SQ_ERROR;
2809   }
2810
2811 }
2812
2813 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
2814 {
2815   (void) vm;
2816
2817   try {
2818     Scripting::exit_screen();
2819
2820     return 0;
2821
2822   } catch(std::exception& e) {
2823     sq_throwerror(vm, e.what());
2824     return SQ_ERROR;
2825   } catch(...) {
2826     sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
2827     return SQ_ERROR;
2828   }
2829
2830 }
2831
2832 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
2833 {
2834   SQFloat arg0;
2835   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2836     sq_throwerror(vm, _SC("Argument 1 not a float"));
2837     return SQ_ERROR;
2838   }
2839
2840   try {
2841     Scripting::fadeout_screen(static_cast<float> (arg0));
2842
2843     return 0;
2844
2845   } catch(std::exception& e) {
2846     sq_throwerror(vm, e.what());
2847     return SQ_ERROR;
2848   } catch(...) {
2849     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
2850     return SQ_ERROR;
2851   }
2852
2853 }
2854
2855 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
2856 {
2857   SQFloat arg0;
2858   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2859     sq_throwerror(vm, _SC("Argument 1 not a float"));
2860     return SQ_ERROR;
2861   }
2862   SQFloat arg1;
2863   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2864     sq_throwerror(vm, _SC("Argument 2 not a float"));
2865     return SQ_ERROR;
2866   }
2867   SQFloat arg2;
2868   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2869     sq_throwerror(vm, _SC("Argument 3 not a float"));
2870     return SQ_ERROR;
2871   }
2872
2873   try {
2874     Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2875
2876     return 0;
2877
2878   } catch(std::exception& e) {
2879     sq_throwerror(vm, e.what());
2880     return SQ_ERROR;
2881   } catch(...) {
2882     sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
2883     return SQ_ERROR;
2884   }
2885
2886 }
2887
2888 static SQInteger abort_screenfade_wrapper(HSQUIRRELVM vm)
2889 {
2890   (void) vm;
2891
2892   try {
2893     Scripting::abort_screenfade();
2894
2895     return 0;
2896
2897   } catch(std::exception& e) {
2898     sq_throwerror(vm, e.what());
2899     return SQ_ERROR;
2900   } catch(...) {
2901     sq_throwerror(vm, _SC("Unexpected exception while executing function 'abort_screenfade'"));
2902     return SQ_ERROR;
2903   }
2904
2905 }
2906
2907 static SQInteger translate_wrapper(HSQUIRRELVM vm)
2908 {
2909   const SQChar* arg0;
2910   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2911     sq_throwerror(vm, _SC("Argument 1 not a string"));
2912     return SQ_ERROR;
2913   }
2914
2915   try {
2916     std::string return_value = Scripting::translate(arg0);
2917
2918     sq_pushstring(vm, return_value.c_str(), return_value.size());
2919     return 1;
2920
2921   } catch(std::exception& e) {
2922     sq_throwerror(vm, e.what());
2923     return SQ_ERROR;
2924   } catch(...) {
2925     sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
2926     return SQ_ERROR;
2927   }
2928
2929 }
2930
2931 static SQInteger import_wrapper(HSQUIRRELVM vm)
2932 {
2933   HSQUIRRELVM arg0 = vm;
2934   const SQChar* arg1;
2935   if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
2936     sq_throwerror(vm, _SC("Argument 1 not a string"));
2937     return SQ_ERROR;
2938   }
2939
2940   try {
2941     Scripting::import(arg0, arg1);
2942
2943     return 0;
2944
2945   } catch(std::exception& e) {
2946     sq_throwerror(vm, e.what());
2947     return SQ_ERROR;
2948   } catch(...) {
2949     sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
2950     return SQ_ERROR;
2951   }
2952
2953 }
2954
2955 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
2956 {
2957   (void) vm;
2958
2959   try {
2960     Scripting::save_state();
2961
2962     return 0;
2963
2964   } catch(std::exception& e) {
2965     sq_throwerror(vm, e.what());
2966     return SQ_ERROR;
2967   } catch(...) {
2968     sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
2969     return SQ_ERROR;
2970   }
2971
2972 }
2973
2974 static SQInteger update_worldmap_wrapper(HSQUIRRELVM vm)
2975 {
2976   (void) vm;
2977
2978   try {
2979     Scripting::update_worldmap();
2980
2981     return 0;
2982
2983   } catch(std::exception& e) {
2984     sq_throwerror(vm, e.what());
2985     return SQ_ERROR;
2986   } catch(...) {
2987     sq_throwerror(vm, _SC("Unexpected exception while executing function 'update_worldmap'"));
2988     return SQ_ERROR;
2989   }
2990
2991 }
2992
2993 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
2994 {
2995   SQBool arg0;
2996   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2997     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2998     return SQ_ERROR;
2999   }
3000
3001   try {
3002     Scripting::debug_collrects(arg0 == SQTrue);
3003
3004     return 0;
3005
3006   } catch(std::exception& e) {
3007     sq_throwerror(vm, e.what());
3008     return SQ_ERROR;
3009   } catch(...) {
3010     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
3011     return SQ_ERROR;
3012   }
3013
3014 }
3015
3016 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
3017 {
3018   SQBool arg0;
3019   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3020     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3021     return SQ_ERROR;
3022   }
3023
3024   try {
3025     Scripting::debug_show_fps(arg0 == SQTrue);
3026
3027     return 0;
3028
3029   } catch(std::exception& e) {
3030     sq_throwerror(vm, e.what());
3031     return SQ_ERROR;
3032   } catch(...) {
3033     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
3034     return SQ_ERROR;
3035   }
3036
3037 }
3038
3039 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
3040 {
3041   SQBool arg0;
3042   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3043     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3044     return SQ_ERROR;
3045   }
3046
3047   try {
3048     Scripting::debug_draw_solids_only(arg0 == SQTrue);
3049
3050     return 0;
3051
3052   } catch(std::exception& e) {
3053     sq_throwerror(vm, e.what());
3054     return SQ_ERROR;
3055   } catch(...) {
3056     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
3057     return SQ_ERROR;
3058   }
3059
3060 }
3061
3062 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
3063 {
3064   const SQChar* arg0;
3065   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3066     sq_throwerror(vm, _SC("Argument 1 not a string"));
3067     return SQ_ERROR;
3068   }
3069
3070   try {
3071     Scripting::play_music(arg0);
3072
3073     return 0;
3074
3075   } catch(std::exception& e) {
3076     sq_throwerror(vm, e.what());
3077     return SQ_ERROR;
3078   } catch(...) {
3079     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
3080     return SQ_ERROR;
3081   }
3082
3083 }
3084
3085 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
3086 {
3087   const SQChar* arg0;
3088   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3089     sq_throwerror(vm, _SC("Argument 1 not a string"));
3090     return SQ_ERROR;
3091   }
3092
3093   try {
3094     Scripting::play_sound(arg0);
3095
3096     return 0;
3097
3098   } catch(std::exception& e) {
3099     sq_throwerror(vm, e.what());
3100     return SQ_ERROR;
3101   } catch(...) {
3102     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
3103     return SQ_ERROR;
3104   }
3105
3106 }
3107
3108 static SQInteger grease_wrapper(HSQUIRRELVM vm)
3109 {
3110   (void) vm;
3111
3112   try {
3113     Scripting::grease();
3114
3115     return 0;
3116
3117   } catch(std::exception& e) {
3118     sq_throwerror(vm, e.what());
3119     return SQ_ERROR;
3120   } catch(...) {
3121     sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
3122     return SQ_ERROR;
3123   }
3124
3125 }
3126
3127 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
3128 {
3129   (void) vm;
3130
3131   try {
3132     Scripting::invincible();
3133
3134     return 0;
3135
3136   } catch(std::exception& e) {
3137     sq_throwerror(vm, e.what());
3138     return SQ_ERROR;
3139   } catch(...) {
3140     sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
3141     return SQ_ERROR;
3142   }
3143
3144 }
3145
3146 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
3147 {
3148   (void) vm;
3149
3150   try {
3151     Scripting::ghost();
3152
3153     return 0;
3154
3155   } catch(std::exception& e) {
3156     sq_throwerror(vm, e.what());
3157     return SQ_ERROR;
3158   } catch(...) {
3159     sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
3160     return SQ_ERROR;
3161   }
3162
3163 }
3164
3165 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
3166 {
3167   (void) vm;
3168
3169   try {
3170     Scripting::mortal();
3171
3172     return 0;
3173
3174   } catch(std::exception& e) {
3175     sq_throwerror(vm, e.what());
3176     return SQ_ERROR;
3177   } catch(...) {
3178     sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
3179     return SQ_ERROR;
3180   }
3181
3182 }
3183
3184 static SQInteger restart_wrapper(HSQUIRRELVM vm)
3185 {
3186   (void) vm;
3187
3188   try {
3189     Scripting::restart();
3190
3191     return 0;
3192
3193   } catch(std::exception& e) {
3194     sq_throwerror(vm, e.what());
3195     return SQ_ERROR;
3196   } catch(...) {
3197     sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
3198     return SQ_ERROR;
3199   }
3200
3201 }
3202
3203 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
3204 {
3205   (void) vm;
3206
3207   try {
3208     Scripting::whereami();
3209
3210     return 0;
3211
3212   } catch(std::exception& e) {
3213     sq_throwerror(vm, e.what());
3214     return SQ_ERROR;
3215   } catch(...) {
3216     sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
3217     return SQ_ERROR;
3218   }
3219
3220 }
3221
3222 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
3223 {
3224   (void) vm;
3225
3226   try {
3227     Scripting::gotoend();
3228
3229     return 0;
3230
3231   } catch(std::exception& e) {
3232     sq_throwerror(vm, e.what());
3233     return SQ_ERROR;
3234   } catch(...) {
3235     sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
3236     return SQ_ERROR;
3237   }
3238
3239 }
3240
3241 static SQInteger camera_wrapper(HSQUIRRELVM vm)
3242 {
3243   (void) vm;
3244
3245   try {
3246     Scripting::camera();
3247
3248     return 0;
3249
3250   } catch(std::exception& e) {
3251     sq_throwerror(vm, e.what());
3252     return SQ_ERROR;
3253   } catch(...) {
3254     sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
3255     return SQ_ERROR;
3256   }
3257
3258 }
3259
3260 static SQInteger quit_wrapper(HSQUIRRELVM vm)
3261 {
3262   (void) vm;
3263
3264   try {
3265     Scripting::quit();
3266
3267     return 0;
3268
3269   } catch(std::exception& e) {
3270     sq_throwerror(vm, e.what());
3271     return SQ_ERROR;
3272   } catch(...) {
3273     sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
3274     return SQ_ERROR;
3275   }
3276
3277 }
3278
3279 static SQInteger rand_wrapper(HSQUIRRELVM vm)
3280 {
3281
3282   try {
3283     int return_value = Scripting::rand();
3284
3285     sq_pushinteger(vm, return_value);
3286     return 1;
3287
3288   } catch(std::exception& e) {
3289     sq_throwerror(vm, e.what());
3290     return SQ_ERROR;
3291   } catch(...) {
3292     sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
3293     return SQ_ERROR;
3294   }
3295
3296 }
3297
3298 } // end of namespace Wrapper
3299 void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
3300 {
3301   using namespace Wrapper;
3302
3303   sq_pushroottable(v);
3304   sq_pushstring(v, "DisplayEffect", -1);
3305   if(SQ_FAILED(sq_get(v, -2))) {
3306     std::ostringstream msg;
3307     msg << "Couldn't resolved squirrel type 'DisplayEffect'";
3308     throw SquirrelError(v, msg.str());
3309   }
3310
3311   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3312     std::ostringstream msg;
3313     msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
3314     throw SquirrelError(v, msg.str());
3315   }
3316   sq_remove(v, -2); // remove object name
3317
3318   if(setup_releasehook) {
3319     sq_setreleasehook(v, -1, DisplayEffect_release_hook);
3320   }
3321
3322   sq_remove(v, -2); // remove root table
3323 }
3324
3325 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
3326 {
3327   using namespace Wrapper;
3328
3329   sq_pushroottable(v);
3330   sq_pushstring(v, "Camera", -1);
3331   if(SQ_FAILED(sq_get(v, -2))) {
3332     std::ostringstream msg;
3333     msg << "Couldn't resolved squirrel type 'Camera'";
3334     throw SquirrelError(v, msg.str());
3335   }
3336
3337   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3338     std::ostringstream msg;
3339     msg << "Couldn't setup squirrel instance for object of type 'Camera'";
3340     throw SquirrelError(v, msg.str());
3341   }
3342   sq_remove(v, -2); // remove object name
3343
3344   if(setup_releasehook) {
3345     sq_setreleasehook(v, -1, Camera_release_hook);
3346   }
3347
3348   sq_remove(v, -2); // remove root table
3349 }
3350
3351 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Level* object, bool setup_releasehook)
3352 {
3353   using namespace Wrapper;
3354
3355   sq_pushroottable(v);
3356   sq_pushstring(v, "Level", -1);
3357   if(SQ_FAILED(sq_get(v, -2))) {
3358     std::ostringstream msg;
3359     msg << "Couldn't resolved squirrel type 'Level'";
3360     throw SquirrelError(v, msg.str());
3361   }
3362
3363   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3364     std::ostringstream msg;
3365     msg << "Couldn't setup squirrel instance for object of type 'Level'";
3366     throw SquirrelError(v, msg.str());
3367   }
3368   sq_remove(v, -2); // remove object name
3369
3370   if(setup_releasehook) {
3371     sq_setreleasehook(v, -1, Level_release_hook);
3372   }
3373
3374   sq_remove(v, -2); // remove root table
3375 }
3376
3377 void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
3378 {
3379   using namespace Wrapper;
3380
3381   sq_pushroottable(v);
3382   sq_pushstring(v, "ScriptedObject", -1);
3383   if(SQ_FAILED(sq_get(v, -2))) {
3384     std::ostringstream msg;
3385     msg << "Couldn't resolved squirrel type 'ScriptedObject'";
3386     throw SquirrelError(v, msg.str());
3387   }
3388
3389   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3390     std::ostringstream msg;
3391     msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
3392     throw SquirrelError(v, msg.str());
3393   }
3394   sq_remove(v, -2); // remove object name
3395
3396   if(setup_releasehook) {
3397     sq_setreleasehook(v, -1, ScriptedObject_release_hook);
3398   }
3399
3400   sq_remove(v, -2); // remove root table
3401 }
3402
3403 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
3404 {
3405   using namespace Wrapper;
3406
3407   sq_pushroottable(v);
3408   sq_pushstring(v, "Text", -1);
3409   if(SQ_FAILED(sq_get(v, -2))) {
3410     std::ostringstream msg;
3411     msg << "Couldn't resolved squirrel type 'Text'";
3412     throw SquirrelError(v, msg.str());
3413   }
3414
3415   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3416     std::ostringstream msg;
3417     msg << "Couldn't setup squirrel instance for object of type 'Text'";
3418     throw SquirrelError(v, msg.str());
3419   }
3420   sq_remove(v, -2); // remove object name
3421
3422   if(setup_releasehook) {
3423     sq_setreleasehook(v, -1, Text_release_hook);
3424   }
3425
3426   sq_remove(v, -2); // remove root table
3427 }
3428
3429 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
3430 {
3431   using namespace Wrapper;
3432
3433   sq_pushroottable(v);
3434   sq_pushstring(v, "Player", -1);
3435   if(SQ_FAILED(sq_get(v, -2))) {
3436     std::ostringstream msg;
3437     msg << "Couldn't resolved squirrel type 'Player'";
3438     throw SquirrelError(v, msg.str());
3439   }
3440
3441   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3442     std::ostringstream msg;
3443     msg << "Couldn't setup squirrel instance for object of type 'Player'";
3444     throw SquirrelError(v, msg.str());
3445   }
3446   sq_remove(v, -2); // remove object name
3447
3448   if(setup_releasehook) {
3449     sq_setreleasehook(v, -1, Player_release_hook);
3450   }
3451
3452   sq_remove(v, -2); // remove root table
3453 }
3454
3455 void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
3456 {
3457   using namespace Wrapper;
3458
3459   sq_pushroottable(v);
3460   sq_pushstring(v, "FloatingImage", -1);
3461   if(SQ_FAILED(sq_get(v, -2))) {
3462     std::ostringstream msg;
3463     msg << "Couldn't resolved squirrel type 'FloatingImage'";
3464     throw SquirrelError(v, msg.str());
3465   }
3466
3467   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3468     std::ostringstream msg;
3469     msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
3470     throw SquirrelError(v, msg.str());
3471   }
3472   sq_remove(v, -2); // remove object name
3473
3474   if(setup_releasehook) {
3475     sq_setreleasehook(v, -1, FloatingImage_release_hook);
3476   }
3477
3478   sq_remove(v, -2); // remove root table
3479 }
3480
3481 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
3482 {
3483   using namespace Wrapper;
3484
3485   sq_pushroottable(v);
3486   sq_pushstring(v, "Platform", -1);
3487   if(SQ_FAILED(sq_get(v, -2))) {
3488     std::ostringstream msg;
3489     msg << "Couldn't resolved squirrel type 'Platform'";
3490     throw SquirrelError(v, msg.str());
3491   }
3492
3493   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3494     std::ostringstream msg;
3495     msg << "Couldn't setup squirrel instance for object of type 'Platform'";
3496     throw SquirrelError(v, msg.str());
3497   }
3498   sq_remove(v, -2); // remove object name
3499
3500   if(setup_releasehook) {
3501     sq_setreleasehook(v, -1, Platform_release_hook);
3502   }
3503
3504   sq_remove(v, -2); // remove root table
3505 }
3506
3507 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
3508 {
3509   using namespace Wrapper;
3510
3511   sq_pushroottable(v);
3512   sq_pushstring(v, "Candle", -1);
3513   if(SQ_FAILED(sq_get(v, -2))) {
3514     std::ostringstream msg;
3515     msg << "Couldn't resolved squirrel type 'Candle'";
3516     throw SquirrelError(v, msg.str());
3517   }
3518
3519   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3520     std::ostringstream msg;
3521     msg << "Couldn't setup squirrel instance for object of type 'Candle'";
3522     throw SquirrelError(v, msg.str());
3523   }
3524   sq_remove(v, -2); // remove object name
3525
3526   if(setup_releasehook) {
3527     sq_setreleasehook(v, -1, Candle_release_hook);
3528   }
3529
3530   sq_remove(v, -2); // remove root table
3531 }
3532
3533 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
3534 {
3535   using namespace Wrapper;
3536
3537   sq_pushroottable(v);
3538   sq_pushstring(v, "Wind", -1);
3539   if(SQ_FAILED(sq_get(v, -2))) {
3540     std::ostringstream msg;
3541     msg << "Couldn't resolved squirrel type 'Wind'";
3542     throw SquirrelError(v, msg.str());
3543   }
3544
3545   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3546     std::ostringstream msg;
3547     msg << "Couldn't setup squirrel instance for object of type 'Wind'";
3548     throw SquirrelError(v, msg.str());
3549   }
3550   sq_remove(v, -2); // remove object name
3551
3552   if(setup_releasehook) {
3553     sq_setreleasehook(v, -1, Wind_release_hook);
3554   }
3555
3556   sq_remove(v, -2); // remove root table
3557 }
3558
3559 void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bool setup_releasehook)
3560 {
3561   using namespace Wrapper;
3562
3563   sq_pushroottable(v);
3564   sq_pushstring(v, "AmbientSound", -1);
3565   if(SQ_FAILED(sq_get(v, -2))) {
3566     std::ostringstream msg;
3567     msg << "Couldn't resolved squirrel type 'AmbientSound'";
3568     throw SquirrelError(v, msg.str());
3569   }
3570
3571   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3572     std::ostringstream msg;
3573     msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'";
3574     throw SquirrelError(v, msg.str());
3575   }
3576   sq_remove(v, -2); // remove object name
3577
3578   if(setup_releasehook) {
3579     sq_setreleasehook(v, -1, AmbientSound_release_hook);
3580   }
3581
3582   sq_remove(v, -2); // remove root table
3583 }
3584
3585 void create_squirrel_instance(HSQUIRRELVM v, Scripting::Thunderstorm* object, bool setup_releasehook)
3586 {
3587   using namespace Wrapper;
3588
3589   sq_pushroottable(v);
3590   sq_pushstring(v, "Thunderstorm", -1);
3591   if(SQ_FAILED(sq_get(v, -2))) {
3592     std::ostringstream msg;
3593     msg << "Couldn't resolved squirrel type 'Thunderstorm'";
3594     throw SquirrelError(v, msg.str());
3595   }
3596
3597   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3598     std::ostringstream msg;
3599     msg << "Couldn't setup squirrel instance for object of type 'Thunderstorm'";
3600     throw SquirrelError(v, msg.str());
3601   }
3602   sq_remove(v, -2); // remove object name
3603
3604   if(setup_releasehook) {
3605     sq_setreleasehook(v, -1, Thunderstorm_release_hook);
3606   }
3607
3608   sq_remove(v, -2); // remove root table
3609 }
3610
3611 void create_squirrel_instance(HSQUIRRELVM v, Scripting::TileMap* object, bool setup_releasehook)
3612 {
3613   using namespace Wrapper;
3614
3615   sq_pushroottable(v);
3616   sq_pushstring(v, "TileMap", -1);
3617   if(SQ_FAILED(sq_get(v, -2))) {
3618     std::ostringstream msg;
3619     msg << "Couldn't resolved squirrel type 'TileMap'";
3620     throw SquirrelError(v, msg.str());
3621   }
3622
3623   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3624     std::ostringstream msg;
3625     msg << "Couldn't setup squirrel instance for object of type 'TileMap'";
3626     throw SquirrelError(v, msg.str());
3627   }
3628   sq_remove(v, -2); // remove object name
3629
3630   if(setup_releasehook) {
3631     sq_setreleasehook(v, -1, TileMap_release_hook);
3632   }
3633
3634   sq_remove(v, -2); // remove root table
3635 }
3636
3637 void create_squirrel_instance(HSQUIRRELVM v, Scripting::SSector* object, bool setup_releasehook)
3638 {
3639   using namespace Wrapper;
3640
3641   sq_pushroottable(v);
3642   sq_pushstring(v, "SSector", -1);
3643   if(SQ_FAILED(sq_get(v, -2))) {
3644     std::ostringstream msg;
3645     msg << "Couldn't resolved squirrel type 'SSector'";
3646     throw SquirrelError(v, msg.str());
3647   }
3648
3649   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3650     std::ostringstream msg;
3651     msg << "Couldn't setup squirrel instance for object of type 'SSector'";
3652     throw SquirrelError(v, msg.str());
3653   }
3654   sq_remove(v, -2); // remove object name
3655
3656   if(setup_releasehook) {
3657     sq_setreleasehook(v, -1, SSector_release_hook);
3658   }
3659
3660   sq_remove(v, -2); // remove root table
3661 }
3662
3663 void create_squirrel_instance(HSQUIRRELVM v, Scripting::LevelTime* object, bool setup_releasehook)
3664 {
3665   using namespace Wrapper;
3666
3667   sq_pushroottable(v);
3668   sq_pushstring(v, "LevelTime", -1);
3669   if(SQ_FAILED(sq_get(v, -2))) {
3670     std::ostringstream msg;
3671     msg << "Couldn't resolved squirrel type 'LevelTime'";
3672     throw SquirrelError(v, msg.str());
3673   }
3674
3675   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3676     std::ostringstream msg;
3677     msg << "Couldn't setup squirrel instance for object of type 'LevelTime'";
3678     throw SquirrelError(v, msg.str());
3679   }
3680   sq_remove(v, -2); // remove object name
3681
3682   if(setup_releasehook) {
3683     sq_setreleasehook(v, -1, LevelTime_release_hook);
3684   }
3685
3686   sq_remove(v, -2); // remove root table
3687 }
3688
3689 void register_supertux_wrapper(HSQUIRRELVM v)
3690 {
3691   using namespace Wrapper;
3692
3693   sq_pushstring(v, "ANCHOR_TOP", -1);
3694   sq_pushinteger(v, 16);
3695   if(SQ_FAILED(sq_createslot(v, -3))) {
3696     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
3697   }
3698
3699   sq_pushstring(v, "ANCHOR_BOTTOM", -1);
3700   sq_pushinteger(v, 32);
3701   if(SQ_FAILED(sq_createslot(v, -3))) {
3702     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
3703   }
3704
3705   sq_pushstring(v, "ANCHOR_LEFT", -1);
3706   sq_pushinteger(v, 1);
3707   if(SQ_FAILED(sq_createslot(v, -3))) {
3708     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
3709   }
3710
3711   sq_pushstring(v, "ANCHOR_RIGHT", -1);
3712   sq_pushinteger(v, 2);
3713   if(SQ_FAILED(sq_createslot(v, -3))) {
3714     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
3715   }
3716
3717   sq_pushstring(v, "ANCHOR_MIDDLE", -1);
3718   sq_pushinteger(v, 0);
3719   if(SQ_FAILED(sq_createslot(v, -3))) {
3720     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
3721   }
3722
3723   sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
3724   sq_pushinteger(v, 17);
3725   if(SQ_FAILED(sq_createslot(v, -3))) {
3726     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
3727   }
3728
3729   sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
3730   sq_pushinteger(v, 18);
3731   if(SQ_FAILED(sq_createslot(v, -3))) {
3732     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
3733   }
3734
3735   sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
3736   sq_pushinteger(v, 33);
3737   if(SQ_FAILED(sq_createslot(v, -3))) {
3738     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
3739   }
3740
3741   sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
3742   sq_pushinteger(v, 34);
3743   if(SQ_FAILED(sq_createslot(v, -3))) {
3744     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
3745   }
3746
3747   sq_pushstring(v, "display", -1);
3748   sq_newclosure(v, &display_wrapper, 0);
3749   if(SQ_FAILED(sq_createslot(v, -3))) {
3750     throw SquirrelError(v, "Couldn't register function 'display'");
3751   }
3752
3753   sq_pushstring(v, "print_stacktrace", -1);
3754   sq_newclosure(v, &print_stacktrace_wrapper, 0);
3755   if(SQ_FAILED(sq_createslot(v, -3))) {
3756     throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
3757   }
3758
3759   sq_pushstring(v, "get_current_thread", -1);
3760   sq_newclosure(v, &get_current_thread_wrapper, 0);
3761   if(SQ_FAILED(sq_createslot(v, -3))) {
3762     throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
3763   }
3764
3765   sq_pushstring(v, "display_text_file", -1);
3766   sq_newclosure(v, &display_text_file_wrapper, 0);
3767   if(SQ_FAILED(sq_createslot(v, -3))) {
3768     throw SquirrelError(v, "Couldn't register function 'display_text_file'");
3769   }
3770
3771   sq_pushstring(v, "load_worldmap", -1);
3772   sq_newclosure(v, &load_worldmap_wrapper, 0);
3773   if(SQ_FAILED(sq_createslot(v, -3))) {
3774     throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
3775   }
3776
3777   sq_pushstring(v, "load_level", -1);
3778   sq_newclosure(v, &load_level_wrapper, 0);
3779   if(SQ_FAILED(sq_createslot(v, -3))) {
3780     throw SquirrelError(v, "Couldn't register function 'load_level'");
3781   }
3782
3783   sq_pushstring(v, "wait", -1);
3784   sq_newclosure(v, &wait_wrapper, 0);
3785   if(SQ_FAILED(sq_createslot(v, -3))) {
3786     throw SquirrelError(v, "Couldn't register function 'wait'");
3787   }
3788
3789   sq_pushstring(v, "wait_for_screenswitch", -1);
3790   sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
3791   if(SQ_FAILED(sq_createslot(v, -3))) {
3792     throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
3793   }
3794
3795   sq_pushstring(v, "exit_screen", -1);
3796   sq_newclosure(v, &exit_screen_wrapper, 0);
3797   if(SQ_FAILED(sq_createslot(v, -3))) {
3798     throw SquirrelError(v, "Couldn't register function 'exit_screen'");
3799   }
3800
3801   sq_pushstring(v, "fadeout_screen", -1);
3802   sq_newclosure(v, &fadeout_screen_wrapper, 0);
3803   if(SQ_FAILED(sq_createslot(v, -3))) {
3804     throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
3805   }
3806
3807   sq_pushstring(v, "shrink_screen", -1);
3808   sq_newclosure(v, &shrink_screen_wrapper, 0);
3809   if(SQ_FAILED(sq_createslot(v, -3))) {
3810     throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
3811   }
3812
3813   sq_pushstring(v, "abort_screenfade", -1);
3814   sq_newclosure(v, &abort_screenfade_wrapper, 0);
3815   if(SQ_FAILED(sq_createslot(v, -3))) {
3816     throw SquirrelError(v, "Couldn't register function 'abort_screenfade'");
3817   }
3818
3819   sq_pushstring(v, "translate", -1);
3820   sq_newclosure(v, &translate_wrapper, 0);
3821   if(SQ_FAILED(sq_createslot(v, -3))) {
3822     throw SquirrelError(v, "Couldn't register function 'translate'");
3823   }
3824
3825   sq_pushstring(v, "import", -1);
3826   sq_newclosure(v, &import_wrapper, 0);
3827   if(SQ_FAILED(sq_createslot(v, -3))) {
3828     throw SquirrelError(v, "Couldn't register function 'import'");
3829   }
3830
3831   sq_pushstring(v, "save_state", -1);
3832   sq_newclosure(v, &save_state_wrapper, 0);
3833   if(SQ_FAILED(sq_createslot(v, -3))) {
3834     throw SquirrelError(v, "Couldn't register function 'save_state'");
3835   }
3836
3837   sq_pushstring(v, "update_worldmap", -1);
3838   sq_newclosure(v, &update_worldmap_wrapper, 0);
3839   if(SQ_FAILED(sq_createslot(v, -3))) {
3840     throw SquirrelError(v, "Couldn't register function 'update_worldmap'");
3841   }
3842
3843   sq_pushstring(v, "debug_collrects", -1);
3844   sq_newclosure(v, &debug_collrects_wrapper, 0);
3845   if(SQ_FAILED(sq_createslot(v, -3))) {
3846     throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
3847   }
3848
3849   sq_pushstring(v, "debug_show_fps", -1);
3850   sq_newclosure(v, &debug_show_fps_wrapper, 0);
3851   if(SQ_FAILED(sq_createslot(v, -3))) {
3852     throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
3853   }
3854
3855   sq_pushstring(v, "debug_draw_solids_only", -1);
3856   sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
3857   if(SQ_FAILED(sq_createslot(v, -3))) {
3858     throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
3859   }
3860
3861   sq_pushstring(v, "play_music", -1);
3862   sq_newclosure(v, &play_music_wrapper, 0);
3863   if(SQ_FAILED(sq_createslot(v, -3))) {
3864     throw SquirrelError(v, "Couldn't register function 'play_music'");
3865   }
3866
3867   sq_pushstring(v, "play_sound", -1);
3868   sq_newclosure(v, &play_sound_wrapper, 0);
3869   if(SQ_FAILED(sq_createslot(v, -3))) {
3870     throw SquirrelError(v, "Couldn't register function 'play_sound'");
3871   }
3872
3873   sq_pushstring(v, "grease", -1);
3874   sq_newclosure(v, &grease_wrapper, 0);
3875   if(SQ_FAILED(sq_createslot(v, -3))) {
3876     throw SquirrelError(v, "Couldn't register function 'grease'");
3877   }
3878
3879   sq_pushstring(v, "invincible", -1);
3880   sq_newclosure(v, &invincible_wrapper, 0);
3881   if(SQ_FAILED(sq_createslot(v, -3))) {
3882     throw SquirrelError(v, "Couldn't register function 'invincible'");
3883   }
3884
3885   sq_pushstring(v, "ghost", -1);
3886   sq_newclosure(v, &ghost_wrapper, 0);
3887   if(SQ_FAILED(sq_createslot(v, -3))) {
3888     throw SquirrelError(v, "Couldn't register function 'ghost'");
3889   }
3890
3891   sq_pushstring(v, "mortal", -1);
3892   sq_newclosure(v, &mortal_wrapper, 0);
3893   if(SQ_FAILED(sq_createslot(v, -3))) {
3894     throw SquirrelError(v, "Couldn't register function 'mortal'");
3895   }
3896
3897   sq_pushstring(v, "restart", -1);
3898   sq_newclosure(v, &restart_wrapper, 0);
3899   if(SQ_FAILED(sq_createslot(v, -3))) {
3900     throw SquirrelError(v, "Couldn't register function 'restart'");
3901   }
3902
3903   sq_pushstring(v, "whereami", -1);
3904   sq_newclosure(v, &whereami_wrapper, 0);
3905   if(SQ_FAILED(sq_createslot(v, -3))) {
3906     throw SquirrelError(v, "Couldn't register function 'whereami'");
3907   }
3908
3909   sq_pushstring(v, "gotoend", -1);
3910   sq_newclosure(v, &gotoend_wrapper, 0);
3911   if(SQ_FAILED(sq_createslot(v, -3))) {
3912     throw SquirrelError(v, "Couldn't register function 'gotoend'");
3913   }
3914
3915   sq_pushstring(v, "camera", -1);
3916   sq_newclosure(v, &camera_wrapper, 0);
3917   if(SQ_FAILED(sq_createslot(v, -3))) {
3918     throw SquirrelError(v, "Couldn't register function 'camera'");
3919   }
3920
3921   sq_pushstring(v, "quit", -1);
3922   sq_newclosure(v, &quit_wrapper, 0);
3923   if(SQ_FAILED(sq_createslot(v, -3))) {
3924     throw SquirrelError(v, "Couldn't register function 'quit'");
3925   }
3926
3927   sq_pushstring(v, "rand", -1);
3928   sq_newclosure(v, &rand_wrapper, 0);
3929   if(SQ_FAILED(sq_createslot(v, -3))) {
3930     throw SquirrelError(v, "Couldn't register function 'rand'");
3931   }
3932
3933   // Register class DisplayEffect
3934   sq_pushstring(v, "DisplayEffect", -1);
3935   if(sq_newclass(v, SQFalse) < 0) {
3936     std::ostringstream msg;
3937     msg << "Couldn't create new class 'DisplayEffect'";
3938     throw SquirrelError(v, msg.str());
3939   }
3940   sq_pushstring(v, "fade_out", -1);
3941   sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
3942   if(SQ_FAILED(sq_createslot(v, -3))) {
3943     throw SquirrelError(v, "Couldn't register function 'fade_out'");
3944   }
3945
3946   sq_pushstring(v, "fade_in", -1);
3947   sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
3948   if(SQ_FAILED(sq_createslot(v, -3))) {
3949     throw SquirrelError(v, "Couldn't register function 'fade_in'");
3950   }
3951
3952   sq_pushstring(v, "set_black", -1);
3953   sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
3954   if(SQ_FAILED(sq_createslot(v, -3))) {
3955     throw SquirrelError(v, "Couldn't register function 'set_black'");
3956   }
3957
3958   sq_pushstring(v, "is_black", -1);
3959   sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
3960   if(SQ_FAILED(sq_createslot(v, -3))) {
3961     throw SquirrelError(v, "Couldn't register function 'is_black'");
3962   }
3963
3964   sq_pushstring(v, "sixteen_to_nine", -1);
3965   sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
3966   if(SQ_FAILED(sq_createslot(v, -3))) {
3967     throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
3968   }
3969
3970   sq_pushstring(v, "four_to_three", -1);
3971   sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
3972   if(SQ_FAILED(sq_createslot(v, -3))) {
3973     throw SquirrelError(v, "Couldn't register function 'four_to_three'");
3974   }
3975
3976   if(SQ_FAILED(sq_createslot(v, -3))) {
3977     throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
3978   }
3979
3980   // Register class Camera
3981   sq_pushstring(v, "Camera", -1);
3982   if(sq_newclass(v, SQFalse) < 0) {
3983     std::ostringstream msg;
3984     msg << "Couldn't create new class 'Camera'";
3985     throw SquirrelError(v, msg.str());
3986   }
3987   sq_pushstring(v, "reload_config", -1);
3988   sq_newclosure(v, &Camera_reload_config_wrapper, 0);
3989   if(SQ_FAILED(sq_createslot(v, -3))) {
3990     throw SquirrelError(v, "Couldn't register function 'reload_config'");
3991   }
3992
3993   sq_pushstring(v, "shake", -1);
3994   sq_newclosure(v, &Camera_shake_wrapper, 0);
3995   if(SQ_FAILED(sq_createslot(v, -3))) {
3996     throw SquirrelError(v, "Couldn't register function 'shake'");
3997   }
3998
3999   sq_pushstring(v, "set_pos", -1);
4000   sq_newclosure(v, &Camera_set_pos_wrapper, 0);
4001   if(SQ_FAILED(sq_createslot(v, -3))) {
4002     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4003   }
4004
4005   sq_pushstring(v, "set_mode", -1);
4006   sq_newclosure(v, &Camera_set_mode_wrapper, 0);
4007   if(SQ_FAILED(sq_createslot(v, -3))) {
4008     throw SquirrelError(v, "Couldn't register function 'set_mode'");
4009   }
4010
4011   sq_pushstring(v, "scroll_to", -1);
4012   sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
4013   if(SQ_FAILED(sq_createslot(v, -3))) {
4014     throw SquirrelError(v, "Couldn't register function 'scroll_to'");
4015   }
4016
4017   if(SQ_FAILED(sq_createslot(v, -3))) {
4018     throw SquirrelError(v, "Couldn't register class 'Camera'");
4019   }
4020
4021   // Register class Level
4022   sq_pushstring(v, "Level", -1);
4023   if(sq_newclass(v, SQFalse) < 0) {
4024     std::ostringstream msg;
4025     msg << "Couldn't create new class 'Level'";
4026     throw SquirrelError(v, msg.str());
4027   }
4028   sq_pushstring(v, "finish", -1);
4029   sq_newclosure(v, &Level_finish_wrapper, 0);
4030   if(SQ_FAILED(sq_createslot(v, -3))) {
4031     throw SquirrelError(v, "Couldn't register function 'finish'");
4032   }
4033
4034   sq_pushstring(v, "spawn", -1);
4035   sq_newclosure(v, &Level_spawn_wrapper, 0);
4036   if(SQ_FAILED(sq_createslot(v, -3))) {
4037     throw SquirrelError(v, "Couldn't register function 'spawn'");
4038   }
4039
4040   sq_pushstring(v, "flip_vertically", -1);
4041   sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
4042   if(SQ_FAILED(sq_createslot(v, -3))) {
4043     throw SquirrelError(v, "Couldn't register function 'flip_vertically'");
4044   }
4045
4046   sq_pushstring(v, "toggle_pause", -1);
4047   sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
4048   if(SQ_FAILED(sq_createslot(v, -3))) {
4049     throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
4050   }
4051
4052   if(SQ_FAILED(sq_createslot(v, -3))) {
4053     throw SquirrelError(v, "Couldn't register class 'Level'");
4054   }
4055
4056   // Register class ScriptedObject
4057   sq_pushstring(v, "ScriptedObject", -1);
4058   if(sq_newclass(v, SQFalse) < 0) {
4059     std::ostringstream msg;
4060     msg << "Couldn't create new class 'ScriptedObject'";
4061     throw SquirrelError(v, msg.str());
4062   }
4063   sq_pushstring(v, "set_action", -1);
4064   sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
4065   if(SQ_FAILED(sq_createslot(v, -3))) {
4066     throw SquirrelError(v, "Couldn't register function 'set_action'");
4067   }
4068
4069   sq_pushstring(v, "get_action", -1);
4070   sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
4071   if(SQ_FAILED(sq_createslot(v, -3))) {
4072     throw SquirrelError(v, "Couldn't register function 'get_action'");
4073   }
4074
4075   sq_pushstring(v, "move", -1);
4076   sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
4077   if(SQ_FAILED(sq_createslot(v, -3))) {
4078     throw SquirrelError(v, "Couldn't register function 'move'");
4079   }
4080
4081   sq_pushstring(v, "set_pos", -1);
4082   sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
4083   if(SQ_FAILED(sq_createslot(v, -3))) {
4084     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4085   }
4086
4087   sq_pushstring(v, "get_pos_x", -1);
4088   sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
4089   if(SQ_FAILED(sq_createslot(v, -3))) {
4090     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4091   }
4092
4093   sq_pushstring(v, "get_pos_y", -1);
4094   sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
4095   if(SQ_FAILED(sq_createslot(v, -3))) {
4096     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4097   }
4098
4099   sq_pushstring(v, "set_velocity", -1);
4100   sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
4101   if(SQ_FAILED(sq_createslot(v, -3))) {
4102     throw SquirrelError(v, "Couldn't register function 'set_velocity'");
4103   }
4104
4105   sq_pushstring(v, "get_velocity_x", -1);
4106   sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
4107   if(SQ_FAILED(sq_createslot(v, -3))) {
4108     throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
4109   }
4110
4111   sq_pushstring(v, "get_velocity_y", -1);
4112   sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
4113   if(SQ_FAILED(sq_createslot(v, -3))) {
4114     throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
4115   }
4116
4117   sq_pushstring(v, "set_visible", -1);
4118   sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
4119   if(SQ_FAILED(sq_createslot(v, -3))) {
4120     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4121   }
4122
4123   sq_pushstring(v, "is_visible", -1);
4124   sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
4125   if(SQ_FAILED(sq_createslot(v, -3))) {
4126     throw SquirrelError(v, "Couldn't register function 'is_visible'");
4127   }
4128
4129   sq_pushstring(v, "set_solid", -1);
4130   sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
4131   if(SQ_FAILED(sq_createslot(v, -3))) {
4132     throw SquirrelError(v, "Couldn't register function 'set_solid'");
4133   }
4134
4135   sq_pushstring(v, "is_solid", -1);
4136   sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
4137   if(SQ_FAILED(sq_createslot(v, -3))) {
4138     throw SquirrelError(v, "Couldn't register function 'is_solid'");
4139   }
4140
4141   sq_pushstring(v, "get_name", -1);
4142   sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
4143   if(SQ_FAILED(sq_createslot(v, -3))) {
4144     throw SquirrelError(v, "Couldn't register function 'get_name'");
4145   }
4146
4147   if(SQ_FAILED(sq_createslot(v, -3))) {
4148     throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
4149   }
4150
4151   // Register class Text
4152   sq_pushstring(v, "Text", -1);
4153   if(sq_newclass(v, SQFalse) < 0) {
4154     std::ostringstream msg;
4155     msg << "Couldn't create new class 'Text'";
4156     throw SquirrelError(v, msg.str());
4157   }
4158   sq_pushstring(v, "set_text", -1);
4159   sq_newclosure(v, &Text_set_text_wrapper, 0);
4160   if(SQ_FAILED(sq_createslot(v, -3))) {
4161     throw SquirrelError(v, "Couldn't register function 'set_text'");
4162   }
4163
4164   sq_pushstring(v, "set_font", -1);
4165   sq_newclosure(v, &Text_set_font_wrapper, 0);
4166   if(SQ_FAILED(sq_createslot(v, -3))) {
4167     throw SquirrelError(v, "Couldn't register function 'set_font'");
4168   }
4169
4170   sq_pushstring(v, "fade_in", -1);
4171   sq_newclosure(v, &Text_fade_in_wrapper, 0);
4172   if(SQ_FAILED(sq_createslot(v, -3))) {
4173     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4174   }
4175
4176   sq_pushstring(v, "fade_out", -1);
4177   sq_newclosure(v, &Text_fade_out_wrapper, 0);
4178   if(SQ_FAILED(sq_createslot(v, -3))) {
4179     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4180   }
4181
4182   sq_pushstring(v, "set_visible", -1);
4183   sq_newclosure(v, &Text_set_visible_wrapper, 0);
4184   if(SQ_FAILED(sq_createslot(v, -3))) {
4185     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4186   }
4187
4188   sq_pushstring(v, "set_centered", -1);
4189   sq_newclosure(v, &Text_set_centered_wrapper, 0);
4190   if(SQ_FAILED(sq_createslot(v, -3))) {
4191     throw SquirrelError(v, "Couldn't register function 'set_centered'");
4192   }
4193
4194   if(SQ_FAILED(sq_createslot(v, -3))) {
4195     throw SquirrelError(v, "Couldn't register class 'Text'");
4196   }
4197
4198   // Register class Player
4199   sq_pushstring(v, "Player", -1);
4200   if(sq_newclass(v, SQFalse) < 0) {
4201     std::ostringstream msg;
4202     msg << "Couldn't create new class 'Player'";
4203     throw SquirrelError(v, msg.str());
4204   }
4205   sq_pushstring(v, "add_bonus", -1);
4206   sq_newclosure(v, &Player_add_bonus_wrapper, 0);
4207   if(SQ_FAILED(sq_createslot(v, -3))) {
4208     throw SquirrelError(v, "Couldn't register function 'add_bonus'");
4209   }
4210
4211   sq_pushstring(v, "add_coins", -1);
4212   sq_newclosure(v, &Player_add_coins_wrapper, 0);
4213   if(SQ_FAILED(sq_createslot(v, -3))) {
4214     throw SquirrelError(v, "Couldn't register function 'add_coins'");
4215   }
4216
4217   sq_pushstring(v, "make_invincible", -1);
4218   sq_newclosure(v, &Player_make_invincible_wrapper, 0);
4219   if(SQ_FAILED(sq_createslot(v, -3))) {
4220     throw SquirrelError(v, "Couldn't register function 'make_invincible'");
4221   }
4222
4223   sq_pushstring(v, "deactivate", -1);
4224   sq_newclosure(v, &Player_deactivate_wrapper, 0);
4225   if(SQ_FAILED(sq_createslot(v, -3))) {
4226     throw SquirrelError(v, "Couldn't register function 'deactivate'");
4227   }
4228
4229   sq_pushstring(v, "activate", -1);
4230   sq_newclosure(v, &Player_activate_wrapper, 0);
4231   if(SQ_FAILED(sq_createslot(v, -3))) {
4232     throw SquirrelError(v, "Couldn't register function 'activate'");
4233   }
4234
4235   sq_pushstring(v, "walk", -1);
4236   sq_newclosure(v, &Player_walk_wrapper, 0);
4237   if(SQ_FAILED(sq_createslot(v, -3))) {
4238     throw SquirrelError(v, "Couldn't register function 'walk'");
4239   }
4240
4241   sq_pushstring(v, "set_visible", -1);
4242   sq_newclosure(v, &Player_set_visible_wrapper, 0);
4243   if(SQ_FAILED(sq_createslot(v, -3))) {
4244     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4245   }
4246
4247   sq_pushstring(v, "get_visible", -1);
4248   sq_newclosure(v, &Player_get_visible_wrapper, 0);
4249   if(SQ_FAILED(sq_createslot(v, -3))) {
4250     throw SquirrelError(v, "Couldn't register function 'get_visible'");
4251   }
4252
4253   sq_pushstring(v, "kill", -1);
4254   sq_newclosure(v, &Player_kill_wrapper, 0);
4255   if(SQ_FAILED(sq_createslot(v, -3))) {
4256     throw SquirrelError(v, "Couldn't register function 'kill'");
4257   }
4258
4259   sq_pushstring(v, "set_ghost_mode", -1);
4260   sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
4261   if(SQ_FAILED(sq_createslot(v, -3))) {
4262     throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
4263   }
4264
4265   sq_pushstring(v, "get_ghost_mode", -1);
4266   sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
4267   if(SQ_FAILED(sq_createslot(v, -3))) {
4268     throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
4269   }
4270
4271   sq_pushstring(v, "do_cheer", -1);
4272   sq_newclosure(v, &Player_do_cheer_wrapper, 0);
4273   if(SQ_FAILED(sq_createslot(v, -3))) {
4274     throw SquirrelError(v, "Couldn't register function 'do_cheer'");
4275   }
4276
4277   sq_pushstring(v, "do_duck", -1);
4278   sq_newclosure(v, &Player_do_duck_wrapper, 0);
4279   if(SQ_FAILED(sq_createslot(v, -3))) {
4280     throw SquirrelError(v, "Couldn't register function 'do_duck'");
4281   }
4282
4283   sq_pushstring(v, "do_standup", -1);
4284   sq_newclosure(v, &Player_do_standup_wrapper, 0);
4285   if(SQ_FAILED(sq_createslot(v, -3))) {
4286     throw SquirrelError(v, "Couldn't register function 'do_standup'");
4287   }
4288
4289   sq_pushstring(v, "do_backflip", -1);
4290   sq_newclosure(v, &Player_do_backflip_wrapper, 0);
4291   if(SQ_FAILED(sq_createslot(v, -3))) {
4292     throw SquirrelError(v, "Couldn't register function 'do_backflip'");
4293   }
4294
4295   sq_pushstring(v, "do_jump", -1);
4296   sq_newclosure(v, &Player_do_jump_wrapper, 0);
4297   if(SQ_FAILED(sq_createslot(v, -3))) {
4298     throw SquirrelError(v, "Couldn't register function 'do_jump'");
4299   }
4300
4301   sq_pushstring(v, "trigger_sequence", -1);
4302   sq_newclosure(v, &Player_trigger_sequence_wrapper, 0);
4303   if(SQ_FAILED(sq_createslot(v, -3))) {
4304     throw SquirrelError(v, "Couldn't register function 'trigger_sequence'");
4305   }
4306
4307   if(SQ_FAILED(sq_createslot(v, -3))) {
4308     throw SquirrelError(v, "Couldn't register class 'Player'");
4309   }
4310
4311   // Register class FloatingImage
4312   sq_pushstring(v, "FloatingImage", -1);
4313   if(sq_newclass(v, SQFalse) < 0) {
4314     std::ostringstream msg;
4315     msg << "Couldn't create new class 'FloatingImage'";
4316     throw SquirrelError(v, msg.str());
4317   }
4318   sq_pushstring(v, "constructor", -1);
4319   sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
4320   if(SQ_FAILED(sq_createslot(v, -3))) {
4321     throw SquirrelError(v, "Couldn't register function 'constructor'");
4322   }
4323
4324   sq_pushstring(v, "set_layer", -1);
4325   sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
4326   if(SQ_FAILED(sq_createslot(v, -3))) {
4327     throw SquirrelError(v, "Couldn't register function 'set_layer'");
4328   }
4329
4330   sq_pushstring(v, "get_layer", -1);
4331   sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
4332   if(SQ_FAILED(sq_createslot(v, -3))) {
4333     throw SquirrelError(v, "Couldn't register function 'get_layer'");
4334   }
4335
4336   sq_pushstring(v, "set_pos", -1);
4337   sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
4338   if(SQ_FAILED(sq_createslot(v, -3))) {
4339     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4340   }
4341
4342   sq_pushstring(v, "get_pos_x", -1);
4343   sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
4344   if(SQ_FAILED(sq_createslot(v, -3))) {
4345     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4346   }
4347
4348   sq_pushstring(v, "get_pos_y", -1);
4349   sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
4350   if(SQ_FAILED(sq_createslot(v, -3))) {
4351     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4352   }
4353
4354   sq_pushstring(v, "set_anchor_point", -1);
4355   sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
4356   if(SQ_FAILED(sq_createslot(v, -3))) {
4357     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4358   }
4359
4360   sq_pushstring(v, "get_anchor_point", -1);
4361   sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
4362   if(SQ_FAILED(sq_createslot(v, -3))) {
4363     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4364   }
4365
4366   sq_pushstring(v, "set_visible", -1);
4367   sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
4368   if(SQ_FAILED(sq_createslot(v, -3))) {
4369     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4370   }
4371
4372   sq_pushstring(v, "get_visible", -1);
4373   sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
4374   if(SQ_FAILED(sq_createslot(v, -3))) {
4375     throw SquirrelError(v, "Couldn't register function 'get_visible'");
4376   }
4377
4378   sq_pushstring(v, "set_action", -1);
4379   sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
4380   if(SQ_FAILED(sq_createslot(v, -3))) {
4381     throw SquirrelError(v, "Couldn't register function 'set_action'");
4382   }
4383
4384   sq_pushstring(v, "get_action", -1);
4385   sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
4386   if(SQ_FAILED(sq_createslot(v, -3))) {
4387     throw SquirrelError(v, "Couldn't register function 'get_action'");
4388   }
4389
4390   sq_pushstring(v, "fade_in", -1);
4391   sq_newclosure(v, &FloatingImage_fade_in_wrapper, 0);
4392   if(SQ_FAILED(sq_createslot(v, -3))) {
4393     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4394   }
4395
4396   sq_pushstring(v, "fade_out", -1);
4397   sq_newclosure(v, &FloatingImage_fade_out_wrapper, 0);
4398   if(SQ_FAILED(sq_createslot(v, -3))) {
4399     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4400   }
4401
4402   if(SQ_FAILED(sq_createslot(v, -3))) {
4403     throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
4404   }
4405
4406   // Register class Platform
4407   sq_pushstring(v, "Platform", -1);
4408   if(sq_newclass(v, SQFalse) < 0) {
4409     std::ostringstream msg;
4410     msg << "Couldn't create new class 'Platform'";
4411     throw SquirrelError(v, msg.str());
4412   }
4413   sq_pushstring(v, "goto_node", -1);
4414   sq_newclosure(v, &Platform_goto_node_wrapper, 0);
4415   if(SQ_FAILED(sq_createslot(v, -3))) {
4416     throw SquirrelError(v, "Couldn't register function 'goto_node'");
4417   }
4418
4419   sq_pushstring(v, "start_moving", -1);
4420   sq_newclosure(v, &Platform_start_moving_wrapper, 0);
4421   if(SQ_FAILED(sq_createslot(v, -3))) {
4422     throw SquirrelError(v, "Couldn't register function 'start_moving'");
4423   }
4424
4425   sq_pushstring(v, "stop_moving", -1);
4426   sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
4427   if(SQ_FAILED(sq_createslot(v, -3))) {
4428     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
4429   }
4430
4431   if(SQ_FAILED(sq_createslot(v, -3))) {
4432     throw SquirrelError(v, "Couldn't register class 'Platform'");
4433   }
4434
4435   // Register class Candle
4436   sq_pushstring(v, "Candle", -1);
4437   if(sq_newclass(v, SQFalse) < 0) {
4438     std::ostringstream msg;
4439     msg << "Couldn't create new class 'Candle'";
4440     throw SquirrelError(v, msg.str());
4441   }
4442   sq_pushstring(v, "get_burning", -1);
4443   sq_newclosure(v, &Candle_get_burning_wrapper, 0);
4444   if(SQ_FAILED(sq_createslot(v, -3))) {
4445     throw SquirrelError(v, "Couldn't register function 'get_burning'");
4446   }
4447
4448   sq_pushstring(v, "set_burning", -1);
4449   sq_newclosure(v, &Candle_set_burning_wrapper, 0);
4450   if(SQ_FAILED(sq_createslot(v, -3))) {
4451     throw SquirrelError(v, "Couldn't register function 'set_burning'");
4452   }
4453
4454   if(SQ_FAILED(sq_createslot(v, -3))) {
4455     throw SquirrelError(v, "Couldn't register class 'Candle'");
4456   }
4457
4458   // Register class Wind
4459   sq_pushstring(v, "Wind", -1);
4460   if(sq_newclass(v, SQFalse) < 0) {
4461     std::ostringstream msg;
4462     msg << "Couldn't create new class 'Wind'";
4463     throw SquirrelError(v, msg.str());
4464   }
4465   sq_pushstring(v, "start", -1);
4466   sq_newclosure(v, &Wind_start_wrapper, 0);
4467   if(SQ_FAILED(sq_createslot(v, -3))) {
4468     throw SquirrelError(v, "Couldn't register function 'start'");
4469   }
4470
4471   sq_pushstring(v, "stop", -1);
4472   sq_newclosure(v, &Wind_stop_wrapper, 0);
4473   if(SQ_FAILED(sq_createslot(v, -3))) {
4474     throw SquirrelError(v, "Couldn't register function 'stop'");
4475   }
4476
4477   if(SQ_FAILED(sq_createslot(v, -3))) {
4478     throw SquirrelError(v, "Couldn't register class 'Wind'");
4479   }
4480
4481   // Register class AmbientSound
4482   sq_pushstring(v, "AmbientSound", -1);
4483   if(sq_newclass(v, SQFalse) < 0) {
4484     std::ostringstream msg;
4485     msg << "Couldn't create new class 'AmbientSound'";
4486     throw SquirrelError(v, msg.str());
4487   }
4488   sq_pushstring(v, "set_pos", -1);
4489   sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
4490   if(SQ_FAILED(sq_createslot(v, -3))) {
4491     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4492   }
4493
4494   sq_pushstring(v, "get_pos_x", -1);
4495   sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
4496   if(SQ_FAILED(sq_createslot(v, -3))) {
4497     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4498   }
4499
4500   sq_pushstring(v, "get_pos_y", -1);
4501   sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
4502   if(SQ_FAILED(sq_createslot(v, -3))) {
4503     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4504   }
4505
4506   if(SQ_FAILED(sq_createslot(v, -3))) {
4507     throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
4508   }
4509
4510   // Register class Thunderstorm
4511   sq_pushstring(v, "Thunderstorm", -1);
4512   if(sq_newclass(v, SQFalse) < 0) {
4513     std::ostringstream msg;
4514     msg << "Couldn't create new class 'Thunderstorm'";
4515     throw SquirrelError(v, msg.str());
4516   }
4517   sq_pushstring(v, "start", -1);
4518   sq_newclosure(v, &Thunderstorm_start_wrapper, 0);
4519   if(SQ_FAILED(sq_createslot(v, -3))) {
4520     throw SquirrelError(v, "Couldn't register function 'start'");
4521   }
4522
4523   sq_pushstring(v, "stop", -1);
4524   sq_newclosure(v, &Thunderstorm_stop_wrapper, 0);
4525   if(SQ_FAILED(sq_createslot(v, -3))) {
4526     throw SquirrelError(v, "Couldn't register function 'stop'");
4527   }
4528
4529   sq_pushstring(v, "thunder", -1);
4530   sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0);
4531   if(SQ_FAILED(sq_createslot(v, -3))) {
4532     throw SquirrelError(v, "Couldn't register function 'thunder'");
4533   }
4534
4535   sq_pushstring(v, "lightning", -1);
4536   sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0);
4537   if(SQ_FAILED(sq_createslot(v, -3))) {
4538     throw SquirrelError(v, "Couldn't register function 'lightning'");
4539   }
4540
4541   sq_pushstring(v, "flash", -1);
4542   sq_newclosure(v, &Thunderstorm_flash_wrapper, 0);
4543   if(SQ_FAILED(sq_createslot(v, -3))) {
4544     throw SquirrelError(v, "Couldn't register function 'flash'");
4545   }
4546
4547   sq_pushstring(v, "electrify", -1);
4548   sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0);
4549   if(SQ_FAILED(sq_createslot(v, -3))) {
4550     throw SquirrelError(v, "Couldn't register function 'electrify'");
4551   }
4552
4553   if(SQ_FAILED(sq_createslot(v, -3))) {
4554     throw SquirrelError(v, "Couldn't register class 'Thunderstorm'");
4555   }
4556
4557   // Register class TileMap
4558   sq_pushstring(v, "TileMap", -1);
4559   if(sq_newclass(v, SQFalse) < 0) {
4560     std::ostringstream msg;
4561     msg << "Couldn't create new class 'TileMap'";
4562     throw SquirrelError(v, msg.str());
4563   }
4564   sq_pushstring(v, "goto_node", -1);
4565   sq_newclosure(v, &TileMap_goto_node_wrapper, 0);
4566   if(SQ_FAILED(sq_createslot(v, -3))) {
4567     throw SquirrelError(v, "Couldn't register function 'goto_node'");
4568   }
4569
4570   sq_pushstring(v, "start_moving", -1);
4571   sq_newclosure(v, &TileMap_start_moving_wrapper, 0);
4572   if(SQ_FAILED(sq_createslot(v, -3))) {
4573     throw SquirrelError(v, "Couldn't register function 'start_moving'");
4574   }
4575
4576   sq_pushstring(v, "stop_moving", -1);
4577   sq_newclosure(v, &TileMap_stop_moving_wrapper, 0);
4578   if(SQ_FAILED(sq_createslot(v, -3))) {
4579     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
4580   }
4581
4582   if(SQ_FAILED(sq_createslot(v, -3))) {
4583     throw SquirrelError(v, "Couldn't register class 'TileMap'");
4584   }
4585
4586   // Register class SSector
4587   sq_pushstring(v, "SSector", -1);
4588   if(sq_newclass(v, SQFalse) < 0) {
4589     std::ostringstream msg;
4590     msg << "Couldn't create new class 'SSector'";
4591     throw SquirrelError(v, msg.str());
4592   }
4593   sq_pushstring(v, "set_ambient_light", -1);
4594   sq_newclosure(v, &SSector_set_ambient_light_wrapper, 0);
4595   if(SQ_FAILED(sq_createslot(v, -3))) {
4596     throw SquirrelError(v, "Couldn't register function 'set_ambient_light'");
4597   }
4598
4599   sq_pushstring(v, "get_ambient_red", -1);
4600   sq_newclosure(v, &SSector_get_ambient_red_wrapper, 0);
4601   if(SQ_FAILED(sq_createslot(v, -3))) {
4602     throw SquirrelError(v, "Couldn't register function 'get_ambient_red'");
4603   }
4604
4605   sq_pushstring(v, "get_ambient_green", -1);
4606   sq_newclosure(v, &SSector_get_ambient_green_wrapper, 0);
4607   if(SQ_FAILED(sq_createslot(v, -3))) {
4608     throw SquirrelError(v, "Couldn't register function 'get_ambient_green'");
4609   }
4610
4611   sq_pushstring(v, "get_ambient_blue", -1);
4612   sq_newclosure(v, &SSector_get_ambient_blue_wrapper, 0);
4613   if(SQ_FAILED(sq_createslot(v, -3))) {
4614     throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'");
4615   }
4616
4617   if(SQ_FAILED(sq_createslot(v, -3))) {
4618     throw SquirrelError(v, "Couldn't register class 'SSector'");
4619   }
4620
4621   // Register class LevelTime
4622   sq_pushstring(v, "LevelTime", -1);
4623   if(sq_newclass(v, SQFalse) < 0) {
4624     std::ostringstream msg;
4625     msg << "Couldn't create new class 'LevelTime'";
4626     throw SquirrelError(v, msg.str());
4627   }
4628   sq_pushstring(v, "start", -1);
4629   sq_newclosure(v, &LevelTime_start_wrapper, 0);
4630   if(SQ_FAILED(sq_createslot(v, -3))) {
4631     throw SquirrelError(v, "Couldn't register function 'start'");
4632   }
4633
4634   sq_pushstring(v, "stop", -1);
4635   sq_newclosure(v, &LevelTime_stop_wrapper, 0);
4636   if(SQ_FAILED(sq_createslot(v, -3))) {
4637     throw SquirrelError(v, "Couldn't register function 'stop'");
4638   }
4639
4640   sq_pushstring(v, "get_time", -1);
4641   sq_newclosure(v, &LevelTime_get_time_wrapper, 0);
4642   if(SQ_FAILED(sq_createslot(v, -3))) {
4643     throw SquirrelError(v, "Couldn't register function 'get_time'");
4644   }
4645
4646   sq_pushstring(v, "set_time", -1);
4647   sq_newclosure(v, &LevelTime_set_time_wrapper, 0);
4648   if(SQ_FAILED(sq_createslot(v, -3))) {
4649     throw SquirrelError(v, "Couldn't register function 'set_time'");
4650   }
4651
4652   if(SQ_FAILED(sq_createslot(v, -3))) {
4653     throw SquirrelError(v, "Couldn't register class 'LevelTime'");
4654   }
4655
4656 }
4657
4658 } // end of namespace Scripting