Skip to content

Commit

Permalink
AURORA: Fix TheWitcherSaveFile to use only file stems
Browse files Browse the repository at this point in the history
  • Loading branch information
Nostritius authored and DrMcCoy committed Nov 3, 2018
1 parent 9ce6c6f commit 7cc5db9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/aurora/thewitchersavefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ void TheWitcherSaveFile::load() {
resource.type = TypeMan.getFileType(resource.name);
resource.index = i;

// Remove the file type from the name
resource.name = TypeMan.setFileType(resource.name, Aurora::kFileTypeNone);

// Replace potential windows slashes
resource.name.replaceAll('\\', '/');

IResource iResource;
iResource.length = _tws->readUint32LE();
iResource.offset = _tws->readUint32LE();
Expand All @@ -116,4 +122,8 @@ void TheWitcherSaveFile::load() {
}
}

uint32 TheWitcherSaveFile::getResourceSize(uint32 index) const {
return _resources[index].length;
}

} // End of namespace Aurora
3 changes: 3 additions & 0 deletions src/aurora/thewitchersavefile.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class TheWitcherSaveFile : public Archive {
/** Return the list of resources. */
const ResourceList &getResources() const;

/** Get the resource size. */
uint32 getResourceSize(uint32 index) const;

/** Return a stream of the resource's contents. */
Common::SeekableReadStream *getResource(uint32 index, bool tryNoCopy = false) const;

Expand Down

0 comments on commit 7cc5db9

Please sign in to comment.