feuerkraft-cvs
[Top][All Lists]
Advanced

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

[Feuerkraft-CVS] rev 327 - in trunk/src: . input


From: Ingo Ruhnke
Subject: [Feuerkraft-CVS] rev 327 - in trunk/src: . input
Date: Sat, 10 Jan 2004 03:02:47 +0100

Author: grumbel
Date: 2004-01-10 03:02:47 +0100 (Sat, 10 Jan 2004)
New Revision: 327

Modified:
   trunk/src/feuerkraft.cxx
   trunk/src/feuerkraft_error.hxx
   trunk/src/input/button_factory.cxx
Log:
- little bug fixes

Modified: trunk/src/feuerkraft.cxx
===================================================================
--- trunk/src/feuerkraft.cxx    2003-12-12 23:12:22 UTC (rev 326)
+++ trunk/src/feuerkraft.cxx    2004-01-10 02:02:47 UTC (rev 327)
@@ -27,6 +27,7 @@
 #include <libguile.h>
 #include <time.h>
 
+#include "feuerkraft_error.hxx"
 #include "fonts.hxx"
 #include "input/input_manager.hxx"
 #include "game_session_manager.hxx"
@@ -169,10 +170,18 @@
     {
       std::cout << "CL_Error: " << err.message.c_str() << std::endl;
     }
+  catch (FeuerkraftError& err)
+    {
+      std::cout << "FeuerkraftError: " << err.what() << std::endl;
+    }
   catch (std::exception& err)
     {
       std::cout << "Error: " << err.what() << std::endl;
     }
+  catch (...)
+    {
+      std::cout << "Bug: Unknown exception catched, don't know what to do" << 
std::endl;
+    }
 
   // Display console close message and wait for a key
   console.display_close_message();

Modified: trunk/src/feuerkraft_error.hxx
===================================================================
--- trunk/src/feuerkraft_error.hxx      2003-12-12 23:12:22 UTC (rev 326)
+++ trunk/src/feuerkraft_error.hxx      2004-01-10 02:02:47 UTC (rev 327)
@@ -31,7 +31,7 @@
   FeuerkraftError(const std::string& message) 
     : message(message) {}
 
-  const char* what() const throw();
+  const char* what() const throw() { return message.c_str(); }
 };
 
 #endif

Modified: trunk/src/input/button_factory.cxx
===================================================================
--- trunk/src/input/button_factory.cxx  2003-12-12 23:12:22 UTC (rev 326)
+++ trunk/src/input/button_factory.cxx  2004-01-10 02:02:47 UTC (rev 327)
@@ -20,6 +20,7 @@
 #include <ClanLib/Display/joystick.h>
 #include <ClanLib/Display/keyboard.h>
 #include "../guile.hxx"
+#include "../string_converter.hxx"
 #include "../feuerkraft_error.hxx"
 #include "input_button.hxx"
 #include "input_button_input_device.hxx"
@@ -57,8 +58,8 @@
     return new InputButtonInputDevice(CL_Joystick::get_device(device_num), 
button_num);
   else
     {
-      throw FeuerkraftError("Error: ButtonFactory::create_joystick_button: "
-                            + Guile::scm2string(lst));
+      throw FeuerkraftError("Error: ButtonFactory::create_joystick_button: 
device out of range"
+                            + to_string(device_num) + " " + 
Guile::scm2string(lst));
     }
 }
 





reply via email to

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