Skip to content

Commit

Permalink
Savegame Tool|Id1Translator: Fix translation of fixed length user sav…
Browse files Browse the repository at this point in the history
…e descriptions

As of this commit, converted vanilla savegames are now listed by the
saved session management UI in Doomsday.

Plus some cleanup.
  • Loading branch information
danij-deng committed Mar 19, 2014
1 parent d0fe522 commit 1eefd0f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions doomsday/tools/savegametool/src/id1translator.cpp
Expand Up @@ -122,9 +122,9 @@ DENG2_PIMPL(Id1Translator)
{
Block tmp(24);
from >> FixedByteArray(tmp);
char descBuf[24];
tmp.get(0, (Block::Byte *)descBuf, 24);
metadata.set("userDescription", String(descBuf, 24));
char descBuf[24 + 1];
tmp.get(0, (Block::Byte *)descBuf, 24); descBuf[24] = 0;
metadata.set("userDescription", descBuf);
}

{
Expand Down Expand Up @@ -152,8 +152,8 @@ DENG2_PIMPL(Id1Translator)
uint episode, map;
from.readAs<dchar>(episode);
from.readAs<dchar>(map);
DENG2_ASSERT(episode > 0 && map > 0);
metadata.set("mapUri", composeMapUriPath(episode - 1, map - 1).asText());
DENG2_ASSERT(map > 0);
metadata.set("mapUri", composeMapUriPath(episode, map - 1).asText());

ArrayValue *array = new ArrayValue;
int idx = 0;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/tools/savegametool/src/id1translator.h
Expand Up @@ -28,7 +28,7 @@
class Id1Translator : public PackageFormatter
{
public:
/// The game identity key of the source data is ambious. @ingroup errors
/// The game identity key of the source data is ambigous. @ingroup errors
DENG2_SUB_ERROR(ReadError, AmbigousGameIdError);

/// Logical identifiers for supported save formats.
Expand Down
4 changes: 1 addition & 3 deletions doomsday/tools/savegametool/src/main.cpp
Expand Up @@ -17,9 +17,7 @@
* 02110-1301 USA</small>
*/

#include <QDebug>
#include <QList>
#include <QMutableListIterator>
#include <QtAlgorithms>
#include <de/DirectoryFeed>
#include <de/TextApp>
Expand Down Expand Up @@ -188,7 +186,7 @@ int main(int argc, char **argv)
if(i + 1 < args.count() && !args.at(i).compareWithoutCase("-idkey"))
{
fallbackGameId = args.at(i + 1).strip().toLower();
i += 2;
i += 1;
}
continue;
}
Expand Down
2 changes: 2 additions & 0 deletions doomsday/tools/savegametool/src/nativetranslator.cpp
Expand Up @@ -18,6 +18,8 @@
*/

#include "lzss.h"
#include <QList>
#include <QMutableListIterator>
#include <de/TextApp>
#include <de/ArrayValue>
#include <de/NativeFile>
Expand Down
2 changes: 1 addition & 1 deletion doomsday/tools/savegametool/src/nativetranslator.h
Expand Up @@ -28,7 +28,7 @@
class NativeTranslator : public PackageFormatter
{
public:
/// The game identity key of the source data is ambious. @ingroup errors
/// The game identity key of the source data is ambigous. @ingroup errors
DENG2_SUB_ERROR(ReadError, AmbigousGameIdError);

/// Logical identifiers for supported save formats.
Expand Down

0 comments on commit 1eefd0f

Please sign in to comment.