pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/gui gui_manager.cxx,1.3,1.4 gui_manag


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/gui gui_manager.cxx,1.3,1.4 gui_manager.hxx,1.3,1.4 root_gui_manager.cxx,1.3,1.4
Date: 30 Jul 2002 14:57:28 -0000

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

Modified Files:
        gui_manager.cxx gui_manager.hxx root_gui_manager.cxx 
Log Message:
some cleanup in the input/gui handling, gamedelta is now usable

Index: gui_manager.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/gui/gui_manager.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gui_manager.cxx     30 Jul 2002 01:58:16 -0000      1.3
+++ gui_manager.cxx     30 Jul 2002 14:57:26 -0000      1.4
@@ -23,6 +23,7 @@
 #include "../input/event.hxx"
 #include "../input/button_event.hxx"
 #include "../input/pointer_event.hxx"
+#include "../game_delta.hxx"
 
 #include "gui_manager.hxx"
 
@@ -46,19 +47,21 @@
 }
 
 void
-GUIManager::update (float delta)
+GUIManager::update (const GameDelta& delta)
 {
+  process_input (delta.get_events ());
+
   for (std::vector<Component*>::iterator i = components.begin (); 
        i != components.end (); ++i)
     {
-      (*i)->update (delta);
+      (*i)->update (delta.get_time ());
     }
 }
 
 void
-GUIManager::process_input (std::list<Event*>& events)
+GUIManager::process_input (const std::list<Input::Event*>& events)
 {
-  for (std::list<Event*>::iterator i = events.begin (); i != events.end (); 
++i)
+  for (std::list<Event*>::const_iterator i = events.begin (); i != events.end 
(); ++i)
     {
       switch ((*i)->get_type())
        {

Index: gui_manager.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/gui/gui_manager.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gui_manager.hxx     30 Jul 2002 01:58:16 -0000      1.3
+++ gui_manager.hxx     30 Jul 2002 14:57:26 -0000      1.4
@@ -20,8 +20,12 @@
 #ifndef HEADER_PINGUS_GUI_GUI_MANAGER_HXX
 #define HEADER_PINGUS_GUI_GUI_MANAGER_HXX
 
+#include <vector>
+#include <list>
 #include "component.hxx"
 
+class GameDelta;
+
 namespace Input
 {
   class Event;
@@ -46,12 +50,15 @@
     // FIXME: Hack: should be handled inside the controller
     int x_pos;
     int y_pos;
+
+    void process_input (const std::list<Input::Event*>& events);
   public:
     GUIManager ();
     virtual ~GUIManager () {}
     
-    void draw ();
-    void update (float delta);
+    virtual void draw ();
+    virtual void update (const GameDelta& delta);
+    virtual void update (float delta) {}
 
     /** Add a component to the manager, if delete_component is true
        the component will get deleted on destruction of the manager,
@@ -61,8 +68,6 @@
 
     /** */
     void remove (Component*);
-
-    void process_input (std::list<Input::Event*>& events);
 
     Component* component_at (int x, int y);  
     bool is_at (int x, int y);

Index: root_gui_manager.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/gui/root_gui_manager.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- root_gui_manager.cxx        30 Jul 2002 01:58:16 -0000      1.3
+++ root_gui_manager.cxx        30 Jul 2002 14:57:26 -0000      1.4
@@ -36,9 +36,10 @@
 void
 RootGUIManager::update (float delta)
 {
+  assert (!"ERROR RootGUIManager absolete");
   assert (controller);
-  GUIManager::update (delta);
-  process_input (controller->get_events ());
+  //GUIManager::update (delta);
+  //process_input (controller->get_events ());
 }
 
 /* EOF */




reply via email to

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