pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/editor editor.cxx,1.21,1.22 editor.hx


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/editor editor.cxx,1.21,1.22 editor.hxx,1.10,1.11 editor_event.cxx,1.26,1.27
Date: 4 Aug 2002 20:27:24 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/editor
In directory dark:/tmp/cvs-serv14135/editor

Modified Files:
        editor.cxx editor.hxx editor_event.cxx 
Log Message:
- fixed event bug in the editor


Index: editor.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor.cxx,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- editor.cxx  4 Aug 2002 19:57:16 -0000       1.21
+++ editor.cxx  4 Aug 2002 20:27:22 -0000       1.22
@@ -114,7 +114,6 @@
 Editor::on_startup ()
 {
   std::cout << "Editor::on_startup ()" << std::endl;
-  quit = false;
 
   Display::set_cursor(CL_MouseCursorProvider::load("cursors/cursor", 
PingusResource::get("core")));
   Display::show_cursor();

Index: editor.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor.hxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- editor.hxx  4 Aug 2002 19:57:16 -0000       1.10
+++ editor.hxx  4 Aug 2002 20:27:22 -0000       1.11
@@ -63,7 +63,6 @@
   int event_handler_ref_counter;
 
   CL_Font* font;
-  bool quit;
 
   int move_x;
   int move_y;

Index: editor_event.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor_event.cxx,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- editor_event.cxx    4 Aug 2002 19:57:16 -0000       1.26
+++ editor_event.cxx    4 Aug 2002 20:27:22 -0000       1.27
@@ -78,6 +78,9 @@
 void
 EditorEvent::enable()
 {
+  assert (is_enabled == false);
+
+  std::cout << "EditorEvent::enable()" << std::endl;
   is_enabled = true;
   editor->get_gui_manager ()->enable_input ();
 }
@@ -85,6 +88,9 @@
 void
 EditorEvent::disable()
 {
+  assert (is_enabled == true);
+
+  std::cout << "EditorEvent::disable()" << std::endl;
   is_enabled = false;
   editor->get_gui_manager ()->disable_input ();
 }
@@ -92,6 +98,8 @@
 void
 EditorEvent::on_button_press(CL_InputDevice *device, const CL_Key& key)
 {
+  std::cout << "EditorEvent::on_button_press: " << is_enabled << std::endl;
+
   if (!accept_input ())
     return;
 
@@ -355,6 +363,8 @@
 void
 EditorEvent::on_button_release(CL_InputDevice *device, const CL_Key &key)
 {
+  std::cout << "EditorEvent::on_button_release: " << is_enabled << std::endl;
+
   if (!accept_input ())
     return;
 
@@ -498,25 +508,21 @@
 void
 EditorEvent::editor_start_current_level()
 {
-  disable();
-
   loading_screen.draw();
 
-  try {
-    std::string levelfile = editor->save_tmp_level();
-    ScreenManager::instance()->push_screen(new PingusGameSession (levelfile), 
true);
-  }
-  
-  catch(PingusError err) {
-    std::cout << "Editor: Error caught from Pingus: " << err.get_message () << 
std::endl;
-  }
-  
-  catch (CL_Error err) {
-    std::cout << "Editor: Error caught from ClanLib: " << err.message << 
std::endl;
-  }
-
-  
-  enable();
+  try 
+    {
+      std::string levelfile = editor->save_tmp_level();
+      ScreenManager::instance()->push_screen(new PingusGameSession 
(levelfile), true);
+    }
+  catch(PingusError err) 
+    {
+      std::cout << "Editor: Error caught from Pingus: " << err.get_message () 
<< std::endl;
+    }  
+  catch (CL_Error err) 
+    {
+      std::cout << "Editor: Error caught from ClanLib: " << err.message << 
std::endl;
+    }
 }
 
 void 
@@ -675,7 +681,7 @@
 {
   std::cout << "Exit editor" << std::endl;
   editor->save_tmp_level();
-  editor->quit = true;
+  ScreenManager::instance ()->pop_screen ();
 }
 
 void




reply via email to

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