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 path_drawable.cxx,NONE,1.1 p


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldmap path_drawable.cxx,NONE,1.1 path_drawable.hxx,NONE,1.1 Makefile.am,1.8,1.9 level_dot.cxx,1.2,1.3 level_dot.hxx,1.2,1.3 path_graph.cxx,1.4,1.5
Date: 13 Oct 2002 16:39:19 -0000

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

Modified Files:
        Makefile.am level_dot.cxx level_dot.hxx path_graph.cxx 
Added Files:
        path_drawable.cxx path_drawable.hxx 
Log Message:
some more worldmap fixes

--- NEW FILE: path_drawable.cxx ---
//  $Id: path_drawable.cxx,v 1.1 2002/10/13 16:39:17 grumbel Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#include "path_drawable.hxx"

namespace WorldMapNS {

PathDrawable::PathDrawable(Path* path, NodeId source, NodeId destination)
{
}

void
PathDrawable::draw(GraphicContext& gc)
{
}

void 
PathDrawable::update()
{
}

} // namespace WorldMapNS

/* EOF */

--- NEW FILE: path_drawable.hxx ---
//  $Id: path_drawable.hxx,v 1.1 2002/10/13 16:39:17 grumbel Exp $
// 
//  Pingus - A free Lemmings clone
//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
// 
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef HEADER_PATH_DRAWABLE_HXX
#define HEADER_PATH_DRAWABLE_HXX

#include "drawable.hxx"
#include "path_graph.hxx"

namespace WorldMapNS {

/** Drawable to show the path between two nodes, only used for
    debugging */
class PathDrawable : public Drawable
{
private:
  
public:
  PathDrawable(Path* path, NodeId source, NodeId destination);

  void draw(GraphicContext& gc);
  void update();

  float get_z_pos() const { return 1000; }
private:
  PathDrawable (const PathDrawable&);
  PathDrawable& operator= (const PathDrawable&);
};

} // namespace WorldMapNS

#endif

/* EOF */

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/Makefile.am,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Makefile.am 13 Oct 2002 14:19:25 -0000      1.8
+++ Makefile.am 13 Oct 2002 16:39:17 -0000      1.9
@@ -32,7 +32,8 @@
 dot_factory.hxx dot_factory.cxx \
 dot.hxx dot.cxx \
 level_dot.hxx level_dot.cxx \
-pathfinder.hxx
+pathfinder.hxx \
+path_drawable.hxx path_drawable.cxx
 
 #node.cxx
 #node.hxx

Index: level_dot.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/level_dot.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- level_dot.cxx       13 Oct 2002 13:34:40 -0000      1.2
+++ level_dot.cxx       13 Oct 2002 16:39:17 -0000      1.3
@@ -27,9 +27,11 @@
 
 LevelDot::LevelDot(xmlDocPtr doc, xmlNodePtr cur)
   : Dot(doc, XMLhelper::skip_blank(cur->children)),
-    green_dot_sur(PingusResource::load_surface("misc/dot_green", "core")),
-    red_dot_sur(PingusResource::load_surface("misc/dot_red", "core"))
+    green_dot_sur("misc/dot_green", "core"),
+    red_dot_sur("misc/dot_red", "core")
 {
+  green_dot_sur.set_align_center();
+  red_dot_sur.set_align_center();
 }
 
 void

Index: level_dot.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/level_dot.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- level_dot.hxx       13 Oct 2002 13:34:40 -0000      1.2
+++ level_dot.hxx       13 Oct 2002 16:39:17 -0000      1.3
@@ -20,7 +20,7 @@
 #ifndef HEADER_PINGUS_WORLDMAP_LEVEL_DOT_HXX
 #define HEADER_PINGUS_WORLDMAP_LEVEL_DOT_HXX
 
-#include <ClanLib/Display/Display/surface.h>
+#include "../sprite.hxx"
 #include "dot.hxx"
 
 namespace WorldMapNS {
@@ -29,8 +29,8 @@
 class LevelDot : public Dot
 {
 private:
-  CL_Surface green_dot_sur;
-  CL_Surface red_dot_sur;
+  Sprite green_dot_sur;
+  Sprite red_dot_sur;
 
 public:
   LevelDot(xmlDocPtr doc, xmlNodePtr cur);

Index: path_graph.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/path_graph.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- path_graph.cxx      13 Oct 2002 14:19:25 -0000      1.4
+++ path_graph.cxx      13 Oct 2002 16:39:17 -0000      1.5
@@ -25,6 +25,7 @@
 #include "worldmap.hxx"
 #include "pathfinder.hxx"
 #include "path_graph.hxx"
+#include "path_drawable.hxx"
 
 namespace WorldMapNS {
 
@@ -137,7 +138,12 @@
               
               child_cur = child_cur->next;
               child_cur = XMLhelper::skip_blank(child_cur);
-            }    
+            }
+
+          // FIXME: Memory leak
+          worldmap->add_drawable(new PathDrawable(path, 
+                                                  node_lookup[source], 
+                                                  node_lookup[destination]));
           
           // FIXME: No error checking, 
           graph.add_bi_edge(path, // FIXME: Memory leak!





reply via email to

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