Fix another small logic error
[supertux.git] / src / scripting / wrapper.cpp
index c4a9e61..f50fa6c 100644 (file)
@@ -485,6 +485,35 @@ static SQInteger Level_toggle_pause_wrapper(HSQUIRRELVM vm)
 
 }
 
+static SQInteger Level_edit_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'edit' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::Level* _this = reinterpret_cast<Scripting::Level*> (data);
+  SQBool arg0;
+  if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not a bool"));
+    return SQ_ERROR;
+  }
+
+  try {
+    _this->edit(arg0 == SQTrue);
+
+    return 0;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'edit'"));
+    return SQ_ERROR;
+  }
+
+}
+
 static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
 {
   Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
@@ -1062,6 +1091,144 @@ static SQInteger Text_set_centered_wrapper(HSQUIRRELVM vm)
 
 }
 
+static SQInteger Text_set_pos_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'set_pos' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+  SQFloat arg0;
+  if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not a float"));
+    return SQ_ERROR;
+  }
+  SQFloat arg1;
+  if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
+    sq_throwerror(vm, _SC("Argument 2 not a float"));
+    return SQ_ERROR;
+  }
+
+  try {
+    _this->set_pos(static_cast<float> (arg0), static_cast<float> (arg1));
+
+    return 0;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_pos'"));
+    return SQ_ERROR;
+  }
+
+}
+
+static SQInteger Text_get_pos_x_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+
+  try {
+    float return_value = _this->get_pos_x();
+
+    sq_pushfloat(vm, return_value);
+    return 1;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_x'"));
+    return SQ_ERROR;
+  }
+
+}
+
+static SQInteger Text_get_pos_y_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+
+  try {
+    float return_value = _this->get_pos_y();
+
+    sq_pushfloat(vm, return_value);
+    return 1;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_pos_y'"));
+    return SQ_ERROR;
+  }
+
+}
+
+static SQInteger Text_set_anchor_point_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+  SQInteger arg0;
+  if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not an integer"));
+    return SQ_ERROR;
+  }
+
+  try {
+    _this->set_anchor_point(static_cast<int> (arg0));
+
+    return 0;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_anchor_point'"));
+    return SQ_ERROR;
+  }
+
+}
+
+static SQInteger Text_get_anchor_point_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+
+  try {
+    int return_value = _this->get_anchor_point();
+
+    sq_pushinteger(vm, return_value);
+    return 1;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_anchor_point'"));
+    return SQ_ERROR;
+  }
+
+}
+
 static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
 {
   Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
@@ -1520,6 +1687,69 @@ static SQInteger Player_trigger_sequence_wrapper(HSQUIRRELVM vm)
 
 }
 
+static SQInteger Player_use_scripting_controller_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'use_scripting_controller' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+  SQBool arg0;
+  if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not a bool"));
+    return SQ_ERROR;
+  }
+
+  try {
+    _this->use_scripting_controller(arg0 == SQTrue);
+
+    return 0;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'use_scripting_controller'"));
+    return SQ_ERROR;
+  }
+
+}
+
+static SQInteger Player_do_scripting_controller_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'do_scripting_controller' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+  const SQChar* arg0;
+  if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not a string"));
+    return SQ_ERROR;
+  }
+  SQBool arg1;
+  if(SQ_FAILED(sq_getbool(vm, 3, &arg1))) {
+    sq_throwerror(vm, _SC("Argument 2 not a bool"));
+    return SQ_ERROR;
+  }
+
+  try {
+    _this->do_scripting_controller(arg0, arg1 == SQTrue);
+
+    return 0;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'do_scripting_controller'"));
+    return SQ_ERROR;
+  }
+
+}
+
 static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
 {
   Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
@@ -2439,39 +2669,262 @@ static SQInteger TileMap_stop_moving_wrapper(HSQUIRRELVM vm)
 
 }
 
