feuerkraft-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Feuerkraft-CVS] rev 307 - trunk/src


From: Ingo Ruhnke
Subject: [Feuerkraft-CVS] rev 307 - trunk/src
Date: Sun, 07 Dec 2003 21:14:13 +0100

Author: grumbel
Date: 2003-12-07 21:14:13 +0100 (Sun, 07 Dec 2003)
New Revision: 307

Modified:
   trunk/src/feuerkraft_options.cxx
   trunk/src/feuerkraft_options.hxx
   trunk/src/keyboard_manager.cxx
   trunk/src/rocket.cxx
   trunk/src/rocket.hxx
Log:
reduced the number of particles a bit
- fixed keyboard stuff a bit more

Modified: trunk/src/feuerkraft_options.cxx
===================================================================
--- trunk/src/feuerkraft_options.cxx    2003-12-07 19:54:13 UTC (rev 306)
+++ trunk/src/feuerkraft_options.cxx    2003-12-07 20:14:13 UTC (rev 307)
@@ -24,6 +24,7 @@
   // Set defaults for all options
   screen_width  = 800;
   screen_height = 600;
+  joystick      = -1;
 
   // FIXME: This needs to be more flexible of course
   config_file = "/home/ingo/.feuerkraft/config";

Modified: trunk/src/feuerkraft_options.hxx
===================================================================
--- trunk/src/feuerkraft_options.hxx    2003-12-07 19:54:13 UTC (rev 306)
+++ trunk/src/feuerkraft_options.hxx    2003-12-07 20:14:13 UTC (rev 307)
@@ -33,6 +33,7 @@
   int screen_width;
   int screen_height;
   std::string config_file;
+  int joystick;
   
 public:
   FeuerkraftOptions ();

Modified: trunk/src/keyboard_manager.cxx
===================================================================
--- trunk/src/keyboard_manager.cxx      2003-12-07 19:54:13 UTC (rev 306)
+++ trunk/src/keyboard_manager.cxx      2003-12-07 20:14:13 UTC (rev 307)
@@ -32,10 +32,12 @@
   slots.push_back(CL_Mouse::sig_key_down().connect(this, 
&KeyboardManager::button_down));
   slots.push_back(CL_Mouse::sig_key_up().connect(this, 
&KeyboardManager::button_up));
 
-  CL_InputDevice joy = CL_Joystick::get_device(1);
-
-  slots.push_back(joy.sig_key_up().connect(this, &KeyboardManager::button_up));
-  slots.push_back(joy.sig_key_down().connect(this, 
&KeyboardManager::button_down));
+  for (int i = 0; i < CL_Joystick::get_device_count(); ++i)
+    {
+      CL_InputDevice joy = CL_Joystick::get_device(i);
+      slots.push_back(joy.sig_key_up().connect(this, 
&KeyboardManager::button_up));
+      slots.push_back(joy.sig_key_down().connect(this, 
&KeyboardManager::button_down));
+    }
 }
 
 KeyboardManager::~KeyboardManager()

Modified: trunk/src/rocket.cxx
===================================================================
--- trunk/src/rocket.cxx        2003-12-07 19:54:13 UTC (rev 306)
+++ trunk/src/rocket.cxx        2003-12-07 20:14:13 UTC (rev 307)
@@ -32,6 +32,7 @@
     max_velocity(50.0f),
     life_time(0)
 {
+  release_count = 0;
   sprite = resources->get_sprite("feuerkraft/rocket");
   smoke  = resources->get_sprite("feuerkraft/rocket_smoke");
 }
@@ -57,7 +58,15 @@
 
   CollisionManager::current()->add_point(get_id(), pos.x, pos.y);
 
-  GameWorld::current()->add(new RocketSmokeParticle(pos));
+  release_count += delta;
+  if (release_count > 0.03f)
+    GameWorld::current()->add(new RocketSmokeParticle(pos));
+
+  while (release_count > 0.03f)
+    {
+      release_count -= 0.03f;
+    }
+
   life_time += delta;
   if (life_time > 2.0f)
     {

Modified: trunk/src/rocket.hxx
===================================================================
--- trunk/src/rocket.hxx        2003-12-07 19:54:13 UTC (rev 306)
+++ trunk/src/rocket.hxx        2003-12-07 20:14:13 UTC (rev 307)
@@ -34,6 +34,7 @@
   float velocity;
   float max_velocity;
   float life_time;
+  float release_count;
 public:
   Rocket(const FloatVector2d& pos, float orientation);
   ~Rocket();





reply via email to

[Prev in Thread] Current Thread [Next in Thread]