pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/worldmap level_dot.cxx,1.5,1.6 level_


From: grumbel
Subject: [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
Date: 27 Nov 2002 20:05:44 -0000

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

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


Index: level_dot.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/level_dot.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- level_dot.cxx       17 Oct 2002 16:06:21 -0000      1.5
+++ level_dot.cxx       27 Nov 2002 20:05:42 -0000      1.6
@@ -81,6 +81,7 @@
 LevelDot::on_click()
 {
   std::cout << "Starting level: " << levelname << std::endl;
+  ScreenManager::instance()->fade_out();
   ScreenManager::instance()->push_screen(new PingusGameSession 
(path_manager.complete("levels/") + levelname),
                                          true);
 }

Index: level_dot.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/level_dot.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- level_dot.hxx       17 Oct 2002 16:06:21 -0000      1.4
+++ level_dot.hxx       27 Nov 2002 20:05:42 -0000      1.5
@@ -41,7 +41,7 @@
 
   void draw(GraphicContext& gc);
   void update();
-
+  PLF* get_plf () const { return plf; }
   void on_click(); 
 
 private:

Index: manager.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/manager.cxx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- manager.cxx 3 Nov 2002 23:31:35 -0000       1.20
+++ manager.cxx 27 Nov 2002 20:05:42 -0000      1.21
@@ -97,6 +97,13 @@
   WorldMapManager::instance ()->worldmap->on_primary_button_press (x, y);
 }
 
+
+void 
+WorldMapManager::WorldMapComponent::on_pointer_move (int x, int y)
+{
+  WorldMapManager::instance ()->worldmap->on_pointer_move (x, y);
+}
+
 void 
 WorldMapManager::WorldMapComponent::on_secondary_button_press (int x, int y)
 {

Index: manager.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/manager.hxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- manager.hxx 3 Nov 2002 23:31:35 -0000       1.14
+++ manager.hxx 27 Nov 2002 20:05:42 -0000      1.15
@@ -36,7 +36,8 @@
 class WorldMap;
 
 /** The WorldMapManager manages the worldmaps and the translation
-    between two worldmaps */
+    between two worldmaps, it also holds the GUI elements that are
+    accessible in the WorldMap Screen */
 class WorldMapManager : public GUIScreen
 {
   /** FIXME: Workaround class to let the worldmap play with well
@@ -48,7 +49,8 @@
       
     void on_primary_button_press (int x, int y);
     void on_secondary_button_press (int x, int y);
- 
+    void on_pointer_move(int x, int y);
+    
     void draw (GraphicContext& gc);
     void update (float delta);
       

Index: worldmap.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/worldmap.cxx,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- worldmap.cxx        3 Nov 2002 23:31:35 -0000       1.27
+++ worldmap.cxx        27 Nov 2002 20:05:42 -0000      1.28
@@ -38,7 +38,9 @@
 #include "drawable_factory.hxx"
 #include "drawable.hxx"
 #include "dot.hxx"
+#include "level_dot.hxx"
 #include "path_graph.hxx"
+#include "../plf.hxx"
 #include "../math.hxx"
 
 namespace WorldMapNS {
@@ -186,6 +188,33 @@
     {
       (*i)->draw (display_gc);
     }
+
+  if (pingus->get_node() != NoNode)
+    {
+      LevelDot* leveldot = 
dynamic_cast<LevelDot*>(path_graph->get_dot(pingus->get_node()));
+
+      if (leveldot)
+        gc.print_center(Fonts::pingus_small, gc.get_width ()/2, 
gc.get_height() - 40,
+                        
System::translate(leveldot->get_plf()->get_levelname()));
+    }
+  
+  
+  Vector mpos = display_gc.screen_to_world(Vector(mouse_x, mouse_y));
+  Dot* dot = path_graph->get_dot(mpos.x, mpos.y);
+  if (dot)
+    {
+      LevelDot* leveldot = dynamic_cast<LevelDot*>(dot);
+
+      if (leveldot)
+        {
+          gc.print_center(Fonts::pingus_small, mouse_x, mouse_y - 30,
+                          
System::translate(leveldot->get_plf()->get_levelname()));
+
+          if (maintainer_mode)
+            gc.print_center(Fonts::pingus_small, mouse_x, mouse_y - 56,
+                            leveldot->get_plf()->get_filename());
+        }
+    }
 }
 
 void
@@ -213,6 +242,13 @@
 WorldMap::set_pingus(NodeId id)
 {
   UNUSED_ARG(id);
+}
+
+void
+WorldMap::on_pointer_move(int x, int y)
+{
+  mouse_x = x;
+  mouse_y = y;
 }
 
 void

Index: worldmap.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/worldmap.hxx,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- worldmap.hxx        3 Nov 2002 23:31:35 -0000       1.19
+++ worldmap.hxx        27 Nov 2002 20:05:42 -0000      1.20
@@ -72,6 +72,9 @@
   /** A collection of drawables loaded from the xml file, this list
       gets deleted at the end */
   ObjectLst objects;
+
+  int mouse_x;
+  int mouse_y;
 public:
   /** Load the given*/
   WorldMap(const std::string& filename);
@@ -93,6 +96,7 @@
   /** x,y are in WorldMap CO, not ScreenCO */
   void on_primary_button_press(int x, int y);
   void on_secondary_button_press(int x, int y);
+  void on_pointer_move(int x, int y);
 private:
 #if 0
   /** @return the node at the given position. x and y are in





reply via email to

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