TITANIC: Fix PET not showing on savegame load in front of nav helmet

This commit is contained in:
Paul Gilbert 2017-02-27 19:45:00 -05:00
parent fc0f3662a0
commit 27c80f012a
5 changed files with 10 additions and 12 deletions

View File

@ -58,7 +58,7 @@ void CResourceKey::setValue(const CString &name) {
_value = _value.mid(idx + 1);
}
CString CResourceKey::exists() const {
CString CResourceKey::getFilename() const {
CString name = _key;
// Check for a resource being specified within an ST container
@ -68,10 +68,9 @@ CString CResourceKey::exists() const {
name += ".st";
}
// The original did tests for the file in the different
// asset paths, which aren't needed in ScummVM
Common::File f;
return f.exists(name) ? name : CString();
// The original did tests for the file in the different asset paths,
// which aren't needed in ScummVM, so just return full name
return name;
}
bool CResourceKey::scanForFile() const {

View File

@ -55,10 +55,9 @@ public:
const CString &getString() const { return _key; }
/**
* Checks whether a file for the given key exists,
* and returns it's filename if it does
* Extracts a filename from the resource key
*/
CString exists() const;
CString getFilename() const;
/**
* Scans for a file with a matching name

View File

@ -103,10 +103,10 @@ void CRoomItem::load(SimpleFile *file) {
}
void CRoomItem::postLoad() {
if (!_exitMovieKey.exists().empty())
if (!_exitMovieKey.getFilename().empty())
return;
CString name = _transitionMovieKey.exists();
CString name = _transitionMovieKey.getFilename();
if (name.right(7) == "nav.avi") {
_exitMovieKey = CResourceKey(name.left(name.size() - 7) + "exit.avi");
}

View File

@ -81,7 +81,7 @@ void CViewItem::load(SimpleFile *file) {
bool CViewItem::getResourceKey(CResourceKey *key) {
*key = _resourceKey;
CString filename = key->exists();
CString filename = key->getFilename();
return !filename.empty();
}

View File

@ -132,7 +132,7 @@ void CGameManager::roomTransition(CRoomItem *oldRoom, CRoomItem *newRoom) {
CResourceKey movieKey = (oldRoom == newRoom) ? oldRoom->getTransitionMovieKey() :
oldRoom->getExitMovieKey();
CString filename = movieKey.exists();
CString filename = movieKey.getFilename();
if (g_vm->_filesManager->fileExists(filename)) {
_movieSurface->freeSurface();
_movie = g_vm->_movieManager.createMovie(filename, _movieSurface);