Flesh out the intro scene some more.
[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 update_worldmap_wrapper(HSQUIRRELVM vm)
3389 {
3390   (void) vm;
3391
3392   try {
3393     scripting::update_worldmap();
3394
3395     return 0;
3396
3397   } catch(std::exception& e) {
3398     sq_throwerror(vm, e.what());
3399     return SQ_ERROR;
3400   } catch(...) {
3401     sq_throwerror(vm, _SC("Unexpected exception while executing function 'update_worldmap'"));
3402     return SQ_ERROR;
3403   }
3404
3405 }
3406
3407 static SQInteger debug_collrects_wrapper(HSQUIRRELVM vm)
3408 {
3409   SQBool arg0;
3410   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3411     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3412     return SQ_ERROR;
3413   }
3414
3415   try {
3416     scripting::debug_collrects(arg0 == SQTrue);
3417
3418     return 0;
3419
3420   } catch(std::exception& e) {
3421     sq_throwerror(vm, e.what());
3422     return SQ_ERROR;
3423   } catch(...) {
3424     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_collrects'"));
3425     return SQ_ERROR;
3426   }
3427
3428 }
3429
3430 static SQInteger debug_show_fps_wrapper(HSQUIRRELVM vm)
3431 {
3432   SQBool arg0;
3433   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3434     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3435     return SQ_ERROR;
3436   }
3437
3438   try {
3439     scripting::debug_show_fps(arg0 == SQTrue);
3440
3441     return 0;
3442
3443   } catch(std::exception& e) {
3444     sq_throwerror(vm, e.what());
3445     return SQ_ERROR;
3446   } catch(...) {
3447     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_show_fps'"));
3448     return SQ_ERROR;
3449   }
3450
3451 }
3452
3453 static SQInteger debug_draw_solids_only_wrapper(HSQUIRRELVM vm)
3454 {
3455   SQBool arg0;
3456   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3457     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3458     return SQ_ERROR;
3459   }
3460
3461   try {
3462     scripting::debug_draw_solids_only(arg0 == SQTrue);
3463
3464     return 0;
3465
3466   } catch(std::exception& e) {
3467     sq_throwerror(vm, e.what());
3468     return SQ_ERROR;
3469   } catch(...) {
3470     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_solids_only'"));
3471     return SQ_ERROR;
3472   }
3473
3474 }
3475
3476 static SQInteger debug_draw_editor_images_wrapper(HSQUIRRELVM vm)
3477 {
3478   SQBool arg0;
3479   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3480     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3481     return SQ_ERROR;
3482   }
3483
3484   try {
3485     scripting::debug_draw_editor_images(arg0 == SQTrue);
3486
3487     return 0;
3488
3489   } catch(std::exception& e) {
3490     sq_throwerror(vm, e.what());
3491     return SQ_ERROR;
3492   } catch(...) {
3493     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_draw_editor_images'"));
3494     return SQ_ERROR;
3495   }
3496
3497 }
3498
3499 static SQInteger debug_worldmap_ghost_wrapper(HSQUIRRELVM vm)
3500 {
3501   SQBool arg0;
3502   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3503     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3504     return SQ_ERROR;
3505   }
3506
3507   try {
3508     scripting::debug_worldmap_ghost(arg0 == SQTrue);
3509
3510     return 0;
3511
3512   } catch(std::exception& e) {
3513     sq_throwerror(vm, e.what());
3514     return SQ_ERROR;
3515   } catch(...) {
3516     sq_throwerror(vm, _SC("Unexpected exception while executing function 'debug_worldmap_ghost'"));
3517     return SQ_ERROR;
3518   }
3519
3520 }
3521
3522 static SQInteger play_music_wrapper(HSQUIRRELVM vm)
3523 {
3524   const SQChar* arg0;
3525   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3526     sq_throwerror(vm, _SC("Argument 1 not a string"));
3527     return SQ_ERROR;
3528   }
3529
3530   try {
3531     scripting::play_music(arg0);
3532
3533     return 0;
3534
3535   } catch(std::exception& e) {
3536     sq_throwerror(vm, e.what());
3537     return SQ_ERROR;
3538   } catch(...) {
3539     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_music'"));
3540     return SQ_ERROR;
3541   }
3542
3543 }
3544
3545 static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
3546 {
3547   const SQChar* arg0;
3548   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3549     sq_throwerror(vm, _SC("Argument 1 not a string"));
3550     return SQ_ERROR;
3551   }
3552
3553   try {
3554     scripting::play_sound(arg0);
3555
3556     return 0;
3557
3558   } catch(std::exception& e) {
3559     sq_throwerror(vm, e.what());
3560     return SQ_ERROR;
3561   } catch(...) {
3562     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_sound'"));
3563     return SQ_ERROR;
3564   }
3565
3566 }
3567
3568 static SQInteger set_game_speed_wrapper(HSQUIRRELVM vm)
3569 {
3570   SQFloat arg0;
3571   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3572     sq_throwerror(vm, _SC("Argument 1 not a float"));
3573     return SQ_ERROR;
3574   }
3575
3576   try {
3577     scripting::set_game_speed(static_cast<float> (arg0));
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 'set_game_speed'"));
3586     return SQ_ERROR;
3587   }
3588
3589 }
3590
3591 static SQInteger grease_wrapper(HSQUIRRELVM vm)
3592 {
3593   (void) vm;
3594
3595   try {
3596     scripting::grease();
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 'grease'"));
3605     return SQ_ERROR;
3606   }
3607
3608 }
3609
3610 static SQInteger invincible_wrapper(HSQUIRRELVM vm)
3611 {
3612   (void) vm;
3613
3614   try {
3615     scripting::invincible();
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 'invincible'"));
3624     return SQ_ERROR;
3625   }
3626
3627 }
3628
3629 static SQInteger ghost_wrapper(HSQUIRRELVM vm)
3630 {
3631   (void) vm;
3632
3633   try {
3634     scripting::ghost();
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 'ghost'"));
3643     return SQ_ERROR;
3644   }
3645
3646 }
3647
3648 static SQInteger mortal_wrapper(HSQUIRRELVM vm)
3649 {
3650   (void) vm;
3651
3652   try {
3653     scripting::mortal();
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 'mortal'"));
3662     return SQ_ERROR;
3663   }
3664
3665 }
3666
3667 static SQInteger restart_wrapper(HSQUIRRELVM vm)
3668 {
3669   (void) vm;
3670
3671   try {
3672     scripting::restart();
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 'restart'"));
3681     return SQ_ERROR;
3682   }
3683
3684 }
3685
3686 static SQInteger whereami_wrapper(HSQUIRRELVM vm)
3687 {
3688   (void) vm;
3689
3690   try {
3691     scripting::whereami();
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 'whereami'"));
3700     return SQ_ERROR;
3701   }
3702
3703 }
3704
3705 static SQInteger gotoend_wrapper(HSQUIRRELVM vm)
3706 {
3707   (void) vm;
3708
3709   try {
3710     scripting::gotoend();
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 'gotoend'"));
3719     return SQ_ERROR;
3720   }
3721
3722 }
3723
3724 static SQInteger camera_wrapper(HSQUIRRELVM vm)
3725 {
3726   (void) vm;
3727
3728   try {
3729     scripting::camera();
3730
3731     return 0;
3732
3733   } catch(std::exception& e) {
3734     sq_throwerror(vm, e.what());
3735     return SQ_ERROR;
3736   } catch(...) {
3737     sq_throwerror(vm, _SC("Unexpected exception while executing function 'camera'"));
3738     return SQ_ERROR;
3739   }
3740
3741 }
3742
3743 static SQInteger set_gamma_wrapper(HSQUIRRELVM vm)
3744 {
3745   SQFloat arg0;
3746   if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
3747     sq_throwerror(vm, _SC("Argument 1 not a float"));
3748     return SQ_ERROR;
3749   }
3750
3751   try {
3752     scripting::set_gamma(static_cast<float> (arg0));
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 'set_gamma'"));
3761     return SQ_ERROR;
3762   }
3763
3764 }
3765
3766 static SQInteger quit_wrapper(HSQUIRRELVM vm)
3767 {
3768   (void) vm;
3769
3770   try {
3771     scripting::quit();
3772
3773     return 0;
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 'quit'"));
3780     return SQ_ERROR;
3781   }
3782
3783 }
3784
3785 static SQInteger rand_wrapper(HSQUIRRELVM vm)
3786 {
3787
3788   try {
3789     int return_value = scripting::rand();
3790
3791     sq_pushinteger(vm, return_value);
3792     return 1;
3793
3794   } catch(std::exception& e) {
3795     sq_throwerror(vm, e.what());
3796     return SQ_ERROR;
3797   } catch(...) {
3798     sq_throwerror(vm, _SC("Unexpected exception while executing function 'rand'"));
3799     return SQ_ERROR;
3800   }
3801
3802 }
3803
3804 static SQInteger record_demo_wrapper(HSQUIRRELVM vm)
3805 {
3806   const SQChar* arg0;
3807   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3808     sq_throwerror(vm, _SC("Argument 1 not a string"));
3809     return SQ_ERROR;
3810   }
3811
3812   try {
3813     scripting::record_demo(arg0);
3814
3815     return 0;
3816
3817   } catch(std::exception& e) {
3818     sq_throwerror(vm, e.what());
3819     return SQ_ERROR;
3820   } catch(...) {
3821     sq_throwerror(vm, _SC("Unexpected exception while executing function 'record_demo'"));
3822     return SQ_ERROR;
3823   }
3824
3825 }
3826
3827 static SQInteger play_demo_wrapper(HSQUIRRELVM vm)
3828 {
3829   const SQChar* arg0;
3830   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3831     sq_throwerror(vm, _SC("Argument 1 not a string"));
3832     return SQ_ERROR;
3833   }
3834
3835   try {
3836     scripting::play_demo(arg0);
3837
3838     return 0;
3839
3840   } catch(std::exception& e) {
3841     sq_throwerror(vm, e.what());
3842     return SQ_ERROR;
3843   } catch(...) {
3844     sq_throwerror(vm, _SC("Unexpected exception while executing function 'play_demo'"));
3845     return SQ_ERROR;
3846   }
3847
3848 }
3849
3850 static SQInteger Level_finish_wrapper(HSQUIRRELVM vm)
3851 {
3852   SQBool arg0;
3853   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3854     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3855     return SQ_ERROR;
3856   }
3857
3858   try {
3859     scripting::Level_finish(arg0 == SQTrue);
3860
3861     return 0;
3862
3863   } catch(std::exception& e) {
3864     sq_throwerror(vm, e.what());
3865     return SQ_ERROR;
3866   } catch(...) {
3867     sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_finish'"));
3868     return SQ_ERROR;
3869   }
3870
3871 }
3872
3873 static SQInteger Level_spawn_wrapper(HSQUIRRELVM vm)
3874 {
3875   const SQChar* arg0;
3876   if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
3877     sq_throwerror(vm, _SC("Argument 1 not a string"));
3878     return SQ_ERROR;
3879   }
3880   const SQChar* arg1;
3881   if(SQ_FAILED(sq_getstring(vm, 3, &arg1))) {
3882     sq_throwerror(vm, _SC("Argument 2 not a string"));
3883     return SQ_ERROR;
3884   }
3885
3886   try {
3887     scripting::Level_spawn(arg0, arg1);
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_spawn'"));
3896     return SQ_ERROR;
3897   }
3898
3899 }
3900
3901 static SQInteger Level_flip_vertically_wrapper(HSQUIRRELVM vm)
3902 {
3903   (void) vm;
3904
3905   try {
3906     scripting::Level_flip_vertically();
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_flip_vertically'"));
3915     return SQ_ERROR;
3916   }
3917
3918 }
3919
3920 static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
3921 {
3922   (void) vm;
3923
3924   try {
3925     scripting::Level_toggle_pause();
3926
3927     return 0;
3928
3929   } catch(std::exception& e) {
3930     sq_throwerror(vm, e.what());
3931     return SQ_ERROR;
3932   } catch(...) {
3933     sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_toggle_pause'"));
3934     return SQ_ERROR;
3935   }
3936
3937 }
3938
3939 static SQInteger Level_edit_wrapper(HSQUIRRELVM vm)
3940 {
3941   SQBool arg0;
3942   if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
3943     sq_throwerror(vm, _SC("Argument 1 not a bool"));
3944     return SQ_ERROR;
3945   }
3946
3947   try {
3948     scripting::Level_edit(arg0 == SQTrue);
3949
3950     return 0;
3951
3952   } catch(std::exception& e) {
3953     sq_throwerror(vm, e.what());
3954     return SQ_ERROR;
3955   } catch(...) {
3956     sq_throwerror(vm, _SC("Unexpected exception while executing function 'Level_edit'"));
3957     return SQ_ERROR;
3958   }
3959
3960 }
3961
3962 } // namespace wrapper
3963 void create_squirrel_instance(HSQUIRRELVM v, scripting::AmbientSound* object, bool setup_releasehook)
3964 {
3965   using namespace wrapper;
3966
3967   sq_pushroottable(v);
3968   sq_pushstring(v, "AmbientSound", -1);
3969   if(SQ_FAILED(sq_get(v, -2))) {
3970     std::ostringstream msg;
3971     msg << "Couldn't resolved squirrel type 'AmbientSound'";
3972     throw SquirrelError(v, msg.str());
3973   }
3974
3975   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
3976     std::ostringstream msg;
3977     msg << "Couldn't setup squirrel instance for object of type 'AmbientSound'";
3978     throw SquirrelError(v, msg.str());
3979   }
3980   sq_remove(v, -2); // remove object name
3981
3982   if(setup_releasehook) {
3983     sq_setreleasehook(v, -1, AmbientSound_release_hook);
3984   }
3985
3986   sq_remove(v, -2); // remove root table
3987 }
3988
3989 void create_squirrel_instance(HSQUIRRELVM v, scripting::Camera* object, bool setup_releasehook)
3990 {
3991   using namespace wrapper;
3992
3993   sq_pushroottable(v);
3994   sq_pushstring(v, "Camera", -1);
3995   if(SQ_FAILED(sq_get(v, -2))) {
3996     std::ostringstream msg;
3997     msg << "Couldn't resolved squirrel type 'Camera'";
3998     throw SquirrelError(v, msg.str());
3999   }
4000
4001   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4002     std::ostringstream msg;
4003     msg << "Couldn't setup squirrel instance for object of type 'Camera'";
4004     throw SquirrelError(v, msg.str());
4005   }
4006   sq_remove(v, -2); // remove object name
4007
4008   if(setup_releasehook) {
4009     sq_setreleasehook(v, -1, Camera_release_hook);
4010   }
4011
4012   sq_remove(v, -2); // remove root table
4013 }
4014
4015 void create_squirrel_instance(HSQUIRRELVM v, scripting::Candle* object, bool setup_releasehook)
4016 {
4017   using namespace wrapper;
4018
4019   sq_pushroottable(v);
4020   sq_pushstring(v, "Candle", -1);
4021   if(SQ_FAILED(sq_get(v, -2))) {
4022     std::ostringstream msg;
4023     msg << "Couldn't resolved squirrel type 'Candle'";
4024     throw SquirrelError(v, msg.str());
4025   }
4026
4027   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4028     std::ostringstream msg;
4029     msg << "Couldn't setup squirrel instance for object of type 'Candle'";
4030     throw SquirrelError(v, msg.str());
4031   }
4032   sq_remove(v, -2); // remove object name
4033
4034   if(setup_releasehook) {
4035     sq_setreleasehook(v, -1, Candle_release_hook);
4036   }
4037
4038   sq_remove(v, -2); // remove root table
4039 }
4040
4041 void create_squirrel_instance(HSQUIRRELVM v, scripting::DisplayEffect* object, bool setup_releasehook)
4042 {
4043   using namespace wrapper;
4044
4045   sq_pushroottable(v);
4046   sq_pushstring(v, "DisplayEffect", -1);
4047   if(SQ_FAILED(sq_get(v, -2))) {
4048     std::ostringstream msg;
4049     msg << "Couldn't resolved squirrel type 'DisplayEffect'";
4050     throw SquirrelError(v, msg.str());
4051   }
4052
4053   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4054     std::ostringstream msg;
4055     msg << "Couldn't setup squirrel instance for object of type 'DisplayEffect'";
4056     throw SquirrelError(v, msg.str());
4057   }
4058   sq_remove(v, -2); // remove object name
4059
4060   if(setup_releasehook) {
4061     sq_setreleasehook(v, -1, DisplayEffect_release_hook);
4062   }
4063
4064   sq_remove(v, -2); // remove root table
4065 }
4066
4067 void create_squirrel_instance(HSQUIRRELVM v, scripting::FloatingImage* object, bool setup_releasehook)
4068 {
4069   using namespace wrapper;
4070
4071   sq_pushroottable(v);
4072   sq_pushstring(v, "FloatingImage", -1);
4073   if(SQ_FAILED(sq_get(v, -2))) {
4074     std::ostringstream msg;
4075     msg << "Couldn't resolved squirrel type 'FloatingImage'";
4076     throw SquirrelError(v, msg.str());
4077   }
4078
4079   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4080     std::ostringstream msg;
4081     msg << "Couldn't setup squirrel instance for object of type 'FloatingImage'";
4082     throw SquirrelError(v, msg.str());
4083   }
4084   sq_remove(v, -2); // remove object name
4085
4086   if(setup_releasehook) {
4087     sq_setreleasehook(v, -1, FloatingImage_release_hook);
4088   }
4089
4090   sq_remove(v, -2); // remove root table
4091 }
4092
4093 void create_squirrel_instance(HSQUIRRELVM v, scripting::LevelTime* object, bool setup_releasehook)
4094 {
4095   using namespace wrapper;
4096
4097   sq_pushroottable(v);
4098   sq_pushstring(v, "LevelTime", -1);
4099   if(SQ_FAILED(sq_get(v, -2))) {
4100     std::ostringstream msg;
4101     msg << "Couldn't resolved squirrel type 'LevelTime'";
4102     throw SquirrelError(v, msg.str());
4103   }
4104
4105   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4106     std::ostringstream msg;
4107     msg << "Couldn't setup squirrel instance for object of type 'LevelTime'";
4108     throw SquirrelError(v, msg.str());
4109   }
4110   sq_remove(v, -2); // remove object name
4111
4112   if(setup_releasehook) {
4113     sq_setreleasehook(v, -1, LevelTime_release_hook);
4114   }
4115
4116   sq_remove(v, -2); // remove root table
4117 }
4118
4119 void create_squirrel_instance(HSQUIRRELVM v, scripting::Platform* object, bool setup_releasehook)
4120 {
4121   using namespace wrapper;
4122
4123   sq_pushroottable(v);
4124   sq_pushstring(v, "Platform", -1);
4125   if(SQ_FAILED(sq_get(v, -2))) {
4126     std::ostringstream msg;
4127     msg << "Couldn't resolved squirrel type 'Platform'";
4128     throw SquirrelError(v, msg.str());
4129   }
4130
4131   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4132     std::ostringstream msg;
4133     msg << "Couldn't setup squirrel instance for object of type 'Platform'";
4134     throw SquirrelError(v, msg.str());
4135   }
4136   sq_remove(v, -2); // remove object name
4137
4138   if(setup_releasehook) {
4139     sq_setreleasehook(v, -1, Platform_release_hook);
4140   }
4141
4142   sq_remove(v, -2); // remove root table
4143 }
4144
4145 void create_squirrel_instance(HSQUIRRELVM v, scripting::Player* object, bool setup_releasehook)
4146 {
4147   using namespace wrapper;
4148
4149   sq_pushroottable(v);
4150   sq_pushstring(v, "Player", -1);
4151   if(SQ_FAILED(sq_get(v, -2))) {
4152     std::ostringstream msg;
4153     msg << "Couldn't resolved squirrel type 'Player'";
4154     throw SquirrelError(v, msg.str());
4155   }
4156
4157   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4158     std::ostringstream msg;
4159     msg << "Couldn't setup squirrel instance for object of type 'Player'";
4160     throw SquirrelError(v, msg.str());
4161   }
4162   sq_remove(v, -2); // remove object name
4163
4164   if(setup_releasehook) {
4165     sq_setreleasehook(v, -1, Player_release_hook);
4166   }
4167
4168   sq_remove(v, -2); // remove root table
4169 }
4170
4171 void create_squirrel_instance(HSQUIRRELVM v, scripting::ScriptedObject* object, bool setup_releasehook)
4172 {
4173   using namespace wrapper;
4174
4175   sq_pushroottable(v);
4176   sq_pushstring(v, "ScriptedObject", -1);
4177   if(SQ_FAILED(sq_get(v, -2))) {
4178     std::ostringstream msg;
4179     msg << "Couldn't resolved squirrel type 'ScriptedObject'";
4180     throw SquirrelError(v, msg.str());
4181   }
4182
4183   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4184     std::ostringstream msg;
4185     msg << "Couldn't setup squirrel instance for object of type 'ScriptedObject'";
4186     throw SquirrelError(v, msg.str());
4187   }
4188   sq_remove(v, -2); // remove object name
4189
4190   if(setup_releasehook) {
4191     sq_setreleasehook(v, -1, ScriptedObject_release_hook);
4192   }
4193
4194   sq_remove(v, -2); // remove root table
4195 }
4196
4197 void create_squirrel_instance(HSQUIRRELVM v, scripting::SSector* object, bool setup_releasehook)
4198 {
4199   using namespace wrapper;
4200
4201   sq_pushroottable(v);
4202   sq_pushstring(v, "SSector", -1);
4203   if(SQ_FAILED(sq_get(v, -2))) {
4204     std::ostringstream msg;
4205     msg << "Couldn't resolved squirrel type 'SSector'";
4206     throw SquirrelError(v, msg.str());
4207   }
4208
4209   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4210     std::ostringstream msg;
4211     msg << "Couldn't setup squirrel instance for object of type 'SSector'";
4212     throw SquirrelError(v, msg.str());
4213   }
4214   sq_remove(v, -2); // remove object name
4215
4216   if(setup_releasehook) {
4217     sq_setreleasehook(v, -1, SSector_release_hook);
4218   }
4219
4220   sq_remove(v, -2); // remove root table
4221 }
4222
4223 void create_squirrel_instance(HSQUIRRELVM v, scripting::Text* object, bool setup_releasehook)
4224 {
4225   using namespace wrapper;
4226
4227   sq_pushroottable(v);
4228   sq_pushstring(v, "Text", -1);
4229   if(SQ_FAILED(sq_get(v, -2))) {
4230     std::ostringstream msg;
4231     msg << "Couldn't resolved squirrel type 'Text'";
4232     throw SquirrelError(v, msg.str());
4233   }
4234
4235   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4236     std::ostringstream msg;
4237     msg << "Couldn't setup squirrel instance for object of type 'Text'";
4238     throw SquirrelError(v, msg.str());
4239   }
4240   sq_remove(v, -2); // remove object name
4241
4242   if(setup_releasehook) {
4243     sq_setreleasehook(v, -1, Text_release_hook);
4244   }
4245
4246   sq_remove(v, -2); // remove root table
4247 }
4248
4249 void create_squirrel_instance(HSQUIRRELVM v, scripting::Thunderstorm* object, bool setup_releasehook)
4250 {
4251   using namespace wrapper;
4252
4253   sq_pushroottable(v);
4254   sq_pushstring(v, "Thunderstorm", -1);
4255   if(SQ_FAILED(sq_get(v, -2))) {
4256     std::ostringstream msg;
4257     msg << "Couldn't resolved squirrel type 'Thunderstorm'";
4258     throw SquirrelError(v, msg.str());
4259   }
4260
4261   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4262     std::ostringstream msg;
4263     msg << "Couldn't setup squirrel instance for object of type 'Thunderstorm'";
4264     throw SquirrelError(v, msg.str());
4265   }
4266   sq_remove(v, -2); // remove object name
4267
4268   if(setup_releasehook) {
4269     sq_setreleasehook(v, -1, Thunderstorm_release_hook);
4270   }
4271
4272   sq_remove(v, -2); // remove root table
4273 }
4274
4275 void create_squirrel_instance(HSQUIRRELVM v, scripting::TileMap* object, bool setup_releasehook)
4276 {
4277   using namespace wrapper;
4278
4279   sq_pushroottable(v);
4280   sq_pushstring(v, "TileMap", -1);
4281   if(SQ_FAILED(sq_get(v, -2))) {
4282     std::ostringstream msg;
4283     msg << "Couldn't resolved squirrel type 'TileMap'";
4284     throw SquirrelError(v, msg.str());
4285   }
4286
4287   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4288     std::ostringstream msg;
4289     msg << "Couldn't setup squirrel instance for object of type 'TileMap'";
4290     throw SquirrelError(v, msg.str());
4291   }
4292   sq_remove(v, -2); // remove object name
4293
4294   if(setup_releasehook) {
4295     sq_setreleasehook(v, -1, TileMap_release_hook);
4296   }
4297
4298   sq_remove(v, -2); // remove root table
4299 }
4300
4301 void create_squirrel_instance(HSQUIRRELVM v, scripting::WillOWisp* object, bool setup_releasehook)
4302 {
4303   using namespace wrapper;
4304
4305   sq_pushroottable(v);
4306   sq_pushstring(v, "WillOWisp", -1);
4307   if(SQ_FAILED(sq_get(v, -2))) {
4308     std::ostringstream msg;
4309     msg << "Couldn't resolved squirrel type 'WillOWisp'";
4310     throw SquirrelError(v, msg.str());
4311   }
4312
4313   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4314     std::ostringstream msg;
4315     msg << "Couldn't setup squirrel instance for object of type 'WillOWisp'";
4316     throw SquirrelError(v, msg.str());
4317   }
4318   sq_remove(v, -2); // remove object name
4319
4320   if(setup_releasehook) {
4321     sq_setreleasehook(v, -1, WillOWisp_release_hook);
4322   }
4323
4324   sq_remove(v, -2); // remove root table
4325 }
4326
4327 void create_squirrel_instance(HSQUIRRELVM v, scripting::Wind* object, bool setup_releasehook)
4328 {
4329   using namespace wrapper;
4330
4331   sq_pushroottable(v);
4332   sq_pushstring(v, "Wind", -1);
4333   if(SQ_FAILED(sq_get(v, -2))) {
4334     std::ostringstream msg;
4335     msg << "Couldn't resolved squirrel type 'Wind'";
4336     throw SquirrelError(v, msg.str());
4337   }
4338
4339   if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
4340     std::ostringstream msg;
4341     msg << "Couldn't setup squirrel instance for object of type 'Wind'";
4342     throw SquirrelError(v, msg.str());
4343   }
4344   sq_remove(v, -2); // remove object name
4345
4346   if(setup_releasehook) {
4347     sq_setreleasehook(v, -1, Wind_release_hook);
4348   }
4349
4350   sq_remove(v, -2); // remove root table
4351 }
4352
4353 void register_supertux_wrapper(HSQUIRRELVM v)
4354 {
4355   using namespace wrapper;
4356
4357   sq_pushstring(v, "ANCHOR_TOP", -1);
4358   sq_pushinteger(v, 16);
4359   if(SQ_FAILED(sq_createslot(v, -3))) {
4360     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP'");
4361   }
4362
4363   sq_pushstring(v, "ANCHOR_BOTTOM", -1);
4364   sq_pushinteger(v, 32);
4365   if(SQ_FAILED(sq_createslot(v, -3))) {
4366     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM'");
4367   }
4368
4369   sq_pushstring(v, "ANCHOR_LEFT", -1);
4370   sq_pushinteger(v, 1);
4371   if(SQ_FAILED(sq_createslot(v, -3))) {
4372     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_LEFT'");
4373   }
4374
4375   sq_pushstring(v, "ANCHOR_RIGHT", -1);
4376   sq_pushinteger(v, 2);
4377   if(SQ_FAILED(sq_createslot(v, -3))) {
4378     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_RIGHT'");
4379   }
4380
4381   sq_pushstring(v, "ANCHOR_MIDDLE", -1);
4382   sq_pushinteger(v, 0);
4383   if(SQ_FAILED(sq_createslot(v, -3))) {
4384     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_MIDDLE'");
4385   }
4386
4387   sq_pushstring(v, "ANCHOR_TOP_LEFT", -1);
4388   sq_pushinteger(v, 17);
4389   if(SQ_FAILED(sq_createslot(v, -3))) {
4390     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_LEFT'");
4391   }
4392
4393   sq_pushstring(v, "ANCHOR_TOP_RIGHT", -1);
4394   sq_pushinteger(v, 18);
4395   if(SQ_FAILED(sq_createslot(v, -3))) {
4396     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_TOP_RIGHT'");
4397   }
4398
4399   sq_pushstring(v, "ANCHOR_BOTTOM_LEFT", -1);
4400   sq_pushinteger(v, 33);
4401   if(SQ_FAILED(sq_createslot(v, -3))) {
4402     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_LEFT'");
4403   }
4404
4405   sq_pushstring(v, "ANCHOR_BOTTOM_RIGHT", -1);
4406   sq_pushinteger(v, 34);
4407   if(SQ_FAILED(sq_createslot(v, -3))) {
4408     throw SquirrelError(v, "Couldn't register constant 'ANCHOR_BOTTOM_RIGHT'");
4409   }
4410
4411   sq_pushstring(v, "display", -1);
4412   sq_newclosure(v, &display_wrapper, 0);
4413   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t.");
4414   if(SQ_FAILED(sq_createslot(v, -3))) {
4415     throw SquirrelError(v, "Couldn't register function 'display'");
4416   }
4417
4418   sq_pushstring(v, "print_stacktrace", -1);
4419   sq_newclosure(v, &print_stacktrace_wrapper, 0);
4420   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4421   if(SQ_FAILED(sq_createslot(v, -3))) {
4422     throw SquirrelError(v, "Couldn't register function 'print_stacktrace'");
4423   }
4424
4425   sq_pushstring(v, "get_current_thread", -1);
4426   sq_newclosure(v, &get_current_thread_wrapper, 0);
4427   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "t");
4428   if(SQ_FAILED(sq_createslot(v, -3))) {
4429     throw SquirrelError(v, "Couldn't register function 'get_current_thread'");
4430   }
4431
4432   sq_pushstring(v, "display_text_file", -1);
4433   sq_newclosure(v, &display_text_file_wrapper, 0);
4434   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4435   if(SQ_FAILED(sq_createslot(v, -3))) {
4436     throw SquirrelError(v, "Couldn't register function 'display_text_file'");
4437   }
4438
4439   sq_pushstring(v, "load_worldmap", -1);
4440   sq_newclosure(v, &load_worldmap_wrapper, 0);
4441   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4442   if(SQ_FAILED(sq_createslot(v, -3))) {
4443     throw SquirrelError(v, "Couldn't register function 'load_worldmap'");
4444   }
4445
4446   sq_pushstring(v, "load_level", -1);
4447   sq_newclosure(v, &load_level_wrapper, 0);
4448   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4449   if(SQ_FAILED(sq_createslot(v, -3))) {
4450     throw SquirrelError(v, "Couldn't register function 'load_level'");
4451   }
4452
4453   sq_pushstring(v, "wait", -1);
4454   sq_newclosure(v, &wait_wrapper, 0);
4455   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4456   if(SQ_FAILED(sq_createslot(v, -3))) {
4457     throw SquirrelError(v, "Couldn't register function 'wait'");
4458   }
4459
4460   sq_pushstring(v, "wait_for_screenswitch", -1);
4461   sq_newclosure(v, &wait_for_screenswitch_wrapper, 0);
4462   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4463   if(SQ_FAILED(sq_createslot(v, -3))) {
4464     throw SquirrelError(v, "Couldn't register function 'wait_for_screenswitch'");
4465   }
4466
4467   sq_pushstring(v, "exit_screen", -1);
4468   sq_newclosure(v, &exit_screen_wrapper, 0);
4469   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4470   if(SQ_FAILED(sq_createslot(v, -3))) {
4471     throw SquirrelError(v, "Couldn't register function 'exit_screen'");
4472   }
4473
4474   sq_pushstring(v, "fadeout_screen", -1);
4475   sq_newclosure(v, &fadeout_screen_wrapper, 0);
4476   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4477   if(SQ_FAILED(sq_createslot(v, -3))) {
4478     throw SquirrelError(v, "Couldn't register function 'fadeout_screen'");
4479   }
4480
4481   sq_pushstring(v, "shrink_screen", -1);
4482   sq_newclosure(v, &shrink_screen_wrapper, 0);
4483   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4484   if(SQ_FAILED(sq_createslot(v, -3))) {
4485     throw SquirrelError(v, "Couldn't register function 'shrink_screen'");
4486   }
4487
4488   sq_pushstring(v, "abort_screenfade", -1);
4489   sq_newclosure(v, &abort_screenfade_wrapper, 0);
4490   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4491   if(SQ_FAILED(sq_createslot(v, -3))) {
4492     throw SquirrelError(v, "Couldn't register function 'abort_screenfade'");
4493   }
4494
4495   sq_pushstring(v, "translate", -1);
4496   sq_newclosure(v, &translate_wrapper, 0);
4497   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4498   if(SQ_FAILED(sq_createslot(v, -3))) {
4499     throw SquirrelError(v, "Couldn't register function 'translate'");
4500   }
4501
4502   sq_pushstring(v, "import", -1);
4503   sq_newclosure(v, &import_wrapper, 0);
4504   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4505   if(SQ_FAILED(sq_createslot(v, -3))) {
4506     throw SquirrelError(v, "Couldn't register function 'import'");
4507   }
4508
4509   sq_pushstring(v, "save_state", -1);
4510   sq_newclosure(v, &save_state_wrapper, 0);
4511   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4512   if(SQ_FAILED(sq_createslot(v, -3))) {
4513     throw SquirrelError(v, "Couldn't register function 'save_state'");
4514   }
4515
4516   sq_pushstring(v, "update_worldmap", -1);
4517   sq_newclosure(v, &update_worldmap_wrapper, 0);
4518   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4519   if(SQ_FAILED(sq_createslot(v, -3))) {
4520     throw SquirrelError(v, "Couldn't register function 'update_worldmap'");
4521   }
4522
4523   sq_pushstring(v, "debug_collrects", -1);
4524   sq_newclosure(v, &debug_collrects_wrapper, 0);
4525   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4526   if(SQ_FAILED(sq_createslot(v, -3))) {
4527     throw SquirrelError(v, "Couldn't register function 'debug_collrects'");
4528   }
4529
4530   sq_pushstring(v, "debug_show_fps", -1);
4531   sq_newclosure(v, &debug_show_fps_wrapper, 0);
4532   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4533   if(SQ_FAILED(sq_createslot(v, -3))) {
4534     throw SquirrelError(v, "Couldn't register function 'debug_show_fps'");
4535   }
4536
4537   sq_pushstring(v, "debug_draw_solids_only", -1);
4538   sq_newclosure(v, &debug_draw_solids_only_wrapper, 0);
4539   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4540   if(SQ_FAILED(sq_createslot(v, -3))) {
4541     throw SquirrelError(v, "Couldn't register function 'debug_draw_solids_only'");
4542   }
4543
4544   sq_pushstring(v, "debug_draw_editor_images", -1);
4545   sq_newclosure(v, &debug_draw_editor_images_wrapper, 0);
4546   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4547   if(SQ_FAILED(sq_createslot(v, -3))) {
4548     throw SquirrelError(v, "Couldn't register function 'debug_draw_editor_images'");
4549   }
4550
4551   sq_pushstring(v, "debug_worldmap_ghost", -1);
4552   sq_newclosure(v, &debug_worldmap_ghost_wrapper, 0);
4553   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4554   if(SQ_FAILED(sq_createslot(v, -3))) {
4555     throw SquirrelError(v, "Couldn't register function 'debug_worldmap_ghost'");
4556   }
4557
4558   sq_pushstring(v, "play_music", -1);
4559   sq_newclosure(v, &play_music_wrapper, 0);
4560   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4561   if(SQ_FAILED(sq_createslot(v, -3))) {
4562     throw SquirrelError(v, "Couldn't register function 'play_music'");
4563   }
4564
4565   sq_pushstring(v, "play_sound", -1);
4566   sq_newclosure(v, &play_sound_wrapper, 0);
4567   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4568   if(SQ_FAILED(sq_createslot(v, -3))) {
4569     throw SquirrelError(v, "Couldn't register function 'play_sound'");
4570   }
4571
4572   sq_pushstring(v, "set_game_speed", -1);
4573   sq_newclosure(v, &set_game_speed_wrapper, 0);
4574   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4575   if(SQ_FAILED(sq_createslot(v, -3))) {
4576     throw SquirrelError(v, "Couldn't register function 'set_game_speed'");
4577   }
4578
4579   sq_pushstring(v, "grease", -1);
4580   sq_newclosure(v, &grease_wrapper, 0);
4581   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4582   if(SQ_FAILED(sq_createslot(v, -3))) {
4583     throw SquirrelError(v, "Couldn't register function 'grease'");
4584   }
4585
4586   sq_pushstring(v, "invincible", -1);
4587   sq_newclosure(v, &invincible_wrapper, 0);
4588   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4589   if(SQ_FAILED(sq_createslot(v, -3))) {
4590     throw SquirrelError(v, "Couldn't register function 'invincible'");
4591   }
4592
4593   sq_pushstring(v, "ghost", -1);
4594   sq_newclosure(v, &ghost_wrapper, 0);
4595   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4596   if(SQ_FAILED(sq_createslot(v, -3))) {
4597     throw SquirrelError(v, "Couldn't register function 'ghost'");
4598   }
4599
4600   sq_pushstring(v, "mortal", -1);
4601   sq_newclosure(v, &mortal_wrapper, 0);
4602   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4603   if(SQ_FAILED(sq_createslot(v, -3))) {
4604     throw SquirrelError(v, "Couldn't register function 'mortal'");
4605   }
4606
4607   sq_pushstring(v, "restart", -1);
4608   sq_newclosure(v, &restart_wrapper, 0);
4609   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4610   if(SQ_FAILED(sq_createslot(v, -3))) {
4611     throw SquirrelError(v, "Couldn't register function 'restart'");
4612   }
4613
4614   sq_pushstring(v, "whereami", -1);
4615   sq_newclosure(v, &whereami_wrapper, 0);
4616   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4617   if(SQ_FAILED(sq_createslot(v, -3))) {
4618     throw SquirrelError(v, "Couldn't register function 'whereami'");
4619   }
4620
4621   sq_pushstring(v, "gotoend", -1);
4622   sq_newclosure(v, &gotoend_wrapper, 0);
4623   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4624   if(SQ_FAILED(sq_createslot(v, -3))) {
4625     throw SquirrelError(v, "Couldn't register function 'gotoend'");
4626   }
4627
4628   sq_pushstring(v, "camera", -1);
4629   sq_newclosure(v, &camera_wrapper, 0);
4630   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4631   if(SQ_FAILED(sq_createslot(v, -3))) {
4632     throw SquirrelError(v, "Couldn't register function 'camera'");
4633   }
4634
4635   sq_pushstring(v, "set_gamma", -1);
4636   sq_newclosure(v, &set_gamma_wrapper, 0);
4637   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4638   if(SQ_FAILED(sq_createslot(v, -3))) {
4639     throw SquirrelError(v, "Couldn't register function 'set_gamma'");
4640   }
4641
4642   sq_pushstring(v, "quit", -1);
4643   sq_newclosure(v, &quit_wrapper, 0);
4644   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4645   if(SQ_FAILED(sq_createslot(v, -3))) {
4646     throw SquirrelError(v, "Couldn't register function 'quit'");
4647   }
4648
4649   sq_pushstring(v, "rand", -1);
4650   sq_newclosure(v, &rand_wrapper, 0);
4651   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4652   if(SQ_FAILED(sq_createslot(v, -3))) {
4653     throw SquirrelError(v, "Couldn't register function 'rand'");
4654   }
4655
4656   sq_pushstring(v, "record_demo", -1);
4657   sq_newclosure(v, &record_demo_wrapper, 0);
4658   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4659   if(SQ_FAILED(sq_createslot(v, -3))) {
4660     throw SquirrelError(v, "Couldn't register function 'record_demo'");
4661   }
4662
4663   sq_pushstring(v, "play_demo", -1);
4664   sq_newclosure(v, &play_demo_wrapper, 0);
4665   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4666   if(SQ_FAILED(sq_createslot(v, -3))) {
4667     throw SquirrelError(v, "Couldn't register function 'play_demo'");
4668   }
4669
4670   sq_pushstring(v, "Level_finish", -1);
4671   sq_newclosure(v, &Level_finish_wrapper, 0);
4672   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4673   if(SQ_FAILED(sq_createslot(v, -3))) {
4674     throw SquirrelError(v, "Couldn't register function 'Level_finish'");
4675   }
4676
4677   sq_pushstring(v, "Level_spawn", -1);
4678   sq_newclosure(v, &Level_spawn_wrapper, 0);
4679   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tss");
4680   if(SQ_FAILED(sq_createslot(v, -3))) {
4681     throw SquirrelError(v, "Couldn't register function 'Level_spawn'");
4682   }
4683
4684   sq_pushstring(v, "Level_flip_vertically", -1);
4685   sq_newclosure(v, &Level_flip_vertically_wrapper, 0);
4686   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4687   if(SQ_FAILED(sq_createslot(v, -3))) {
4688     throw SquirrelError(v, "Couldn't register function 'Level_flip_vertically'");
4689   }
4690
4691   sq_pushstring(v, "Level_toggle_pause", -1);
4692   sq_newclosure(v, &Level_toggle_pause_wrapper, 0);
4693   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4694   if(SQ_FAILED(sq_createslot(v, -3))) {
4695     throw SquirrelError(v, "Couldn't register function 'Level_toggle_pause'");
4696   }
4697
4698   sq_pushstring(v, "Level_edit", -1);
4699   sq_newclosure(v, &Level_edit_wrapper, 0);
4700   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4701   if(SQ_FAILED(sq_createslot(v, -3))) {
4702     throw SquirrelError(v, "Couldn't register function 'Level_edit'");
4703   }
4704
4705   // Register class AmbientSound
4706   sq_pushstring(v, "AmbientSound", -1);
4707   if(sq_newclass(v, SQFalse) < 0) {
4708     std::ostringstream msg;
4709     msg << "Couldn't create new class 'AmbientSound'";
4710     throw SquirrelError(v, msg.str());
4711   }
4712   sq_pushstring(v, "set_pos", -1);
4713   sq_newclosure(v, &AmbientSound_set_pos_wrapper, 0);
4714   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4715   if(SQ_FAILED(sq_createslot(v, -3))) {
4716     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4717   }
4718
4719   sq_pushstring(v, "get_pos_x", -1);
4720   sq_newclosure(v, &AmbientSound_get_pos_x_wrapper, 0);
4721   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4722   if(SQ_FAILED(sq_createslot(v, -3))) {
4723     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4724   }
4725
4726   sq_pushstring(v, "get_pos_y", -1);
4727   sq_newclosure(v, &AmbientSound_get_pos_y_wrapper, 0);
4728   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4729   if(SQ_FAILED(sq_createslot(v, -3))) {
4730     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4731   }
4732
4733   if(SQ_FAILED(sq_createslot(v, -3))) {
4734     throw SquirrelError(v, "Couldn't register class 'AmbientSound'");
4735   }
4736
4737   // Register class Camera
4738   sq_pushstring(v, "Camera", -1);
4739   if(sq_newclass(v, SQFalse) < 0) {
4740     std::ostringstream msg;
4741     msg << "Couldn't create new class 'Camera'";
4742     throw SquirrelError(v, msg.str());
4743   }
4744   sq_pushstring(v, "reload_config", -1);
4745   sq_newclosure(v, &Camera_reload_config_wrapper, 0);
4746   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4747   if(SQ_FAILED(sq_createslot(v, -3))) {
4748     throw SquirrelError(v, "Couldn't register function 'reload_config'");
4749   }
4750
4751   sq_pushstring(v, "shake", -1);
4752   sq_newclosure(v, &Camera_shake_wrapper, 0);
4753   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4754   if(SQ_FAILED(sq_createslot(v, -3))) {
4755     throw SquirrelError(v, "Couldn't register function 'shake'");
4756   }
4757
4758   sq_pushstring(v, "set_pos", -1);
4759   sq_newclosure(v, &Camera_set_pos_wrapper, 0);
4760   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4761   if(SQ_FAILED(sq_createslot(v, -3))) {
4762     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4763   }
4764
4765   sq_pushstring(v, "set_mode", -1);
4766   sq_newclosure(v, &Camera_set_mode_wrapper, 0);
4767   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4768   if(SQ_FAILED(sq_createslot(v, -3))) {
4769     throw SquirrelError(v, "Couldn't register function 'set_mode'");
4770   }
4771
4772   sq_pushstring(v, "scroll_to", -1);
4773   sq_newclosure(v, &Camera_scroll_to_wrapper, 0);
4774   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
4775   if(SQ_FAILED(sq_createslot(v, -3))) {
4776     throw SquirrelError(v, "Couldn't register function 'scroll_to'");
4777   }
4778
4779   if(SQ_FAILED(sq_createslot(v, -3))) {
4780     throw SquirrelError(v, "Couldn't register class 'Camera'");
4781   }
4782
4783   // Register class Candle
4784   sq_pushstring(v, "Candle", -1);
4785   if(sq_newclass(v, SQFalse) < 0) {
4786     std::ostringstream msg;
4787     msg << "Couldn't create new class 'Candle'";
4788     throw SquirrelError(v, msg.str());
4789   }
4790   sq_pushstring(v, "get_burning", -1);
4791   sq_newclosure(v, &Candle_get_burning_wrapper, 0);
4792   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4793   if(SQ_FAILED(sq_createslot(v, -3))) {
4794     throw SquirrelError(v, "Couldn't register function 'get_burning'");
4795   }
4796
4797   sq_pushstring(v, "set_burning", -1);
4798   sq_newclosure(v, &Candle_set_burning_wrapper, 0);
4799   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4800   if(SQ_FAILED(sq_createslot(v, -3))) {
4801     throw SquirrelError(v, "Couldn't register function 'set_burning'");
4802   }
4803
4804   if(SQ_FAILED(sq_createslot(v, -3))) {
4805     throw SquirrelError(v, "Couldn't register class 'Candle'");
4806   }
4807
4808   // Register class DisplayEffect
4809   sq_pushstring(v, "DisplayEffect", -1);
4810   if(sq_newclass(v, SQFalse) < 0) {
4811     std::ostringstream msg;
4812     msg << "Couldn't create new class 'DisplayEffect'";
4813     throw SquirrelError(v, msg.str());
4814   }
4815   sq_pushstring(v, "fade_out", -1);
4816   sq_newclosure(v, &DisplayEffect_fade_out_wrapper, 0);
4817   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4818   if(SQ_FAILED(sq_createslot(v, -3))) {
4819     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4820   }
4821
4822   sq_pushstring(v, "fade_in", -1);
4823   sq_newclosure(v, &DisplayEffect_fade_in_wrapper, 0);
4824   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4825   if(SQ_FAILED(sq_createslot(v, -3))) {
4826     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4827   }
4828
4829   sq_pushstring(v, "set_black", -1);
4830   sq_newclosure(v, &DisplayEffect_set_black_wrapper, 0);
4831   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4832   if(SQ_FAILED(sq_createslot(v, -3))) {
4833     throw SquirrelError(v, "Couldn't register function 'set_black'");
4834   }
4835
4836   sq_pushstring(v, "is_black", -1);
4837   sq_newclosure(v, &DisplayEffect_is_black_wrapper, 0);
4838   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4839   if(SQ_FAILED(sq_createslot(v, -3))) {
4840     throw SquirrelError(v, "Couldn't register function 'is_black'");
4841   }
4842
4843   sq_pushstring(v, "sixteen_to_nine", -1);
4844   sq_newclosure(v, &DisplayEffect_sixteen_to_nine_wrapper, 0);
4845   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4846   if(SQ_FAILED(sq_createslot(v, -3))) {
4847     throw SquirrelError(v, "Couldn't register function 'sixteen_to_nine'");
4848   }
4849
4850   sq_pushstring(v, "four_to_three", -1);
4851   sq_newclosure(v, &DisplayEffect_four_to_three_wrapper, 0);
4852   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4853   if(SQ_FAILED(sq_createslot(v, -3))) {
4854     throw SquirrelError(v, "Couldn't register function 'four_to_three'");
4855   }
4856
4857   if(SQ_FAILED(sq_createslot(v, -3))) {
4858     throw SquirrelError(v, "Couldn't register class 'DisplayEffect'");
4859   }
4860
4861   // Register class FloatingImage
4862   sq_pushstring(v, "FloatingImage", -1);
4863   if(sq_newclass(v, SQFalse) < 0) {
4864     std::ostringstream msg;
4865     msg << "Couldn't create new class 'FloatingImage'";
4866     throw SquirrelError(v, msg.str());
4867   }
4868   sq_pushstring(v, "constructor", -1);
4869   sq_newclosure(v, &FloatingImage_constructor_wrapper, 0);
4870   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4871   if(SQ_FAILED(sq_createslot(v, -3))) {
4872     throw SquirrelError(v, "Couldn't register function 'constructor'");
4873   }
4874
4875   sq_pushstring(v, "set_layer", -1);
4876   sq_newclosure(v, &FloatingImage_set_layer_wrapper, 0);
4877   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4878   if(SQ_FAILED(sq_createslot(v, -3))) {
4879     throw SquirrelError(v, "Couldn't register function 'set_layer'");
4880   }
4881
4882   sq_pushstring(v, "get_layer", -1);
4883   sq_newclosure(v, &FloatingImage_get_layer_wrapper, 0);
4884   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4885   if(SQ_FAILED(sq_createslot(v, -3))) {
4886     throw SquirrelError(v, "Couldn't register function 'get_layer'");
4887   }
4888
4889   sq_pushstring(v, "set_pos", -1);
4890   sq_newclosure(v, &FloatingImage_set_pos_wrapper, 0);
4891   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
4892   if(SQ_FAILED(sq_createslot(v, -3))) {
4893     throw SquirrelError(v, "Couldn't register function 'set_pos'");
4894   }
4895
4896   sq_pushstring(v, "get_pos_x", -1);
4897   sq_newclosure(v, &FloatingImage_get_pos_x_wrapper, 0);
4898   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4899   if(SQ_FAILED(sq_createslot(v, -3))) {
4900     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
4901   }
4902
4903   sq_pushstring(v, "get_pos_y", -1);
4904   sq_newclosure(v, &FloatingImage_get_pos_y_wrapper, 0);
4905   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4906   if(SQ_FAILED(sq_createslot(v, -3))) {
4907     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
4908   }
4909
4910   sq_pushstring(v, "set_anchor_point", -1);
4911   sq_newclosure(v, &FloatingImage_set_anchor_point_wrapper, 0);
4912   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
4913   if(SQ_FAILED(sq_createslot(v, -3))) {
4914     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
4915   }
4916
4917   sq_pushstring(v, "get_anchor_point", -1);
4918   sq_newclosure(v, &FloatingImage_get_anchor_point_wrapper, 0);
4919   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4920   if(SQ_FAILED(sq_createslot(v, -3))) {
4921     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
4922   }
4923
4924   sq_pushstring(v, "set_visible", -1);
4925   sq_newclosure(v, &FloatingImage_set_visible_wrapper, 0);
4926   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
4927   if(SQ_FAILED(sq_createslot(v, -3))) {
4928     throw SquirrelError(v, "Couldn't register function 'set_visible'");
4929   }
4930
4931   sq_pushstring(v, "get_visible", -1);
4932   sq_newclosure(v, &FloatingImage_get_visible_wrapper, 0);
4933   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4934   if(SQ_FAILED(sq_createslot(v, -3))) {
4935     throw SquirrelError(v, "Couldn't register function 'get_visible'");
4936   }
4937
4938   sq_pushstring(v, "set_action", -1);
4939   sq_newclosure(v, &FloatingImage_set_action_wrapper, 0);
4940   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
4941   if(SQ_FAILED(sq_createslot(v, -3))) {
4942     throw SquirrelError(v, "Couldn't register function 'set_action'");
4943   }
4944
4945   sq_pushstring(v, "get_action", -1);
4946   sq_newclosure(v, &FloatingImage_get_action_wrapper, 0);
4947   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4948   if(SQ_FAILED(sq_createslot(v, -3))) {
4949     throw SquirrelError(v, "Couldn't register function 'get_action'");
4950   }
4951
4952   sq_pushstring(v, "fade_in", -1);
4953   sq_newclosure(v, &FloatingImage_fade_in_wrapper, 0);
4954   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4955   if(SQ_FAILED(sq_createslot(v, -3))) {
4956     throw SquirrelError(v, "Couldn't register function 'fade_in'");
4957   }
4958
4959   sq_pushstring(v, "fade_out", -1);
4960   sq_newclosure(v, &FloatingImage_fade_out_wrapper, 0);
4961   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
4962   if(SQ_FAILED(sq_createslot(v, -3))) {
4963     throw SquirrelError(v, "Couldn't register function 'fade_out'");
4964   }
4965
4966   if(SQ_FAILED(sq_createslot(v, -3))) {
4967     throw SquirrelError(v, "Couldn't register class 'FloatingImage'");
4968   }
4969
4970   // Register class LevelTime
4971   sq_pushstring(v, "LevelTime", -1);
4972   if(sq_newclass(v, SQFalse) < 0) {
4973     std::ostringstream msg;
4974     msg << "Couldn't create new class 'LevelTime'";
4975     throw SquirrelError(v, msg.str());
4976   }
4977   sq_pushstring(v, "start", -1);
4978   sq_newclosure(v, &LevelTime_start_wrapper, 0);
4979   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4980   if(SQ_FAILED(sq_createslot(v, -3))) {
4981     throw SquirrelError(v, "Couldn't register function 'start'");
4982   }
4983
4984   sq_pushstring(v, "stop", -1);
4985   sq_newclosure(v, &LevelTime_stop_wrapper, 0);
4986   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4987   if(SQ_FAILED(sq_createslot(v, -3))) {
4988     throw SquirrelError(v, "Couldn't register function 'stop'");
4989   }
4990
4991   sq_pushstring(v, "get_time", -1);
4992   sq_newclosure(v, &LevelTime_get_time_wrapper, 0);
4993   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
4994   if(SQ_FAILED(sq_createslot(v, -3))) {
4995     throw SquirrelError(v, "Couldn't register function 'get_time'");
4996   }
4997
4998   sq_pushstring(v, "set_time", -1);
4999   sq_newclosure(v, &LevelTime_set_time_wrapper, 0);
5000   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5001   if(SQ_FAILED(sq_createslot(v, -3))) {
5002     throw SquirrelError(v, "Couldn't register function 'set_time'");
5003   }
5004
5005   if(SQ_FAILED(sq_createslot(v, -3))) {
5006     throw SquirrelError(v, "Couldn't register class 'LevelTime'");
5007   }
5008
5009   // Register class Platform
5010   sq_pushstring(v, "Platform", -1);
5011   if(sq_newclass(v, SQFalse) < 0) {
5012     std::ostringstream msg;
5013     msg << "Couldn't create new class 'Platform'";
5014     throw SquirrelError(v, msg.str());
5015   }
5016   sq_pushstring(v, "goto_node", -1);
5017   sq_newclosure(v, &Platform_goto_node_wrapper, 0);
5018   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5019   if(SQ_FAILED(sq_createslot(v, -3))) {
5020     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5021   }
5022
5023   sq_pushstring(v, "start_moving", -1);
5024   sq_newclosure(v, &Platform_start_moving_wrapper, 0);
5025   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5026   if(SQ_FAILED(sq_createslot(v, -3))) {
5027     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5028   }
5029
5030   sq_pushstring(v, "stop_moving", -1);
5031   sq_newclosure(v, &Platform_stop_moving_wrapper, 0);
5032   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5033   if(SQ_FAILED(sq_createslot(v, -3))) {
5034     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5035   }
5036
5037   if(SQ_FAILED(sq_createslot(v, -3))) {
5038     throw SquirrelError(v, "Couldn't register class 'Platform'");
5039   }
5040
5041   // Register class Player
5042   sq_pushstring(v, "Player", -1);
5043   if(sq_newclass(v, SQFalse) < 0) {
5044     std::ostringstream msg;
5045     msg << "Couldn't create new class 'Player'";
5046     throw SquirrelError(v, msg.str());
5047   }
5048   sq_pushstring(v, "add_bonus", -1);
5049   sq_newclosure(v, &Player_add_bonus_wrapper, 0);
5050   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5051   if(SQ_FAILED(sq_createslot(v, -3))) {
5052     throw SquirrelError(v, "Couldn't register function 'add_bonus'");
5053   }
5054
5055   sq_pushstring(v, "add_coins", -1);
5056   sq_newclosure(v, &Player_add_coins_wrapper, 0);
5057   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5058   if(SQ_FAILED(sq_createslot(v, -3))) {
5059     throw SquirrelError(v, "Couldn't register function 'add_coins'");
5060   }
5061
5062   sq_pushstring(v, "make_invincible", -1);
5063   sq_newclosure(v, &Player_make_invincible_wrapper, 0);
5064   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5065   if(SQ_FAILED(sq_createslot(v, -3))) {
5066     throw SquirrelError(v, "Couldn't register function 'make_invincible'");
5067   }
5068
5069   sq_pushstring(v, "deactivate", -1);
5070   sq_newclosure(v, &Player_deactivate_wrapper, 0);
5071   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5072   if(SQ_FAILED(sq_createslot(v, -3))) {
5073     throw SquirrelError(v, "Couldn't register function 'deactivate'");
5074   }
5075
5076   sq_pushstring(v, "activate", -1);
5077   sq_newclosure(v, &Player_activate_wrapper, 0);
5078   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5079   if(SQ_FAILED(sq_createslot(v, -3))) {
5080     throw SquirrelError(v, "Couldn't register function 'activate'");
5081   }
5082
5083   sq_pushstring(v, "walk", -1);
5084   sq_newclosure(v, &Player_walk_wrapper, 0);
5085   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5086   if(SQ_FAILED(sq_createslot(v, -3))) {
5087     throw SquirrelError(v, "Couldn't register function 'walk'");
5088   }
5089
5090   sq_pushstring(v, "set_dir", -1);
5091   sq_newclosure(v, &Player_set_dir_wrapper, 0);
5092   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5093   if(SQ_FAILED(sq_createslot(v, -3))) {
5094     throw SquirrelError(v, "Couldn't register function 'set_dir'");
5095   }
5096
5097   sq_pushstring(v, "set_visible", -1);
5098   sq_newclosure(v, &Player_set_visible_wrapper, 0);
5099   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5100   if(SQ_FAILED(sq_createslot(v, -3))) {
5101     throw SquirrelError(v, "Couldn't register function 'set_visible'");
5102   }
5103
5104   sq_pushstring(v, "get_visible", -1);
5105   sq_newclosure(v, &Player_get_visible_wrapper, 0);
5106   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5107   if(SQ_FAILED(sq_createslot(v, -3))) {
5108     throw SquirrelError(v, "Couldn't register function 'get_visible'");
5109   }
5110
5111   sq_pushstring(v, "kill", -1);
5112   sq_newclosure(v, &Player_kill_wrapper, 0);
5113   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5114   if(SQ_FAILED(sq_createslot(v, -3))) {
5115     throw SquirrelError(v, "Couldn't register function 'kill'");
5116   }
5117
5118   sq_pushstring(v, "set_ghost_mode", -1);
5119   sq_newclosure(v, &Player_set_ghost_mode_wrapper, 0);
5120   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5121   if(SQ_FAILED(sq_createslot(v, -3))) {
5122     throw SquirrelError(v, "Couldn't register function 'set_ghost_mode'");
5123   }
5124
5125   sq_pushstring(v, "get_ghost_mode", -1);
5126   sq_newclosure(v, &Player_get_ghost_mode_wrapper, 0);
5127   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5128   if(SQ_FAILED(sq_createslot(v, -3))) {
5129     throw SquirrelError(v, "Couldn't register function 'get_ghost_mode'");
5130   }
5131
5132   sq_pushstring(v, "kick", -1);
5133   sq_newclosure(v, &Player_kick_wrapper, 0);
5134   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5135   if(SQ_FAILED(sq_createslot(v, -3))) {
5136     throw SquirrelError(v, "Couldn't register function 'kick'");
5137   }
5138
5139   sq_pushstring(v, "do_cheer", -1);
5140   sq_newclosure(v, &Player_do_cheer_wrapper, 0);
5141   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5142   if(SQ_FAILED(sq_createslot(v, -3))) {
5143     throw SquirrelError(v, "Couldn't register function 'do_cheer'");
5144   }
5145
5146   sq_pushstring(v, "do_duck", -1);
5147   sq_newclosure(v, &Player_do_duck_wrapper, 0);
5148   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5149   if(SQ_FAILED(sq_createslot(v, -3))) {
5150     throw SquirrelError(v, "Couldn't register function 'do_duck'");
5151   }
5152
5153   sq_pushstring(v, "do_standup", -1);
5154   sq_newclosure(v, &Player_do_standup_wrapper, 0);
5155   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5156   if(SQ_FAILED(sq_createslot(v, -3))) {
5157     throw SquirrelError(v, "Couldn't register function 'do_standup'");
5158   }
5159
5160   sq_pushstring(v, "do_backflip", -1);
5161   sq_newclosure(v, &Player_do_backflip_wrapper, 0);
5162   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5163   if(SQ_FAILED(sq_createslot(v, -3))) {
5164     throw SquirrelError(v, "Couldn't register function 'do_backflip'");
5165   }
5166
5167   sq_pushstring(v, "do_jump", -1);
5168   sq_newclosure(v, &Player_do_jump_wrapper, 0);
5169   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5170   if(SQ_FAILED(sq_createslot(v, -3))) {
5171     throw SquirrelError(v, "Couldn't register function 'do_jump'");
5172   }
5173
5174   sq_pushstring(v, "trigger_sequence", -1);
5175   sq_newclosure(v, &Player_trigger_sequence_wrapper, 0);
5176   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5177   if(SQ_FAILED(sq_createslot(v, -3))) {
5178     throw SquirrelError(v, "Couldn't register function 'trigger_sequence'");
5179   }
5180
5181   sq_pushstring(v, "use_scripting_controller", -1);
5182   sq_newclosure(v, &Player_use_scripting_controller_wrapper, 0);
5183   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5184   if(SQ_FAILED(sq_createslot(v, -3))) {
5185     throw SquirrelError(v, "Couldn't register function 'use_scripting_controller'");
5186   }
5187
5188   sq_pushstring(v, "do_scripting_controller", -1);
5189   sq_newclosure(v, &Player_do_scripting_controller_wrapper, 0);
5190   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tsb");
5191   if(SQ_FAILED(sq_createslot(v, -3))) {
5192     throw SquirrelError(v, "Couldn't register function 'do_scripting_controller'");
5193   }
5194
5195   if(SQ_FAILED(sq_createslot(v, -3))) {
5196     throw SquirrelError(v, "Couldn't register class 'Player'");
5197   }
5198
5199   // Register class ScriptedObject
5200   sq_pushstring(v, "ScriptedObject", -1);
5201   if(sq_newclass(v, SQFalse) < 0) {
5202     std::ostringstream msg;
5203     msg << "Couldn't create new class 'ScriptedObject'";
5204     throw SquirrelError(v, msg.str());
5205   }
5206   sq_pushstring(v, "set_action", -1);
5207   sq_newclosure(v, &ScriptedObject_set_action_wrapper, 0);
5208   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5209   if(SQ_FAILED(sq_createslot(v, -3))) {
5210     throw SquirrelError(v, "Couldn't register function 'set_action'");
5211   }
5212
5213   sq_pushstring(v, "get_action", -1);
5214   sq_newclosure(v, &ScriptedObject_get_action_wrapper, 0);
5215   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5216   if(SQ_FAILED(sq_createslot(v, -3))) {
5217     throw SquirrelError(v, "Couldn't register function 'get_action'");
5218   }
5219
5220   sq_pushstring(v, "move", -1);
5221   sq_newclosure(v, &ScriptedObject_move_wrapper, 0);
5222   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5223   if(SQ_FAILED(sq_createslot(v, -3))) {
5224     throw SquirrelError(v, "Couldn't register function 'move'");
5225   }
5226
5227   sq_pushstring(v, "set_pos", -1);
5228   sq_newclosure(v, &ScriptedObject_set_pos_wrapper, 0);
5229   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5230   if(SQ_FAILED(sq_createslot(v, -3))) {
5231     throw SquirrelError(v, "Couldn't register function 'set_pos'");
5232   }
5233
5234   sq_pushstring(v, "get_pos_x", -1);
5235   sq_newclosure(v, &ScriptedObject_get_pos_x_wrapper, 0);
5236   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5237   if(SQ_FAILED(sq_createslot(v, -3))) {
5238     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5239   }
5240
5241   sq_pushstring(v, "get_pos_y", -1);
5242   sq_newclosure(v, &ScriptedObject_get_pos_y_wrapper, 0);
5243   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5244   if(SQ_FAILED(sq_createslot(v, -3))) {
5245     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5246   }
5247
5248   sq_pushstring(v, "set_velocity", -1);
5249   sq_newclosure(v, &ScriptedObject_set_velocity_wrapper, 0);
5250   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5251   if(SQ_FAILED(sq_createslot(v, -3))) {
5252     throw SquirrelError(v, "Couldn't register function 'set_velocity'");
5253   }
5254
5255   sq_pushstring(v, "get_velocity_x", -1);
5256   sq_newclosure(v, &ScriptedObject_get_velocity_x_wrapper, 0);
5257   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5258   if(SQ_FAILED(sq_createslot(v, -3))) {
5259     throw SquirrelError(v, "Couldn't register function 'get_velocity_x'");
5260   }
5261
5262   sq_pushstring(v, "get_velocity_y", -1);
5263   sq_newclosure(v, &ScriptedObject_get_velocity_y_wrapper, 0);
5264   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5265   if(SQ_FAILED(sq_createslot(v, -3))) {
5266     throw SquirrelError(v, "Couldn't register function 'get_velocity_y'");
5267   }
5268
5269   sq_pushstring(v, "enable_gravity", -1);
5270   sq_newclosure(v, &ScriptedObject_enable_gravity_wrapper, 0);
5271   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5272   if(SQ_FAILED(sq_createslot(v, -3))) {
5273     throw SquirrelError(v, "Couldn't register function 'enable_gravity'");
5274   }
5275
5276   sq_pushstring(v, "gravity_enabled", -1);
5277   sq_newclosure(v, &ScriptedObject_gravity_enabled_wrapper, 0);
5278   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5279   if(SQ_FAILED(sq_createslot(v, -3))) {
5280     throw SquirrelError(v, "Couldn't register function 'gravity_enabled'");
5281   }
5282
5283   sq_pushstring(v, "set_visible", -1);
5284   sq_newclosure(v, &ScriptedObject_set_visible_wrapper, 0);
5285   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5286   if(SQ_FAILED(sq_createslot(v, -3))) {
5287     throw SquirrelError(v, "Couldn't register function 'set_visible'");
5288   }
5289
5290   sq_pushstring(v, "is_visible", -1);
5291   sq_newclosure(v, &ScriptedObject_is_visible_wrapper, 0);
5292   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5293   if(SQ_FAILED(sq_createslot(v, -3))) {
5294     throw SquirrelError(v, "Couldn't register function 'is_visible'");
5295   }
5296
5297   sq_pushstring(v, "set_solid", -1);
5298   sq_newclosure(v, &ScriptedObject_set_solid_wrapper, 0);
5299   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5300   if(SQ_FAILED(sq_createslot(v, -3))) {
5301     throw SquirrelError(v, "Couldn't register function 'set_solid'");
5302   }
5303
5304   sq_pushstring(v, "is_solid", -1);
5305   sq_newclosure(v, &ScriptedObject_is_solid_wrapper, 0);
5306   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5307   if(SQ_FAILED(sq_createslot(v, -3))) {
5308     throw SquirrelError(v, "Couldn't register function 'is_solid'");
5309   }
5310
5311   sq_pushstring(v, "get_name", -1);
5312   sq_newclosure(v, &ScriptedObject_get_name_wrapper, 0);
5313   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5314   if(SQ_FAILED(sq_createslot(v, -3))) {
5315     throw SquirrelError(v, "Couldn't register function 'get_name'");
5316   }
5317
5318   if(SQ_FAILED(sq_createslot(v, -3))) {
5319     throw SquirrelError(v, "Couldn't register class 'ScriptedObject'");
5320   }
5321
5322   // Register class SSector
5323   sq_pushstring(v, "SSector", -1);
5324   if(sq_newclass(v, SQFalse) < 0) {
5325     std::ostringstream msg;
5326     msg << "Couldn't create new class 'SSector'";
5327     throw SquirrelError(v, msg.str());
5328   }
5329   sq_pushstring(v, "set_ambient_light", -1);
5330   sq_newclosure(v, &SSector_set_ambient_light_wrapper, 0);
5331   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnnn");
5332   if(SQ_FAILED(sq_createslot(v, -3))) {
5333     throw SquirrelError(v, "Couldn't register function 'set_ambient_light'");
5334   }
5335
5336   sq_pushstring(v, "get_ambient_red", -1);
5337   sq_newclosure(v, &SSector_get_ambient_red_wrapper, 0);
5338   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5339   if(SQ_FAILED(sq_createslot(v, -3))) {
5340     throw SquirrelError(v, "Couldn't register function 'get_ambient_red'");
5341   }
5342
5343   sq_pushstring(v, "get_ambient_green", -1);
5344   sq_newclosure(v, &SSector_get_ambient_green_wrapper, 0);
5345   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5346   if(SQ_FAILED(sq_createslot(v, -3))) {
5347     throw SquirrelError(v, "Couldn't register function 'get_ambient_green'");
5348   }
5349
5350   sq_pushstring(v, "get_ambient_blue", -1);
5351   sq_newclosure(v, &SSector_get_ambient_blue_wrapper, 0);
5352   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5353   if(SQ_FAILED(sq_createslot(v, -3))) {
5354     throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'");
5355   }
5356
5357   sq_pushstring(v, "set_gravity", -1);
5358   sq_newclosure(v, &SSector_set_gravity_wrapper, 0);
5359   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5360   if(SQ_FAILED(sq_createslot(v, -3))) {
5361     throw SquirrelError(v, "Couldn't register function 'set_gravity'");
5362   }
5363
5364   if(SQ_FAILED(sq_createslot(v, -3))) {
5365     throw SquirrelError(v, "Couldn't register class 'SSector'");
5366   }
5367
5368   // Register class Text
5369   sq_pushstring(v, "Text", -1);
5370   if(sq_newclass(v, SQFalse) < 0) {
5371     std::ostringstream msg;
5372     msg << "Couldn't create new class 'Text'";
5373     throw SquirrelError(v, msg.str());
5374   }
5375   sq_pushstring(v, "set_text", -1);
5376   sq_newclosure(v, &Text_set_text_wrapper, 0);
5377   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5378   if(SQ_FAILED(sq_createslot(v, -3))) {
5379     throw SquirrelError(v, "Couldn't register function 'set_text'");
5380   }
5381
5382   sq_pushstring(v, "set_font", -1);
5383   sq_newclosure(v, &Text_set_font_wrapper, 0);
5384   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5385   if(SQ_FAILED(sq_createslot(v, -3))) {
5386     throw SquirrelError(v, "Couldn't register function 'set_font'");
5387   }
5388
5389   sq_pushstring(v, "fade_in", -1);
5390   sq_newclosure(v, &Text_fade_in_wrapper, 0);
5391   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5392   if(SQ_FAILED(sq_createslot(v, -3))) {
5393     throw SquirrelError(v, "Couldn't register function 'fade_in'");
5394   }
5395
5396   sq_pushstring(v, "fade_out", -1);
5397   sq_newclosure(v, &Text_fade_out_wrapper, 0);
5398   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5399   if(SQ_FAILED(sq_createslot(v, -3))) {
5400     throw SquirrelError(v, "Couldn't register function 'fade_out'");
5401   }
5402
5403   sq_pushstring(v, "set_visible", -1);
5404   sq_newclosure(v, &Text_set_visible_wrapper, 0);
5405   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5406   if(SQ_FAILED(sq_createslot(v, -3))) {
5407     throw SquirrelError(v, "Couldn't register function 'set_visible'");
5408   }
5409
5410   sq_pushstring(v, "set_centered", -1);
5411   sq_newclosure(v, &Text_set_centered_wrapper, 0);
5412   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tb");
5413   if(SQ_FAILED(sq_createslot(v, -3))) {
5414     throw SquirrelError(v, "Couldn't register function 'set_centered'");
5415   }
5416
5417   sq_pushstring(v, "set_pos", -1);
5418   sq_newclosure(v, &Text_set_pos_wrapper, 0);
5419   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5420   if(SQ_FAILED(sq_createslot(v, -3))) {
5421     throw SquirrelError(v, "Couldn't register function 'set_pos'");
5422   }
5423
5424   sq_pushstring(v, "get_pos_x", -1);
5425   sq_newclosure(v, &Text_get_pos_x_wrapper, 0);
5426   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5427   if(SQ_FAILED(sq_createslot(v, -3))) {
5428     throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
5429   }
5430
5431   sq_pushstring(v, "get_pos_y", -1);
5432   sq_newclosure(v, &Text_get_pos_y_wrapper, 0);
5433   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5434   if(SQ_FAILED(sq_createslot(v, -3))) {
5435     throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
5436   }
5437
5438   sq_pushstring(v, "set_anchor_point", -1);
5439   sq_newclosure(v, &Text_set_anchor_point_wrapper, 0);
5440   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5441   if(SQ_FAILED(sq_createslot(v, -3))) {
5442     throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
5443   }
5444
5445   sq_pushstring(v, "get_anchor_point", -1);
5446   sq_newclosure(v, &Text_get_anchor_point_wrapper, 0);
5447   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5448   if(SQ_FAILED(sq_createslot(v, -3))) {
5449     throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
5450   }
5451
5452   if(SQ_FAILED(sq_createslot(v, -3))) {
5453     throw SquirrelError(v, "Couldn't register class 'Text'");
5454   }
5455
5456   // Register class Thunderstorm
5457   sq_pushstring(v, "Thunderstorm", -1);
5458   if(sq_newclass(v, SQFalse) < 0) {
5459     std::ostringstream msg;
5460     msg << "Couldn't create new class 'Thunderstorm'";
5461     throw SquirrelError(v, msg.str());
5462   }
5463   sq_pushstring(v, "start", -1);
5464   sq_newclosure(v, &Thunderstorm_start_wrapper, 0);
5465   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5466   if(SQ_FAILED(sq_createslot(v, -3))) {
5467     throw SquirrelError(v, "Couldn't register function 'start'");
5468   }
5469
5470   sq_pushstring(v, "stop", -1);
5471   sq_newclosure(v, &Thunderstorm_stop_wrapper, 0);
5472   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5473   if(SQ_FAILED(sq_createslot(v, -3))) {
5474     throw SquirrelError(v, "Couldn't register function 'stop'");
5475   }
5476
5477   sq_pushstring(v, "thunder", -1);
5478   sq_newclosure(v, &Thunderstorm_thunder_wrapper, 0);
5479   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5480   if(SQ_FAILED(sq_createslot(v, -3))) {
5481     throw SquirrelError(v, "Couldn't register function 'thunder'");
5482   }
5483
5484   sq_pushstring(v, "lightning", -1);
5485   sq_newclosure(v, &Thunderstorm_lightning_wrapper, 0);
5486   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5487   if(SQ_FAILED(sq_createslot(v, -3))) {
5488     throw SquirrelError(v, "Couldn't register function 'lightning'");
5489   }
5490
5491   sq_pushstring(v, "flash", -1);
5492   sq_newclosure(v, &Thunderstorm_flash_wrapper, 0);
5493   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5494   if(SQ_FAILED(sq_createslot(v, -3))) {
5495     throw SquirrelError(v, "Couldn't register function 'flash'");
5496   }
5497
5498   sq_pushstring(v, "electrify", -1);
5499   sq_newclosure(v, &Thunderstorm_electrify_wrapper, 0);
5500   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5501   if(SQ_FAILED(sq_createslot(v, -3))) {
5502     throw SquirrelError(v, "Couldn't register function 'electrify'");
5503   }
5504
5505   if(SQ_FAILED(sq_createslot(v, -3))) {
5506     throw SquirrelError(v, "Couldn't register class 'Thunderstorm'");
5507   }
5508
5509   // Register class TileMap
5510   sq_pushstring(v, "TileMap", -1);
5511   if(sq_newclass(v, SQFalse) < 0) {
5512     std::ostringstream msg;
5513     msg << "Couldn't create new class 'TileMap'";
5514     throw SquirrelError(v, msg.str());
5515   }
5516   sq_pushstring(v, "goto_node", -1);
5517   sq_newclosure(v, &TileMap_goto_node_wrapper, 0);
5518   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5519   if(SQ_FAILED(sq_createslot(v, -3))) {
5520     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5521   }
5522
5523   sq_pushstring(v, "start_moving", -1);
5524   sq_newclosure(v, &TileMap_start_moving_wrapper, 0);
5525   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5526   if(SQ_FAILED(sq_createslot(v, -3))) {
5527     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5528   }
5529
5530   sq_pushstring(v, "stop_moving", -1);
5531   sq_newclosure(v, &TileMap_stop_moving_wrapper, 0);
5532   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5533   if(SQ_FAILED(sq_createslot(v, -3))) {
5534     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5535   }
5536
5537   sq_pushstring(v, "fade", -1);
5538   sq_newclosure(v, &TileMap_fade_wrapper, 0);
5539   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tnn");
5540   if(SQ_FAILED(sq_createslot(v, -3))) {
5541     throw SquirrelError(v, "Couldn't register function 'fade'");
5542   }
5543
5544   sq_pushstring(v, "set_alpha", -1);
5545   sq_newclosure(v, &TileMap_set_alpha_wrapper, 0);
5546   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|tn");
5547   if(SQ_FAILED(sq_createslot(v, -3))) {
5548     throw SquirrelError(v, "Couldn't register function 'set_alpha'");
5549   }
5550
5551   sq_pushstring(v, "get_alpha", -1);
5552   sq_newclosure(v, &TileMap_get_alpha_wrapper, 0);
5553   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5554   if(SQ_FAILED(sq_createslot(v, -3))) {
5555     throw SquirrelError(v, "Couldn't register function 'get_alpha'");
5556   }
5557
5558   if(SQ_FAILED(sq_createslot(v, -3))) {
5559     throw SquirrelError(v, "Couldn't register class 'TileMap'");
5560   }
5561
5562   // Register class WillOWisp
5563   sq_pushstring(v, "WillOWisp", -1);
5564   if(sq_newclass(v, SQFalse) < 0) {
5565     std::ostringstream msg;
5566     msg << "Couldn't create new class 'WillOWisp'";
5567     throw SquirrelError(v, msg.str());
5568   }
5569   sq_pushstring(v, "goto_node", -1);
5570   sq_newclosure(v, &WillOWisp_goto_node_wrapper, 0);
5571   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ti");
5572   if(SQ_FAILED(sq_createslot(v, -3))) {
5573     throw SquirrelError(v, "Couldn't register function 'goto_node'");
5574   }
5575
5576   sq_pushstring(v, "set_state", -1);
5577   sq_newclosure(v, &WillOWisp_set_state_wrapper, 0);
5578   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|ts");
5579   if(SQ_FAILED(sq_createslot(v, -3))) {
5580     throw SquirrelError(v, "Couldn't register function 'set_state'");
5581   }
5582
5583   sq_pushstring(v, "start_moving", -1);
5584   sq_newclosure(v, &WillOWisp_start_moving_wrapper, 0);
5585   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5586   if(SQ_FAILED(sq_createslot(v, -3))) {
5587     throw SquirrelError(v, "Couldn't register function 'start_moving'");
5588   }
5589
5590   sq_pushstring(v, "stop_moving", -1);
5591   sq_newclosure(v, &WillOWisp_stop_moving_wrapper, 0);
5592   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5593   if(SQ_FAILED(sq_createslot(v, -3))) {
5594     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
5595   }
5596
5597   if(SQ_FAILED(sq_createslot(v, -3))) {
5598     throw SquirrelError(v, "Couldn't register class 'WillOWisp'");
5599   }
5600
5601   // Register class Wind
5602   sq_pushstring(v, "Wind", -1);
5603   if(sq_newclass(v, SQFalse) < 0) {
5604     std::ostringstream msg;
5605     msg << "Couldn't create new class 'Wind'";
5606     throw SquirrelError(v, msg.str());
5607   }
5608   sq_pushstring(v, "start", -1);
5609   sq_newclosure(v, &Wind_start_wrapper, 0);
5610   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5611   if(SQ_FAILED(sq_createslot(v, -3))) {
5612     throw SquirrelError(v, "Couldn't register function 'start'");
5613   }
5614
5615   sq_pushstring(v, "stop", -1);
5616   sq_newclosure(v, &Wind_stop_wrapper, 0);
5617   sq_setparamscheck(v, SQ_MATCHTYPEMASKSTRING, "x|t");
5618   if(SQ_FAILED(sq_createslot(v, -3))) {
5619     throw SquirrelError(v, "Couldn't register function 'stop'");
5620   }
5621
5622   if(SQ_FAILED(sq_createslot(v, -3))) {
5623     throw SquirrelError(v, "Couldn't register class 'Wind'");
5624   }
5625
5626 }
5627
5628 } // namespace scripting
5629
5630 /* EOF */