Big CMakeLists update.
[supertux.git] / src / scripting / functions.cpp
index c2f8c98..95d8607 100644 (file)
@@ -51,6 +51,8 @@
 #include "squirrel_util.hpp"
 #include "time_scheduler.hpp"
 
+extern float game_speed;
+
 namespace Scripting
 {
 
@@ -96,6 +98,11 @@ void shrink_screen(float dest_x, float dest_y, float seconds)
   main_loop->set_screen_fade(new ShrinkFade(Vector(dest_x, dest_y), seconds));
 }
 
+void abort_screenfade()
+{
+  main_loop->set_screen_fade(NULL);
+}
+
 std::string translate(const std::string& text)
 {
   return dictionary_manager.get_dictionary().translate(text);
@@ -187,13 +194,13 @@ bool validate_sector_player()
   if (Sector::current() == 0)
   {
     log_info << "No current sector." << std::endl;
-       return false;
+    return false;
   }
 
   if (Sector::current()->player == 0)
   {
     log_info << "No player." << std::endl;
-       return false;
+    return false;
   }
   return true;
 }
@@ -270,6 +277,10 @@ void camera()
   log_info << "Camera is at " << Sector::current()->camera->get_translation().x << "," << Sector::current()->camera->get_translation().y << std::endl;
 }
 
+void set_gamma(float gamma) {
+  SDL_SetGamma(gamma, gamma, gamma);
+}
+
 void quit()
 {
   main_loop->quit();
@@ -280,4 +291,9 @@ int rand()
   return systemRandom.rand();
 }
 
+void set_game_speed(float speed)
+{
+  ::game_speed = speed;
+}
+
 }