pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src client.cxx,1.13,1.14 playfield.cxx,1.


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src client.cxx,1.13,1.14 playfield.cxx,1.12,1.13 view.cxx,1.6,1.7
Date: 5 Aug 2002 09:19:10 -0000

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

Modified Files:
        client.cxx playfield.cxx view.cxx 
Log Message:
fixed bug which caused the view to lose the mouse

Index: client.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/client.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- client.cxx  3 Aug 2002 11:37:45 -0000       1.13
+++ client.cxx  5 Aug 2002 09:19:08 -0000       1.14
@@ -59,13 +59,6 @@
 {
   //Display::add_flip_screen_hook(cursor);
   
-  gui_manager->add (new GUI::SurfaceButton 
-                   (400, 200,
-                    ResDescriptor ("editor/button", "core", 
ResDescriptor::RD_RESOURCE),
-                    ResDescriptor ("editor/button_pressed", "core", 
ResDescriptor::RD_RESOURCE),
-                    ResDescriptor ("editor/actions", "core", 
ResDescriptor::RD_RESOURCE)));
-
-
   Timer timer;
   
   timer.start();

Index: playfield.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/playfield.cxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- playfield.cxx       4 Aug 2002 12:56:10 -0000       1.12
+++ playfield.cxx       5 Aug 2002 09:19:08 -0000       1.13
@@ -185,6 +185,7 @@
   for(unsigned int i=0; i < view.size(); ++i)
     {
       view[i]->update (delta);
+
       if (view[i]->is_current() && !mouse_scrolling)
        { 
          current_view = i;
@@ -199,6 +200,7 @@
 void 
 Playfield::on_primary_button_press(int x, int y)
 {
+  std::cout << "Playfield::on_primary_button_press(" << x << ", " << y << 
std::endl;
   if (current_pingu)
     {
       char str[256];
@@ -228,6 +230,11 @@
   // FIXME: useless stuff, but currently the controller doesn't have a state
   mouse_x = x;
   mouse_y = y;
+
+  for(unsigned int i=0; i < view.size(); ++i)
+    {
+      view[i]->on_pointer_move (x, y);
+    }  
 
   if (mouse_scrolling)
     {

Index: view.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/view.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- view.cxx    2 Aug 2002 13:17:42 -0000       1.6
+++ view.cxx    5 Aug 2002 09:19:08 -0000       1.7
@@ -31,6 +31,7 @@
   : cap (client->get_button_panel ()),
     current_pingu (0)
 {
+  mouse_over = false;
   assert(world);
 
   size = s;
@@ -96,12 +97,7 @@
 bool
 View::is_over(int x, int y)
 {
-  if (x >= x1_pos && x <= x2_pos 
-      && y >= y1_pos && y <= y2_pos) {
-    return true;
-  } else {
-    return false;
-  }
+  return (x >= x1_pos && x <= x2_pos && y >= y1_pos && y <= y2_pos);
 }
 
 bool




reply via email to

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