[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r3664 - in trunk/pingus: . src/worldmap src/worldobjs
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r3664 - in trunk/pingus: . src/worldmap src/worldobjs |
Date: |
Fri, 4 Jul 2008 09:04:23 +0200 |
Author: grumbel
Date: 2008-07-04 09:04:22 +0200 (Fri, 04 Jul 2008)
New Revision: 3664
Removed:
trunk/pingus/src/worldmap/metamap.cpp
trunk/pingus/src/worldmap/metamap.hpp
Modified:
trunk/pingus/SConstruct
trunk/pingus/src/worldmap/manager.cpp
trunk/pingus/src/worldmap/path_graph.cpp
trunk/pingus/src/worldmap/path_graph.hpp
trunk/pingus/src/worldmap/worldmap.cpp
trunk/pingus/src/worldobjs/solid_color_background.cpp
Log:
Some more cleanup of old cruft
Modified: trunk/pingus/SConstruct
===================================================================
--- trunk/pingus/SConstruct 2008-07-04 06:59:19 UTC (rev 3663)
+++ trunk/pingus/SConstruct 2008-07-04 07:04:22 UTC (rev 3664)
@@ -251,7 +251,6 @@
'src/worldmap/graph.cpp',
'src/worldmap/level_dot.cpp',
'src/worldmap/manager.cpp',
-'src/worldmap/metamap.cpp',
'src/worldmap/path.cpp',
'src/worldmap/path_drawable.cpp',
'src/worldmap/path_graph.cpp',
Modified: trunk/pingus/src/worldmap/manager.cpp
===================================================================
--- trunk/pingus/src/worldmap/manager.cpp 2008-07-04 06:59:19 UTC (rev
3663)
+++ trunk/pingus/src/worldmap/manager.cpp 2008-07-04 07:04:22 UTC (rev
3664)
@@ -30,7 +30,6 @@
#include "resource.hpp"
#include "worldmap_story.hpp"
#include "pingus.hpp"
-#include "metamap.hpp"
#include "manager.hpp"
#include "../story_screen.hpp"
@@ -217,7 +216,6 @@
exit_worldmap(false),
worldmap(0),
new_worldmap(0)
- ////metamap(new MetaMap(path_manager.complete("metamap/metamap.xml")))
{
// FIXME: a bit ugly because of the proteced member, but should work
// FIXME: well enough. GUIScreen could also use multi-inheritage,
@@ -253,13 +251,6 @@
exit_worldmap = false;
Sound::PingusSound::stop_music();
-#if 0
- if (!worldmap)
- {
- load(path_manager.complete("worldmaps/" +
metamap->get_default_worldmap()));
- }
-#endif
-
if (worldmap)
worldmap->on_startup ();
}
Deleted: trunk/pingus/src/worldmap/metamap.cpp
===================================================================
--- trunk/pingus/src/worldmap/metamap.cpp 2008-07-04 06:59:19 UTC (rev
3663)
+++ trunk/pingus/src/worldmap/metamap.cpp 2008-07-04 07:04:22 UTC (rev
3664)
@@ -1,129 +0,0 @@
-// Pingus - A free Lemmings clone
-// Copyright (C) 2006 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 3 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, see <http://www.gnu.org/licenses/>.
-
-#include "dot.hpp"
-#include "metamap.hpp"
-#include "path_graph.hpp"
-#include "graph.hpp"
-#include "../pingus_error.hpp"
-#include "../debug.hpp"
-#include "../globals.hpp"
-#include "../stat_manager.hpp"
-#include "../sexpr_file_reader.hpp"
-
-namespace WorldMapNS {
-
-// Constructor
-MetaMap::MetaMap(const std::string &filename_arg)
- : filename(filename_arg)
-{
-#if 0
- CL_InputSourceProvider_File provider(".");
- CL_DomDocument doc(provider.open_source(filename), true);
- CL_DomElement root = doc.get_document_element();
-
- XMLFileReader xml(root);
- parse_file(xml);
-#endif
- pout(PINGUS_DEBUG_WORLDMAP) << "Metamap Info: " <<
- " Default Node: " << default_node <<
- " Final Node: " << final_node <<
- " Default World Name: " << path_graph->get_dot(default_node)->get_name()
<< std::endl;
-}
-
-// Parse the XML file
-void
-MetaMap::parse_file(FileReader &reader)
-{
- if (reader.get_name() == "pingus-metamap")
- {
- parse_graph(reader.read_section("graph"));
- parse_properties(reader.read_section("head"));
- // FIXME: Implement this stuff eventually.
- // parse_objects(reader.read_section("objects"));
- // intro_story = new WorldMapStory(reader.read_section("intro_story"));
- // end_story = new WorldMapStory(reader.read_section("end_story"));
- }
- else
- PingusError::raise("MetaMap: " + filename + ": not a MetaMap file");
-
- if (!path_graph)
- PingusError::raise("MetaMap: " + filename + " missing Graph");
-}
-
-// Parse the nodes and edges
-void
-MetaMap::parse_graph(FileReader reader)
-{
- path_graph = new PathGraph(this, reader);
-}
-
-// Parse the properties of this file
-void
-MetaMap::parse_properties(FileReader reader)
-{
- // Get beginning and ending nodes.
- std::string node_name;
- reader.read_string("default-node", node_name);
- default_node = path_graph->lookup_node(node_name);
-
- unlock_default(node_name);
-
- reader.read_string("final-node", node_name);
- final_node = path_graph->lookup_node(node_name);
-}
-
-void
-MetaMap::unlock_default(const std::string &default_node_name)
-{
- bool is_opened = false;
- StatManager::instance()->get_bool(default_node_name + "-accessible",
is_opened);
- if (!is_opened)
- {
- StatManager::instance()->set_bool(default_node_name + "-accessible",
true);
- }
-}
-
-std::string
-MetaMap::get_default_worldmap()
-{
- return (path_graph->get_dot(default_node)->get_name());
-}
-
-std::string
-MetaMap::get_final_worldmap()
-{
- return (path_graph->get_dot(final_node)->get_name());
-}
-
-void
-MetaMap::finish_node(const std::string &worldmap_shortname)
-{
- StatManager::instance()->set_bool(worldmap_shortname + "-finished", true);
- // NodeId id = path_graph->lookup_node(worldmap_shortname);
- // FIXME: Not entirely sure how the whole pathfinder thing works,
- // FIXME: so I'm hardcoding this for now... <evil!!!>
- unlock_default("volcano");
-}
-
-MetaMap::~MetaMap()
-{
- delete path_graph;
-}
-
-} // WorldMap namespace
-
-/* EOF */
Deleted: trunk/pingus/src/worldmap/metamap.hpp
===================================================================
--- trunk/pingus/src/worldmap/metamap.hpp 2008-07-04 06:59:19 UTC (rev
3663)
+++ trunk/pingus/src/worldmap/metamap.hpp 2008-07-04 07:04:22 UTC (rev
3664)
@@ -1,94 +0,0 @@
-// Pingus - A free Lemmings clone
-// Copyright (C) 2006 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 3 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, see <http://www.gnu.org/licenses/>.
-
-#ifndef HEADER_PINGUS_METAMAP_HPP
-#define HEADER_PINGUS_METAMAP_HPP
-
-#include <string>
-
-
- class FileReader;
-
-namespace WorldMapNS {
-
- class Drawable;
- class PathGraph;
- typedef int EdgeId;
- typedef int NodeId;
-
-/** This class is used to connect the WorldMaps (or "islands").
- FIXME: Eventually, this should draw a picture of the globe so you
- FIXME: can watch your pingus sail around and pick which island/area
they want
- FIXME: to go to */
-class MetaMap {
-private:
- // here, a NodeId represents a WorldMap.
- NodeId default_node;
- NodeId final_node;
-
- /** The graph that represents the path between Nodes */
- PathGraph* path_graph;
-
- /** Filename of this Metamap */
- std::string filename;
-
-public:
- MetaMap(const std::string &filename_arg);
- ~MetaMap();
-
- /** Returns whether or not the given worldmap is accessible. Use the
<short-name>
- tag in the WorldMap XML file as the string variable. */
- bool is_accessible(const std::string &worldmap_shortname);
-
- /** Action to take when the worldmap has been completed. This should
record that
- fact, as well as unlock all other worldmaps */
- void set_finished(const std::string &worldmap_shortname);
-
- /** FIXME: Implement this when the MetaMap is viewable */
- void add_drawable(Drawable* drawable) { }
-
- /** Return the name of the default node in this metamap (which is a
worldmap) */
- std::string get_default_worldmap();
- std::string get_final_worldmap();
-
- /** Finish the specified node and unlock it's neighbors */
- void finish_node(const std::string &worldmap_shortname);
-
-private:
- /** Unlock surrounding nodes. This sets the "-accessible" tag in the
StatManager for
- the accessible worldmaps */
- void unlock_nodes();
- void unlock_default(const std::string &default_node_name);
-
- /** Parses the passed filename to get information about the MetaMap */
- void parse_file(FileReader &reader);
-
- /** Parses the <head> section */
- void parse_properties(FileReader reader);
-
- /** Parses the <graph> section */
- void parse_graph(FileReader reader);
-
- MetaMap();
- MetaMap (const MetaMap&);
- MetaMap& operator= (const MetaMap&);
-}; // MetaMap class.
-
-} // WorldMap namespace;
-
-#endif
-
-/* EOF */
Modified: trunk/pingus/src/worldmap/path_graph.cpp
===================================================================
--- trunk/pingus/src/worldmap/path_graph.cpp 2008-07-04 06:59:19 UTC (rev
3663)
+++ trunk/pingus/src/worldmap/path_graph.cpp 2008-07-04 07:04:22 UTC (rev
3664)
@@ -21,7 +21,6 @@
#include "dot.hpp"
#include "dot_factory.hpp"
#include "worldmap.hpp"
-#include "metamap.hpp"
#include "pathfinder.hpp"
#include "path_graph.hpp"
#include "path_drawable.hpp"
@@ -39,17 +38,6 @@
init_cache();
}
-PathGraph::PathGraph(MetaMap* arg_metamap, FileReader &reader)
- : worldmap(0),
- metamap(arg_metamap)
-
-{
- parse_nodes(reader.read_section("nodes"));
- parse_edges(reader.read_section("edges"));
-
- init_cache();
-}
-
void delete_Path(Edge<Path*> x)
{
delete x.data;
@@ -83,8 +71,6 @@
// add the dot to the list of drawables
if (worldmap)
worldmap->add_drawable(dot);
- else
- metamap->add_drawable(dot);
// FIXME: should be use this for freeing the stuff?
dots.push_back(dot);
Modified: trunk/pingus/src/worldmap/path_graph.hpp
===================================================================
--- trunk/pingus/src/worldmap/path_graph.hpp 2008-07-04 06:59:19 UTC (rev
3663)
+++ trunk/pingus/src/worldmap/path_graph.hpp 2008-07-04 07:04:22 UTC (rev
3664)
@@ -28,15 +28,12 @@
class Dot;
class WorldMap;
-class MetaMap;
/** This class represents the walkable path on the Worldmap */
class PathGraph
{
private:
- // The pathgraph will have one of these, not both.
WorldMap* worldmap;
- MetaMap* metamap;
public:
// FIXME: Memory leak? Where do we free stuff data inside the graph?
@@ -60,7 +57,6 @@
PathGraph, it is used so that the PathGraph can insert its
drawables into the world */
PathGraph(WorldMap* worldmap, FileReader &reader);
- PathGraph(MetaMap* metamap, FileReader &reader);
~PathGraph();
@@ -85,7 +81,7 @@
private:
void parse_nodes(FileReader reader);
void parse_edges(FileReader reader);
- void init_cache();
+ void init_cache();
PathGraph (const PathGraph&);
PathGraph& operator= (const PathGraph&);
Modified: trunk/pingus/src/worldmap/worldmap.cpp
===================================================================
--- trunk/pingus/src/worldmap/worldmap.cpp 2008-07-04 06:59:19 UTC (rev
3663)
+++ trunk/pingus/src/worldmap/worldmap.cpp 2008-07-04 07:04:22 UTC (rev
3664)
@@ -34,7 +34,6 @@
#include "../lisp/lisp.hpp"
#include "worldmap.hpp"
#include "worldmap_story.hpp"
-#include "metamap.hpp"
#include "manager.hpp"
#include "pingus.hpp"
#include "drawable_factory.hpp"
Modified: trunk/pingus/src/worldobjs/solid_color_background.cpp
===================================================================
--- trunk/pingus/src/worldobjs/solid_color_background.cpp 2008-07-04
06:59:19 UTC (rev 3663)
+++ trunk/pingus/src/worldobjs/solid_color_background.cpp 2008-07-04
07:04:22 UTC (rev 3664)
@@ -28,7 +28,6 @@
void
SolidColorBackground::draw (SceneContext& gc)
{
- // FIXME: should use SceneContext, not CL_Display
gc.color().fill_screen(color);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r3664 - in trunk/pingus: . src/worldmap src/worldobjs,
grumbel at BerliOS <=