Skip to content

Commit

Permalink
Refactor|DEH Reader: Updated DED, MapInfo access (now Record)
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Jul 28, 2014
1 parent 2ced9df commit ef4063c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
3 changes: 1 addition & 2 deletions doomsday/plugins/dehread/include/dehreader_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@

#include <QString>
#include <QStringList>
#include <doomsday/defs/mapinfo.h>
#include "dehreader.h"

/// @return Newly composed map URI.
de::Uri composeMapUri(int episode, int map);

int mapInfoDefForUri(de::Uri const &uri, ded_mapinfo_t **def = 0);

int valueDefForPath(de::String const &id, ded_value_t **def = 0);

/**
Expand Down
7 changes: 3 additions & 4 deletions doomsday/plugins/dehread/src/dehreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1449,13 +1449,12 @@ class DehReader

// Apply.
de::Uri const uri = composeMapUri(episode, map);
ded_mapinfo_t *def;
int idx = mapInfoDefForUri(uri, &def);
int idx = ded->getMapInfoNum(&uri);
if(idx >= 0)
{
def->parTime = parTime;
ded->mapInfos[idx].set("parTime", parTime);
LOG_DEBUG("MapInfo #%i \"%s\" parTime => %d")
<< idx << uri << def->parTime;
<< idx << uri << parTime;
}
else
{
Expand Down
15 changes: 0 additions & 15 deletions doomsday/plugins/dehread/src/dehreader_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,6 @@ de::Uri composeMapUri(int episode, int map)
}
}

int mapInfoDefForUri(de::Uri const &uri, ded_mapinfo_t **def)
{
if(!uri.path().isEmpty())
for(int i = ded->mapInfo.size() - 1; i >= 0; i--)
{
ded_mapinfo_t &info = ded->mapInfo[i];
if(info.uri && *info.uri == uri)
{
if(def) *def = &info;
return i;
}
}
return -1; // Not found.
}

int valueDefForPath(String const &id, ded_value_t **def)
{
if(!id.isEmpty())
Expand Down

0 comments on commit ef4063c

Please sign in to comment.