Skip to content

Commit

Permalink
ResourceSystem: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Mar 14, 2014
1 parent 2e8cf9a commit 4560da6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions doomsday/client/include/resource/savegameconverter.h
Expand Up @@ -30,6 +30,9 @@ namespace de {
* @param inputFilePath Path to the savegame file to be converted.
* @param session SavedSession to update if conversion is successful.
*
* @return @c true if conversion completed successfully. Note that this is not a
* guarantee that the given @a session is now loadable, however.
*
* @ingroup resource
*/
bool convertSavegame(de::Path inputFilePath, de::game::SavedSession &session);
Expand Down
7 changes: 4 additions & 3 deletions doomsday/client/src/resource/savegameconverter.cpp
Expand Up @@ -20,6 +20,7 @@
#include "resource/savegameconverter.h"

#include "dd_main.h"
#include <de/Error>
#include <de/game/SavedSessionRepository>
#include <de/Log>
#include <de/NativePath>
Expand All @@ -34,15 +35,15 @@ static void tryConversion(Path const &inputFilePath, Path const &outputFilePath)
Str_Set(Str_InitStd(&parm.inputFilePath), NativePath(inputFilePath).expand().asText().toUtf8().constData());
Str_Set(Str_InitStd(&parm.outputFilePath), NativePath(outputFilePath).expand().asText().toUtf8().constData());

// Try to converter the savegame via each plugin in turn.
// Try to convert the savegame via each plugin in turn.
dd_bool success = DD_CallHooks(HOOK_MAP_CONVERT, 0, &parm);

Str_Free(&parm.inputFilePath);
Str_Free(&parm.inputFilePath);
Str_Free(&parm.outputFilePath);

if(!success)
{
/// @throw Error Seemingly no converter was able to fulfill our request.
/// @throw Error Seemingly no plugin was able to fulfill our request.
throw Error("SavegameConverter", "Savegame file format was not recognized");
}
}
Expand Down

0 comments on commit 4560da6

Please sign in to comment.