+static SQInteger TileMap_fade_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'fade' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
+  SQFloat arg0;
+  if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not a float"));
+    return SQ_ERROR;
+  }
+  SQFloat arg1;
+  if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
+    sq_throwerror(vm, _SC("Argument 2 not a float"));
+    return SQ_ERROR;
+  }
+
+  try {
+    _this->fade(static_cast<float> (arg0), static_cast<float> (arg1));
+
+    return 0;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'fade'"));
+    return SQ_ERROR;
+  }
+
+}
+
+static SQInteger TileMap_set_alpha_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'set_alpha' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
+  SQFloat arg0;
+  if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not a float"));
+    return SQ_ERROR;
+  }
+
+  try {
+    _this->set_alpha(static_cast<float> (arg0));
+
+    return 0;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_alpha'"));
+    return SQ_ERROR;
+  }
+
+}
+
+static SQInteger TileMap_get_alpha_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'get_alpha' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
+
+  try {
+    float return_value = _this->get_alpha();
+
+    sq_pushfloat(vm, return_value);
+    return 1;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_alpha'"));
+    return SQ_ERROR;
+  }
+
+}
+
 static SQInteger SSector_release_hook(SQUserPointer ptr, SQInteger )
 {
-  Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (ptr);
+  Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (ptr);
+  delete _this;
+  return 0;
+}
+
+static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'set_ambient_light' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
+  SQFloat arg0;
+  if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not a float"));
+    return SQ_ERROR;
+  }
+  SQFloat arg1;
+  if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
+    sq_throwerror(vm, _SC("Argument 2 not a float"));
+    return SQ_ERROR;
+  }
+  SQFloat arg2;
+  if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
+    sq_throwerror(vm, _SC("Argument 3 not a float"));
+    return SQ_ERROR;
+  }
+
+  try {
+    _this->set_ambient_light(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
+
+    return 0;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ambient_light'"));
+    return SQ_ERROR;
+  }
+
+}
+
+static SQInteger SSector_get_ambient_red_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'get_ambient_red' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
+
+  try {
+    float return_value = _this->get_ambient_red();
+
+    sq_pushfloat(vm, return_value);
+    return 1;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_red'"));
+    return SQ_ERROR;
+  }
+
+}
+
+static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'get_ambient_green' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
+
+  try {
+    float return_value = _this->get_ambient_green();
+
+    sq_pushfloat(vm, return_value);
+    return 1;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_green'"));
+    return SQ_ERROR;
+  }
+
+}
+
+static SQInteger SSector_get_ambient_blue_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'get_ambient_blue' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
+
+  try {
+    float return_value = _this->get_ambient_blue();
+
+    sq_pushfloat(vm, return_value);
+    return 1;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_blue'"));
+    return SQ_ERROR;
+  }
+
+}
+
+static SQInteger SSector_set_gravity_wrapper(HSQUIRRELVM vm)
+{
+  SQUserPointer data;
+  if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
+    sq_throwerror(vm, _SC("'set_gravity' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
+  SQFloat arg0;
+  if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not a float"));
+    return SQ_ERROR;
+  }
+
+  try {
+    _this->set_gravity(static_cast<float> (arg0));
+
+    return 0;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_gravity'"));
+    return SQ_ERROR;
+  }
+
+}
+
+static SQInteger LevelTime_release_hook(SQUserPointer ptr, SQInteger )
+{
+  Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (ptr);
   delete _this;
   return 0;
 }
 
-static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm)
+static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm)
 {
   SQUserPointer data;
   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
-    sq_throwerror(vm, _SC("'set_ambient_light' called without instance"));
-    return SQ_ERROR;
-  }
-  Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
-  SQFloat arg0;
-  if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
-    sq_throwerror(vm, _SC("Argument 1 not a float"));
-    return SQ_ERROR;
-  }
-  SQFloat arg1;
-  if(SQ_FAILED(sq_getfloat(vm, 3, &arg1))) {
-    sq_throwerror(vm, _SC("Argument 2 not a float"));
-    return SQ_ERROR;
-  }
-  SQFloat arg2;
-  if(SQ_FAILED(sq_getfloat(vm, 4, &arg2))) {
-    sq_throwerror(vm, _SC("Argument 3 not a float"));
+    sq_throwerror(vm, _SC("'start' called without instance"));
     return SQ_ERROR;
   }
