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