Update CMake to 3.2.1 in .travis.yml
[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
7 #include <sstream>
8
9 #include "scripting/squirrel_error.hpp"
10 #include "scripting/wrapper.interface.hpp"
11
12 namespace scripting {
13 namespace wrapper {
14
15 static SQInteger AmbientSound_release_hook(SQUserPointer ptr, SQInteger )
16 {
17   scripting::AmbientSound* _this = reinterpret_cast<scripting::AmbientSound*> (ptr);
18   delete _this;
19   return 0;
20 }
21
22 static SQInteger AmbientSound_set_pos_wrapper(HSQUIRRELVM vm)
23 {
24   SQUserPointer data;
25   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
26     sq_throwerror(vm, _SC("'set_pos' called without instance"));
27     return SQ_ERROR;
28   }
29   scripting::AmbientSound* _this = reinterpret_cast<scripting::AmbientSound*> (data);
30   SQFloat arg0;
31   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
32     sq_throwerror(vm, _SC("Argument 1 not a float"));
33     return SQ_ERROR;
34   }
35   SQFloat arg1;
36   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
37     sq_throwerror(vm, _SC("Argument 2 not a float"));
38     return SQ_ERROR;
39   }
40
41   try {
42     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
43
44     return 0;
45
46   } catch(std::exception& e) {
47     sq_throwerror(vm, e.what());
48     return SQ_ERROR;
49   } catch(...) {
50     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
51     return SQ_ERROR;
52   }
53
54 }
55
56 static SQInteger AmbientSound_get_pos_x_wrapper(HSQUIRRELVM vm)
57 {
58   SQUserPointer data;
59   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
60     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
61     return SQ_ERROR;
62   }
63   scripting::AmbientSound* _this = reinterpret_cast<scripting::AmbientSound*> (data);
64
65   try {
66     float return_value = _this->get_pos_x();
67
68     sq_pushfloat(vm, return_value);
69     return 1;
70
71   } catch(std::exception& e) {
72     sq_throwerror(vm, e.what());
73     return SQ_ERROR;
74   } catch(...) {
75     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
76     return SQ_ERROR;
77   }
78
79 }
80
81 static SQInteger AmbientSound_get_pos_y_wrapper(HSQUIRRELVM vm)
82 {
83   SQUserPointer data;
84   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
85     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
86     return SQ_ERROR;
87   }
88   scripting::AmbientSound* _this = reinterpret_cast<scripting::AmbientSound*> (data);
89
90   try {
91     float return_value = _this->get_pos_y();
92
93     sq_pushfloat(vm, return_value);
94     return 1;
95
96   } catch(std::exception& e) {
97     sq_throwerror(vm, e.what());
98     return SQ_ERROR;
99   } catch(...) {
100     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
101     return SQ_ERROR;
102   }
103
104 }
105
106 static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger )
107 {
108   scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (ptr);
109   delete _this;
110   return 0;
111 }
112
113 static SQInteger Camera_reload_config_wrapper(HSQUIRRELVM vm)
114 {
115   SQUserPointer data;
116   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
117     sq_throwerror(vm, _SC("'reload_config' called without instance"));
118     return SQ_ERROR;
119   }
120   scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
121
122   try {
123     _this->reload_config();
124
125     return 0;
126
127   } catch(std::exception& e) {
128     sq_throwerror(vm, e.what());
129     return SQ_ERROR;
130   } catch(...) {
131     sq_throwerror(vm, _SC("Unexpected exception while executing function 'reload_config'"));
132     return SQ_ERROR;
133   }
134
135 }
136
137 static SQInteger Camera_shake_wrapper(HSQUIRRELVM vm)
138 {
139   SQUserPointer data;
140   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
141     sq_throwerror(vm, _SC("'shake' called without instance"));
142     return SQ_ERROR;
143   }
144   scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
145   SQFloat arg0;
146   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
147     sq_throwerror(vm, _SC("Argument 1 not a float"));
148     return SQ_ERROR;
149   }
150   SQFloat arg1;
151   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
152     sq_throwerror(vm, _SC("Argument 2 not a float"));
153     return SQ_ERROR;
154   }
155   SQFloat arg2;
156   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
157     sq_throwerror(vm, _SC("Argument 3 not a float"));
158     return SQ_ERROR;
159   }
160
161   try {
162     _this->shake(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
163
164     return 0;
165
166   } catch(std::exception& e) {
167     sq_throwerror(vm, e.what());
168     return SQ_ERROR;
169   } catch(...) {
170     sq_throwerror(vm, _SC("Unexpected exception while executing function 'shake'"));
171     return SQ_ERROR;
172   }
173
174 }
175
176 static SQInteger Camera_set_pos_wrapper(HSQUIRRELVM vm)
177 {
178   SQUserPointer data;
179   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
180     sq_throwerror(vm, _SC("'set_pos' called without instance"));
181     return SQ_ERROR;
182   }
183   scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
184   SQFloat arg0;
185   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
186     sq_throwerror(vm, _SC("Argument 1 not a float"));
187     return SQ_ERROR;
188   }
189   SQFloat arg1;
190   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
191     sq_throwerror(vm, _SC("Argument 2 not a float"));
192     return SQ_ERROR;
193   }
194
195   try {
196     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
197
198     return 0;
199
200   } catch(std::exception& e) {
201     sq_throwerror(vm, e.what());
202     return SQ_ERROR;
203   } catch(...) {
204     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
205     return SQ_ERROR;
206   }
207
208 }
209
210 static SQInteger Camera_set_mode_wrapper(HSQUIRRELVM vm)
211 {
212   SQUserPointer data;
213   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
214     sq_throwerror(vm, _SC("'set_mode' called without instance"));
215     return SQ_ERROR;
216   }
217   scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
218   const SQChar* arg0;
219   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
220     sq_throwerror(vm, _SC("Argument 1 not a string"));
221     return SQ_ERROR;
222   }
223
224   try {
225     _this->set_mode(arg0);
226
227     return 0;
228
229   } catch(std::exception& e) {
230     sq_throwerror(vm, e.what());
231     return SQ_ERROR;
232   } catch(...) {
233     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_mode'"));
234     return SQ_ERROR;
235   }
236
237 }
238
239 static SQInteger Camera_scroll_to_wrapper(HSQUIRRELVM vm)
240 {
241   SQUserPointer data;
242   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
243     sq_throwerror(vm, _SC("'scroll_to' called without instance"));
244     return SQ_ERROR;
245   }
246   scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
247   SQFloat arg0;
248   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
249     sq_throwerror(vm, _SC("Argument 1 not a float"));
250     return SQ_ERROR;
251   }
252   SQFloat arg1;
253   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
254     sq_throwerror(vm, _SC("Argument 2 not a float"));
255     return SQ_ERROR;
256   }
257   SQFloat arg2;
258   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
259     sq_throwerror(vm, _SC("Argument 3 not a float"));
260     return SQ_ERROR;
261   }
262
263   try {
264     _this->scroll_to(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
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 'scroll_to'"));
273     return SQ_ERROR;
274   }
275
276 }
277
278 static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
279 {
280   scripting::Candle* _this = reinterpret_cast<scripting::Candle*> (ptr);
281   delete _this;
282   return 0;
283 }
284
285 static SQInteger Candle_get_burning_wrapper(HSQUIRRELVM vm)
286 {
287   SQUserPointer data;
288   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
289     sq_throwerror(vm, _SC("'get_burning' called without instance"));
290     return SQ_ERROR;
291   }
292   scripting::Candle* _this = reinterpret_cast<scripting::Candle*> (data);
293
294   try {
295     bool return_value = _this->get_burning();
296
297     sq_pushbool(vm, return_value);
298     return 1;
299
300   } catch(std::exception& e) {
301     sq_throwerror(vm, e.what());
302     return SQ_ERROR;
303   } catch(...) {
304     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_burning'"));
305     return SQ_ERROR;
306   }
307
308 }
309
310 static SQInteger Candle_set_burning_wrapper(HSQUIRRELVM vm)
311 {
312   SQUserPointer data;
313   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
314     sq_throwerror(vm, _SC("'set_burning' called without instance"));
315     return SQ_ERROR;
316   }
317   scripting::Candle* _this = reinterpret_cast<scripting::Candle*> (data);
318   SQBool arg0;
319   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
320     sq_throwerror(vm, _SC("Argument 1 not a bool"));
321     return SQ_ERROR;
322   }
323
324   try {
325     _this->set_burning(arg0 == SQTrue);
326
327     return 0;
328
329   } catch(std::exception& e) {
330     sq_throwerror(vm, e.what());
331     return SQ_ERROR;
332   } catch(...) {
333     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_burning'"));
334     return SQ_ERROR;
335   }
336
337 }
338
339 static SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger )
340 {
341   scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (ptr);
342   delete _this;
343   return 0;
344 }
345
346 static SQInteger DisplayEffect_fade_out_wrapper(HSQUIRRELVM vm)
347 {
348   SQUserPointer data;
349   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
350     sq_throwerror(vm, _SC("'fade_out' called without instance"));
351     return SQ_ERROR;
352   }
353   scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
354   SQFloat arg0;
355   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
356     sq_throwerror(vm, _SC("Argument 1 not a float"));
357     return SQ_ERROR;
358   }
359
360   try {
361     _this->fade_out(static_cast<float> (arg0));
362
363     return 0;
364
365   } catch(std::exception& e) {
366     sq_throwerror(vm, e.what());
367     return SQ_ERROR;
368   } catch(...) {
369     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
370     return SQ_ERROR;
371   }
372
373 }
374
375 static SQInteger DisplayEffect_fade_in_wrapper(HSQUIRRELVM vm)
376 {
377   SQUserPointer data;
378   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
379     sq_throwerror(vm, _SC("'fade_in' called without instance"));
380     return SQ_ERROR;
381   }
382   scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
383   SQFloat arg0;
384   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
385     sq_throwerror(vm, _SC("Argument 1 not a float"));
386     return SQ_ERROR;
387   }
388
389   try {
390     _this->fade_in(static_cast<float> (arg0));
391
392     return 0;
393
394   } catch(std::exception& e) {
395     sq_throwerror(vm, e.what());
396     return SQ_ERROR;
397   } catch(...) {
398     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
399     return SQ_ERROR;
400   }
401
402 }
403
404 static SQInteger DisplayEffect_set_black_wrapper(HSQUIRRELVM vm)
405 {
406   SQUserPointer data;
407   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
408     sq_throwerror(vm, _SC("'set_black' called without instance"));
409     return SQ_ERROR;
410   }
411   scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
412   SQBool arg0;
413   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
414     sq_throwerror(vm, _SC("Argument 1 not a bool"));
415     return SQ_ERROR;
416   }
417
418   try {
419     _this->set_black(arg0 == SQTrue);
420
421     return 0;
422
423   } catch(std::exception& e) {
424     sq_throwerror(vm, e.what());
425     return SQ_ERROR;
426   } catch(...) {
427     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_black'"));
428     return SQ_ERROR;
429   }
430
431 }
432
433 static SQInteger DisplayEffect_is_black_wrapper(HSQUIRRELVM vm)
434 {
435   SQUserPointer data;
436   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
437     sq_throwerror(vm, _SC("'is_black' called without instance"));
438     return SQ_ERROR;
439   }
440   scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
441
442   try {
443     bool return_value = _this->is_black();
444
445     sq_pushbool(vm, return_value);
446     return 1;
447
448   } catch(std::exception& e) {
449     sq_throwerror(vm, e.what());
450     return SQ_ERROR;
451   } catch(...) {
452     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_black'"));
453     return SQ_ERROR;
454   }
455
456 }
457
458 static SQInteger DisplayEffect_sixteen_to_nine_wrapper(HSQUIRRELVM vm)
459 {
460   SQUserPointer data;
461   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
462     sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance"));
463     return SQ_ERROR;
464   }
465   scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
466   SQFloat arg0;
467   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
468     sq_throwerror(vm, _SC("Argument 1 not a float"));
469     return SQ_ERROR;
470   }
471
472   try {
473     _this->sixteen_to_nine(static_cast<float> (arg0));
474
475     return 0;
476
477   } catch(std::exception& e) {
478     sq_throwerror(vm, e.what());
479     return SQ_ERROR;
480   } catch(...) {
481     sq_throwerror(vm, _SC("Unexpected exception while executing function 'sixteen_to_nine'"));
482     return SQ_ERROR;
483   }
484
485 }
486
487 static SQInteger DisplayEffect_four_to_three_wrapper(HSQUIRRELVM vm)
488 {
489   SQUserPointer data;
490   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
491     sq_throwerror(vm, _SC("'four_to_three' called without instance"));
492     return SQ_ERROR;
493   }
494   scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
495   SQFloat arg0;
496   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
497     sq_throwerror(vm, _SC("Argument 1 not a float"));
498     return SQ_ERROR;
499   }
500
501   try {
502     _this->four_to_three(static_cast<float> (arg0));
503
504     return 0;
505
506   } catch(std::exception& e) {
507     sq_throwerror(vm, e.what());
508     return SQ_ERROR;
509   } catch(...) {
510     sq_throwerror(vm, _SC("Unexpected exception while executing function 'four_to_three'"));
511     return SQ_ERROR;
512   }
513
514 }
515
516 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
517 {
518   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (ptr);
519   delete _this;
520   return 0;
521 }
522
523 static SQInteger FloatingImage_constructor_wrapper(HSQUIRRELVM vm)
524 {
525   const SQChar* arg0;
526   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
527     sq_throwerror(vm, _SC("Argument 1 not a string"));
528     return SQ_ERROR;
529   }
530
531   try {
532     scripting::FloatingImage* _this = new scripting::FloatingImage(arg0);
533   if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
534     sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
535     return SQ_ERROR;
536   }
537   sq_setreleasehook(vm, 1, FloatingImage_release_hook);
538
539     return 0;
540
541   } catch(std::exception& e) {
542     sq_throwerror(vm, e.what());
543     return SQ_ERROR;
544   } catch(...) {
545     sq_throwerror(vm, _SC("Unexpected exception while executing function 'constructor'"));
546     return SQ_ERROR;
547   }
548
549 }
550
551 static SQInteger FloatingImage_set_layer_wrapper(HSQUIRRELVM vm)
552 {
553   SQUserPointer data;
554   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
555     sq_throwerror(vm, _SC("'set_layer' called without instance"));
556     return SQ_ERROR;
557   }
558   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
559   SQInteger arg0;
560   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
561     sq_throwerror(vm, _SC("Argument 1 not an integer"));
562     return SQ_ERROR;
563   }
564
565   try {
566     _this->set_layer(static_cast<int> (arg0));
567
568     return 0;
569
570   } catch(std::exception& e) {
571     sq_throwerror(vm, e.what());
572     return SQ_ERROR;
573   } catch(...) {
574     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_layer'"));
575     return SQ_ERROR;
576   }
577
578 }
579
580 static SQInteger FloatingImage_get_layer_wrapper(HSQUIRRELVM vm)
581 {
582   SQUserPointer data;
583   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
584     sq_throwerror(vm, _SC("'get_layer' called without instance"));
585     return SQ_ERROR;
586   }
587   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
588
589   try {
590     int return_value = _this->get_layer();
591
592     sq_pushinteger(vm, return_value);
593     return 1;
594
595   } catch(std::exception& e) {
596     sq_throwerror(vm, e.what());
597     return SQ_ERROR;
598   } catch(...) {
599     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_layer'"));
600     return SQ_ERROR;
601   }
602
603 }
604
605 static SQInteger FloatingImage_set_pos_wrapper(HSQUIRRELVM vm)
606 {
607   SQUserPointer data;
608   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
609     sq_throwerror(vm, _SC("'set_pos' called without instance"));
610     return SQ_ERROR;
611   }
612   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
613   SQFloat arg0;
614   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
615     sq_throwerror(vm, _SC("Argument 1 not a float"));
616     return SQ_ERROR;
617   }
618   SQFloat arg1;
619   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
620     sq_throwerror(vm, _SC("Argument 2 not a float"));
621     return SQ_ERROR;
622   }
623
624   try {
625     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
626
627     return 0;
628
629   } catch(std::exception& e) {
630     sq_throwerror(vm, e.what());
631     return SQ_ERROR;
632   } catch(...) {
633     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
634     return SQ_ERROR;
635   }
636
637 }
638
639 static SQInteger FloatingImage_get_pos_x_wrapper(HSQUIRRELVM vm)
640 {
641   SQUserPointer data;
642   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
643     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
644     return SQ_ERROR;
645   }
646   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
647
648   try {
649     float return_value = _this->get_pos_x();
650
651     sq_pushfloat(vm, return_value);
652     return 1;
653
654   } catch(std::exception& e) {
655     sq_throwerror(vm, e.what());
656     return SQ_ERROR;
657   } catch(...) {
658     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
659     return SQ_ERROR;
660   }
661
662 }
663
664 static SQInteger FloatingImage_get_pos_y_wrapper(HSQUIRRELVM vm)
665 {
666   SQUserPointer data;
667   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
668     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
669     return SQ_ERROR;
670   }
671   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
672
673   try {
674     float return_value = _this->get_pos_y();
675
676     sq_pushfloat(vm, return_value);
677     return 1;
678
679   } catch(std::exception& e) {
680     sq_throwerror(vm, e.what());
681     return SQ_ERROR;
682   } catch(...) {
683     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
684     return SQ_ERROR;
685   }
686
687 }
688
689 static SQInteger FloatingImage_set_anchor_point_wrapper(HSQUIRRELVM vm)
690 {
691   SQUserPointer data;
692   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
693     sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
694     return SQ_ERROR;
695   }
696   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
697   SQInteger arg0;
698   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
699     sq_throwerror(vm, _SC("Argument 1 not an integer"));
700     return SQ_ERROR;
701   }
702
703   try {
704     _this->set_anchor_point(static_cast<int> (arg0));
705
706     return 0;
707
708   } catch(std::exception& e) {
709     sq_throwerror(vm, e.what());
710     return SQ_ERROR;
711   } catch(...) {
712     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
713     return SQ_ERROR;
714   }
715
716 }
717
718 static SQInteger FloatingImage_get_anchor_point_wrapper(HSQUIRRELVM vm)
719 {
720   SQUserPointer data;
721   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
722     sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
723     return SQ_ERROR;
724   }
725   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
726
727   try {
728     int return_value = _this->get_anchor_point();
729
730     sq_pushinteger(vm, return_value);
731     return 1;
732
733   } catch(std::exception& e) {
734     sq_throwerror(vm, e.what());
735     return SQ_ERROR;
736   } catch(...) {
737     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
738     return SQ_ERROR;
739   }
740
741 }
742
743 static SQInteger FloatingImage_set_visible_wrapper(HSQUIRRELVM vm)
744 {
745   SQUserPointer data;
746   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
747     sq_throwerror(vm, _SC("'set_visible' called without instance"));
748     return SQ_ERROR;
749   }
750   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
751   SQBool arg0;
752   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
753     sq_throwerror(vm, _SC("Argument 1 not a bool"));
754     return SQ_ERROR;
755   }
756
757   try {
758     _this->set_visible(arg0 == SQTrue);
759
760     return 0;
761
762   } catch(std::exception& e) {
763     sq_throwerror(vm, e.what());
764     return SQ_ERROR;
765   } catch(...) {
766     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
767     return SQ_ERROR;
768   }
769
770 }
771
772 static SQInteger FloatingImage_get_visible_wrapper(HSQUIRRELVM vm)
773 {
774   SQUserPointer data;
775   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
776     sq_throwerror(vm, _SC("'get_visible' called without instance"));
777     return SQ_ERROR;
778   }
779   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
780
781   try {
782     bool return_value = _this->get_visible();
783
784     sq_pushbool(vm, return_value);
785     return 1;
786
787   } catch(std::exception& e) {
788     sq_throwerror(vm, e.what());
789     return SQ_ERROR;
790   } catch(...) {
791     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
792     return SQ_ERROR;
793   }
794
795 }
796
797 static SQInteger FloatingImage_set_action_wrapper(HSQUIRRELVM vm)
798 {
799   SQUserPointer data;
800   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
801     sq_throwerror(vm, _SC("'set_action' called without instance"));
802     return SQ_ERROR;
803   }
804   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
805   const SQChar* arg0;
806   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
807     sq_throwerror(vm, _SC("Argument 1 not a string"));
808     return SQ_ERROR;
809   }
810
811   try {
812     _this->set_action(arg0);
813
814     return 0;
815
816   } catch(std::exception& e) {
817     sq_throwerror(vm, e.what());
818     return SQ_ERROR;
819   } catch(...) {
820     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
821     return SQ_ERROR;
822   }
823
824 }
825
826 static SQInteger FloatingImage_get_action_wrapper(HSQUIRRELVM vm)
827 {
828   SQUserPointer data;
829   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
830     sq_throwerror(vm, _SC("'get_action' called without instance"));
831     return SQ_ERROR;
832   }
833   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
834
835   try {
836     std::string return_value = _this->get_action();
837
838     sq_pushstring(vm, return_value.c_str(), return_value.size());
839     return 1;
840
841   } catch(std::exception& e) {
842     sq_throwerror(vm, e.what());
843     return SQ_ERROR;
844   } catch(...) {
845     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
846     return SQ_ERROR;
847   }
848
849 }
850
851 static SQInteger FloatingImage_fade_in_wrapper(HSQUIRRELVM vm)
852 {
853   SQUserPointer data;
854   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
855     sq_throwerror(vm, _SC("'fade_in' called without instance"));
856     return SQ_ERROR;
857   }
858   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
859   SQFloat arg0;
860   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
861     sq_throwerror(vm, _SC("Argument 1 not a float"));
862     return SQ_ERROR;
863   }
864
865   try {
866     _this->fade_in(static_cast<float> (arg0));
867
868     return 0;
869
870   } catch(std::exception& e) {
871     sq_throwerror(vm, e.what());
872     return SQ_ERROR;
873   } catch(...) {
874     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
875     return SQ_ERROR;
876   }
877
878 }
879
880 static SQInteger FloatingImage_fade_out_wrapper(HSQUIRRELVM vm)
881 {
882   SQUserPointer data;
883   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
884     sq_throwerror(vm, _SC("'fade_out' called without instance"));
885     return SQ_ERROR;
886   }
887   scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
888   SQFloat arg0;
889   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
890     sq_throwerror(vm, _SC("Argument 1 not a float"));
891     return SQ_ERROR;
892   }
893
894   try {
895     _this->fade_out(static_cast<float> (arg0));
896
897     return 0;
898
899   } catch(std::exception& e) {
900     sq_throwerror(vm, e.what());
901     return SQ_ERROR;
902   } catch(...) {
903     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
904     return SQ_ERROR;
905   }
906
907 }
908
909 static SQInteger LevelTime_release_hook(SQUserPointer ptr, SQInteger )
910 {
911   scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (ptr);
912   delete _this;
913   return 0;
914 }
915
916 static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm)
917 {
918   SQUserPointer data;
919   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
920     sq_throwerror(vm, _SC("'start' called without instance"));
921     return SQ_ERROR;
922   }
923   scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (data);
924
925   try {
926     _this->start();
927
928     return 0;
929
930   } catch(std::exception& e) {
931     sq_throwerror(vm, e.what());
932     return SQ_ERROR;
933   } catch(...) {
934     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
935     return SQ_ERROR;
936   }
937
938 }
939
940 static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm)
941 {
942   SQUserPointer data;
943   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
944     sq_throwerror(vm, _SC("'stop' called without instance"));
945     return SQ_ERROR;
946   }
947   scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (data);
948
949   try {
950     _this->stop();
951
952     return 0;
953
954   } catch(std::exception& e) {
955     sq_throwerror(vm, e.what());
956     return SQ_ERROR;
957   } catch(...) {
958     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
959     return SQ_ERROR;
960   }
961
962 }
963
964 static SQInteger LevelTime_get_time_wrapper(HSQUIRRELVM vm)
965 {
966   SQUserPointer data;
967   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
968     sq_throwerror(vm, _SC("'get_time' called without instance"));
969     return SQ_ERROR;
970   }
971   scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (data);
972
973   try {
974     float return_value = _this->get_time();
975
976     sq_pushfloat(vm, return_value);
977     return 1;
978
979   } catch(std::exception& e) {
980     sq_throwerror(vm, e.what());
981     return SQ_ERROR;
982   } catch(...) {
983     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_time'"));
984     return SQ_ERROR;
985   }
986
987 }
988
989 static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm)
990 {
991   SQUserPointer data;
992   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
993     sq_throwerror(vm, _SC("'set_time' called without instance"));
994     return SQ_ERROR;
995   }
996   scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (data);
997   SQFloat arg0;
998   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
999     sq_throwerror(vm, _SC("Argument 1 not a float"));
1000     return SQ_ERROR;
1001   }
1002
1003   try {
1004     _this->set_time(static_cast<float> (arg0));
1005
1006     return 0;
1007
1008   } catch(std::exception& e) {
1009     sq_throwerror(vm, e.what());
1010     return SQ_ERROR;
1011   } catch(...) {
1012     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_time'"));
1013     return SQ_ERROR;
1014   }
1015
1016 }
1017
1018 static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
1019 {
1020   scripting::Platform* _this = reinterpret_cast<scripting::Platform*> (ptr);
1021   delete _this;
1022   return 0;
1023 }
1024
1025 static SQInteger Platform_goto_node_wrapper(HSQUIRRELVM vm)
1026 {
1027   SQUserPointer data;
1028   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1029     sq_throwerror(vm, _SC("'goto_node' called without instance"));
1030     return SQ_ERROR;
1031   }
1032   scripting::Platform* _this = reinterpret_cast<scripting::Platform*> (data);
1033   SQInteger arg0;
1034   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1035     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1036     return SQ_ERROR;
1037   }
1038
1039   try {
1040     _this->goto_node(static_cast<int> (arg0));
1041
1042     return 0;
1043
1044   } catch(std::exception& e) {
1045     sq_throwerror(vm, e.what());
1046     return SQ_ERROR;
1047   } catch(...) {
1048     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
1049     return SQ_ERROR;
1050   }
1051
1052 }
1053
1054 static SQInteger Platform_start_moving_wrapper(HSQUIRRELVM vm)
1055 {
1056   SQUserPointer data;
1057   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1058     sq_throwerror(vm, _SC("'start_moving' called without instance"));
1059     return SQ_ERROR;
1060   }
1061   scripting::Platform* _this = reinterpret_cast<scripting::Platform*> (data);
1062
1063   try {
1064     _this->start_moving();
1065
1066     return 0;
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 'start_moving'"));
1073     return SQ_ERROR;
1074   }
1075
1076 }
1077
1078 static SQInteger Platform_stop_moving_wrapper(HSQUIRRELVM vm)
1079 {
1080   SQUserPointer data;
1081   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1082     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
1083     return SQ_ERROR;
1084   }
1085   scripting::Platform* _this = reinterpret_cast<scripting::Platform*> (data);
1086
1087   try {
1088     _this->stop_moving();
1089
1090     return 0;
1091
1092   } catch(std::exception& e) {
1093     sq_throwerror(vm, e.what());
1094     return SQ_ERROR;
1095   } catch(...) {
1096     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
1097     return SQ_ERROR;
1098   }
1099
1100 }
1101
1102 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
1103 {
1104   scripting::Player* _this = reinterpret_cast<scripting::Player*> (ptr);
1105   delete _this;
1106   return 0;
1107 }
1108
1109 static SQInteger Player_add_bonus_wrapper(HSQUIRRELVM vm)
1110 {
1111   SQUserPointer data;
1112   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1113     sq_throwerror(vm, _SC("'add_bonus' called without instance"));
1114     return SQ_ERROR;
1115   }
1116   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1117   const SQChar* arg0;
1118   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1119     sq_throwerror(vm, _SC("Argument 1 not a string"));
1120     return SQ_ERROR;
1121   }
1122
1123   try {
1124     bool return_value = _this->add_bonus(arg0);
1125
1126     sq_pushbool(vm, return_value);
1127     return 1;
1128
1129   } catch(std::exception& e) {
1130     sq_throwerror(vm, e.what());
1131     return SQ_ERROR;
1132   } catch(...) {
1133     sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_bonus'"));
1134     return SQ_ERROR;
1135   }
1136
1137 }
1138
1139 static SQInteger Player_add_coins_wrapper(HSQUIRRELVM vm)
1140 {
1141   SQUserPointer data;
1142   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1143     sq_throwerror(vm, _SC("'add_coins' called without instance"));
1144     return SQ_ERROR;
1145   }
1146   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1147   SQInteger arg0;
1148   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
1149     sq_throwerror(vm, _SC("Argument 1 not an integer"));
1150     return SQ_ERROR;
1151   }
1152
1153   try {
1154     _this->add_coins(static_cast<int> (arg0));
1155
1156     return 0;
1157
1158   } catch(std::exception& e) {
1159     sq_throwerror(vm, e.what());
1160     return SQ_ERROR;
1161   } catch(...) {
1162     sq_throwerror(vm, _SC("Unexpected exception while executing function 'add_coins'"));
1163     return SQ_ERROR;
1164   }
1165
1166 }
1167
1168 static SQInteger Player_make_invincible_wrapper(HSQUIRRELVM vm)
1169 {
1170   SQUserPointer data;
1171   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1172     sq_throwerror(vm, _SC("'make_invincible' called without instance"));
1173     return SQ_ERROR;
1174   }
1175   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1176
1177   try {
1178     _this->make_invincible();
1179
1180     return 0;
1181
1182   } catch(std::exception& e) {
1183     sq_throwerror(vm, e.what());
1184     return SQ_ERROR;
1185   } catch(...) {
1186     sq_throwerror(vm, _SC("Unexpected exception while executing function 'make_invincible'"));
1187     return SQ_ERROR;
1188   }
1189
1190 }
1191
1192 static SQInteger Player_deactivate_wrapper(HSQUIRRELVM vm)
1193 {
1194   SQUserPointer data;
1195   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1196     sq_throwerror(vm, _SC("'deactivate' called without instance"));
1197     return SQ_ERROR;
1198   }
1199   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1200
1201   try {
1202     _this->deactivate();
1203
1204     return 0;
1205
1206   } catch(std::exception& e) {
1207     sq_throwerror(vm, e.what());
1208     return SQ_ERROR;
1209   } catch(...) {
1210     sq_throwerror(vm, _SC("Unexpected exception while executing function 'deactivate'"));
1211     return SQ_ERROR;
1212   }
1213
1214 }
1215
1216 static SQInteger Player_activate_wrapper(HSQUIRRELVM vm)
1217 {
1218   SQUserPointer data;
1219   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1220     sq_throwerror(vm, _SC("'activate' called without instance"));
1221     return SQ_ERROR;
1222   }
1223   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1224
1225   try {
1226     _this->activate();
1227
1228     return 0;
1229
1230   } catch(std::exception& e) {
1231     sq_throwerror(vm, e.what());
1232     return SQ_ERROR;
1233   } catch(...) {
1234     sq_throwerror(vm, _SC("Unexpected exception while executing function 'activate'"));
1235     return SQ_ERROR;
1236   }
1237
1238 }
1239
1240 static SQInteger Player_walk_wrapper(HSQUIRRELVM vm)
1241 {
1242   SQUserPointer data;
1243   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1244     sq_throwerror(vm, _SC("'walk' called without instance"));
1245     return SQ_ERROR;
1246   }
1247   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1248   SQFloat arg0;
1249   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1250     sq_throwerror(vm, _SC("Argument 1 not a float"));
1251     return SQ_ERROR;
1252   }
1253
1254   try {
1255     _this->walk(static_cast<float> (arg0));
1256
1257     return 0;
1258
1259   } catch(std::exception& e) {
1260     sq_throwerror(vm, e.what());
1261     return SQ_ERROR;
1262   } catch(...) {
1263     sq_throwerror(vm, _SC("Unexpected exception while executing function 'walk'"));
1264     return SQ_ERROR;
1265   }
1266
1267 }
1268
1269 static SQInteger Player_set_dir_wrapper(HSQUIRRELVM vm)
1270 {
1271   SQUserPointer data;
1272   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1273     sq_throwerror(vm, _SC("'set_dir' called without instance"));
1274     return SQ_ERROR;
1275   }
1276   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1277   SQBool arg0;
1278   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1279     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1280     return SQ_ERROR;
1281   }
1282
1283   try {
1284     _this->set_dir(arg0 == SQTrue);
1285
1286     return 0;
1287
1288   } catch(std::exception& e) {
1289     sq_throwerror(vm, e.what());
1290     return SQ_ERROR;
1291   } catch(...) {
1292     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_dir'"));
1293     return SQ_ERROR;
1294   }
1295
1296 }
1297
1298 static SQInteger Player_set_visible_wrapper(HSQUIRRELVM vm)
1299 {
1300   SQUserPointer data;
1301   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1302     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1303     return SQ_ERROR;
1304   }
1305   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1306   SQBool arg0;
1307   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1308     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1309     return SQ_ERROR;
1310   }
1311
1312   try {
1313     _this->set_visible(arg0 == SQTrue);
1314
1315     return 0;
1316
1317   } catch(std::exception& e) {
1318     sq_throwerror(vm, e.what());
1319     return SQ_ERROR;
1320   } catch(...) {
1321     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
1322     return SQ_ERROR;
1323   }
1324
1325 }
1326
1327 static SQInteger Player_get_visible_wrapper(HSQUIRRELVM vm)
1328 {
1329   SQUserPointer data;
1330   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1331     sq_throwerror(vm, _SC("'get_visible' called without instance"));
1332     return SQ_ERROR;
1333   }
1334   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1335
1336   try {
1337     bool return_value = _this->get_visible();
1338
1339     sq_pushbool(vm, return_value);
1340     return 1;
1341
1342   } catch(std::exception& e) {
1343     sq_throwerror(vm, e.what());
1344     return SQ_ERROR;
1345   } catch(...) {
1346     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_visible'"));
1347     return SQ_ERROR;
1348   }
1349
1350 }
1351
1352 static SQInteger Player_kill_wrapper(HSQUIRRELVM vm)
1353 {
1354   SQUserPointer data;
1355   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1356     sq_throwerror(vm, _SC("'kill' called without instance"));
1357     return SQ_ERROR;
1358   }
1359   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1360   SQBool arg0;
1361   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1362     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1363     return SQ_ERROR;
1364   }
1365
1366   try {
1367     _this->kill(arg0 == SQTrue);
1368
1369     return 0;
1370
1371   } catch(std::exception& e) {
1372     sq_throwerror(vm, e.what());
1373     return SQ_ERROR;
1374   } catch(...) {
1375     sq_throwerror(vm, _SC("Unexpected exception while executing function 'kill'"));
1376     return SQ_ERROR;
1377   }
1378
1379 }
1380
1381 static SQInteger Player_set_ghost_mode_wrapper(HSQUIRRELVM vm)
1382 {
1383   SQUserPointer data;
1384   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1385     sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
1386     return SQ_ERROR;
1387   }
1388   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1389   SQBool arg0;
1390   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1391     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1392     return SQ_ERROR;
1393   }
1394
1395   try {
1396     _this->set_ghost_mode(arg0 == SQTrue);
1397
1398     return 0;
1399
1400   } catch(std::exception& e) {
1401     sq_throwerror(vm, e.what());
1402     return SQ_ERROR;
1403   } catch(...) {
1404     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ghost_mode'"));
1405     return SQ_ERROR;
1406   }
1407
1408 }
1409
1410 static SQInteger Player_get_ghost_mode_wrapper(HSQUIRRELVM vm)
1411 {
1412   SQUserPointer data;
1413   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1414     sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
1415     return SQ_ERROR;
1416   }
1417   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1418
1419   try {
1420     bool return_value = _this->get_ghost_mode();
1421
1422     sq_pushbool(vm, return_value);
1423     return 1;
1424
1425   } catch(std::exception& e) {
1426     sq_throwerror(vm, e.what());
1427     return SQ_ERROR;
1428   } catch(...) {
1429     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ghost_mode'"));
1430     return SQ_ERROR;
1431   }
1432
1433 }
1434
1435 static SQInteger Player_kick_wrapper(HSQUIRRELVM vm)
1436 {
1437   SQUserPointer data;
1438   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1439     sq_throwerror(vm, _SC("'kick' called without instance"));
1440     return SQ_ERROR;
1441   }
1442   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1443
1444   try {
1445     _this->kick();
1446
1447     return 0;
1448
1449   } catch(std::exception& e) {
1450     sq_throwerror(vm, e.what());
1451     return SQ_ERROR;
1452   } catch(...) {
1453     sq_throwerror(vm, _SC("Unexpected exception while executing function 'kick'"));
1454     return SQ_ERROR;
1455   }
1456
1457 }
1458
1459 static SQInteger Player_do_cheer_wrapper(HSQUIRRELVM vm)
1460 {
1461   SQUserPointer data;
1462   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1463     sq_throwerror(vm, _SC("'do_cheer' called without instance"));
1464     return SQ_ERROR;
1465   }
1466   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1467
1468   try {
1469     _this->do_cheer();
1470
1471     return 0;
1472
1473   } catch(std::exception& e) {
1474     sq_throwerror(vm, e.what());
1475     return SQ_ERROR;
1476   } catch(...) {
1477     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_cheer'"));
1478     return SQ_ERROR;
1479   }
1480
1481 }
1482
1483 static SQInteger Player_do_duck_wrapper(HSQUIRRELVM vm)
1484 {
1485   SQUserPointer data;
1486   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1487     sq_throwerror(vm, _SC("'do_duck' called without instance"));
1488     return SQ_ERROR;
1489   }
1490   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1491
1492   try {
1493     _this->do_duck();
1494
1495     return 0;
1496
1497   } catch(std::exception& e) {
1498     sq_throwerror(vm, e.what());
1499     return SQ_ERROR;
1500   } catch(...) {
1501     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_duck'"));
1502     return SQ_ERROR;
1503   }
1504
1505 }
1506
1507 static SQInteger Player_do_standup_wrapper(HSQUIRRELVM vm)
1508 {
1509   SQUserPointer data;
1510   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1511     sq_throwerror(vm, _SC("'do_standup' called without instance"));
1512     return SQ_ERROR;
1513   }
1514   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1515
1516   try {
1517     _this->do_standup();
1518
1519     return 0;
1520
1521   } catch(std::exception& e) {
1522     sq_throwerror(vm, e.what());
1523     return SQ_ERROR;
1524   } catch(...) {
1525     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_standup'"));
1526     return SQ_ERROR;
1527   }
1528
1529 }
1530
1531 static SQInteger Player_do_backflip_wrapper(HSQUIRRELVM vm)
1532 {
1533   SQUserPointer data;
1534   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1535     sq_throwerror(vm, _SC("'do_backflip' called without instance"));
1536     return SQ_ERROR;
1537   }
1538   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1539
1540   try {
1541     _this->do_backflip();
1542
1543     return 0;
1544
1545   } catch(std::exception& e) {
1546     sq_throwerror(vm, e.what());
1547     return SQ_ERROR;
1548   } catch(...) {
1549     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_backflip'"));
1550     return SQ_ERROR;
1551   }
1552
1553 }
1554
1555 static SQInteger Player_do_jump_wrapper(HSQUIRRELVM vm)
1556 {
1557   SQUserPointer data;
1558   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1559     sq_throwerror(vm, _SC("'do_jump' called without instance"));
1560     return SQ_ERROR;
1561   }
1562   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1563   SQFloat arg0;
1564   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1565     sq_throwerror(vm, _SC("Argument 1 not a float"));
1566     return SQ_ERROR;
1567   }
1568
1569   try {
1570     _this->do_jump(static_cast<float> (arg0));
1571
1572     return 0;
1573
1574   } catch(std::exception& e) {
1575     sq_throwerror(vm, e.what());
1576     return SQ_ERROR;
1577   } catch(...) {
1578     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_jump'"));
1579     return SQ_ERROR;
1580   }
1581
1582 }
1583
1584 static SQInteger Player_trigger_sequence_wrapper(HSQUIRRELVM vm)
1585 {
1586   SQUserPointer data;
1587   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1588     sq_throwerror(vm, _SC("'trigger_sequence' called without instance"));
1589     return SQ_ERROR;
1590   }
1591   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1592   const SQChar* arg0;
1593   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1594     sq_throwerror(vm, _SC("Argument 1 not a string"));
1595     return SQ_ERROR;
1596   }
1597
1598   try {
1599     _this->trigger_sequence(arg0);
1600
1601     return 0;
1602
1603   } catch(std::exception& e) {
1604     sq_throwerror(vm, e.what());
1605     return SQ_ERROR;
1606   } catch(...) {
1607     sq_throwerror(vm, _SC("Unexpected exception while executing function 'trigger_sequence'"));
1608     return SQ_ERROR;
1609   }
1610
1611 }
1612
1613 static SQInteger Player_use_scripting_controller_wrapper(HSQUIRRELVM vm)
1614 {
1615   SQUserPointer data;
1616   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1617     sq_throwerror(vm, _SC("'use_scripting_controller' called without instance"));
1618     return SQ_ERROR;
1619   }
1620   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1621   SQBool arg0;
1622   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1623     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1624     return SQ_ERROR;
1625   }
1626
1627   try {
1628     _this->use_scripting_controller(arg0 == SQTrue);
1629
1630     return 0;
1631
1632   } catch(std::exception& e) {
1633     sq_throwerror(vm, e.what());
1634     return SQ_ERROR;
1635   } catch(...) {
1636     sq_throwerror(vm, _SC("Unexpected exception while executing function 'use_scripting_controller'"));
1637     return SQ_ERROR;
1638   }
1639
1640 }
1641
1642 static SQInteger Player_do_scripting_controller_wrapper(HSQUIRRELVM vm)
1643 {
1644   SQUserPointer data;
1645   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1646     sq_throwerror(vm, _SC("'do_scripting_controller' called without instance"));
1647     return SQ_ERROR;
1648   }
1649   scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
1650   const SQChar* arg0;
1651   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1652     sq_throwerror(vm, _SC("Argument 1 not a string"));
1653     return SQ_ERROR;
1654   }
1655   SQBool arg1;
1656   if(SQ_FAILED(sq_getbool(vm, 3, &arg1))) {
1657     sq_throwerror(vm, _SC("Argument 2 not a bool"));
1658     return SQ_ERROR;
1659   }
1660
1661   try {
1662     _this->do_scripting_controller(arg0, arg1 == SQTrue);
1663
1664     return 0;
1665
1666   } catch(std::exception& e) {
1667     sq_throwerror(vm, e.what());
1668     return SQ_ERROR;
1669   } catch(...) {
1670     sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_scripting_controller'"));
1671     return SQ_ERROR;
1672   }
1673
1674 }
1675
1676 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
1677 {
1678   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (ptr);
1679   delete _this;
1680   return 0;
1681 }
1682
1683 static SQInteger ScriptedObject_set_action_wrapper(HSQUIRRELVM vm)
1684 {
1685   SQUserPointer data;
1686   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1687     sq_throwerror(vm, _SC("'set_action' called without instance"));
1688     return SQ_ERROR;
1689   }
1690   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1691   const SQChar* arg0;
1692   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
1693     sq_throwerror(vm, _SC("Argument 1 not a string"));
1694     return SQ_ERROR;
1695   }
1696
1697   try {
1698     _this->set_action(arg0);
1699
1700     return 0;
1701
1702   } catch(std::exception& e) {
1703     sq_throwerror(vm, e.what());
1704     return SQ_ERROR;
1705   } catch(...) {
1706     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_action'"));
1707     return SQ_ERROR;
1708   }
1709
1710 }
1711
1712 static SQInteger ScriptedObject_get_action_wrapper(HSQUIRRELVM vm)
1713 {
1714   SQUserPointer data;
1715   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1716     sq_throwerror(vm, _SC("'get_action' called without instance"));
1717     return SQ_ERROR;
1718   }
1719   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1720
1721   try {
1722     std::string return_value = _this->get_action();
1723
1724     sq_pushstring(vm, return_value.c_str(), return_value.size());
1725     return 1;
1726
1727   } catch(std::exception& e) {
1728     sq_throwerror(vm, e.what());
1729     return SQ_ERROR;
1730   } catch(...) {
1731     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_action'"));
1732     return SQ_ERROR;
1733   }
1734
1735 }
1736
1737 static SQInteger ScriptedObject_move_wrapper(HSQUIRRELVM vm)
1738 {
1739   SQUserPointer data;
1740   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1741     sq_throwerror(vm, _SC("'move' called without instance"));
1742     return SQ_ERROR;
1743   }
1744   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1745   SQFloat arg0;
1746   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1747     sq_throwerror(vm, _SC("Argument 1 not a float"));
1748     return SQ_ERROR;
1749   }
1750   SQFloat arg1;
1751   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1752     sq_throwerror(vm, _SC("Argument 2 not a float"));
1753     return SQ_ERROR;
1754   }
1755
1756   try {
1757     _this->move(static_cast<float> (arg0), static_cast<float> (arg1));
1758
1759     return 0;
1760
1761   } catch(std::exception& e) {
1762     sq_throwerror(vm, e.what());
1763     return SQ_ERROR;
1764   } catch(...) {
1765     sq_throwerror(vm, _SC("Unexpected exception while executing function 'move'"));
1766     return SQ_ERROR;
1767   }
1768
1769 }
1770
1771 static SQInteger ScriptedObject_set_pos_wrapper(HSQUIRRELVM vm)
1772 {
1773   SQUserPointer data;
1774   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1775     sq_throwerror(vm, _SC("'set_pos' called without instance"));
1776     return SQ_ERROR;
1777   }
1778   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1779   SQFloat arg0;
1780   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1781     sq_throwerror(vm, _SC("Argument 1 not a float"));
1782     return SQ_ERROR;
1783   }
1784   SQFloat arg1;
1785   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1786     sq_throwerror(vm, _SC("Argument 2 not a float"));
1787     return SQ_ERROR;
1788   }
1789
1790   try {
1791     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
1792
1793     return 0;
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 'set_pos'"));
1800     return SQ_ERROR;
1801   }
1802
1803 }
1804
1805 static SQInteger ScriptedObject_get_pos_x_wrapper(HSQUIRRELVM vm)
1806 {
1807   SQUserPointer data;
1808   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1809     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
1810     return SQ_ERROR;
1811   }
1812   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1813
1814   try {
1815     float return_value = _this->get_pos_x();
1816
1817     sq_pushfloat(vm, return_value);
1818     return 1;
1819
1820   } catch(std::exception& e) {
1821     sq_throwerror(vm, e.what());
1822     return SQ_ERROR;
1823   } catch(...) {
1824     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
1825     return SQ_ERROR;
1826   }
1827
1828 }
1829
1830 static SQInteger ScriptedObject_get_pos_y_wrapper(HSQUIRRELVM vm)
1831 {
1832   SQUserPointer data;
1833   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1834     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
1835     return SQ_ERROR;
1836   }
1837   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1838
1839   try {
1840     float return_value = _this->get_pos_y();
1841
1842     sq_pushfloat(vm, return_value);
1843     return 1;
1844
1845   } catch(std::exception& e) {
1846     sq_throwerror(vm, e.what());
1847     return SQ_ERROR;
1848   } catch(...) {
1849     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
1850     return SQ_ERROR;
1851   }
1852
1853 }
1854
1855 static SQInteger ScriptedObject_set_velocity_wrapper(HSQUIRRELVM vm)
1856 {
1857   SQUserPointer data;
1858   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1859     sq_throwerror(vm, _SC("'set_velocity' called without instance"));
1860     return SQ_ERROR;
1861   }
1862   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1863   SQFloat arg0;
1864   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
1865     sq_throwerror(vm, _SC("Argument 1 not a float"));
1866     return SQ_ERROR;
1867   }
1868   SQFloat arg1;
1869   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
1870     sq_throwerror(vm, _SC("Argument 2 not a float"));
1871     return SQ_ERROR;
1872   }
1873
1874   try {
1875     _this->set_velocity(static_cast<float> (arg0), static_cast<float> (arg1));
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 'set_velocity'"));
1884     return SQ_ERROR;
1885   }
1886
1887 }
1888
1889 static SQInteger ScriptedObject_get_velocity_x_wrapper(HSQUIRRELVM vm)
1890 {
1891   SQUserPointer data;
1892   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1893     sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
1894     return SQ_ERROR;
1895   }
1896   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1897
1898   try {
1899     float return_value = _this->get_velocity_x();
1900
1901     sq_pushfloat(vm, return_value);
1902     return 1;
1903
1904   } catch(std::exception& e) {
1905     sq_throwerror(vm, e.what());
1906     return SQ_ERROR;
1907   } catch(...) {
1908     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_x'"));
1909     return SQ_ERROR;
1910   }
1911
1912 }
1913
1914 static SQInteger ScriptedObject_get_velocity_y_wrapper(HSQUIRRELVM vm)
1915 {
1916   SQUserPointer data;
1917   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1918     sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
1919     return SQ_ERROR;
1920   }
1921   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1922
1923   try {
1924     float return_value = _this->get_velocity_y();
1925
1926     sq_pushfloat(vm, return_value);
1927     return 1;
1928
1929   } catch(std::exception& e) {
1930     sq_throwerror(vm, e.what());
1931     return SQ_ERROR;
1932   } catch(...) {
1933     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_velocity_y'"));
1934     return SQ_ERROR;
1935   }
1936
1937 }
1938
1939 static SQInteger ScriptedObject_enable_gravity_wrapper(HSQUIRRELVM vm)
1940 {
1941   SQUserPointer data;
1942   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1943     sq_throwerror(vm, _SC("'enable_gravity' called without instance"));
1944     return SQ_ERROR;
1945   }
1946   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1947   SQBool arg0;
1948   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
1949     sq_throwerror(vm, _SC("Argument 1 not a bool"));
1950     return SQ_ERROR;
1951   }
1952
1953   try {
1954     _this->enable_gravity(arg0 == SQTrue);
1955
1956     return 0;
1957
1958   } catch(std::exception& e) {
1959     sq_throwerror(vm, e.what());
1960     return SQ_ERROR;
1961   } catch(...) {
1962     sq_throwerror(vm, _SC("Unexpected exception while executing function 'enable_gravity'"));
1963     return SQ_ERROR;
1964   }
1965
1966 }
1967
1968 static SQInteger ScriptedObject_gravity_enabled_wrapper(HSQUIRRELVM vm)
1969 {
1970   SQUserPointer data;
1971   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1972     sq_throwerror(vm, _SC("'gravity_enabled' called without instance"));
1973     return SQ_ERROR;
1974   }
1975   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
1976
1977   try {
1978     bool return_value = _this->gravity_enabled();
1979
1980     sq_pushbool(vm, return_value);
1981     return 1;
1982
1983   } catch(std::exception& e) {
1984     sq_throwerror(vm, e.what());
1985     return SQ_ERROR;
1986   } catch(...) {
1987     sq_throwerror(vm, _SC("Unexpected exception while executing function 'gravity_enabled'"));
1988     return SQ_ERROR;
1989   }
1990
1991 }
1992
1993 static SQInteger ScriptedObject_set_visible_wrapper(HSQUIRRELVM vm)
1994 {
1995   SQUserPointer data;
1996   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
1997     sq_throwerror(vm, _SC("'set_visible' called without instance"));
1998     return SQ_ERROR;
1999   }
2000   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2001   SQBool arg0;
2002   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2003     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2004     return SQ_ERROR;
2005   }
2006
2007   try {
2008     _this->set_visible(arg0 == SQTrue);
2009
2010     return 0;
2011
2012   } catch(std::exception& e) {
2013     sq_throwerror(vm, e.what());
2014     return SQ_ERROR;
2015   } catch(...) {
2016     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
2017     return SQ_ERROR;
2018   }
2019
2020 }
2021
2022 static SQInteger ScriptedObject_is_visible_wrapper(HSQUIRRELVM vm)
2023 {
2024   SQUserPointer data;
2025   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2026     sq_throwerror(vm, _SC("'is_visible' called without instance"));
2027     return SQ_ERROR;
2028   }
2029   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2030
2031   try {
2032     bool return_value = _this->is_visible();
2033
2034     sq_pushbool(vm, return_value);
2035     return 1;
2036
2037   } catch(std::exception& e) {
2038     sq_throwerror(vm, e.what());
2039     return SQ_ERROR;
2040   } catch(...) {
2041     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_visible'"));
2042     return SQ_ERROR;
2043   }
2044
2045 }
2046
2047 static SQInteger ScriptedObject_set_solid_wrapper(HSQUIRRELVM vm)
2048 {
2049   SQUserPointer data;
2050   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2051     sq_throwerror(vm, _SC("'set_solid' called without instance"));
2052     return SQ_ERROR;
2053   }
2054   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2055   SQBool arg0;
2056   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2057     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2058     return SQ_ERROR;
2059   }
2060
2061   try {
2062     _this->set_solid(arg0 == SQTrue);
2063
2064     return 0;
2065
2066   } catch(std::exception& e) {
2067     sq_throwerror(vm, e.what());
2068     return SQ_ERROR;
2069   } catch(...) {
2070     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_solid'"));
2071     return SQ_ERROR;
2072   }
2073
2074 }
2075
2076 static SQInteger ScriptedObject_is_solid_wrapper(HSQUIRRELVM vm)
2077 {
2078   SQUserPointer data;
2079   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2080     sq_throwerror(vm, _SC("'is_solid' called without instance"));
2081     return SQ_ERROR;
2082   }
2083   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2084
2085   try {
2086     bool return_value = _this->is_solid();
2087
2088     sq_pushbool(vm, return_value);
2089     return 1;
2090
2091   } catch(std::exception& e) {
2092     sq_throwerror(vm, e.what());
2093     return SQ_ERROR;
2094   } catch(...) {
2095     sq_throwerror(vm, _SC("Unexpected exception while executing function 'is_solid'"));
2096     return SQ_ERROR;
2097   }
2098
2099 }
2100
2101 static SQInteger ScriptedObject_get_name_wrapper(HSQUIRRELVM vm)
2102 {
2103   SQUserPointer data;
2104   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2105     sq_throwerror(vm, _SC("'get_name' called without instance"));
2106     return SQ_ERROR;
2107   }
2108   scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
2109
2110   try {
2111     std::string return_value = _this->get_name();
2112
2113     sq_pushstring(vm, return_value.c_str(), return_value.size());
2114     return 1;
2115
2116   } catch(std::exception& e) {
2117     sq_throwerror(vm, e.what());
2118     return SQ_ERROR;
2119   } catch(...) {
2120     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_name'"));
2121     return SQ_ERROR;
2122   }
2123
2124 }
2125
2126 static SQInteger SSector_release_hook(SQUserPointer ptr, SQInteger )
2127 {
2128   scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (ptr);
2129   delete _this;
2130   return 0;
2131 }
2132
2133 static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm)
2134 {
2135   SQUserPointer data;
2136   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2137     sq_throwerror(vm, _SC("'set_ambient_light' called without instance"));
2138     return SQ_ERROR;
2139   }
2140   scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2141   SQFloat arg0;
2142   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2143     sq_throwerror(vm, _SC("Argument 1 not a float"));
2144     return SQ_ERROR;
2145   }
2146   SQFloat arg1;
2147   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2148     sq_throwerror(vm, _SC("Argument 2 not a float"));
2149     return SQ_ERROR;
2150   }
2151   SQFloat arg2;
2152   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
2153     sq_throwerror(vm, _SC("Argument 3 not a float"));
2154     return SQ_ERROR;
2155   }
2156
2157   try {
2158     _this->set_ambient_light(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
2159
2160     return 0;
2161
2162   } catch(std::exception& e) {
2163     sq_throwerror(vm, e.what());
2164     return SQ_ERROR;
2165   } catch(...) {
2166     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ambient_light'"));
2167     return SQ_ERROR;
2168   }
2169
2170 }
2171
2172 static SQInteger SSector_get_ambient_red_wrapper(HSQUIRRELVM vm)
2173 {
2174   SQUserPointer data;
2175   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2176     sq_throwerror(vm, _SC("'get_ambient_red' called without instance"));
2177     return SQ_ERROR;
2178   }
2179   scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2180
2181   try {
2182     float return_value = _this->get_ambient_red();
2183
2184     sq_pushfloat(vm, return_value);
2185     return 1;
2186
2187   } catch(std::exception& e) {
2188     sq_throwerror(vm, e.what());
2189     return SQ_ERROR;
2190   } catch(...) {
2191     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_red'"));
2192     return SQ_ERROR;
2193   }
2194
2195 }
2196
2197 static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm)
2198 {
2199   SQUserPointer data;
2200   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2201     sq_throwerror(vm, _SC("'get_ambient_green' called without instance"));
2202     return SQ_ERROR;
2203   }
2204   scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2205
2206   try {
2207     float return_value = _this->get_ambient_green();
2208
2209     sq_pushfloat(vm, return_value);
2210     return 1;
2211
2212   } catch(std::exception& e) {
2213     sq_throwerror(vm, e.what());
2214     return SQ_ERROR;
2215   } catch(...) {
2216     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_green'"));
2217     return SQ_ERROR;
2218   }
2219
2220 }
2221
2222 static SQInteger SSector_get_ambient_blue_wrapper(HSQUIRRELVM vm)
2223 {
2224   SQUserPointer data;
2225   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2226     sq_throwerror(vm, _SC("'get_ambient_blue' called without instance"));
2227     return SQ_ERROR;
2228   }
2229   scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2230
2231   try {
2232     float return_value = _this->get_ambient_blue();
2233
2234     sq_pushfloat(vm, return_value);
2235     return 1;
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 'get_ambient_blue'"));
2242     return SQ_ERROR;
2243   }
2244
2245 }
2246
2247 static SQInteger SSector_set_gravity_wrapper(HSQUIRRELVM vm)
2248 {
2249   SQUserPointer data;
2250   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2251     sq_throwerror(vm, _SC("'set_gravity' called without instance"));
2252     return SQ_ERROR;
2253   }
2254   scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
2255   SQFloat arg0;
2256   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2257     sq_throwerror(vm, _SC("Argument 1 not a float"));
2258     return SQ_ERROR;
2259   }
2260
2261   try {
2262     _this->set_gravity(static_cast<float> (arg0));
2263
2264     return 0;
2265
2266   } catch(std::exception& e) {
2267     sq_throwerror(vm, e.what());
2268     return SQ_ERROR;
2269   } catch(...) {
2270     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_gravity'"));
2271     return SQ_ERROR;
2272   }
2273
2274 }
2275
2276 static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
2277 {
2278   scripting::Text* _this = reinterpret_cast<scripting::Text*> (ptr);
2279   delete _this;
2280   return 0;
2281 }
2282
2283 static SQInteger Text_set_text_wrapper(HSQUIRRELVM vm)
2284 {
2285   SQUserPointer data;
2286   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2287     sq_throwerror(vm, _SC("'set_text' called without instance"));
2288     return SQ_ERROR;
2289   }
2290   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2291   const SQChar* arg0;
2292   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2293     sq_throwerror(vm, _SC("Argument 1 not a string"));
2294     return SQ_ERROR;
2295   }
2296
2297   try {
2298     _this->set_text(arg0);
2299
2300     return 0;
2301
2302   } catch(std::exception& e) {
2303     sq_throwerror(vm, e.what());
2304     return SQ_ERROR;
2305   } catch(...) {
2306     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_text'"));
2307     return SQ_ERROR;
2308   }
2309
2310 }
2311
2312 static SQInteger Text_set_font_wrapper(HSQUIRRELVM vm)
2313 {
2314   SQUserPointer data;
2315   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2316     sq_throwerror(vm, _SC("'set_font' called without instance"));
2317     return SQ_ERROR;
2318   }
2319   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2320   const SQChar* arg0;
2321   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2322     sq_throwerror(vm, _SC("Argument 1 not a string"));
2323     return SQ_ERROR;
2324   }
2325
2326   try {
2327     _this->set_font(arg0);
2328
2329     return 0;
2330
2331   } catch(std::exception& e) {
2332     sq_throwerror(vm, e.what());
2333     return SQ_ERROR;
2334   } catch(...) {
2335     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_font'"));
2336     return SQ_ERROR;
2337   }
2338
2339 }
2340
2341 static SQInteger Text_fade_in_wrapper(HSQUIRRELVM vm)
2342 {
2343   SQUserPointer data;
2344   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2345     sq_throwerror(vm, _SC("'fade_in' called without instance"));
2346     return SQ_ERROR;
2347   }
2348   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2349   SQFloat arg0;
2350   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2351     sq_throwerror(vm, _SC("Argument 1 not a float"));
2352     return SQ_ERROR;
2353   }
2354
2355   try {
2356     _this->fade_in(static_cast<float> (arg0));
2357
2358     return 0;
2359
2360   } catch(std::exception& e) {
2361     sq_throwerror(vm, e.what());
2362     return SQ_ERROR;
2363   } catch(...) {
2364     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_in'"));
2365     return SQ_ERROR;
2366   }
2367
2368 }
2369
2370 static SQInteger Text_fade_out_wrapper(HSQUIRRELVM vm)
2371 {
2372   SQUserPointer data;
2373   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2374     sq_throwerror(vm, _SC("'fade_out' called without instance"));
2375     return SQ_ERROR;
2376   }
2377   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2378   SQFloat arg0;
2379   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2380     sq_throwerror(vm, _SC("Argument 1 not a float"));
2381     return SQ_ERROR;
2382   }
2383
2384   try {
2385     _this->fade_out(static_cast<float> (arg0));
2386
2387     return 0;
2388
2389   } catch(std::exception& e) {
2390     sq_throwerror(vm, e.what());
2391     return SQ_ERROR;
2392   } catch(...) {
2393     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade_out'"));
2394     return SQ_ERROR;
2395   }
2396
2397 }
2398
2399 static SQInteger Text_set_visible_wrapper(HSQUIRRELVM vm)
2400 {
2401   SQUserPointer data;
2402   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2403     sq_throwerror(vm, _SC("'set_visible' called without instance"));
2404     return SQ_ERROR;
2405   }
2406   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2407   SQBool arg0;
2408   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2409     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2410     return SQ_ERROR;
2411   }
2412
2413   try {
2414     _this->set_visible(arg0 == SQTrue);
2415
2416     return 0;
2417
2418   } catch(std::exception& e) {
2419     sq_throwerror(vm, e.what());
2420     return SQ_ERROR;
2421   } catch(...) {
2422     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_visible'"));
2423     return SQ_ERROR;
2424   }
2425
2426 }
2427
2428 static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
2429 {
2430   SQUserPointer data;
2431   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2432     sq_throwerror(vm, _SC("'set_centered' called without instance"));
2433     return SQ_ERROR;
2434   }
2435   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2436   SQBool arg0;
2437   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
2438     sq_throwerror(vm, _SC("Argument 1 not a bool"));
2439     return SQ_ERROR;
2440   }
2441
2442   try {
2443     _this->set_centered(arg0 == SQTrue);
2444
2445     return 0;
2446
2447   } catch(std::exception& e) {
2448     sq_throwerror(vm, e.what());
2449     return SQ_ERROR;
2450   } catch(...) {
2451     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_centered'"));
2452     return SQ_ERROR;
2453   }
2454
2455 }
2456
2457 static SQInteger Text_set_pos_wrapper(HSQUIRRELVM vm)
2458 {
2459   SQUserPointer data;
2460   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2461     sq_throwerror(vm, _SC("'set_pos' called without instance"));
2462     return SQ_ERROR;
2463   }
2464   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2465   SQFloat arg0;
2466   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2467     sq_throwerror(vm, _SC("Argument 1 not a float"));
2468     return SQ_ERROR;
2469   }
2470   SQFloat arg1;
2471   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2472     sq_throwerror(vm, _SC("Argument 2 not a float"));
2473     return SQ_ERROR;
2474   }
2475
2476   try {
2477     _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
2478
2479     return 0;
2480
2481   } catch(std::exception& e) {
2482     sq_throwerror(vm, e.what());
2483     return SQ_ERROR;
2484   } catch(...) {
2485     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
2486     return SQ_ERROR;
2487   }
2488
2489 }
2490
2491 static SQInteger Text_get_pos_x_wrapper(HSQUIRRELVM vm)
2492 {
2493   SQUserPointer data;
2494   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2495     sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
2496     return SQ_ERROR;
2497   }
2498   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2499
2500   try {
2501     float return_value = _this->get_pos_x();
2502
2503     sq_pushfloat(vm, return_value);
2504     return 1;
2505
2506   } catch(std::exception& e) {
2507     sq_throwerror(vm, e.what());
2508     return SQ_ERROR;
2509   } catch(...) {
2510     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
2511     return SQ_ERROR;
2512   }
2513
2514 }
2515
2516 static SQInteger Text_get_pos_y_wrapper(HSQUIRRELVM vm)
2517 {
2518   SQUserPointer data;
2519   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2520     sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
2521     return SQ_ERROR;
2522   }
2523   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2524
2525   try {
2526     float return_value = _this->get_pos_y();
2527
2528     sq_pushfloat(vm, return_value);
2529     return 1;
2530
2531   } catch(std::exception& e) {
2532     sq_throwerror(vm, e.what());
2533     return SQ_ERROR;
2534   } catch(...) {
2535     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
2536     return SQ_ERROR;
2537   }
2538
2539 }
2540
2541 static SQInteger Text_set_anchor_point_wrapper(HSQUIRRELVM vm)
2542 {
2543   SQUserPointer data;
2544   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2545     sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
2546     return SQ_ERROR;
2547   }
2548   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2549   SQInteger arg0;
2550   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2551     sq_throwerror(vm, _SC("Argument 1 not an integer"));
2552     return SQ_ERROR;
2553   }
2554
2555   try {
2556     _this->set_anchor_point(static_cast<int> (arg0));
2557
2558     return 0;
2559
2560   } catch(std::exception& e) {
2561     sq_throwerror(vm, e.what());
2562     return SQ_ERROR;
2563   } catch(...) {
2564     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
2565     return SQ_ERROR;
2566   }
2567
2568 }
2569
2570 static SQInteger Text_get_anchor_point_wrapper(HSQUIRRELVM vm)
2571 {
2572   SQUserPointer data;
2573   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2574     sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
2575     return SQ_ERROR;
2576   }
2577   scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
2578
2579   try {
2580     int return_value = _this->get_anchor_point();
2581
2582     sq_pushinteger(vm, return_value);
2583     return 1;
2584
2585   } catch(std::exception& e) {
2586     sq_throwerror(vm, e.what());
2587     return SQ_ERROR;
2588   } catch(...) {
2589     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
2590     return SQ_ERROR;
2591   }
2592
2593 }
2594
2595 static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger )
2596 {
2597   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (ptr);
2598   delete _this;
2599   return 0;
2600 }
2601
2602 static SQInteger Thunderstorm_start_wrapper(HSQUIRRELVM vm)
2603 {
2604   SQUserPointer data;
2605   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2606     sq_throwerror(vm, _SC("'start' called without instance"));
2607     return SQ_ERROR;
2608   }
2609   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2610
2611   try {
2612     _this->start();
2613
2614     return 0;
2615
2616   } catch(std::exception& e) {
2617     sq_throwerror(vm, e.what());
2618     return SQ_ERROR;
2619   } catch(...) {
2620     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
2621     return SQ_ERROR;
2622   }
2623
2624 }
2625
2626 static SQInteger Thunderstorm_stop_wrapper(HSQUIRRELVM vm)
2627 {
2628   SQUserPointer data;
2629   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2630     sq_throwerror(vm, _SC("'stop' called without instance"));
2631     return SQ_ERROR;
2632   }
2633   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2634
2635   try {
2636     _this->stop();
2637
2638     return 0;
2639
2640   } catch(std::exception& e) {
2641     sq_throwerror(vm, e.what());
2642     return SQ_ERROR;
2643   } catch(...) {
2644     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
2645     return SQ_ERROR;
2646   }
2647
2648 }
2649
2650 static SQInteger Thunderstorm_thunder_wrapper(HSQUIRRELVM vm)
2651 {
2652   SQUserPointer data;
2653   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2654     sq_throwerror(vm, _SC("'thunder' called without instance"));
2655     return SQ_ERROR;
2656   }
2657   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2658
2659   try {
2660     _this->thunder();
2661
2662     return 0;
2663
2664   } catch(std::exception& e) {
2665     sq_throwerror(vm, e.what());
2666     return SQ_ERROR;
2667   } catch(...) {
2668     sq_throwerror(vm, _SC("Unexpected exception while executing function 'thunder'"));
2669     return SQ_ERROR;
2670   }
2671
2672 }
2673
2674 static SQInteger Thunderstorm_lightning_wrapper(HSQUIRRELVM vm)
2675 {
2676   SQUserPointer data;
2677   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2678     sq_throwerror(vm, _SC("'lightning' called without instance"));
2679     return SQ_ERROR;
2680   }
2681   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2682
2683   try {
2684     _this->lightning();
2685
2686     return 0;
2687
2688   } catch(std::exception& e) {
2689     sq_throwerror(vm, e.what());
2690     return SQ_ERROR;
2691   } catch(...) {
2692     sq_throwerror(vm, _SC("Unexpected exception while executing function 'lightning'"));
2693     return SQ_ERROR;
2694   }
2695
2696 }
2697
2698 static SQInteger Thunderstorm_flash_wrapper(HSQUIRRELVM vm)
2699 {
2700   SQUserPointer data;
2701   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2702     sq_throwerror(vm, _SC("'flash' called without instance"));
2703     return SQ_ERROR;
2704   }
2705   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2706
2707   try {
2708     _this->flash();
2709
2710     return 0;
2711
2712   } catch(std::exception& e) {
2713     sq_throwerror(vm, e.what());
2714     return SQ_ERROR;
2715   } catch(...) {
2716     sq_throwerror(vm, _SC("Unexpected exception while executing function 'flash'"));
2717     return SQ_ERROR;
2718   }
2719
2720 }
2721
2722 static SQInteger Thunderstorm_electrify_wrapper(HSQUIRRELVM vm)
2723 {
2724   SQUserPointer data;
2725   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2726     sq_throwerror(vm, _SC("'electrify' called without instance"));
2727     return SQ_ERROR;
2728   }
2729   scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
2730
2731   try {
2732     _this->electrify();
2733
2734     return 0;
2735
2736   } catch(std::exception& e) {
2737     sq_throwerror(vm, e.what());
2738     return SQ_ERROR;
2739   } catch(...) {
2740     sq_throwerror(vm, _SC("Unexpected exception while executing function 'electrify'"));
2741     return SQ_ERROR;
2742   }
2743
2744 }
2745
2746 static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger )
2747 {
2748   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (ptr);
2749   delete _this;
2750   return 0;
2751 }
2752
2753 static SQInteger TileMap_goto_node_wrapper(HSQUIRRELVM vm)
2754 {
2755   SQUserPointer data;
2756   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2757     sq_throwerror(vm, _SC("'goto_node' called without instance"));
2758     return SQ_ERROR;
2759   }
2760   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2761   SQInteger arg0;
2762   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2763     sq_throwerror(vm, _SC("Argument 1 not an integer"));
2764     return SQ_ERROR;
2765   }
2766
2767   try {
2768     _this->goto_node(static_cast<int> (arg0));
2769
2770     return 0;
2771
2772   } catch(std::exception& e) {
2773     sq_throwerror(vm, e.what());
2774     return SQ_ERROR;
2775   } catch(...) {
2776     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2777     return SQ_ERROR;
2778   }
2779
2780 }
2781
2782 static SQInteger TileMap_start_moving_wrapper(HSQUIRRELVM vm)
2783 {
2784   SQUserPointer data;
2785   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2786     sq_throwerror(vm, _SC("'start_moving' called without instance"));
2787     return SQ_ERROR;
2788   }
2789   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2790
2791   try {
2792     _this->start_moving();
2793
2794     return 0;
2795
2796   } catch(std::exception& e) {
2797     sq_throwerror(vm, e.what());
2798     return SQ_ERROR;
2799   } catch(...) {
2800     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
2801     return SQ_ERROR;
2802   }
2803
2804 }
2805
2806 static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm)
2807 {
2808   SQUserPointer data;
2809   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2810     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
2811     return SQ_ERROR;
2812   }
2813   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2814
2815   try {
2816     _this->stop_moving();
2817
2818     return 0;
2819
2820   } catch(std::exception& e) {
2821     sq_throwerror(vm, e.what());
2822     return SQ_ERROR;
2823   } catch(...) {
2824     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
2825     return SQ_ERROR;
2826   }
2827
2828 }
2829
2830 static SQInteger TileMap_fade_wrapper(HSQUIRRELVM vm)
2831 {
2832   SQUserPointer data;
2833   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2834     sq_throwerror(vm, _SC("'fade' called without instance"));
2835     return SQ_ERROR;
2836   }
2837   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2838   SQFloat arg0;
2839   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2840     sq_throwerror(vm, _SC("Argument 1 not a float"));
2841     return SQ_ERROR;
2842   }
2843   SQFloat arg1;
2844   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
2845     sq_throwerror(vm, _SC("Argument 2 not a float"));
2846     return SQ_ERROR;
2847   }
2848
2849   try {
2850     _this->fade(static_cast<float> (arg0), static_cast<float> (arg1));
2851
2852     return 0;
2853
2854   } catch(std::exception& e) {
2855     sq_throwerror(vm, e.what());
2856     return SQ_ERROR;
2857   } catch(...) {
2858     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade'"));
2859     return SQ_ERROR;
2860   }
2861
2862 }
2863
2864 static SQInteger TileMap_set_alpha_wrapper(HSQUIRRELVM vm)
2865 {
2866   SQUserPointer data;
2867   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2868     sq_throwerror(vm, _SC("'set_alpha' called without instance"));
2869     return SQ_ERROR;
2870   }
2871   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2872   SQFloat arg0;
2873   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
2874     sq_throwerror(vm, _SC("Argument 1 not a float"));
2875     return SQ_ERROR;
2876   }
2877
2878   try {
2879     _this->set_alpha(static_cast<float> (arg0));
2880
2881     return 0;
2882
2883   } catch(std::exception& e) {
2884     sq_throwerror(vm, e.what());
2885     return SQ_ERROR;
2886   } catch(...) {
2887     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_alpha'"));
2888     return SQ_ERROR;
2889   }
2890
2891 }
2892
2893 static SQInteger TileMap_get_alpha_wrapper(HSQUIRRELVM vm)
2894 {
2895   SQUserPointer data;
2896   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2897     sq_throwerror(vm, _SC("'get_alpha' called without instance"));
2898     return SQ_ERROR;
2899   }
2900   scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
2901
2902   try {
2903     float return_value = _this->get_alpha();
2904
2905     sq_pushfloat(vm, return_value);
2906     return 1;
2907
2908   } catch(std::exception& e) {
2909     sq_throwerror(vm, e.what());
2910     return SQ_ERROR;
2911   } catch(...) {
2912     sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_alpha'"));
2913     return SQ_ERROR;
2914   }
2915
2916 }
2917
2918 static SQInteger WillOWisp_release_hook(SQUserPointer ptr, SQInteger )
2919 {
2920   scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (ptr);
2921   delete _this;
2922   return 0;
2923 }
2924
2925 static SQInteger WillOWisp_goto_node_wrapper(HSQUIRRELVM vm)
2926 {
2927   SQUserPointer data;
2928   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2929     sq_throwerror(vm, _SC("'goto_node' called without instance"));
2930     return SQ_ERROR;
2931   }
2932   scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2933   SQInteger arg0;
2934   if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
2935     sq_throwerror(vm, _SC("Argument 1 not an integer"));
2936     return SQ_ERROR;
2937   }
2938
2939   try {
2940     _this->goto_node(static_cast<int> (arg0));
2941
2942     return 0;
2943
2944   } catch(std::exception& e) {
2945     sq_throwerror(vm, e.what());
2946     return SQ_ERROR;
2947   } catch(...) {
2948     sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
2949     return SQ_ERROR;
2950   }
2951
2952 }
2953
2954 static SQInteger WillOWisp_set_state_wrapper(HSQUIRRELVM vm)
2955 {
2956   SQUserPointer data;
2957   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2958     sq_throwerror(vm, _SC("'set_state' called without instance"));
2959     return SQ_ERROR;
2960   }
2961   scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2962   const SQChar* arg0;
2963   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
2964     sq_throwerror(vm, _SC("Argument 1 not a string"));
2965     return SQ_ERROR;
2966   }
2967
2968   try {
2969     _this->set_state(arg0);
2970
2971     return 0;
2972
2973   } catch(std::exception& e) {
2974     sq_throwerror(vm, e.what());
2975     return SQ_ERROR;
2976   } catch(...) {
2977     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_state'"));
2978     return SQ_ERROR;
2979   }
2980
2981 }
2982
2983 static SQInteger WillOWisp_start_moving_wrapper(HSQUIRRELVM vm)
2984 {
2985   SQUserPointer data;
2986   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
2987     sq_throwerror(vm, _SC("'start_moving' called without instance"));
2988     return SQ_ERROR;
2989   }
2990   scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
2991
2992   try {
2993     _this->start_moving();
2994
2995     return 0;
2996
2997   } catch(std::exception& e) {
2998     sq_throwerror(vm, e.what());
2999     return SQ_ERROR;
3000   } catch(...) {
3001     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
3002     return SQ_ERROR;
3003   }
3004
3005 }
3006
3007 static SQInteger WillOWisp_stop_moving_wrapper(HSQUIRRELVM vm)
3008 {
3009   SQUserPointer data;
3010   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
3011     sq_throwerror(vm, _SC("'stop_moving' called without instance"));
3012     return SQ_ERROR;
3013   }
3014   scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
3015
3016   try {
3017     _this->stop_moving();
3018
3019     return 0;
3020
3021   } catch(std::exception& e) {
3022     sq_throwerror(vm, e.what());
3023     return SQ_ERROR;
3024   } catch(...) {
3025     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
3026     return SQ_ERROR;
3027   }
3028
3029 }
3030
3031 static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
3032 {
3033   scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (ptr);
3034   delete _this;
3035   return 0;
3036 }
3037
3038 static SQInteger Wind_start_wrapper(HSQUIRRELVM vm)
3039 {
3040   SQUserPointer data;
3041   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
3042     sq_throwerror(vm, _SC("'start' called without instance"));
3043     return SQ_ERROR;
3044   }
3045   scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (data);
3046
3047   try {
3048     _this->start();
3049
3050     return 0;
3051
3052   } catch(std::exception& e) {
3053     sq_throwerror(vm, e.what());
3054     return SQ_ERROR;
3055   } catch(...) {
3056     sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
3057     return SQ_ERROR;
3058   }
3059
3060 }
3061
3062 static SQInteger Wind_stop_wrapper(HSQUIRRELVM vm)
3063 {
3064   SQUserPointer data;
3065   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0)) || !data) {
3066     sq_throwerror(vm, _SC("'stop' called without instance"));
3067     return SQ_ERROR;
3068   }
3069   scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (data);
3070
3071   try {
3072     _this->stop();
3073
3074     return 0;
3075
3076   } catch(std::exception& e) {
3077     sq_throwerror(vm, e.what());
3078     return SQ_ERROR;
3079   } catch(...) {
3080     sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
3081     return SQ_ERROR;
3082   }
3083
3084 }
3085
3086 static SQInteger display_wrapper(HSQUIRRELVM vm)
3087 {
3088   return scripting::display(vm);
3089 }
3090
3091 static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
3092 {
3093   HSQUIRRELVM arg0 = vm;
3094
3095   try {
3096     scripting::print_stacktrace(arg0);
3097
3098     return 0;
3099
3100   } catch(std::exception& e) {
3101     sq_throwerror(vm, e.what());
3102     return SQ_ERROR;
3103   } catch(...) {
3104     sq_throwerror(vm, _SC("Unexpected exception while executing function 'print_stacktrace'"));
3105     return SQ_ERROR;
3106   }
3107
3108 }
3109
3110 static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
3111 {
3112   return scripting::get_current_thread(vm);
3113 }
3114
3115 static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
3116 {
3117   const SQChar* arg0;
3118   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3119     sq_throwerror(vm, _SC("Argument 1 not a string"));
3120     return SQ_ERROR;
3121   }
3122
3123   try {
3124     scripting::display_text_file(arg0);
3125
3126     return 0;
3127
3128   } catch(std::exception& e) {
3129     sq_throwerror(vm, e.what());
3130     return SQ_ERROR;
3131   } catch(...) {
3132     sq_throwerror(vm, _SC("Unexpected exception while executing function 'display_text_file'"));
3133     return SQ_ERROR;
3134   }
3135
3136 }
3137
3138 static SQInteger load_worldmap_wrapper(HSQUIRRELVM vm)
3139 {
3140   const SQChar* arg0;
3141   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3142     sq_throwerror(vm, _SC("Argument 1 not a string"));
3143     return SQ_ERROR;
3144   }
3145
3146   try {
3147     scripting::load_worldmap(arg0);
3148
3149     return 0;
3150
3151   } catch(std::exception& e) {
3152     sq_throwerror(vm, e.what());
3153     return SQ_ERROR;
3154   } catch(...) {
3155     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_worldmap'"));
3156     return SQ_ERROR;
3157   }
3158
3159 }
3160
3161 static SQInteger load_level_wrapper(HSQUIRRELVM vm)
3162 {
3163   const SQChar* arg0;
3164   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3165     sq_throwerror(vm, _SC("Argument 1 not a string"));
3166     return SQ_ERROR;
3167   }
3168
3169   try {
3170     scripting::load_level(arg0);
3171
3172     return 0;
3173
3174   } catch(std::exception& e) {
3175     sq_throwerror(vm, e.what());
3176     return SQ_ERROR;
3177   } catch(...) {
3178     sq_throwerror(vm, _SC("Unexpected exception while executing function 'load_level'"));
3179     return SQ_ERROR;
3180   }
3181
3182 }
3183
3184 static SQInteger wait_wrapper(HSQUIRRELVM vm)
3185 {
3186   HSQUIRRELVM arg0 = vm;
3187   SQFloat arg1;
3188   if(SQ_FAILED(sq_getfloat(vm, 2, &arg1))) {
3189     sq_throwerror(vm, _SC("Argument 1 not a float"));
3190     return SQ_ERROR;
3191   }
3192
3193   try {
3194     scripting::wait(arg0, static_cast<float> (arg1));
3195
3196     return sq_suspendvm(vm);
3197
3198   } catch(std::exception& e) {
3199     sq_throwerror(vm, e.what());
3200     return SQ_ERROR;
3201   } catch(...) {
3202     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait'"));
3203     return SQ_ERROR;
3204   }
3205
3206 }
3207
3208 static SQInteger wait_for_screenswitch_wrapper(HSQUIRRELVM vm)
3209 {
3210   HSQUIRRELVM arg0 = vm;
3211
3212   try {
3213     scripting::wait_for_screenswitch(arg0);
3214
3215     return sq_suspendvm(vm);
3216
3217   } catch(std::exception& e) {
3218     sq_throwerror(vm, e.what());
3219     return SQ_ERROR;
3220   } catch(...) {
3221     sq_throwerror(vm, _SC("Unexpected exception while executing function 'wait_for_screenswitch'"));
3222     return SQ_ERROR;
3223   }
3224
3225 }
3226
3227 static SQInteger exit_screen_wrapper(HSQUIRRELVM vm)
3228 {
3229   (void) vm;
3230
3231   try {
3232     scripting::exit_screen();
3233
3234     return 0;
3235
3236   } catch(std::exception& e) {
3237     sq_throwerror(vm, e.what());
3238     return SQ_ERROR;
3239   } catch(...) {
3240     sq_throwerror(vm, _SC("Unexpected exception while executing function 'exit_screen'"));
3241     return SQ_ERROR;
3242   }
3243
3244 }
3245
3246 static SQInteger fadeout_screen_wrapper(HSQUIRRELVM vm)
3247 {
3248   SQFloat arg0;
3249   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3250     sq_throwerror(vm, _SC("Argument 1 not a float"));
3251     return SQ_ERROR;
3252   }
3253
3254   try {
3255     scripting::fadeout_screen(static_cast<float> (arg0));
3256
3257     return 0;
3258
3259   } catch(std::exception& e) {
3260     sq_throwerror(vm, e.what());
3261     return SQ_ERROR;
3262   } catch(...) {
3263     sq_throwerror(vm, _SC("Unexpected exception while executing function 'fadeout_screen'"));
3264     return SQ_ERROR;
3265   }
3266
3267 }
3268
3269 static SQInteger shrink_screen_wrapper(HSQUIRRELVM vm)
3270 {
3271   SQFloat arg0;
3272   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3273     sq_throwerror(vm, _SC("Argument 1 not a float"));
3274     return SQ_ERROR;
3275   }
3276   SQFloat arg1;
3277   if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
3278     sq_throwerror(vm, _SC("Argument 2 not a float"));
3279     return SQ_ERROR;
3280   }
3281   SQFloat arg2;
3282   if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
3283     sq_throwerror(vm, _SC("Argument 3 not a float"));
3284     return SQ_ERROR;
3285   }
3286
3287   try {
3288     scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
3289
3290     return 0;
3291
3292   } catch(std::exception& e) {
3293     sq_throwerror(vm, e.what());
3294     return SQ_ERROR;
3295   } catch(...) {
3296     sq_throwerror(vm, _SC("Unexpected exception while executing function 'shrink_screen'"));
3297     return SQ_ERROR;
3298   }
3299
3300 }
3301
3302 static SQInteger abort_screenfade_wrapper(HSQUIRRELVM vm)
3303 {
3304   (void) vm;
3305
3306   try {
3307     scripting::abort_screenfade();
3308
3309     return 0;
3310
3311   } catch(std::exception& e) {
3312     sq_throwerror(vm, e.what());
3313     return SQ_ERROR;
3314   } catch(...) {
3315     sq_throwerror(vm, _SC("Unexpected exception while executing function 'abort_screenfade'"));
3316     return SQ_ERROR;
3317   }
3318
3319 }
3320
3321 static SQInteger translate_wrapper(HSQUIRRELVM vm)
3322 {
3323   const SQChar* arg0;
3324   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3325     sq_throwerror(vm, _SC("Argument 1 not a string"));
3326     return SQ_ERROR;
3327   }
3328
3329   try {
3330     std::string return_value = scripting::translate(arg0);
3331
3332     sq_pushstring(vm, return_value.c_str(), return_value.size());
3333     return 1;
3334
3335   } catch(std::exception& e) {
3336     sq_throwerror(vm, e.what());
3337     return SQ_ERROR;
3338   } catch(...) {
3339     sq_throwerror(vm, _SC("Unexpected exception while executing function 'translate'"));
3340     return SQ_ERROR;
3341   }
3342
3343 }
3344
3345 static SQInteger import_wrapper(HSQUIRRELVM vm)
3346 {
3347   HSQUIRRELVM arg0 = vm;
3348   const SQChar* arg1;
3349   if(SQ_FAILED(sq_getstring(vm, 2, &arg1))) {
3350     sq_throwerror(vm, _SC("Argument 1 not a string"));
3351     return SQ_ERROR;
3352   }
3353
3354   try {
3355     scripting::import(arg0, arg1);
3356
3357     return 0;
3358
3359   } catch(std::exception& e) {
3360     sq_throwerror(vm, e.what());
3361     return SQ_ERROR;
3362   } catch(...) {
3363     sq_throwerror(vm, _SC("Unexpected exception while executing function 'import'"));
3364     return SQ_ERROR;
3365   }
3366
3367 }
3368
3369 static SQInteger save_state_wrapper(HSQUIRRELVM vm)
3370 {
3371   (void) vm;
3372
3373   try {
3374     scripting::save_state();
3375
3376     return 0;
3377
3378   } catch(std::exception& e) {
3379     sq_throwerror(vm, e.what());
3380     return SQ_ERROR;
3381   } catch(...) {
3382     sq_throwerror(vm, _SC("Unexpected exception while executing function 'save_state'"));
3383     return SQ_ERROR;
3384   }
3385
3386 }
3387
3388 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
3389 {
3390   SQBool arg0;
3391   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3392     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3393     return SQ_ERROR;
3394   }
3395
3396   try {
3397     scripting::debug_collrects(arg0 == SQTrue);
3398
3399     return 0;
3400
3401   } catch(std::exception& e) {
3402     sq_throwerror(vm, e.what());
3403     return SQ_ERROR;
3404   } catch(...) {
3405     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
3406     return SQ_ERROR;
3407   }
3408
3409 }
3410
3411 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
3412 {
3413   SQBool arg0;
3414   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3415     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3416     return SQ_ERROR;
3417   }
3418
3419   try {
3420     scripting::debug_show_fps(arg0 == SQTrue);
3421
3422     return 0;
3423
3424   } catch(std::exception& e) {
3425     sq_throwerror(vm, e.what());
3426     return SQ_ERROR;
3427   } catch(...) {
3428     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
3429     return SQ_ERROR;
3430   }
3431
3432 }
3433
3434 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
3435 {
3436   SQBool arg0;
3437   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3438     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3439     return SQ_ERROR;
3440   }
3441
3442   try {
3443     scripting::debug_draw_solids_only(arg0 == SQTrue);
3444
3445     return 0;
3446
3447   } catch(std::exception& e) {
3448     sq_throwerror(vm, e.what());
3449     return SQ_ERROR;
3450   } catch(...) {
3451     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
3452     return SQ_ERROR;
3453   }
3454
3455 }
3456
3457 static SQInteger debug_draw_editor_images_wrapper(HSQUIRRELVM vm)
3458 {
3459   SQBool arg0;
3460   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3461     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3462     return SQ_ERROR;
3463   }
3464
3465   try {
3466     scripting::debug_draw_editor_images(arg0 == SQTrue);
3467
3468     return 0;
3469
3470   } catch(std::exception& e) {
3471     sq_throwerror(vm, e.what());
3472     return SQ_ERROR;
3473   } catch(...) {
3474     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_editor_images'"));
3475     return SQ_ERROR;
3476   }
3477
3478 }
3479
3480 static SQInteger debug_worldmap_ghost_wrapper(HSQUIRRELVM vm)
3481 {
3482   SQBool arg0;
3483   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3484     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3485     return SQ_ERROR;
3486   }
3487
3488   try {
3489     scripting::debug_worldmap_ghost(arg0 == SQTrue);
3490
3491     return 0;
3492
3493   } catch(std::exception& e) {
3494     sq_throwerror(vm, e.what());
3495     return SQ_ERROR;
3496   } catch(...) {
3497     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_worldmap_ghost'"));
3498     return SQ_ERROR;
3499   }
3500
3501 }
3502
3503 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
3504 {
3505   const SQChar* arg0;
3506   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3507     sq_throwerror(vm, _SC("Argument 1 not a string"));
3508     return SQ_ERROR;
3509   }
3510
3511   try {
3512     scripting::play_music(arg0);
3513
3514     return 0;
3515
3516   } catch(std::exception& e) {
3517     sq_throwerror(vm, e.what());
3518     return SQ_ERROR;
3519   } catch(...) {
3520     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
3521     return SQ_ERROR;
3522   }
3523
3524 }
3525
3526 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
3527 {
3528   const SQChar* arg0;
3529   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3530     sq_throwerror(vm, _SC("Argument 1 not a string"));
3531     return SQ_ERROR;
3532   }
3533
3534   try {
3535     scripting::play_sound(arg0);
3536
3537     return 0;
3538
3539   } catch(std::exception& e) {
3540     sq_throwerror(vm, e.what());
3541     return SQ_ERROR;
3542   } catch(...) {
3543     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
3544     return SQ_ERROR;
3545   }
3546
3547 }
3548
3549 static SQInteger set_game_speed_wrapper(HSQUIRRELVM vm)
3550 {
3551   SQFloat arg0;
3552   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3553     sq_throwerror(vm, _SC("Argument 1 not a float"));
3554     return SQ_ERROR;
3555   }
3556
3557   try {
3558     scripting::set_game_speed(static_cast<float> (arg0));
3559
3560     return 0;
3561
3562   } catch(std::exception& e) {
3563     sq_throwerror(vm, e.what());
3564     return SQ_ERROR;
3565   } catch(...) {
3566     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_game_speed'"));
3567     return SQ_ERROR;
3568   }
3569
3570 }
3571
3572 static SQInteger grease_wrapper(HSQUIRRELVM vm)
3573 {
3574   (void) vm;
3575
3576   try {
3577     scripting::grease();
3578
3579     return 0;
3580
3581   } catch(std::exception& e) {
3582     sq_throwerror(vm, e.what());
3583     return SQ_ERROR;
3584   } catch(...) {
3585     sq_throwerror(vm, _SC("Unexpected exception while executing function 'grease'"));
3586     return SQ_ERROR;
3587   }
3588
3589 }
3590
3591 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
3592 {
3593   (void) vm;
3594
3595   try {
3596     scripting::invincible();
3597
3598     return 0;
3599
3600   } catch(std::exception& e) {
3601     sq_throwerror(vm, e.what());
3602     return SQ_ERROR;
3603   } catch(...) {
3604     sq_throwerror(vm, _SC("Unexpected exception while executing function 'invincible'"));
3605     return SQ_ERROR;
3606   }
3607
3608 }
3609
3610 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
3611 {
3612   (void) vm;
3613
3614   try {
3615     scripting::ghost();
3616
3617     return 0;
3618
3619   } catch(std::exception& e) {
3620     sq_throwerror(vm, e.what());
3621     return SQ_ERROR;
3622   } catch(...) {
3623     sq_throwerror(vm, _SC("Unexpected exception while executing function 'ghost'"));
3624     return SQ_ERROR;
3625   }
3626
3627 }
3628
3629 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
3630 {
3631   (void) vm;
3632
3633   try {
3634     scripting::mortal();
3635
3636     return 0;
3637
3638   } catch(std::exception& e) {
3639     sq_throwerror(vm, e.what());
3640     return SQ_ERROR;
3641   } catch(...) {
3642     sq_throwerror(vm, _SC("Unexpected exception while executing function 'mortal'"));
3643     return SQ_ERROR;
3644   }
3645
3646 }
3647
3648 static SQInteger restart_wrapper(HSQUIRRELVM vm)
3649 {
3650   (void) vm;
3651
3652   try {
3653     scripting::restart();
3654
3655     return 0;
3656
3657   } catch(std::exception& e) {
3658     sq_throwerror(vm, e.what());
3659     return SQ_ERROR;
3660   } catch(...) {
3661     sq_throwerror(vm, _SC("Unexpected exception while executing function 'restart'"));
3662     return SQ_ERROR;
3663   }
3664
3665 }
3666
3667 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
3668 {
3669   (void) vm;
3670
3671   try {
3672     scripting::whereami();
3673
3674     return 0;
3675
3676   } catch(std::exception& e) {
3677     sq_throwerror(vm, e.what());
3678     return SQ_ERROR;
3679   } catch(...) {
3680     sq_throwerror(vm, _SC("Unexpected exception while executing function 'whereami'"));
3681     return SQ_ERROR;
3682   }
3683
3684 }
3685
3686 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
3687 {
3688   (void) vm;
3689
3690   try {
3691     scripting::gotoend();
3692
3693     return 0;
3694
3695   } catch(std::exception& e) {
3696     sq_throwerror(vm, e.what());
3697     return SQ_ERROR;
3698   } catch(...) {
3699     sq_throwerror(vm, _SC("Unexpected exception while executing function 'gotoend'"));
3700     return SQ_ERROR;
3701   }
3702
3703 }
3704
3705 static SQInteger camera_wrapper(HSQUIRRELVM vm)
3706 {
3707   (void) vm;
3708
3709   try {
3710     scripting::camera();
3711
3712     return 0;
3713
3714   } catch(std::exception& e) {
3715     sq_throwerror(vm, e.what());
3716     return SQ_ERROR;
3717   } catch(...) {
3718     sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
3719     return SQ_ERROR;
3720   }
3721
3722 }
3723
3724 static SQInteger set_gamma_wrapper(HSQUIRRELVM vm)
3725 {
3726   SQFloat arg0;
3727   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3728     sq_throwerror(vm, _SC("Argument 1 not a float"));
3729     return SQ_ERROR;
3730   }
3731
3732   try {
3733     scripting::set_gamma(static_cast<float> (arg0));
3734
3735     return 0;
3736
3737   } catch(std::exception& e) {
3738     sq_throwerror(vm, e.what());
3739     return SQ_ERROR;
3740   } catch(...) {
3741     sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_gamma'"));
3742     return SQ_ERROR;
3743   }
3744
3745 }
3746
3747 static SQInteger quit_wrapper(HSQUIRRELVM vm)
3748 {
3749   (void) vm;
3750
3751   try {
3752     scripting::quit();
3753
3754     return 0;
3755
3756   } catch(std::exception& e) {
3757     sq_throwerror(vm, e.what());
3758     return SQ_ERROR;
3759   } catch(...) {
3760     sq_throwerror(vm, _SC("Unexpected exception while executing function 'quit'"));
3761     return SQ_ERROR;
3762   }
3763
3764 }
3765
3766 static SQInteger rand_wrapper(HSQUIRRELVM vm)
3767 {
3768
3769   try {
3770     int return_value = scripting::rand();
3771
3772     sq_pushinteger(vm, return_value);
3773     return 1;
3774
3775   } catch(std::exception& e) {
3776     sq_throwerror(vm, e.what());
3777     return SQ_ERROR;
3778   } catch(...) {
3779     sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
3780     return SQ_ERROR;
3781   }
3782
3783 }
3784
3785 static SQInteger record_demo_wrapper(HSQUIRRELVM vm)
3786 {
3787   const SQChar* arg0;
3788   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3789     sq_throwerror(vm, _SC("Argument 1 not a string"));
3790     return SQ_ERROR;
3791   }
3792
3793   try {
3794     scripting::record_demo(arg0);
3795
3796     return 0;
3797
3798   } catch(std::exception& e) {
3799     sq_throwerror(vm, e.what());
3800     return SQ_ERROR;
3801   } catch(...) {
3802     sq_throwerror(vm, _SC("Unexpected exception while executing function 'record_demo'"));
3803     return SQ_ERROR;
3804   }
3805
3806 }
3807
3808 static SQInteger play_demo_wrapper(HSQUIRRELVM vm)
3809 {
3810   const SQChar* arg0;
3811   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3812     sq_throwerror(vm, _SC("Argument 1 not a string"));
3813     return SQ_ERROR;
3814   }
3815
3816   try {
3817     scripting::play_demo(arg0);
3818
3819     return 0;
3820
3821   } catch(std::exception& e) {
3822     sq_throwerror(vm, e.what());
3823     return SQ_ERROR;
3824   } catch(...) {
3825     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_demo'"));
3826     return SQ_ERROR;
3827   }
3828
3829 }
3830
3831 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
3832 {
3833   SQBool arg0;
3834   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3835     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3836     return SQ_ERROR;
3837   }
3838
3839   try {
3840     scripting::Level_finish(arg0 == SQTrue);
3841
3842     return 0;
3843
3844   } catch(std::exception& e) {
3845     sq_throwerror(vm, e.what());
3846     return SQ_ERROR;
3847   } catch(...) {
3848     sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_finish'"));
3849     return SQ_ERROR;
3850   }
3851
3852 }
3853
3854 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
3855 {
3856   const SQChar* arg0;
3857   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3858     sq_throwerror(vm, _SC("Argument 1 not a string"));
3859     return SQ_ERROR;
3860   }
3861   const SQChar* arg1;
3862   if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
3863     sq_throwerror(vm, _SC("Argument 2 not a string"));
3864     return SQ_ERROR;
3865   }
3866
3867   try {
3868     scripting::Level_spawn(arg0, arg1);
3869
3870     return 0;
3871
3872   } catch(std::exception& e) {
3873     sq_throwerror(vm, e.what());
3874     return SQ_ERROR;
3875   } catch(...) {
3876     sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_spawn'"));
3877     return SQ_ERROR;
3878   }
3879
3880 }
3881
3882 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
3883 {
3884   (void) vm;
3885
3886   try {
3887     scripting::Level_flip_vertically();
3888
3889     return 0;
3890
3891   } catch(std::exception& e) {
3892     sq_throwerror(vm, e.what());
3893     return SQ_ERROR;
3894   } catch(...) {
3895     sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_flip_vertically'"));
3896     return SQ_ERROR;
3897   }
3898
3899 }
3900
3901 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
3902 {
3903   (void) vm;
3904
3905   try {
3906     scripting::Level_toggle_pause();
3907
3908     return 0;
3909
3910   } catch(std::exception& e) {
3911     sq_throwerror(vm, e.what());
3912     return SQ_ERROR;
3913   } catch(...) {
3914     sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_toggle_pause'"));
3915     return SQ_ERROR;
3916   }
3917
3918 }
3919
3920 static SQInteger Level_edit_wrapper(HSQUIRRELVM vm)
3921 {
3922   SQBool arg0;
3923   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3924     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3925     return SQ_ERROR;
3926   }
3927
3928   try {
3929     scripting::Level_edit(arg0 == SQTrue);
3930
3931     return 0;
3932
3933   } catch(std::exception& e) {
3934     sq_throwerror(vm, e.what());
3935     return SQ_ERROR;
3936   } catch(...) {
3937     sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_edit'"));
3938     return SQ_ERROR;
3939   }
3940
3941 }
3942
3943 } // namespace wrapper
3944 void create_squirrel_instance(HSQUIRRELVM v, scripting::AmbientSound* object, bool setup_releasehook)
3945 {
3946   using namespace wrapper;
3947
3948   sq_pushroottable(v);
3949   sq_pushstring(v, "AmbientSound", -1);
3950   if(SQ_FAILED(sq_get(v, -2))) {
3951     std::ostringstream msg;
3952     msg << "Couldn't resolved squirrel type 'AmbientSound'";
3953     throw SquirrelError(v, msg.str());
3954   }
3955
3956   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3957     std::ostringstream msg;
3958     msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'";
3959     throw SquirrelError(v, msg.str());
3960   }
3961   sq_remove(v, -2); // remove object name
3962
3963   if(setup_releasehook) {
3964     sq_setreleasehook(v, -1, AmbientSound_release_hook);
3965   }
3966
3967   sq_remove(v, -2); // remove root table
3968 }
3969
3970 void create_squirrel_instance(HSQUIRRELVM v, scripting::Camera* object, bool setup_releasehook)
3971 {
3972   using namespace wrapper;
3973
3974   sq_pushroottable(v);
3975   sq_pushstring(v, "Camera", -1);
3976   if(SQ_FAILED(sq_get(v, -2))) {
3977     std::ostringstream msg;
3978     msg << "Couldn't resolved squirrel type 'Camera'";
3979     throw SquirrelError(v, msg.str());
3980   }
3981
3982   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3983     std::ostringstream msg;
3984     msg << "Couldn't setup squirrel instance for object of type 'Camera'";
3985     throw SquirrelError(v, msg.str());
3986   }
3987   sq_remove(v, -2); // remove object name
3988
3989   if(setup_releasehook) {
3990     sq_setreleasehook(v, -1, Camera_release_hook);
3991   }
3992
3993   sq_remove(v, -2); // remove root table
3994 }
3995
3996 void create_squirrel_instance(HSQUIRRELVM v, scripting::Candle* object, bool setup_releasehook)
3997 {
3998   using namespace wrapper;
3999
4000   sq_pushroottable(v);
4001   sq_pushstring(v, "Candle", -1);
4002   if(SQ_FAILED(sq_get(v, -2))) {
4003     std::ostringstream msg;
4004     msg << "Couldn't resolved squirrel type 'Candle'";
4005     throw SquirrelError(v, msg.str());
4006   }
4007
4008   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4009     std::ostringstream msg;
4010     msg << "Couldn't setup squirrel instance for object of type 'Candle'";
4011     throw SquirrelError(v, msg.str());
4012   }
4013   sq_remove(v, -2); // remove object name
4014
4015   if(setup_releasehook) {
4016     sq_setreleasehook(v, -1, Candle_release_hook);
4017   }
4018
4019   sq_remove(v, -2); // remove root table
4020 }
4021
4022 void create_squirrel_instance(HSQUIRRELVM v, scripting::DisplayEffect* object, bool setup_releasehook)
4023 {
4024   using namespace wrapper;
4025
4026   sq_pushroottable(v);
4027   sq_pushstring(v, "DisplayEffect", -1);
4028   if(SQ_FAILED(sq_get(v, -2))) {
4029     std::ostringstream msg;
4030     msg << "Couldn't resolved squirrel type 'DisplayEffect'";
4031     throw SquirrelError(v, msg.str());
4032   }
4033
4034   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4035     std::ostringstream msg;
4036     msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
4037     throw SquirrelError(v, msg.str());
4038   }
4039   sq_remove(v, -2); // remove object name
4040
4041   if(setup_releasehook) {
4042     sq_setreleasehook(v, -1, DisplayEffect_release_hook);
4043   }
4044
4045   sq_remove(v, -2); // remove root table
4046 }
4047
4048 void create_squirrel_instance(HSQUIRRELVM v, scripting::FloatingImage* object, bool setup_releasehook)
4049 {
4050   using namespace wrapper;
4051
4052   sq_pushroottable(v);
4053   sq_pushstring(v, "FloatingImage", -1);
4054   if(SQ_FAILED(sq_get(v, -2))) {
4055     std::ostringstream msg;
4056     msg << "Couldn't resolved squirrel type 'FloatingImage'";
4057     throw SquirrelError(v, msg.str());
4058   }
4059
4060   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4061     std::ostringstream msg;
4062     msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
4063     throw SquirrelError(v, msg.str());
4064   }
4065   sq_remove(v, -2); // remove object name
4066
4067   if(setup_releasehook) {
4068     sq_setreleasehook(v, -1, FloatingImage_release_hook);
4069   }
4070
4071   sq_remove(v, -2); // remove root table
4072 }
4073
4074 void create_squirrel_instance(HSQUIRRELVM v, scripting::LevelTime* object, bool setup_releasehook)
4075 {
4076   using namespace wrapper;
4077
4078   sq_pushroottable(v);
4079   sq_pushstring(v, "LevelTime", -1);
4080   if(SQ_FAILED(sq_get(v, -2))) {
4081     std::ostringstream msg;
4082     msg << "Couldn't resolved squirrel type 'LevelTime'";
4083     throw SquirrelError(v, msg.str());
4084   }
4085
4086   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4087     std::ostringstream msg;
4088     msg << "Couldn't setup squirrel instance for object of type 'LevelTime'";
4089     throw SquirrelError(v, msg.str());
4090   }
4091   sq_remove(v, -2); // remove object name
4092
4093   if(setup_releasehook) {
4094     sq_setreleasehook(v, -1, LevelTime_release_hook);
4095   }
4096
4097   sq_remove(v, -2); // remove root table
4098 }
4099
4100 void create_squirrel_instance(HSQUIRRELVM v, scripting::Platform* object, bool setup_releasehook)
4101 {
4102   using namespace wrapper;
4103
4104   sq_pushroottable(v);
4105   sq_pushstring(v, "Platform", -1);
4106   if(SQ_FAILED(sq_get(v, -2))) {
4107     std::ostringstream msg;
4108     msg << "Couldn't resolved squirrel type 'Platform'";
4109     throw SquirrelError(v, msg.str());
4110   }
4111
4112   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4113     std::ostringstream msg;
4114     msg << "Couldn't setup squirrel instance for object of type 'Platform'";
4115     throw SquirrelError(v, msg.str());
4116   }
4117   sq_remove(v, -2); // remove object name
4118
4119   if(setup_releasehook) {
4120     sq_setreleasehook(v, -1, Platform_release_hook);
4121   }
4122
4123   sq_remove(v, -2); // remove root table
4124 }
4125
4126 void create_squirrel_instance(HSQUIRRELVM v, scripting::Player* object, bool setup_releasehook)
4127 {
4128   using namespace wrapper;
4129
4130   sq_pushroottable(v);
4131   sq_pushstring(v, "Player", -1);
4132   if(SQ_FAILED(sq_get(v, -2))) {
4133     std::ostringstream msg;
4134     msg << "Couldn't resolved squirrel type 'Player'";
4135     throw SquirrelError(v, msg.str());
4136   }
4137
4138   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4139     std::ostringstream msg;
4140     msg << "Couldn't setup squirrel instance for object of type 'Player'";
4141     throw SquirrelError(v, msg.str());
4142   }
4143   sq_remove(v, -2); // remove object name
4144
4145   if(setup_releasehook) {
4146     sq_setreleasehook(v, -1, Player_release_hook);
4147   }
4148
4149   sq_remove(v, -2); // remove root table
4150 }
4151
4152 void create_squirrel_instance(HSQUIRRELVM v, scripting::ScriptedObject* object, bool setup_releasehook)
4153 {
4154   using namespace wrapper;
4155
4156   sq_pushroottable(v);
4157   sq_pushstring(v, "ScriptedObject", -1);
4158   if(SQ_FAILED(sq_get(v, -2))) {
4159     std::ostringstream msg;
4160     msg << "Couldn't resolved squirrel type 'ScriptedObject'";
4161     throw SquirrelError(v, msg.str());
4162   }
4163
4164   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4165     std::ostringstream msg;
4166     msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
4167     throw SquirrelError(v, msg.str());
4168   }
4169   sq_remove(v, -2); // remove object name
4170
4171   if(setup_releasehook) {
4172     sq_setreleasehook(v, -1, ScriptedObject_release_hook);
4173   }
4174
4175   sq_remove(v, -2); // remove root table
4176 }
4177
4178 void create_squirrel_instance(HSQUIRRELVM v, scripting::SSector* object, bool setup_releasehook)
4179 {
4180   using namespace wrapper;
4181
4182   sq_pushroottable(v);
4183   sq_pushstring(v, "SSector", -1);
4184   if(SQ_FAILED(sq_get(v, -2))) {
4185     std::ostringstream msg;
4186     msg << "Couldn't resolved squirrel type 'SSector'";
4187     throw SquirrelError(v, msg.str());
4188   }
4189
4190   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4191     std::ostringstream msg;
4192     msg << "Couldn't setup squirrel instance for object of type 'SSector'";
4193     throw SquirrelError(v, msg.str());
4194   }
4195   sq_remove(v, -2); // remove object name
4196
4197   if(setup_releasehook) {
4198     sq_setreleasehook(v, -1, SSector_release_hook);
4199   }
4200
4201   sq_remove(v, -2); // remove root table
4202 }
4203
4204 void create_squirrel_instance(HSQUIRRELVM v, scripting::Text* object, bool setup_releasehook)
4205 {
4206   using namespace wrapper;
4207
4208   sq_pushroottable(v);
4209   sq_pushstring(v, "Text", -1);
4210   if(SQ_FAILED(sq_get(v, -2))) {
4211     std::ostringstream msg;
4212     msg << "Couldn't resolved squirrel type 'Text'";
4213     throw SquirrelError(v, msg.str());
4214   }
4215
4216   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4217     std::ostringstream msg;
4218     msg << "Couldn't setup squirrel instance for object of type 'Text'";
4219     throw SquirrelError(v, msg.str());
4220   }
4221   sq_remove(v, -2); // remove object name
4222
4223   if(setup_releasehook) {
4224     sq_setreleasehook(v, -1, Text_release_hook);
4225   }
4226
4227   sq_remove(v, -2); // remove root table
4228 }
4229
4230 void create_squirrel_instance(HSQUIRRELVM v, scripting::Thunderstorm* object, bool setup_releasehook)
4231 {
4232   using namespace wrapper;
4233
4234   sq_pushroottable(v);
4235   sq_pushstring(v, "Thunderstorm", -1);
4236   if(SQ_FAILED(sq_get(v, -2))) {
4237     std::ostringstream msg;
4238     msg << "Couldn't resolved squirrel type 'Thunderstorm'";
4239     throw SquirrelError(v, msg.str());
4240   }
4241
4242   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4243     std::ostringstream msg;
4244     msg << "Couldn't setup squirrel instance for object of type 'Thunderstorm'";
4245     throw SquirrelError(v, msg.str());
4246   }
4247   sq_remove(v, -2); // remove object name
4248
4249   if(setup_releasehook) {
4250     sq_setreleasehook(v, -1, Thunderstorm_release_hook);
4251   }
4252
4253   sq_remove(v, -2); // remove root table
4254 }
4255
4256 void create_squirrel_instance(HSQUIRRELVM v, scripting::TileMap* object, bool setup_releasehook)
4257 {
4258   using namespace wrapper;
4259
4260   sq_pushroottable(v);
4261   sq_pushstring(v, "TileMap", -1);
4262   if(SQ_FAILED(sq_get(v, -2))) {
4263     std::ostringstream msg;
4264     msg << "Couldn't resolved squirrel type 'TileMap'";
4265     throw SquirrelError(v, msg.str());
4266   }
4267
4268   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4269     std::ostringstream msg;
4270     msg << "Couldn't setup squirrel instance for object of type 'TileMap'";
4271     throw SquirrelError(v, msg.str());
4272   }
4273   sq_remove(v, -2); // remove object name
4274
4275   if(setup_releasehook) {
4276     sq_setreleasehook(v, -1, TileMap_release_hook);
4277   }
4278
4279   sq_remove(v, -2); // remove root table
4280 }
4281
4282 void create_squirrel_instance(HSQUIRRELVM v, scripting::WillOWisp* object, bool setup_releasehook)
4283 {
4284   using namespace wrapper;
4285
4286   sq_pushroottable(v);
4287   sq_pushstring(v, "WillOWisp", -1);
4288   if(SQ_FAILED(sq_get(v, -2))) {
4289     std::ostringstream msg;
4290     msg << "Couldn't resolved squirrel type 'WillOWisp'";
4291     throw SquirrelError(v, msg.str());
4292   }
4293
4294   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4295     std::ostringstream msg;
4296     msg << "Couldn't setup squirrel instance for object of type 'WillOWisp'";
4297     throw SquirrelError(v, msg.str());
4298   }
4299   sq_remove(v, -2); // remove object name
4300
4301   if(setup_releasehook) {
4302     sq_setreleasehook(v, -1, WillOWisp_release_hook);
4303   }
4304
4305   sq_remove(v, -2); // remove root table
4306 }
4307
4308 void create_squirrel_instance(HSQUIRRELVM v, scripting::Wind* object, bool setup_releasehook)
4309 {
4310   using namespace wrapper;
4311
4312   sq_pushroottable(v);
4313   sq_pushstring(v, "Wind", -1);
4314   if(SQ_FAILED(sq_get(v, -2))) {
4315     std::ostringstream msg;
4316     msg << "Couldn't resolved squirrel type 'Wind'";
4317     throw SquirrelError(v, msg.str());
4318   }
4319
4320   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4321     std::ostringstream msg;
4322     msg << "Couldn't setup squirrel instance for object of type 'Wind'";
4323     throw SquirrelError(v, msg.str());
4324   }
4325   sq_remove(v, -2); // remove object name
4326
4327   if(setup_releasehook) {
4328     sq_setreleasehook(v, -1, Wind_release_hook);
4329   }
4330
4331   sq_remove(v, -2); // remove root table
4332 }
4333
4334 void register_supertux_wrapper(HSQUIRRELVM v)
4335 {
4336   using namespace wrapper;
4337
4338   sq_pushstring(v, "ANCHOR_TOP", -1);
4339   sq_pushinteger(v, 16);
4340   if(SQ_FAILED(sq_createslot(v, -3))) {
4341     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
4342   }
4343
4344   sq_pushstring(v, "ANCHOR_BOTTOM", -1);
4345   sq_pushinteger(v, 32);
4346   if(SQ_FAILED(sq_createslot(v, -3))) {
4347     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
4348   }
4349
4350   sq_pushstring(v, "ANCHOR_LEFT", -1);
4351   sq_pushinteger(v, 1);
4352   if(SQ_FAILED(sq_createslot(v, -3))) {
4353     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
4354   }
4355
4356   sq_pushstring(v, "ANCHOR_RIGHT", -1);
4357   sq_pushinteger(v, 2);
4358   if(SQ_FAILED(sq_createslot(v, -3))) {
4359     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
4360   }
4361
4362   sq_pushstring(v, "ANCHOR_MIDDLE", -1);
4363   sq_pushinteger(v, 0);
4364   if(SQ_FAILED(sq_createslot(v, -3))) {
4365     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
4366   }
4367
4368   sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
4369   sq_pushinteger(v, 17);
4370   if(SQ_FAILED(sq_createslot(v, -3))) {
4371     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
4372   }
4373
4374   sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
4375   sq_pushinteger(v, 18);
4376   if(SQ_FAILED(sq_createslot(v, -3))) {
4377     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
4378   }
4379
4380   sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
4381   sq_pushinteger(v, 33);
4382   if(SQ_FAILED(sq_createslot(v, -3))) {
4383     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
4384   }
4385
4386   sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
4387   sq_pushinteger(v, 34);
4388   if(SQ_FAILED(sq_createslot(v, -3))) {
4389     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
4390   }
4391
4392   sq_pushstring(v, "display", -1);
4393   sq_newclosure(v, &display_wrapper, 0);
4394   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t.");
4395   if(SQ_FAILED(sq_createslot(v, -3))) {
4396     throw SquirrelError(v, "Couldn't register function 'display'");
4397   }
4398
4399   sq_pushstring(v, "print_stacktrace", -1);
4400   sq_newclosure(v, &print_stacktrace_wrapper, 0);
4401   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4402   if(SQ_FAILED(sq_createslot(v, -3))) {
4403     throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
4404   }
4405
4406   sq_pushstring(v, "get_current_thread", -1);
4407   sq_newclosure(v, &get_current_thread_wrapper, 0);
4408   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t");
4409   if(SQ_FAILED(sq_createslot(v, -3))) {
4410     throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
4411   }
4412
4413   sq_pushstring(v, "display_text_file", -1);
4414   sq_newclosure(v, &display_text_file_wrapper, 0);
4415   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4416   if(SQ_FAILED(sq_createslot(v, -3))) {
4417     throw SquirrelError(v, "Couldn't register function 'display_text_file'");
4418   }
4419
4420   sq_pushstring(v, "load_worldmap", -1);
4421   sq_newclosure(v, &load_worldmap_wrapper, 0);
4422   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4423   if(SQ_FAILED(sq_createslot(v, -3))) {
4424     throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
4425   }
4426
4427   sq_pushstring(v, "load_level", -1);
4428   sq_newclosure(v, &load_level_wrapper, 0);
4429   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4430   if(SQ_FAILED(sq_createslot(v, -3))) {
4431     throw SquirrelError(v, "Couldn't register function 'load_level'");
4432   }
4433
4434   sq_pushstring(v, "wait", -1);
4435   sq_newclosure(v, &wait_wrapper, 0);
4436   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4437   if(SQ_FAILED(sq_createslot(v, -3))) {
4438     throw SquirrelError(v, "Couldn't register function 'wait'");
4439   }
4440
4441   sq_pushstring(v, "wait_for_screenswitch", -1);
4442   sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
4443   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4444   if(SQ_FAILED(sq_createslot(v, -3))) {
4445     throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
4446   }
4447
4448   sq_pushstring(v, "exit_screen", -1);
4449   sq_newclosure(v, &exit_screen_wrapper, 0);
4450   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4451   if(SQ_FAILED(sq_createslot(v, -3))) {
4452     throw SquirrelError(v, "Couldn't register function 'exit_screen'");
4453   }
4454
4455   sq_pushstring(v, "fadeout_screen", -1);
4456   sq_newclosure(v, &fadeout_screen_wrapper, 0);
4457   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4458   if(SQ_FAILED(sq_createslot(v, -3))) {
4459     throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
4460   }
4461
4462   sq_pushstring(v, "shrink_screen", -1);
4463   sq_newclosure(v, &shrink_screen_wrapper, 0);
4464   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4465   if(SQ_FAILED(sq_createslot(v, -3))) {
4466     throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
4467   }
4468
4469   sq_pushstring(v, "abort_screenfade", -1);
4470   sq_newclosure(v, &abort_screenfade_wrapper, 0);
4471   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4472   if(SQ_FAILED(sq_createslot(v, -3))) {
4473     throw SquirrelError(v, "Couldn't register function 'abort_screenfade'");
4474   }
4475
4476   sq_pushstring(v, "translate", -1);
4477   sq_newclosure(v, &translate_wrapper, 0);
4478   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4479   if(SQ_FAILED(sq_createslot(v, -3))) {
4480     throw SquirrelError(v, "Couldn't register function 'translate'");
4481   }
4482
4483   sq_pushstring(v, "import", -1);
4484   sq_newclosure(v, &import_wrapper, 0);
4485   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4486   if(SQ_FAILED(sq_createslot(v, -3))) {
4487     throw SquirrelError(v, "Couldn't register function 'import'");
4488   }
4489
4490   sq_pushstring(v, "save_state", -1);
4491   sq_newclosure(v, &save_state_wrapper, 0);
4492   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4493   if(SQ_FAILED(sq_createslot(v, -3))) {
4494     throw SquirrelError(v, "Couldn't register function 'save_state'");
4495   }
4496
4497   sq_pushstring(v, "debug_collrects", -1);
4498   sq_newclosure(v, &debug_collrects_wrapper, 0);
4499   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4500   if(SQ_FAILED(sq_createslot(v, -3))) {
4501     throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
4502   }
4503
4504   sq_pushstring(v, "debug_show_fps", -1);
4505   sq_newclosure(v, &debug_show_fps_wrapper, 0);
4506   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4507   if(SQ_FAILED(sq_createslot(v, -3))) {
4508     throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
4509   }
4510
4511   sq_pushstring(v, "debug_draw_solids_only", -1);
4512   sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
4513   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4514   if(SQ_FAILED(sq_createslot(v, -3))) {
4515     throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
4516   }
4517
4518   sq_pushstring(v, "debug_draw_editor_images", -1);
4519   sq_newclosure(v, &debug_draw_editor_images_wrapper, 0);
4520   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4521   if(SQ_FAILED(sq_createslot(v, -3))) {
4522     throw SquirrelError(v, "Couldn't register function 'debug_draw_editor_images'");
4523   }
4524
4525   sq_pushstring(v, "debug_worldmap_ghost", -1);
4526   sq_newclosure(v, &debug_worldmap_ghost_wrapper, 0);
4527   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4528   if(SQ_FAILED(sq_createslot(v, -3))) {
4529     throw SquirrelError(v, "Couldn't register function 'debug_worldmap_ghost'");
4530   }
4531
4532   sq_pushstring(v, "play_music", -1);
4533   sq_newclosure(v, &play_music_wrapper, 0);
4534   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4535   if(SQ_FAILED(sq_createslot(v, -3))) {
4536     throw SquirrelError(v, "Couldn't register function 'play_music'");
4537   }
4538
4539   sq_pushstring(v, "play_sound", -1);
4540   sq_newclosure(v, &play_sound_wrapper, 0);
4541   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4542   if(SQ_FAILED(sq_createslot(v, -3))) {
4543     throw SquirrelError(v, "Couldn't register function 'play_sound'");
4544   }
4545
4546   sq_pushstring(v, "set_game_speed", -1);
4547   sq_newclosure(v, &set_game_speed_wrapper, 0);
4548   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4549   if(SQ_FAILED(sq_createslot(v, -3))) {
4550     throw SquirrelError(v, "Couldn't register function 'set_game_speed'");
4551   }
4552
4553   sq_pushstring(v, "grease", -1);
4554   sq_newclosure(v, &grease_wrapper, 0);
4555   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4556   if(SQ_FAILED(sq_createslot(v, -3))) {
4557     throw SquirrelError(v, "Couldn't register function 'grease'");
4558   }
4559
4560   sq_pushstring(v, "invincible", -1);
4561   sq_newclosure(v, &invincible_wrapper, 0);
4562   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4563   if(SQ_FAILED(sq_createslot(v, -3))) {
4564     throw SquirrelError(v, "Couldn't register function 'invincible'");
4565   }
4566
4567   sq_pushstring(v, "ghost", -1);
4568   sq_newclosure(v, &ghost_wrapper, 0);
4569   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4570   if(SQ_FAILED(sq_createslot(v, -3))) {
4571     throw SquirrelError(v, "Couldn't register function 'ghost'");
4572   }
4573
4574   sq_pushstring(v, "mortal", -1);
4575   sq_newclosure(v, &mortal_wrapper, 0);
4576   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4577   if(SQ_FAILED(sq_createslot(v, -3))) {
4578     throw SquirrelError(v, "Couldn't register function 'mortal'");
4579   }
4580
4581   sq_pushstring(v, "restart", -1);
4582   sq_newclosure(v, &restart_wrapper, 0);
4583   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4584   if(SQ_FAILED(sq_createslot(v, -3))) {
4585     throw SquirrelError(v, "Couldn't register function 'restart'");
4586   }
4587
4588   sq_pushstring(v, "whereami", -1);
4589   sq_newclosure(v, &whereami_wrapper, 0);
4590   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4591   if(SQ_FAILED(sq_createslot(v, -3))) {
4592     throw SquirrelError(v, "Couldn't register function 'whereami'");
4593   }
4594
4595   sq_pushstring(v, "gotoend", -1);
4596   sq_newclosure(v, &gotoend_wrapper, 0);
4597   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4598   if(SQ_FAILED(sq_createslot(v, -3))) {
4599     throw SquirrelError(v, "Couldn't register function 'gotoend'");
4600   }
4601
4602   sq_pushstring(v, "camera", -1);
4603   sq_newclosure(v, &camera_wrapper, 0);
4604   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4605   if(SQ_FAILED(sq_createslot(v, -3))) {
4606     throw SquirrelError(v, "Couldn't register function 'camera'");
4607   }
4608
4609   sq_pushstring(v, "set_gamma", -1);
4610   sq_newclosure(v, &set_gamma_wrapper, 0);
4611   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4612   if(SQ_FAILED(sq_createslot(v, -3))) {
4613     throw SquirrelError(v, "Couldn't register function 'set_gamma'");
4614   }
4615
4616   sq_pushstring(v, "quit", -1);
4617   sq_newclosure(v, &quit_wrapper, 0);
4618   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4619   if(SQ_FAILED(sq_createslot(v, -3))) {
4620     throw SquirrelError(v, "Couldn't register function 'quit'");
4621   }
4622
4623   sq_pushstring(v, "rand", -1);
4624   sq_newclosure(v, &rand_wrapper, 0);
4625   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4626   if(SQ_FAILED(sq_createslot(v, -3))) {
4627     throw SquirrelError(v, "Couldn't register function 'rand'");
4628   }
4629
4630   sq_pushstring(v, "record_demo", -1);
4631   sq_newclosure(v, &record_demo_wrapper, 0);
4632   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4633   if(SQ_FAILED(sq_createslot(v, -3))) {
4634     throw SquirrelError(v, "Couldn't register function 'record_demo'");
4635   }
4636
4637   sq_pushstring(v, "play_demo", -1);
4638   sq_newclosure(v, &play_demo_wrapper, 0);
4639   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4640   if(SQ_FAILED(sq_createslot(v, -3))) {
4641     throw SquirrelError(v, "Couldn't register function 'play_demo'");
4642   }
4643
4644   sq_pushstring(v, "Level_finish", -1);
4645   sq_newclosure(v, &Level_finish_wrapper, 0);
4646   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4647   if(SQ_FAILED(sq_createslot(v, -3))) {
4648     throw SquirrelError(v, "Couldn't register function 'Level_finish'");
4649   }
4650
4651   sq_pushstring(v, "Level_spawn", -1);
4652   sq_newclosure(v, &Level_spawn_wrapper, 0);
4653   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tss");
4654   if(SQ_FAILED(sq_createslot(v, -3))) {
4655     throw SquirrelError(v, "Couldn't register function 'Level_spawn'");
4656   }
4657
4658   sq_pushstring(v, "Level_flip_vertically", -1);
4659   sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
4660   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4661   if(SQ_FAILED(sq_createslot(v, -3))) {
4662     throw SquirrelError(v, "Couldn't register function 'Level_flip_vertically'");
4663   }
4664
4665   sq_pushstring(v, "Level_toggle_pause", -1);
4666   sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
4667   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4668   if(SQ_FAILED(sq_createslot(v, -3))) {
4669     throw SquirrelError(v, "Couldn't register function 'Level_toggle_pause'");
4670   }
4671
4672   sq_pushstring(v, "Level_edit", -1);
4673   sq_newclosure(v, &Level_edit_wrapper, 0);
4674   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4675   if(SQ_FAILED(sq_createslot(v, -3))) {
4676     throw SquirrelError(v, "Couldn't register function 'Level_edit'");
4677   }
4678
4679   // Register class AmbientSound
4680   sq_pushstring(v, "AmbientSound", -1);
4681   if(sq_newclass(v, SQFalse) < 0) {
4682     std::ostringstream msg;
4683     msg << "Couldn't create new class 'AmbientSound'";
4684     throw SquirrelError(v, msg.str());
4685   }
4686   sq_pushstring(v, "set_pos", -1);
4687   sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
4688   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4689   if(SQ_FAILED(sq_createslot(v, -3))) {
4690     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4691   }
4692
4693   sq_pushstring(v, "get_pos_x", -1);
4694   sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
4695   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4696   if(SQ_FAILED(sq_createslot(v, -3))) {
4697     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4698   }
4699
4700   sq_pushstring(v, "get_pos_y", -1);
4701   sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
4702   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4703   if(SQ_FAILED(sq_createslot(v, -3))) {
4704     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4705   }
4706
4707   if(SQ_FAILED(sq_createslot(v, -3))) {
4708     throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
4709   }
4710
4711   // Register class Camera
4712   sq_pushstring(v, "Camera", -1);
4713   if(sq_newclass(v, SQFalse) < 0) {
4714     std::ostringstream msg;
4715     msg << "Couldn't create new class 'Camera'";
4716     throw SquirrelError(v, msg.str());
4717   }
4718   sq_pushstring(v, "reload_config", -1);
4719   sq_newclosure(v, &Camera_reload_config_wrapper, 0);
4720   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4721   if(SQ_FAILED(sq_createslot(v, -3))) {
4722     throw SquirrelError(v, "Couldn't register function 'reload_config'");
4723   }
4724
4725   sq_pushstring(v, "shake", -1);
4726   sq_newclosure(v, &Camera_shake_wrapper, 0);
4727   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4728   if(SQ_FAILED(sq_createslot(v, -3))) {
4729     throw SquirrelError(v, "Couldn't register function 'shake'");
4730   }
4731
4732   sq_pushstring(v, "set_pos", -1);
4733   sq_newclosure(v, &Camera_set_pos_wrapper, 0);
4734   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4735   if(SQ_FAILED(sq_createslot(v, -3))) {
4736     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4737   }
4738
4739   sq_pushstring(v, "set_mode", -1);
4740   sq_newclosure(v, &Camera_set_mode_wrapper, 0);
4741   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4742   if(SQ_FAILED(sq_createslot(v, -3))) {
4743     throw SquirrelError(v, "Couldn't register function 'set_mode'");
4744   }
4745
4746   sq_pushstring(v, "scroll_to", -1);
4747   sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
4748   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4749   if(SQ_FAILED(sq_createslot(v, -3))) {
4750     throw SquirrelError(v, "Couldn't register function 'scroll_to'");
4751   }
4752
4753   if(SQ_FAILED(sq_createslot(v, -3))) {
4754     throw SquirrelError(v, "Couldn't register class 'Camera'");
4755   }
4756
4757   // Register class Candle
4758   sq_pushstring(v, "Candle", -1);
4759   if(sq_newclass(v, SQFalse) < 0) {
4760     std::ostringstream msg;
4761     msg << "Couldn't create new class 'Candle'";
4762     throw SquirrelError(v, msg.str());
4763   }
4764   sq_pushstring(v, "get_burning", -1);
4765   sq_newclosure(v, &Candle_get_burning_wrapper, 0);
4766   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4767   if(SQ_FAILED(sq_createslot(v, -3))) {
4768     throw SquirrelError(v, "Couldn't register function 'get_burning'");
4769   }
4770
4771   sq_pushstring(v, "set_burning", -1);
4772   sq_newclosure(v, &Candle_set_burning_wrapper, 0);
4773   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4774   if(SQ_FAILED(sq_createslot(v, -3))) {
4775     throw SquirrelError(v, "Couldn't register function 'set_burning'");
4776   }
4777
4778   if(SQ_FAILED(sq_createslot(v, -3))) {
4779     throw SquirrelError(v, "Couldn't register class 'Candle'");
4780   }
4781
4782   // Register class DisplayEffect
4783   sq_pushstring(v, "DisplayEffect", -1);
4784   if(sq_newclass(v, SQFalse) < 0) {
4785     std::ostringstream msg;
4786     msg << "Couldn't create new class 'DisplayEffect'";
4787     throw SquirrelError(v, msg.str());
4788   }
4789   sq_pushstring(v, "fade_out", -1);
4790   sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
4791   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4792   if(SQ_FAILED(sq_createslot(v, -3))) {
4793     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4794   }
4795
4796   sq_pushstring(v, "fade_in", -1);
4797   sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
4798   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4799   if(SQ_FAILED(sq_createslot(v, -3))) {
4800     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4801   }
4802
4803   sq_pushstring(v, "set_black", -1);
4804   sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
4805   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4806   if(SQ_FAILED(sq_createslot(v, -3))) {
4807     throw SquirrelError(v, "Couldn't register function 'set_black'");
4808   }
4809
4810   sq_pushstring(v, "is_black", -1);
4811   sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
4812   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4813   if(SQ_FAILED(sq_createslot(v, -3))) {
4814     throw SquirrelError(v, "Couldn't register function 'is_black'");
4815   }
4816
4817   sq_pushstring(v, "sixteen_to_nine", -1);
4818   sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
4819   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4820   if(SQ_FAILED(sq_createslot(v, -3))) {
4821     throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
4822   }
4823
4824   sq_pushstring(v, "four_to_three", -1);
4825   sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
4826   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4827   if(SQ_FAILED(sq_createslot(v, -3))) {
4828     throw SquirrelError(v, "Couldn't register function 'four_to_three'");
4829   }
4830
4831   if(SQ_FAILED(sq_createslot(v, -3))) {
4832     throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
4833   }
4834
4835   // Register class FloatingImage
4836   sq_pushstring(v, "FloatingImage", -1);
4837   if(sq_newclass(v, SQFalse) < 0) {
4838     std::ostringstream msg;
4839     msg << "Couldn't create new class 'FloatingImage'";
4840     throw SquirrelError(v, msg.str());
4841   }
4842   sq_pushstring(v, "constructor", -1);
4843   sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
4844   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4845   if(SQ_FAILED(sq_createslot(v, -3))) {
4846     throw SquirrelError(v, "Couldn't register function 'constructor'");
4847   }
4848
4849   sq_pushstring(v, "set_layer", -1);
4850   sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
4851   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4852   if(SQ_FAILED(sq_createslot(v, -3))) {
4853     throw SquirrelError(v, "Couldn't register function 'set_layer'");
4854   }
4855
4856   sq_pushstring(v, "get_layer", -1);
4857   sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
4858   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4859   if(SQ_FAILED(sq_createslot(v, -3))) {
4860     throw SquirrelError(v, "Couldn't register function 'get_layer'");
4861   }
4862
4863   sq_pushstring(v, "set_pos", -1);
4864   sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
4865   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4866   if(SQ_FAILED(sq_createslot(v, -3))) {
4867     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4868   }
4869
4870   sq_pushstring(v, "get_pos_x", -1);
4871   sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
4872   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4873   if(SQ_FAILED(sq_createslot(v, -3))) {
4874     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4875   }
4876
4877   sq_pushstring(v, "get_pos_y", -1);
4878   sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
4879   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4880   if(SQ_FAILED(sq_createslot(v, -3))) {
4881     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4882   }
4883
4884   sq_pushstring(v, "set_anchor_point", -1);
4885   sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
4886   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4887   if(SQ_FAILED(sq_createslot(v, -3))) {
4888     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4889   }
4890
4891   sq_pushstring(v, "get_anchor_point", -1);
4892   sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
4893   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4894   if(SQ_FAILED(sq_createslot(v, -3))) {
4895     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4896   }
4897
4898   sq_pushstring(v, "set_visible", -1);
4899   sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
4900   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4901   if(SQ_FAILED(sq_createslot(v, -3))) {
4902     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4903   }
4904
4905   sq_pushstring(v, "get_visible", -1);
4906   sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
4907   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4908   if(SQ_FAILED(sq_createslot(v, -3))) {
4909     throw SquirrelError(v, "Couldn't register function 'get_visible'");
4910   }
4911
4912   sq_pushstring(v, "set_action", -1);
4913   sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
4914   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4915   if(SQ_FAILED(sq_createslot(v, -3))) {
4916     throw SquirrelError(v, "Couldn't register function 'set_action'");
4917   }
4918
4919   sq_pushstring(v, "get_action", -1);
4920   sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
4921   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4922   if(SQ_FAILED(sq_createslot(v, -3))) {
4923     throw SquirrelError(v, "Couldn't register function 'get_action'");
4924   }
4925
4926   sq_pushstring(v, "fade_in", -1);
4927   sq_newclosure(v, &FloatingImage_fade_in_wrapper, 0);
4928   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4929   if(SQ_FAILED(sq_createslot(v, -3))) {
4930     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4931   }
4932
4933   sq_pushstring(v, "fade_out", -1);
4934   sq_newclosure(v, &FloatingImage_fade_out_wrapper, 0);
4935   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4936   if(SQ_FAILED(sq_createslot(v, -3))) {
4937     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4938   }
4939
4940   if(SQ_FAILED(sq_createslot(v, -3))) {
4941     throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
4942   }
4943
4944   // Register class LevelTime
4945   sq_pushstring(v, "LevelTime", -1);
4946   if(sq_newclass(v, SQFalse) < 0) {
4947     std::ostringstream msg;
4948     msg << "Couldn't create new class 'LevelTime'";
4949     throw SquirrelError(v, msg.str());
4950   }
4951   sq_pushstring(v, "start", -1);
4952   sq_newclosure(v, &LevelTime_start_wrapper, 0);
4953   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4954   if(SQ_FAILED(sq_createslot(v, -3))) {
4955     throw SquirrelError(v, "Couldn't register function 'start'");
4956   }
4957
4958   sq_pushstring(v, "stop", -1);
4959   sq_newclosure(v, &LevelTime_stop_wrapper, 0);
4960   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4961   if(SQ_FAILED(sq_createslot(v, -3))) {
4962     throw SquirrelError(v, "Couldn't register function 'stop'");
4963   }
4964
4965   sq_pushstring(v, "get_time", -1);
4966   sq_newclosure(v, &LevelTime_get_time_wrapper, 0);
4967   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4968   if(SQ_FAILED(sq_createslot(v, -3))) {
4969     throw SquirrelError(v, "Couldn't register function 'get_time'");
4970   }
4971
4972   sq_pushstring(v, "set_time", -1);
4973   sq_newclosure(v, &LevelTime_set_time_wrapper, 0);
4974   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4975   if(SQ_FAILED(sq_createslot(v, -3))) {
4976     throw SquirrelError(v, "Couldn't register function 'set_time'");
4977   }
4978
4979   if(SQ_FAILED(sq_createslot(v, -3))) {
4980     throw SquirrelError(v, "Couldn't register class 'LevelTime'");
4981   }
4982
4983   // Register class Platform
4984   sq_pushstring(v, "Platform", -1);
4985   if(sq_newclass(v, SQFalse) < 0) {
4986     std::ostringstream msg;
4987     msg << "Couldn't create new class 'Platform'";
4988     throw SquirrelError(v, msg.str());
4989   }
4990   sq_pushstring(v, "goto_node", -1);
4991   sq_newclosure(v, &Platform_goto_node_wrapper, 0);
4992   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4993   if(SQ_FAILED(sq_createslot(v, -3))) {
4994     throw SquirrelError(v, "Couldn't register function 'goto_node'");
4995   }
4996
4997   sq_pushstring(v, "start_moving", -1);
4998   sq_newclosure(v, &Platform_start_moving_wrapper, 0);
4999   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5000   if(SQ_FAILED(sq_createslot(v, -3))) {
5001     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5002   }
5003
5004   sq_pushstring(v, "stop_moving", -1);
5005   sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
5006   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5007   if(SQ_FAILED(sq_createslot(v, -3))) {
5008     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5009   }
5010
5011   if(SQ_FAILED(sq_createslot(v, -3))) {
5012     throw SquirrelError(v, "Couldn't register class 'Platform'");
5013   }
5014
5015   // Register class Player
5016   sq_pushstring(v, "Player", -1);
5017   if(sq_newclass(v, SQFalse) < 0) {
5018     std::ostringstream msg;
5019     msg << "Couldn't create new class 'Player'";
5020     throw SquirrelError(v, msg.str());
5021   }
5022   sq_pushstring(v, "add_bonus", -1);
5023   sq_newclosure(v, &Player_add_bonus_wrapper, 0);
5024   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5025   if(SQ_FAILED(sq_createslot(v, -3))) {
5026     throw SquirrelError(v, "Couldn't register function 'add_bonus'");
5027   }
5028
5029   sq_pushstring(v, "add_coins", -1);
5030   sq_newclosure(v, &Player_add_coins_wrapper, 0);
5031   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5032   if(SQ_FAILED(sq_createslot(v, -3))) {
5033     throw SquirrelError(v, "Couldn't register function 'add_coins'");
5034   }
5035
5036   sq_pushstring(v, "make_invincible", -1);
5037   sq_newclosure(v, &Player_make_invincible_wrapper, 0);
5038   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5039   if(SQ_FAILED(sq_createslot(v, -3))) {
5040     throw SquirrelError(v, "Couldn't register function 'make_invincible'");
5041   }
5042
5043   sq_pushstring(v, "deactivate", -1);
5044   sq_newclosure(v, &Player_deactivate_wrapper, 0);
5045   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5046   if(SQ_FAILED(sq_createslot(v, -3))) {
5047     throw SquirrelError(v, "Couldn't register function 'deactivate'");
5048   }
5049
5050   sq_pushstring(v, "activate", -1);
5051   sq_newclosure(v, &Player_activate_wrapper, 0);
5052   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5053   if(SQ_FAILED(sq_createslot(v, -3))) {
5054     throw SquirrelError(v, "Couldn't register function 'activate'");
5055   }
5056
5057   sq_pushstring(v, "walk", -1);
5058   sq_newclosure(v, &Player_walk_wrapper, 0);
5059   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5060   if(SQ_FAILED(sq_createslot(v, -3))) {
5061     throw SquirrelError(v, "Couldn't register function 'walk'");
5062   }
5063
5064   sq_pushstring(v, "set_dir", -1);
5065   sq_newclosure(v, &Player_set_dir_wrapper, 0);
5066   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5067   if(SQ_FAILED(sq_createslot(v, -3))) {
5068     throw SquirrelError(v, "Couldn't register function 'set_dir'");
5069   }
5070
5071   sq_pushstring(v, "set_visible", -1);
5072   sq_newclosure(v, &Player_set_visible_wrapper, 0);
5073   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5074   if(SQ_FAILED(sq_createslot(v, -3))) {
5075     throw SquirrelError(v, "Couldn't register function 'set_visible'");
5076   }
5077
5078   sq_pushstring(v, "get_visible", -1);
5079   sq_newclosure(v, &Player_get_visible_wrapper, 0);
5080   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5081   if(SQ_FAILED(sq_createslot(v, -3))) {
5082     throw SquirrelError(v, "Couldn't register function 'get_visible'");
5083   }
5084
5085   sq_pushstring(v, "kill", -1);
5086   sq_newclosure(v, &Player_kill_wrapper, 0);
5087   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5088   if(SQ_FAILED(sq_createslot(v, -3))) {
5089     throw SquirrelError(v, "Couldn't register function 'kill'");
5090   }
5091
5092   sq_pushstring(v, "set_ghost_mode", -1);
5093   sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
5094   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5095   if(SQ_FAILED(sq_createslot(v, -3))) {
5096     throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
5097   }
5098
5099   sq_pushstring(v, "get_ghost_mode", -1);
5100   sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
5101   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5102   if(SQ_FAILED(sq_createslot(v, -3))) {
5103     throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
5104   }
5105
5106   sq_pushstring(v, "kick", -1);
5107   sq_newclosure(v, &Player_kick_wrapper, 0);
5108   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5109   if(SQ_FAILED(sq_createslot(v, -3))) {
5110     throw SquirrelError(v, "Couldn't register function 'kick'");
5111   }
5112
5113   sq_pushstring(v, "do_cheer", -1);
5114   sq_newclosure(v, &Player_do_cheer_wrapper, 0);
5115   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5116   if(SQ_FAILED(sq_createslot(v, -3))) {
5117     throw SquirrelError(v, "Couldn't register function 'do_cheer'");
5118   }
5119
5120   sq_pushstring(v, "do_duck", -1);
5121   sq_newclosure(v, &Player_do_duck_wrapper, 0);
5122   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5123   if(SQ_FAILED(sq_createslot(v, -3))) {
5124     throw SquirrelError(v, "Couldn't register function 'do_duck'");
5125   }
5126
5127   sq_pushstring(v, "do_standup", -1);
5128   sq_newclosure(v, &Player_do_standup_wrapper, 0);
5129   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5130   if(SQ_FAILED(sq_createslot(v, -3))) {
5131     throw SquirrelError(v, "Couldn't register function 'do_standup'");
5132   }
5133
5134   sq_pushstring(v, "do_backflip", -1);
5135   sq_newclosure(v, &Player_do_backflip_wrapper, 0);
5136   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5137   if(SQ_FAILED(sq_createslot(v, -3))) {
5138     throw SquirrelError(v, "Couldn't register function 'do_backflip'");
5139   }
5140
5141   sq_pushstring(v, "do_jump", -1);
5142   sq_newclosure(v, &Player_do_jump_wrapper, 0);
5143   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5144   if(SQ_FAILED(sq_createslot(v, -3))) {
5145     throw SquirrelError(v, "Couldn't register function 'do_jump'");
5146   }
5147
5148   sq_pushstring(v, "trigger_sequence", -1);
5149   sq_newclosure(v, &Player_trigger_sequence_wrapper, 0);
5150   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5151   if(SQ_FAILED(sq_createslot(v, -3))) {
5152     throw SquirrelError(v, "Couldn't register function 'trigger_sequence'");
5153   }
5154
5155   sq_pushstring(v, "use_scripting_controller", -1);
5156   sq_newclosure(v, &Player_use_scripting_controller_wrapper, 0);
5157   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5158   if(SQ_FAILED(sq_createslot(v, -3))) {
5159     throw SquirrelError(v, "Couldn't register function 'use_scripting_controller'");
5160   }
5161
5162   sq_pushstring(v, "do_scripting_controller", -1);
5163   sq_newclosure(v, &Player_do_scripting_controller_wrapper, 0);
5164   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tsb");
5165   if(SQ_FAILED(sq_createslot(v, -3))) {
5166     throw SquirrelError(v, "Couldn't register function 'do_scripting_controller'");
5167   }
5168
5169   if(SQ_FAILED(sq_createslot(v, -3))) {
5170     throw SquirrelError(v, "Couldn't register class 'Player'");
5171   }
5172
5173   // Register class ScriptedObject
5174   sq_pushstring(v, "ScriptedObject", -1);
5175   if(sq_newclass(v, SQFalse) < 0) {
5176     std::ostringstream msg;
5177     msg << "Couldn't create new class 'ScriptedObject'";
5178     throw SquirrelError(v, msg.str());
5179   }
5180   sq_pushstring(v, "set_action", -1);
5181   sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
5182   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5183   if(SQ_FAILED(sq_createslot(v, -3))) {
5184     throw SquirrelError(v, "Couldn't register function 'set_action'");
5185   }
5186
5187   sq_pushstring(v, "get_action", -1);
5188   sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
5189   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5190   if(SQ_FAILED(sq_createslot(v, -3))) {
5191     throw SquirrelError(v, "Couldn't register function 'get_action'");
5192   }
5193
5194   sq_pushstring(v, "move", -1);
5195   sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
5196   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5197   if(SQ_FAILED(sq_createslot(v, -3))) {
5198     throw SquirrelError(v, "Couldn't register function 'move'");
5199   }
5200
5201   sq_pushstring(v, "set_pos", -1);
5202   sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
5203   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5204   if(SQ_FAILED(sq_createslot(v, -3))) {
5205     throw SquirrelError(v, "Couldn't register function 'set_pos'");
5206   }
5207
5208   sq_pushstring(v, "get_pos_x", -1);
5209   sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
5210   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5211   if(SQ_FAILED(sq_createslot(v, -3))) {
5212     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5213   }
5214
5215   sq_pushstring(v, "get_pos_y", -1);
5216   sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
5217   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5218   if(SQ_FAILED(sq_createslot(v, -3))) {
5219     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5220   }
5221
5222   sq_pushstring(v, "set_velocity", -1);
5223   sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
5224   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5225   if(SQ_FAILED(sq_createslot(v, -3))) {
5226     throw SquirrelError(v, "Couldn't register function 'set_velocity'");
5227   }
5228
5229   sq_pushstring(v, "get_velocity_x", -1);
5230   sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
5231   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5232   if(SQ_FAILED(sq_createslot(v, -3))) {
5233     throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
5234   }
5235
5236   sq_pushstring(v, "get_velocity_y", -1);
5237   sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
5238   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5239   if(SQ_FAILED(sq_createslot(v, -3))) {
5240     throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
5241   }
5242
5243   sq_pushstring(v, "enable_gravity", -1);
5244   sq_newclosure(v, &ScriptedObject_enable_gravity_wrapper, 0);
5245   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5246   if(SQ_FAILED(sq_createslot(v, -3))) {
5247     throw SquirrelError(v, "Couldn't register function 'enable_gravity'");
5248   }
5249
5250   sq_pushstring(v, "gravity_enabled", -1);
5251   sq_newclosure(v, &ScriptedObject_gravity_enabled_wrapper, 0);
5252   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5253   if(SQ_FAILED(sq_createslot(v, -3))) {
5254     throw SquirrelError(v, "Couldn't register function 'gravity_enabled'");
5255   }
5256
5257   sq_pushstring(v, "set_visible", -1);
5258   sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
5259   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5260   if(SQ_FAILED(sq_createslot(v, -3))) {
5261     throw SquirrelError(v, "Couldn't register function 'set_visible'");
5262   }
5263
5264   sq_pushstring(v, "is_visible", -1);
5265   sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
5266   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5267   if(SQ_FAILED(sq_createslot(v, -3))) {
5268     throw SquirrelError(v, "Couldn't register function 'is_visible'");
5269   }
5270
5271   sq_pushstring(v, "set_solid", -1);
5272   sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
5273   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5274   if(SQ_FAILED(sq_createslot(v, -3))) {
5275     throw SquirrelError(v, "Couldn't register function 'set_solid'");
5276   }
5277
5278   sq_pushstring(v, "is_solid", -1);
5279   sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
5280   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5281   if(SQ_FAILED(sq_createslot(v, -3))) {
5282     throw SquirrelError(v, "Couldn't register function 'is_solid'");
5283   }
5284
5285   sq_pushstring(v, "get_name", -1);
5286   sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
5287   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5288   if(SQ_FAILED(sq_createslot(v, -3))) {
5289     throw SquirrelError(v, "Couldn't register function 'get_name'");
5290   }
5291
5292   if(SQ_FAILED(sq_createslot(v, -3))) {
5293     throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
5294   }
5295
5296   // Register class SSector
5297   sq_pushstring(v, "SSector", -1);
5298   if(sq_newclass(v, SQFalse) < 0) {
5299     std::ostringstream msg;
5300     msg << "Couldn't create new class 'SSector'";
5301     throw SquirrelError(v, msg.str());
5302   }
5303   sq_pushstring(v, "set_ambient_light", -1);
5304   sq_newclosure(v, &SSector_set_ambient_light_wrapper, 0);
5305   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
5306   if(SQ_FAILED(sq_createslot(v, -3))) {
5307     throw SquirrelError(v, "Couldn't register function 'set_ambient_light'");
5308   }
5309
5310   sq_pushstring(v, "get_ambient_red", -1);
5311   sq_newclosure(v, &SSector_get_ambient_red_wrapper, 0);
5312   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5313   if(SQ_FAILED(sq_createslot(v, -3))) {
5314     throw SquirrelError(v, "Couldn't register function 'get_ambient_red'");
5315   }
5316
5317   sq_pushstring(v, "get_ambient_green", -1);
5318   sq_newclosure(v, &SSector_get_ambient_green_wrapper, 0);
5319   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5320   if(SQ_FAILED(sq_createslot(v, -3))) {
5321     throw SquirrelError(v, "Couldn't register function 'get_ambient_green'");
5322   }
5323
5324   sq_pushstring(v, "get_ambient_blue", -1);
5325   sq_newclosure(v, &SSector_get_ambient_blue_wrapper, 0);
5326   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5327   if(SQ_FAILED(sq_createslot(v, -3))) {
5328     throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'");
5329   }
5330
5331   sq_pushstring(v, "set_gravity", -1);
5332   sq_newclosure(v, &SSector_set_gravity_wrapper, 0);
5333   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5334   if(SQ_FAILED(sq_createslot(v, -3))) {
5335     throw SquirrelError(v, "Couldn't register function 'set_gravity'");
5336   }
5337
5338   if(SQ_FAILED(sq_createslot(v, -3))) {
5339     throw SquirrelError(v, "Couldn't register class 'SSector'");
5340   }
5341
5342   // Register class Text
5343   sq_pushstring(v, "Text", -1);
5344   if(sq_newclass(v, SQFalse) < 0) {
5345     std::ostringstream msg;
5346     msg << "Couldn't create new class 'Text'";
5347     throw SquirrelError(v, msg.str());
5348   }
5349   sq_pushstring(v, "set_text", -1);
5350   sq_newclosure(v, &Text_set_text_wrapper, 0);
5351   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5352   if(SQ_FAILED(sq_createslot(v, -3))) {
5353     throw SquirrelError(v, "Couldn't register function 'set_text'");
5354   }
5355
5356   sq_pushstring(v, "set_font", -1);
5357   sq_newclosure(v, &Text_set_font_wrapper, 0);
5358   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5359   if(SQ_FAILED(sq_createslot(v, -3))) {
5360     throw SquirrelError(v, "Couldn't register function 'set_font'");
5361   }
5362
5363   sq_pushstring(v, "fade_in", -1);
5364   sq_newclosure(v, &Text_fade_in_wrapper, 0);
5365   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5366   if(SQ_FAILED(sq_createslot(v, -3))) {
5367     throw SquirrelError(v, "Couldn't register function 'fade_in'");
5368   }
5369
5370   sq_pushstring(v, "fade_out", -1);
5371   sq_newclosure(v, &Text_fade_out_wrapper, 0);
5372   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5373   if(SQ_FAILED(sq_createslot(v, -3))) {
5374     throw SquirrelError(v, "Couldn't register function 'fade_out'");
5375   }
5376
5377   sq_pushstring(v, "set_visible", -1);
5378   sq_newclosure(v, &Text_set_visible_wrapper, 0);
5379   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5380   if(SQ_FAILED(sq_createslot(v, -3))) {
5381     throw SquirrelError(v, "Couldn't register function 'set_visible'");
5382   }
5383
5384   sq_pushstring(v, "set_centered", -1);
5385   sq_newclosure(v, &Text_set_centered_wrapper, 0);
5386   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5387   if(SQ_FAILED(sq_createslot(v, -3))) {
5388     throw SquirrelError(v, "Couldn't register function 'set_centered'");
5389   }
5390
5391   sq_pushstring(v, "set_pos", -1);
5392   sq_newclosure(v, &Text_set_pos_wrapper, 0);
5393   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5394   if(SQ_FAILED(sq_createslot(v, -3))) {
5395     throw SquirrelError(v, "Couldn't register function 'set_pos'");
5396   }
5397
5398   sq_pushstring(v, "get_pos_x", -1);
5399   sq_newclosure(v, &Text_get_pos_x_wrapper, 0);
5400   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5401   if(SQ_FAILED(sq_createslot(v, -3))) {
5402     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5403   }
5404
5405   sq_pushstring(v, "get_pos_y", -1);
5406   sq_newclosure(v, &Text_get_pos_y_wrapper, 0);
5407   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5408   if(SQ_FAILED(sq_createslot(v, -3))) {
5409     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5410   }
5411
5412   sq_pushstring(v, "set_anchor_point", -1);
5413   sq_newclosure(v, &Text_set_anchor_point_wrapper, 0);
5414   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5415   if(SQ_FAILED(sq_createslot(v, -3))) {
5416     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
5417   }
5418
5419   sq_pushstring(v, "get_anchor_point", -1);
5420   sq_newclosure(v, &Text_get_anchor_point_wrapper, 0);
5421   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5422   if(SQ_FAILED(sq_createslot(v, -3))) {
5423     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
5424   }
5425
5426   if(SQ_FAILED(sq_createslot(v, -3))) {
5427     throw SquirrelError(v, "Couldn't register class 'Text'");
5428   }
5429
5430   // Register class Thunderstorm
5431   sq_pushstring(v, "Thunderstorm", -1);
5432   if(sq_newclass(v, SQFalse) < 0) {
5433     std::ostringstream msg;
5434     msg << "Couldn't create new class 'Thunderstorm'";
5435     throw SquirrelError(v, msg.str());
5436   }
5437   sq_pushstring(v, "start", -1);
5438   sq_newclosure(v, &Thunderstorm_start_wrapper, 0);
5439   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5440   if(SQ_FAILED(sq_createslot(v, -3))) {
5441     throw SquirrelError(v, "Couldn't register function 'start'");
5442   }
5443
5444   sq_pushstring(v, "stop", -1);
5445   sq_newclosure(v, &Thunderstorm_stop_wrapper, 0);
5446   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5447   if(SQ_FAILED(sq_createslot(v, -3))) {
5448     throw SquirrelError(v, "Couldn't register function 'stop'");
5449   }
5450
5451   sq_pushstring(v, "thunder", -1);
5452   sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0);
5453   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5454   if(SQ_FAILED(sq_createslot(v, -3))) {
5455     throw SquirrelError(v, "Couldn't register function 'thunder'");
5456   }
5457
5458   sq_pushstring(v, "lightning", -1);
5459   sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0);
5460   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5461   if(SQ_FAILED(sq_createslot(v, -3))) {
5462     throw SquirrelError(v, "Couldn't register function 'lightning'");
5463   }
5464
5465   sq_pushstring(v, "flash", -1);
5466   sq_newclosure(v, &Thunderstorm_flash_wrapper, 0);
5467   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5468   if(SQ_FAILED(sq_createslot(v, -3))) {
5469     throw SquirrelError(v, "Couldn't register function 'flash'");
5470   }
5471
5472   sq_pushstring(v, "electrify", -1);
5473   sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0);
5474   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5475   if(SQ_FAILED(sq_createslot(v, -3))) {
5476     throw SquirrelError(v, "Couldn't register function 'electrify'");
5477   }
5478
5479   if(SQ_FAILED(sq_createslot(v, -3))) {
5480     throw SquirrelError(v, "Couldn't register class 'Thunderstorm'");
5481   }
5482
5483   // Register class TileMap
5484   sq_pushstring(v, "TileMap", -1);
5485   if(sq_newclass(v, SQFalse) < 0) {
5486     std::ostringstream msg;
5487     msg << "Couldn't create new class 'TileMap'";
5488     throw SquirrelError(v, msg.str());
5489   }
5490   sq_pushstring(v, "goto_node", -1);
5491   sq_newclosure(v, &TileMap_goto_node_wrapper, 0);
5492   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5493   if(SQ_FAILED(sq_createslot(v, -3))) {
5494     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5495   }
5496
5497   sq_pushstring(v, "start_moving", -1);
5498   sq_newclosure(v, &TileMap_start_moving_wrapper, 0);
5499   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5500   if(SQ_FAILED(sq_createslot(v, -3))) {
5501     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5502   }
5503
5504   sq_pushstring(v, "stop_moving", -1);
5505   sq_newclosure(v, &TileMap_stop_moving_wrapper, 0);
5506   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5507   if(SQ_FAILED(sq_createslot(v, -3))) {
5508     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5509   }
5510
5511   sq_pushstring(v, "fade", -1);
5512   sq_newclosure(v, &TileMap_fade_wrapper, 0);
5513   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5514   if(SQ_FAILED(sq_createslot(v, -3))) {
5515     throw SquirrelError(v, "Couldn't register function 'fade'");
5516   }
5517
5518   sq_pushstring(v, "set_alpha", -1);
5519   sq_newclosure(v, &TileMap_set_alpha_wrapper, 0);
5520   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5521   if(SQ_FAILED(sq_createslot(v, -3))) {
5522     throw SquirrelError(v, "Couldn't register function 'set_alpha'");
5523   }
5524
5525   sq_pushstring(v, "get_alpha", -1);
5526   sq_newclosure(v, &TileMap_get_alpha_wrapper, 0);
5527   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5528   if(SQ_FAILED(sq_createslot(v, -3))) {
5529     throw SquirrelError(v, "Couldn't register function 'get_alpha'");
5530   }
5531
5532   if(SQ_FAILED(sq_createslot(v, -3))) {
5533     throw SquirrelError(v, "Couldn't register class 'TileMap'");
5534   }
5535
5536   // Register class WillOWisp
5537   sq_pushstring(v, "WillOWisp", -1);
5538   if(sq_newclass(v, SQFalse) < 0) {
5539     std::ostringstream msg;
5540     msg << "Couldn't create new class 'WillOWisp'";
5541     throw SquirrelError(v, msg.str());
5542   }
5543   sq_pushstring(v, "goto_node", -1);
5544   sq_newclosure(v, &WillOWisp_goto_node_wrapper, 0);
5545   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5546   if(SQ_FAILED(sq_createslot(v, -3))) {
5547     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5548   }
5549
5550   sq_pushstring(v, "set_state", -1);
5551   sq_newclosure(v, &WillOWisp_set_state_wrapper, 0);
5552   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5553   if(SQ_FAILED(sq_createslot(v, -3))) {
5554     throw SquirrelError(v, "Couldn't register function 'set_state'");
5555   }
5556
5557   sq_pushstring(v, "start_moving", -1);
5558   sq_newclosure(v, &WillOWisp_start_moving_wrapper, 0);
5559   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5560   if(SQ_FAILED(sq_createslot(v, -3))) {
5561     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5562   }
5563
5564   sq_pushstring(v, "stop_moving", -1);
5565   sq_newclosure(v, &WillOWisp_stop_moving_wrapper, 0);
5566   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5567   if(SQ_FAILED(sq_createslot(v, -3))) {
5568     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5569   }
5570
5571   if(SQ_FAILED(sq_createslot(v, -3))) {
5572     throw SquirrelError(v, "Couldn't register class 'WillOWisp'");
5573   }
5574
5575   // Register class Wind
5576   sq_pushstring(v, "Wind", -1);
5577   if(sq_newclass(v, SQFalse) < 0) {
5578     std::ostringstream msg;
5579     msg << "Couldn't create new class 'Wind'";
5580     throw SquirrelError(v, msg.str());
5581   }
5582   sq_pushstring(v, "start", -1);
5583   sq_newclosure(v, &Wind_start_wrapper, 0);
5584   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5585   if(SQ_FAILED(sq_createslot(v, -3))) {
5586     throw SquirrelError(v, "Couldn't register function 'start'");
5587   }
5588
5589   sq_pushstring(v, "stop", -1);
5590   sq_newclosure(v, &Wind_stop_wrapper, 0);
5591   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5592   if(SQ_FAILED(sq_createslot(v, -3))) {
5593     throw SquirrelError(v, "Couldn't register function 'stop'");
5594   }
5595
5596   if(SQ_FAILED(sq_createslot(v, -3))) {
5597     throw SquirrelError(v, "Couldn't register class 'Wind'");
5598   }
5599
5600 }
5601
5602 } // namespace scripting
5603
5604 /* EOF */