+  Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
 
   try {
-    _this->set_ambient_light(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
+    _this->start();
 
     return 0;
 
@@ -2479,48 +2932,47 @@ static SQInteger SSector_set_ambient_light_wrapper(HSQUIRRELVM vm)
     sq_throwerror(vm, e.what());
     return SQ_ERROR;
   } catch(...) {
-    sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_ambient_light'"));
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
     return SQ_ERROR;
   }
 
 }
 
-static SQInteger SSector_get_ambient_red_wrapper(HSQUIRRELVM vm)
+static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm)
 {
   SQUserPointer data;
   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
-    sq_throwerror(vm, _SC("'get_ambient_red' called without instance"));
+    sq_throwerror(vm, _SC("'stop' called without instance"));
     return SQ_ERROR;
   }
-  Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
+  Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
 
   try {
-    float return_value = _this->get_ambient_red();
+    _this->stop();
 
-    sq_pushfloat(vm, return_value);
-    return 1;
+    return 0;
 
   } catch(std::exception& e) {
     sq_throwerror(vm, e.what());
     return SQ_ERROR;
   } catch(...) {
-    sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_red'"));
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
     return SQ_ERROR;
   }
 
 }
 
-static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm)
+static SQInteger LevelTime_get_time_wrapper(HSQUIRRELVM vm)
 {
   SQUserPointer data;
   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
-    sq_throwerror(vm, _SC("'get_ambient_green' called without instance"));
+    sq_throwerror(vm, _SC("'get_time' called without instance"));
     return SQ_ERROR;
   }
-  Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
+  Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
 
   try {
-    float return_value = _this->get_ambient_green();
+    float return_value = _this->get_time();
 
     sq_pushfloat(vm, return_value);
     return 1;
@@ -2529,55 +2981,64 @@ static SQInteger SSector_get_ambient_green_wrapper(HSQUIRRELVM vm)
     sq_throwerror(vm, e.what());
     return SQ_ERROR;
   } catch(...) {
-    sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_green'"));
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_time'"));
     return SQ_ERROR;
   }
 
 }
 
-static SQInteger SSector_get_ambient_blue_wrapper(HSQUIRRELVM vm)
+static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm)
 {
   SQUserPointer data;
   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
-    sq_throwerror(vm, _SC("'get_ambient_blue' called without instance"));
+    sq_throwerror(vm, _SC("'set_time' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
+  SQFloat arg0;
+  if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not a float"));
     return SQ_ERROR;
   }
-  Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
 
   try {
-    float return_value = _this->get_ambient_blue();
+    _this->set_time(static_cast<float> (arg0));
 
-    sq_pushfloat(vm, return_value);
-    return 1;
+    return 0;
 
   } catch(std::exception& e) {
     sq_throwerror(vm, e.what());
     return SQ_ERROR;
   } catch(...) {
-    sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_ambient_blue'"));
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_time'"));
     return SQ_ERROR;
   }
 
 }
 
-static SQInteger LevelTime_release_hook(SQUserPointer ptr, SQInteger )
+static SQInteger WillOWisp_release_hook(SQUserPointer ptr, SQInteger )
 {
-  Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (ptr);
+  Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (ptr);
   delete _this;
   return 0;
 }
 
-static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm)
+static SQInteger WillOWisp_goto_node_wrapper(HSQUIRRELVM vm)
 {
   SQUserPointer data;
   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
-    sq_throwerror(vm, _SC("'start' called without instance"));
+    sq_throwerror(vm, _SC("'goto_node' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
+  SQInteger arg0;
+  if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not an integer"));
     return SQ_ERROR;
   }
-  Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
 
   try {
-    _this->start();
+    _this->goto_node(static_cast<int> (arg0));
 
     return 0;
 
@@ -2585,23 +3046,28 @@ static SQInteger LevelTime_start_wrapper(HSQUIRRELVM vm)
     sq_throwerror(vm, e.what());
     return SQ_ERROR;
   } catch(...) {
-    sq_throwerror(vm, _SC("Unexpected exception while executing function 'start'"));
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'goto_node'"));
     return SQ_ERROR;
   }
 
 }
 
-static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm)
+static SQInteger WillOWisp_set_state_wrapper(HSQUIRRELVM vm)
 {
   SQUserPointer data;
   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
-    sq_throwerror(vm, _SC("'stop' called without instance"));
+    sq_throwerror(vm, _SC("'set_state' called without instance"));
+    return SQ_ERROR;
+  }
+  Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
+  const SQChar* arg0;
+  if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not a string"));
     return SQ_ERROR;
   }
