Skip to content

Commit

Permalink
Fixed|World|WadMapConverter: Build error/warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Jul 4, 2014
1 parent 609faf6 commit e847bc7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion doomsday/client/src/world/api_map.cpp
Expand Up @@ -1489,7 +1489,7 @@ DENG_EXTERN_C dd_bool P_MapIsCustom(char const *uriCString)
#undef P_MapSourceFile
DENG_EXTERN_C AutoStr *P_MapSourceFile(char const *uriCString)
{
if(!uriCString || !uriCString[0]) return false;
if(!uriCString || !uriCString[0]) return 0;
if(MapDef const *mapDef = App_ResourceSystem().mapDef(de::Uri(uriCString, RC_NULL)))
{
return AutoStr_FromTextStd(mapDef->sourceFile()->composePath().toUtf8().constData());
Expand Down
5 changes: 0 additions & 5 deletions doomsday/client/src/world/worldsystem.cpp
Expand Up @@ -263,11 +263,6 @@ dd_bool ddMapSetup;

static char const *mapCacheDir = "mapcache/";

static inline lumpnum_t markerLumpNumForPath(String path)
{
return App_FileSystem().lumpNumForName(path);
}

/// Determine the identity key for maps loaded from the specified @a sourcePath.
static String cacheIdForMap(String const &sourcePath)
{
Expand Down
31 changes: 18 additions & 13 deletions doomsday/plugins/wadmapconverter/src/id1map.cpp
Expand Up @@ -40,11 +40,16 @@ namespace internal {
class Id1MapElement
{
public:
Id1MapElement(Id1Map &map) : map(map) {}
Id1MapElement(Id1MapElement const &other) : map(other.map) {}
Id1MapElement(Id1Map &map) : _map(&map) {}
Id1MapElement(Id1MapElement const &other) : _map(other._map) {}
virtual ~Id1MapElement() {}

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

Id1Map *_map;
};

struct SideDef : public Id1MapElement
Expand Down Expand Up @@ -72,24 +77,24 @@ struct SideDef : public Id1MapElement
case Id1MapRecognizer::HexenFormat: {
Block name;
from.readBytes(8, name);
topMaterial = map.toMaterialId(name.constData(), WallMaterials);
topMaterial = map().toMaterialId(name.constData(), WallMaterials);

from.readBytes(8, name);
bottomMaterial = map.toMaterialId(name.constData(), WallMaterials);
bottomMaterial = map().toMaterialId(name.constData(), WallMaterials);

from.readBytes(8, name);
middleMaterial = map.toMaterialId(name.constData(), WallMaterials);
middleMaterial = map().toMaterialId(name.constData(), WallMaterials);
break; }

case Id1MapRecognizer::Doom64Format:
from.readAs<duint16>(idx);
topMaterial = map.toMaterialId(idx, WallMaterials);
topMaterial = map().toMaterialId(idx, WallMaterials);

from.readAs<duint16>(idx);
bottomMaterial = map.toMaterialId(idx, WallMaterials);
bottomMaterial = map().toMaterialId(idx, WallMaterials);

from.readAs<duint16>(idx);
middleMaterial = map.toMaterialId(idx, WallMaterials);
middleMaterial = map().toMaterialId(idx, WallMaterials);
break;

default:
Expand Down Expand Up @@ -303,21 +308,21 @@ struct SectorDef : public Id1MapElement
case Id1MapRecognizer::HexenFormat: {
Block name;
from.readBytes(8, name);
floorMaterial= map.toMaterialId(name.constData(), PlaneMaterials);
floorMaterial= map().toMaterialId(name.constData(), PlaneMaterials);

from.readBytes(8, name);
ceilMaterial = map.toMaterialId(name.constData(), PlaneMaterials);
ceilMaterial = map().toMaterialId(name.constData(), PlaneMaterials);

from >> lightLevel;
break; }

case Id1MapRecognizer::Doom64Format: {
duint16 idx;
from >> idx;
floorMaterial= map.toMaterialId(idx, PlaneMaterials);
floorMaterial= map().toMaterialId(idx, PlaneMaterials);

from >> idx;
ceilMaterial = map.toMaterialId(idx, PlaneMaterials);
ceilMaterial = map().toMaterialId(idx, PlaneMaterials);

from >> d64ceilingColor
>> d64floorColor
Expand Down

0 comments on commit e847bc7

Please sign in to comment.