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 component.hxx,1.12,1.13 gui_manag


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/gui component.hxx,1.12,1.13 gui_manager.cxx,1.15,1.16 gui_manager.hxx,1.11,1.12
Date: 27 Nov 2002 20:05:44 -0000

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

Modified Files:
        component.hxx gui_manager.cxx gui_manager.hxx 
Log Message:
- little cleanup here and there
- added level names to the worldmap
- added absolute time to gamedelta


Index: component.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/gui/component.hxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- component.hxx       28 Sep 2002 22:24:24 -0000      1.12
+++ component.hxx       27 Nov 2002 20:05:42 -0000      1.13
@@ -48,6 +48,8 @@
   /** Gets issued once the primary button is released */
   virtual void on_primary_button_release (int x, int y) { UNUSED_ARG(x); 
UNUSED_ARG(y); }
 
+  virtual void on_primary_button_double_click (int x, int y) { UNUSED_ARG(x); 
UNUSED_ARG(y); }
+
   virtual void on_secondary_button_press (int x, int y) { UNUSED_ARG(x); 
UNUSED_ARG(y); }
   virtual void on_secondary_button_release (int x, int y) { UNUSED_ARG(x); 
UNUSED_ARG(y); }
 

Index: gui_manager.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/gui/gui_manager.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- gui_manager.cxx     14 Oct 2002 11:15:15 -0000      1.15
+++ gui_manager.cxx     27 Nov 2002 20:05:42 -0000      1.16
@@ -50,7 +50,7 @@
 void
 GUIManager::update (const GameDelta& delta)
 {
-  process_input (delta.get_events ());
+  process_input (delta);
 
   for (std::vector<Component*>::iterator i = components.begin (); 
        i != components.end (); ++i)
@@ -60,8 +60,10 @@
 }
 
 void
-GUIManager::process_input (const std::list<Input::Event*>& events)
+GUIManager::process_input (const GameDelta& delta)
 {
+  const std::list<Input::Event*>& events = delta.get_events();
+
   for (std::list<Event*>::const_iterator i = events.begin (); i != events.end 
(); ++i)
     {
       switch ((*i)->get_type())
@@ -75,7 +77,7 @@
        case Input::ButtonEventType:
          {
            ButtonEvent* event = dynamic_cast<ButtonEvent*>(*i);
-           process_button_event (event);
+           process_button_event (delta.get_absolute_time(), event);
            break;
          }
          
@@ -176,11 +178,11 @@
 }
 
 void
-GUIManager::process_button_event (Input::ButtonEvent* event)
+GUIManager::process_button_event (unsigned int time_stamp, Input::ButtonEvent* 
event)
 {
   //std::cout << "GUIManager: Got button event: " << event->name << " " << 
event->state << std::endl;
 
-  Component* comp = component_at (x_pos, y_pos);//FIXME
+  Component* comp = component_at (x_pos, y_pos);//FIXME: x/y_pos should be 
inside controller
 
   if (comp)
     {
@@ -188,6 +190,8 @@
        {
          primary_pressed_component = comp;
          comp->on_primary_button_press (x_pos, y_pos);
+
+          // FIXME: add double click detection here
        }
       else if (event->name == primary && event->state == Input::released) 
        {

Index: gui_manager.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/gui/gui_manager.hxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- gui_manager.hxx     27 Sep 2002 11:26:46 -0000      1.11
+++ gui_manager.hxx     27 Nov 2002 20:05:42 -0000      1.12
@@ -61,9 +61,9 @@
     int x_pos;
     int y_pos;
 
-    void process_input (const std::list<Input::Event*>& events);
+    void process_input (const GameDelta& delta);
     void process_pointer_event (Input::PointerEvent* event);
-    void process_button_event (Input::ButtonEvent* event);
+    void process_button_event (unsigned int time_stamp, Input::ButtonEvent* 
event);
   public:
     GUIManager ();
     virtual ~GUIManager () {}





reply via email to

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