-  Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
 
   try {
-    _this->stop();
+    _this->set_state(arg0);
 
     return 0;
 
@@ -2609,53 +3075,47 @@ static SQInteger LevelTime_stop_wrapper(HSQUIRRELVM vm)
     sq_throwerror(vm, e.what());
     return SQ_ERROR;
   } catch(...) {
-    sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop'"));
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_state'"));
     return SQ_ERROR;
   }
 
 }
 
-static SQInteger LevelTime_get_time_wrapper(HSQUIRRELVM vm)
+static SQInteger WillOWisp_start_moving_wrapper(HSQUIRRELVM vm)
 {
   SQUserPointer data;
   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
-    sq_throwerror(vm, _SC("'get_time' called without instance"));
+    sq_throwerror(vm, _SC("'start_moving' called without instance"));
     return SQ_ERROR;
   }
-  Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
+  Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
 
   try {
-    float return_value = _this->get_time();
+    _this->start_moving();
 
-    sq_pushfloat(vm, return_value);
-    return 1;
+    return 0;
 
   } catch(std::exception& e) {
     sq_throwerror(vm, e.what());
     return SQ_ERROR;
   } catch(...) {
-    sq_throwerror(vm, _SC("Unexpected exception while executing function 'get_time'"));
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'start_moving'"));
     return SQ_ERROR;
   }
 
 }
 
-static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm)
+static SQInteger WillOWisp_stop_moving_wrapper(HSQUIRRELVM vm)
 {
   SQUserPointer data;
   if(SQ_FAILED(sq_getinstanceup(vm, 1, &data, 0))) {
-    sq_throwerror(vm, _SC("'set_time' called without instance"));
-    return SQ_ERROR;
-  }
-  Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
-  SQFloat arg0;
-  if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
-    sq_throwerror(vm, _SC("Argument 1 not a float"));
+    sq_throwerror(vm, _SC("'stop_moving' called without instance"));
     return SQ_ERROR;
   }
+  Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
 
   try {
-    _this->set_time(static_cast<float> (arg0));
+    _this->stop_moving();
 
     return 0;
 
@@ -2663,7 +3123,7 @@ static SQInteger LevelTime_set_time_wrapper(HSQUIRRELVM vm)
     sq_throwerror(vm, e.what());
     return SQ_ERROR;
   } catch(...) {
-    sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_time'"));
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'stop_moving'"));
     return SQ_ERROR;
   }
 
@@ -3105,6 +3565,29 @@ static SQInteger play_sound_wrapper(HSQUIRRELVM vm)
 
 }
 
+static SQInteger set_game_speed_wrapper(HSQUIRRELVM vm)
+{
+  SQFloat arg0;
+  if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not a float"));
+    return SQ_ERROR;
+  }
+
+  try {
+    Scripting::set_game_speed(static_cast<float> (arg0));
+
+    return 0;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_game_speed'"));
+    return SQ_ERROR;
+  }
+
+}
+
 static SQInteger grease_wrapper(HSQUIRRELVM vm)
 {
   (void) vm;
@@ -3257,6 +3740,29 @@ static SQInteger camera_wrapper(HSQUIRRELVM vm)
 
 }
 
