[Supertux-Commit] r5438 - trunk/supertux/src/object

matzeb at millhouse.dreamhost.com matzeb at millhouse.dreamhost.com
Thu May 8 11:59:41 PDT 2008


Author: matzeb
Date: 2008-05-08 11:59:40 -0700 (Thu, 08 May 2008)
New Revision: 5438

Modified:
   trunk/supertux/src/object/camera.cpp
Log:
set new camera defaults, make it work without camera.cfg

Modified: trunk/supertux/src/object/camera.cpp
===================================================================
--- trunk/supertux/src/object/camera.cpp	2008-05-08 18:57:31 UTC (rev 5437)
+++ trunk/supertux/src/object/camera.cpp	2008-05-08 18:59:40 UTC (rev 5438)
@@ -77,21 +77,21 @@
   float dynamic_speed_sm;
 
   CameraConfig() {
-    xmode = 1;
-    ymode = 1;
+    xmode = 4;
+    ymode = 3;
     target_x = .5f;
-    target_y = 2.f/3.f;
-    max_speed_y = 140;
-    max_speed_x = 130;
-    clamp_x = 1.f/6.f;
-    clamp_y = 1.f/6.f;
+    target_y = .5f;
+    max_speed_y = 100;
+    max_speed_x = 100;
+    clamp_x = 0.1666f;
+    clamp_y = 0.3f;
     kirby_rectsize_x = 0.2f;
     kirby_rectsize_y = 0.34f;
-    edge_x = 1.f/3.f;
-    sensitive_x = 1.f/4.f;
+    edge_x = 0.4f;
+    sensitive_x = -1;
     dynamic_max_speed_x = 1.0;
     dirchange_time = 0.2f;
-    dynamic_speed_sm = 1.0f;
+    dynamic_speed_sm = 0.8f;
   }
 
   void load(const std::string& filename)
@@ -262,7 +262,12 @@
 void
 Camera::reload_config()
 {
-  config->load("camera.cfg");
+  try {
+    config->load("camera.cfg");
+  } catch(std::exception &e) {
+    log_debug << "Couldn't load camera.cfg, using defaults ("
+      << e.what() << ")";
+  }
 }
 
 float clamp(float val, float min, float max)




More information about the Supertux-Commit mailing list