Skip to content

Commit

Permalink
libcommon: One MapInfoParser can now be used to read multiple definit…
Browse files Browse the repository at this point in the history
…ion sources

Also applied PIMPL plus some cleanup.
  • Loading branch information
danij-deng committed Jul 21, 2014
1 parent bd8205a commit 097a39d
Show file tree
Hide file tree
Showing 3 changed files with 235 additions and 193 deletions.
28 changes: 26 additions & 2 deletions doomsday/plugins/common/include/mapinfo.h
Expand Up @@ -36,10 +36,34 @@ class MapInfo : public de::Record
void resetToDefaults();
};

// Central MapInfo database.
typedef std::map<std::string, MapInfo> MapInfos;
extern MapInfos mapInfos;

/**
* Populate the MapInfo database by parsing the MAPINFO lump.
* Parser for Hexen's MAPINFO definition lumps.
*/
void MapInfoParser(Str const *path);
class MapInfoParser
{
public:
/// Base class for all parse-related errors. @ingroup errors
DENG2_ERROR(ParseError);

public:
MapInfoParser();

void parse(AutoStr const &buffer, de::String sourceFile);

/**
* Clear any custom default map definition currently in use. Map definitions
* read after this is called will use the games' default map definition as a
* basis (unless specified otherwise).
*/
void clearDefaultMap();

private:
DENG2_PRIVATE(d)
};

/**
* @param mapUri Identifier of the map to lookup info for. Can be @c 0 in which
Expand Down

0 comments on commit 097a39d

Please sign in to comment.