+static SQInteger set_gamma_wrapper(HSQUIRRELVM vm)
+{
+  SQFloat arg0;
+  if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
+    sq_throwerror(vm, _SC("Argument 1 not a float"));
+    return SQ_ERROR;
+  }
+
+  try {
+    Scripting::set_gamma(static_cast<float> (arg0));
+
+    return 0;
+
+  } catch(std::exception& e) {
+    sq_throwerror(vm, e.what());
+    return SQ_ERROR;
+  } catch(...) {
+    sq_throwerror(vm, _SC("Unexpected exception while executing function 'set_gamma'"));
+    return SQ_ERROR;
+  }
+
+}
+
 static SQInteger quit_wrapper(HSQUIRRELVM vm)
 {
   (void) vm;
@@ -3686,6 +4192,32 @@ void create_squirrel_instance(HSQUIRRELVM v, Scripting::LevelTime* object, bool
   sq_remove(v, -2); // remove root table
 }
 
+void create_squirrel_instance(HSQUIRRELVM v, Scripting::WillOWisp* object, bool setup_releasehook)
+{
+  using namespace Wrapper;
+
+  sq_pushroottable(v);
+  sq_pushstring(v, "WillOWisp", -1);
+  if(SQ_FAILED(sq_get(v, -2))) {
+    std::ostringstream msg;
+    msg << "Couldn't resolved squirrel type 'WillOWisp'";
+    throw SquirrelError(v, msg.str());
+  }
+
+  if(SQ_FAILED(sq_createinstance(v, -1)) || SQ_FAILED(sq_setinstanceup(v, -1, object))) {
+    std::ostringstream msg;
+    msg << "Couldn't setup squirrel instance for object of type 'WillOWisp'";
+    throw SquirrelError(v, msg.str());
+  }
+  sq_remove(v, -2); // remove object name
+
+  if(setup_releasehook) {
+    sq_setreleasehook(v, -1, WillOWisp_release_hook);
+  }
+
+  sq_remove(v, -2); // remove root table
+}
+
 void register_supertux_wrapper(HSQUIRRELVM v)
 {
   using namespace Wrapper;
@@ -3870,6 +4402,12 @@ void register_supertux_wrapper(HSQUIRRELVM v)
     throw SquirrelError(v, "Couldn't register function 'play_sound'");
   }
 
+  sq_pushstring(v, "set_game_speed", -1);
+  sq_newclosure(v, &set_game_speed_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'set_game_speed'");
+  }
+
   sq_pushstring(v, "grease", -1);
   sq_newclosure(v, &grease_wrapper, 0);
   if(SQ_FAILED(sq_createslot(v, -3))) {
@@ -3918,6 +4456,12 @@ void register_supertux_wrapper(HSQUIRRELVM v)
     throw SquirrelError(v, "Couldn't register function 'camera'");
   }
 
+  sq_pushstring(v, "set_gamma", -1);
+  sq_newclosure(v, &set_gamma_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'set_gamma'");
+  }
+
   sq_pushstring(v, "quit", -1);
   sq_newclosure(v, &quit_wrapper, 0);
   if(SQ_FAILED(sq_createslot(v, -3))) {
@@ -4049,6 +4593,12 @@ void register_supertux_wrapper(HSQUIRRELVM v)
     throw SquirrelError(v, "Couldn't register function 'toggle_pause'");
   }
 
+  sq_pushstring(v, "edit", -1);
+  sq_newclosure(v, &Level_edit_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'edit'");
+  }
+
   if(SQ_FAILED(sq_createslot(v, -3))) {
     throw SquirrelError(v, "Couldn't register class 'Level'");
   }
@@ -4191,6 +4741,36 @@ void register_supertux_wrapper(HSQUIRRELVM v)
     throw SquirrelError(v, "Couldn't register function 'set_centered'");
   }
 
