Skip to content

Commit

Permalink
WadMapConverter|Id1Map: Applied pimpl idiom to Id1Map; cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Dec 19, 2013
1 parent dd4d0f8 commit b8ad233
Show file tree
Hide file tree
Showing 7 changed files with 329 additions and 349 deletions.
46 changes: 3 additions & 43 deletions doomsday/plugins/wadmapconverter/include/id1map.h
Expand Up @@ -75,9 +75,8 @@ class Id1Map

public:
Id1Map(MapFormatId format);
~Id1Map();

MapFormatId format() const { return mapFormat; }
MapFormatId format() const;

void load(MapLumpInfos &lumpInfos);

Expand All @@ -88,9 +87,7 @@ class Id1Map
MaterialDictId addMaterialToDictionary(char const *name, MaterialDictGroup group);

private:
inline de::String const &findMaterialInDictionary(MaterialDictId id) {
return materials.stringRef(id);
}
de::String const &findMaterialInDictionary(MaterialDictId id) const;

/// @todo fixme: A real performance killer...
AutoStr *composeMaterialRef(MaterialDictId id);
Expand All @@ -102,31 +99,6 @@ class Id1Map
bool loadThings(Reader *reader, int numElements);
bool loadSurfaceTints(Reader *reader, int numElements);

/**
* Create a temporary polyobj.
*/
mpolyobj_t *createPolyobj(LineList &lineList, int tag, int sequenceType,
int16_t anchorX, int16_t anchorY);
/**
* @param lineList @c NULL, will cause IterFindPolyLines to count
* the number of lines in the polyobj.
*/
void collectPolyobjLinesWorker(LineList &lineList, coord_t x, coord_t y);

void collectPolyobjLines(LineList &lineList, Lines::iterator lineIt);

/**
* Find all linedefs marked as belonging to a polyobject with the given tag
* and attempt to create a polyobject from them.
*
* @param tag Line tag of linedefs to search for.
*
* @return @c true = successfully created polyobj.
*/
bool findAndCreatePolyobj(int16_t tag, int16_t anchorX, int16_t anchorY);

void findPolyobjs();

void transferVertexes();
void transferSectors();
void transferLinesAndSides();
Expand All @@ -135,19 +107,7 @@ class Id1Map
void transferThings();

private:
MapFormatId mapFormat;

uint numVertexes;
coord_t *vertexes; ///< Array of vertex coords [v0:X, vo:Y, v1:X, v1:Y, ..]

Lines lines;
Sides sides;
Sectors sectors;
Things things;
SurfaceTints surfaceTints;
Polyobjs polyobjs;

de::StringPool materials; ///< Material dictionary.
DENG2_PRIVATE(d)
};

#endif // WADMAPCONVERTER_ID1MAP_H

0 comments on commit b8ad233

Please sign in to comment.