[Top][All Lists]
[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 () {}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [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,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/worldmap level_dot.cxx,1.5,1.6 level_dot.hxx,1.4,1.5 manager.cxx,1.20,1.21 manager.hxx,1.14,1.15 worldmap.cxx,1.27,1.28 worldmap.hxx,1.19,1.20
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src config.cxx,1.7,1.8 delta_manager.hxx,1.6,1.7 game_delta.hxx,1.9,1.10 game_time.hxx,1.7,1.8 pingu_action_factory.cxx,1.10,1.11 screen_manager.cxx,1.26,1.27 screen_manager.hxx,1.15,1.16
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/worldmap level_dot.cxx,1.5,1.6 level_dot.hxx,1.4,1.5 manager.cxx,1.20,1.21 manager.hxx,1.14,1.15 worldmap.cxx,1.27,1.28 worldmap.hxx,1.19,1.20
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src config.cxx,1.7,1.8 delta_manager.hxx,1.6,1.7 game_delta.hxx,1.9,1.10 game_time.hxx,1.7,1.8 pingu_action_factory.cxx,1.10,1.11 screen_manager.cxx,1.26,1.27 screen_manager.hxx,1.15,1.16
- Index(es):