+  sq_pushstring(v, "set_pos", -1);
+  sq_newclosure(v, &Text_set_pos_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'set_pos'");
+  }
+
+  sq_pushstring(v, "get_pos_x", -1);
+  sq_newclosure(v, &Text_get_pos_x_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'get_pos_x'");
+  }
+
+  sq_pushstring(v, "get_pos_y", -1);
+  sq_newclosure(v, &Text_get_pos_y_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'get_pos_y'");
+  }
+
+  sq_pushstring(v, "set_anchor_point", -1);
+  sq_newclosure(v, &Text_set_anchor_point_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'set_anchor_point'");
+  }
+
+  sq_pushstring(v, "get_anchor_point", -1);
+  sq_newclosure(v, &Text_get_anchor_point_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'get_anchor_point'");
+  }
+
   if(SQ_FAILED(sq_createslot(v, -3))) {
     throw SquirrelError(v, "Couldn't register class 'Text'");
   }
@@ -4304,6 +4884,18 @@ void register_supertux_wrapper(HSQUIRRELVM v)
     throw SquirrelError(v, "Couldn't register function 'trigger_sequence'");
   }
 
+  sq_pushstring(v, "use_scripting_controller", -1);
+  sq_newclosure(v, &Player_use_scripting_controller_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'use_scripting_controller'");
+  }
+
+  sq_pushstring(v, "do_scripting_controller", -1);
+  sq_newclosure(v, &Player_do_scripting_controller_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'do_scripting_controller'");
+  }
+
   if(SQ_FAILED(sq_createslot(v, -3))) {
     throw SquirrelError(v, "Couldn't register class 'Player'");
   }
@@ -4579,6 +5171,24 @@ void register_supertux_wrapper(HSQUIRRELVM v)
     throw SquirrelError(v, "Couldn't register function 'stop_moving'");
   }
 
+  sq_pushstring(v, "fade", -1);
+  sq_newclosure(v, &TileMap_fade_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'fade'");
+  }
+
+  sq_pushstring(v, "set_alpha", -1);
+  sq_newclosure(v, &TileMap_set_alpha_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'set_alpha'");
+  }
+
+  sq_pushstring(v, "get_alpha", -1);
+  sq_newclosure(v, &TileMap_get_alpha_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'get_alpha'");
+  }
+
   if(SQ_FAILED(sq_createslot(v, -3))) {
     throw SquirrelError(v, "Couldn't register class 'TileMap'");
   }
@@ -4614,6 +5224,12 @@ void register_supertux_wrapper(HSQUIRRELVM v)
     throw SquirrelError(v, "Couldn't register function 'get_ambient_blue'");
   }
 
+  sq_pushstring(v, "set_gravity", -1);
+  sq_newclosure(v, &SSector_set_gravity_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'set_gravity'");
+  }
+
   if(SQ_FAILED(sq_createslot(v, -3))) {
     throw SquirrelError(v, "Couldn't register class 'SSector'");
   }
@@ -4653,6 +5269,41 @@ void register_supertux_wrapper(HSQUIRRELVM v)
     throw SquirrelError(v, "Couldn't register class 'LevelTime'");
   }
 
+  // Register class WillOWisp
+  sq_pushstring(v, "WillOWisp", -1);
+  if(sq_newclass(v, SQFalse) < 0) {
+    std::ostringstream msg;
+    msg << "Couldn't create new class 'WillOWisp'";
+    throw SquirrelError(v, msg.str());
+  }
+  sq_pushstring(v, "goto_node", -1);
+  sq_newclosure(v, &WillOWisp_goto_node_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'goto_node'");
+  }
+
+  sq_pushstring(v, "set_state", -1);
+  sq_newclosure(v, &WillOWisp_set_state_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'set_state'");
+  }
+
+  sq_pushstring(v, "start_moving", -1);
+  sq_newclosure(v, &WillOWisp_start_moving_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'start_moving'");
+  }
+
+  sq_pushstring(v, "stop_moving", -1);
+  sq_newclosure(v, &WillOWisp_stop_moving_wrapper, 0);
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register function 'stop_moving'");
+  }
+
+  if(SQ_FAILED(sq_createslot(v, -3))) {
+    throw SquirrelError(v, "Couldn't register class 'WillOWisp'");
+  }
+
 }
 
 } // end of namespace Scripting