Skip to content

Commit

Permalink
Refactor|IdTech1Converter: Renamed idtech1::Id1Map as idtech1::MapImp…
Browse files Browse the repository at this point in the history
…orter
  • Loading branch information
danij-deng committed Jul 26, 2014
1 parent 32e82e9 commit 2250af5
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
10 changes: 5 additions & 5 deletions doomsday/plugins/idtech1converter/idtech1converter.pro
Expand Up @@ -16,14 +16,14 @@ deng_debug: DEFINES += DENG_IDTECH1CONVERTER_DEBUG
INCLUDEPATH += include

HEADERS += \
include/id1map.h \
include/idtech1converter.h \
include/mapimporter.h \
include/version.h \
include/idtech1converter.h

SOURCES += \
src/id1map.cpp \
src/id1map_loadblockmap.cpp \
src/idtech1converter.cpp
src/idtech1converter.cpp \
src/mapimporter.cpp \
src/mapimporter_loadblockmap.cpp

win32 {
RC_FILE = res/idtech1converter.rc
Expand Down
Expand Up @@ -27,7 +27,7 @@
#define IDTECH1CONVERTER_H

#include "doomsday.h"
#include "id1map.h"
#include "mapimporter.h"

DENG_USING_API(Base);
DENG_USING_API(F);
Expand Down
@@ -1,4 +1,4 @@
/** @file id1map.h id Tech 1 map format reader/interpreter.
/** @file mapimporter.h Resource importer for id Tech 1 format maps.
*
* @authors Copyright © 2007-2014 Daniel Swanson <danij@dengine.net>
*
Expand All @@ -17,8 +17,8 @@
* 02110-1301 USA</small>
*/

#ifndef IDTECH1CONVERTER_ID1MAP_H
#define IDTECH1CONVERTER_ID1MAP_H
#ifndef IDTECH1CONVERTER_MAPIMPORTER_H
#define IDTECH1CONVERTER_MAPIMPORTER_H

#include "dd_types.h" // lumpnum_t
#include <doomsday/filesys/file.h>
Expand All @@ -43,11 +43,11 @@ enum MaterialGroup {
typedef de::StringPool::Id MaterialId;

/**
* Map resource converter/interpreter for id Tech 1 map format(s).
* Resource importer for id Tech 1 format maps.
*
* @ingroup idtech1converter
*/
class Id1Map
class MapImporter
{
public:
/// Base class for load-related errors. @ingroup errors
Expand All @@ -57,7 +57,7 @@ class Id1Map
/**
* Attempt to construct a new Id1Map from the @a recognized data specified.
*/
Id1Map(de::Id1MapRecognizer const &recognized);
MapImporter(de::Id1MapRecognizer const &recognized);

/**
* Transfer the map to Doomsday (i.e., rebuild in native map format via the
Expand All @@ -81,4 +81,4 @@ class Id1Map

} // namespace idtech1

#endif // IDTECH1CONVERTER_ID1MAP_H
#endif // IDTECH1CONVERTER_MAPIMPORTER_H
4 changes: 2 additions & 2 deletions doomsday/plugins/idtech1converter/src/idtech1converter.cpp
Expand Up @@ -52,7 +52,7 @@ int ConvertMapHook(int /*hookType*/, int /*parm*/, void *context)
// Attempt a conversion...
try
{
QScopedPointer<Id1Map> map(new Id1Map(recognizer));
QScopedPointer<MapImporter> map(new MapImporter(recognizer));

// The archived map data was read successfully.
// Transfer to the engine via the runtime map editing interface.
Expand All @@ -61,7 +61,7 @@ int ConvertMapHook(int /*hookType*/, int /*parm*/, void *context)
map->transfer();
return true; // success
}
catch(Id1Map::LoadError const &er)
catch(MapImporter::LoadError const &er)
{
LOG_AS("IdTech1Converter");
LOG_MAP_ERROR("Load error: ") << er.asText();
Expand Down
@@ -1,4 +1,4 @@
/** @file id1map.cpp id Tech 1 map format reader.
/** @file mapimporter.cpp Resource importer for id Tech 1 format maps.
*
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2006-2014 Daniel Swanson <danij@dengine.net>
Expand All @@ -18,7 +18,7 @@
* 02110-1301 USA</small>
*/

#include "id1map.h"
#include "mapimporter.h"
#include <vector>
#include <list>
#include <QVector>
Expand All @@ -40,16 +40,16 @@ namespace internal {
class Id1MapElement
{
public:
Id1MapElement(Id1Map &map) : _map(&map) {}
Id1MapElement(MapImporter &map) : _map(&map) {}
Id1MapElement(Id1MapElement const &other) : _map(other._map) {}
virtual ~Id1MapElement() {}

Id1Map &map() const {
MapImporter &map() const {
DENG2_ASSERT(_map != 0);
return *_map;
}

Id1Map *_map;
MapImporter *_map;
};

struct SideDef : public Id1MapElement
Expand All @@ -61,7 +61,7 @@ struct SideDef : public Id1MapElement
MaterialId middleMaterial;
dint sector;

SideDef(Id1Map &map) : Id1MapElement(map) {}
SideDef(MapImporter &map) : Id1MapElement(map) {}

void operator << (de::Reader &from)
{
Expand Down Expand Up @@ -152,7 +152,7 @@ struct LineDef : public Id1MapElement
dint ddFlags;
duint validCount; ///< Used for polyobj line collection.

LineDef(Id1Map &map) : Id1MapElement(map) {}
LineDef(MapImporter &map) : Id1MapElement(map) {}

int sideIndex(Side which) const
{
Expand Down Expand Up @@ -293,7 +293,7 @@ struct SectorDef : public Id1MapElement
duint16 d64wallTopColor;
duint16 d64wallBottomColor;

SectorDef(Id1Map &map) : Id1MapElement(map) {}
SectorDef(MapImporter &map) : Id1MapElement(map) {}

void operator << (de::Reader &from)
{
Expand Down Expand Up @@ -375,7 +375,7 @@ struct Thing : public Id1MapElement
// DOOM64 format members:
dint16 d64TID;

Thing(Id1Map &map) : Id1MapElement(map) {}
Thing(MapImporter &map) : Id1MapElement(map) {}

void operator << (de::Reader &from)
{
Expand Down Expand Up @@ -576,7 +576,7 @@ struct TintColor : public Id1MapElement
dfloat rgb[3];
dint8 xx[3];

TintColor(Id1Map &map) : Id1MapElement(map) {}
TintColor(MapImporter &map) : Id1MapElement(map) {}

void operator << (de::Reader &from)
{
Expand Down Expand Up @@ -609,7 +609,7 @@ using namespace internal;

static uint validCount = 0; ///< Used with Polyobj LineDef collection.

DENG2_PIMPL(Id1Map)
DENG2_PIMPL(MapImporter)
{
Id1MapRecognizer::Format format;

Expand Down Expand Up @@ -1159,12 +1159,12 @@ DENG2_PIMPL(Id1Map)
}
};

Id1Map::Id1Map(Id1MapRecognizer const &recognized)
MapImporter::MapImporter(Id1MapRecognizer const &recognized)
: d(new Instance(this))
{
d->format = recognized.format();
if(d->format == Id1MapRecognizer::UnknownFormat)
throw LoadError("Id1Map", "Format unrecognized");
throw LoadError("MapImporter", "Format unrecognized");

// Allocate the vertices first as a large contiguous array suitable for
// passing directly to Doomsday's MapEdit interface.
Expand Down Expand Up @@ -1207,9 +1207,9 @@ Id1Map::Id1Map(Id1MapRecognizer const &recognized)
d->analyze();
}

void Id1Map::transfer()
void MapImporter::transfer()
{
LOG_AS("Id1Map");
LOG_AS("MapImporter");

Time begunAt;

Expand All @@ -1225,12 +1225,12 @@ void Id1Map::transfer()
LOGDEV_MAP_VERBOSE("Transfer completed in %.2f seconds") << begunAt.since();
}

MaterialId Id1Map::toMaterialId(String name, MaterialGroup group)
MaterialId MapImporter::toMaterialId(String name, MaterialGroup group)
{
return d->materials.toMaterialId(name, group);
}

MaterialId Id1Map::toMaterialId(int uniqueId, MaterialGroup group)
MaterialId MapImporter::toMaterialId(int uniqueId, MaterialGroup group)
{
return d->materials.toMaterialId(uniqueId, group);
}
Expand Down
@@ -1,4 +1,4 @@
/** @file id1map_loadblockmap.cpp id Tech 1 blockmap interpreter.
/** @file mapconverter_loadblockmap.cpp Blockmap data converter for id Tech 1 format maps.
*
* @ingroup idtech1converter
*
Expand Down

0 comments on commit 2250af5

Please sign in to comment.