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