aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2017-02-27 19:45:00 -0500
committerPaul Gilbert2017-02-27 19:45:00 -0500
commit27c80f012a15d0255881df363041217c2a8a7836 (patch)
tree4b11db3e8d94d4e97bf3a3d37d55a9ce23982aa4 /engines
parentfc0f3662a09409ec987cef20c6dba3b9862278bf (diff)
downloadscummvm-rg350-27c80f012a15d0255881df363041217c2a8a7836.tar.gz
scummvm-rg350-27c80f012a15d0255881df363041217c2a8a7836.tar.bz2
scummvm-rg350-27c80f012a15d0255881df363041217c2a8a7836.zip
TITANIC: Fix PET not showing on savegame load in front of nav helmet
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/core/resource_key.cpp9
-rw-r--r--engines/titanic/core/resource_key.h5
-rw-r--r--engines/titanic/core/room_item.cpp4
-rw-r--r--engines/titanic/core/view_item.cpp2
-rw-r--r--engines/titanic/game_manager.cpp2
5 files changed, 10 insertions, 12 deletions
diff --git a/engines/titanic/core/resource_key.cpp b/engines/titanic/core/resource_key.cpp
index 3db5812d7d..e10b3be4cb 100644
--- a/engines/titanic/core/resource_key.cpp
+++ b/engines/titanic/core/resource_key.cpp
@@ -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 {
diff --git a/engines/titanic/core/resource_key.h b/engines/titanic/core/resource_key.h
index 27b23ed1e7..f9c37a7de0 100644
--- a/engines/titanic/core/resource_key.h
+++ b/engines/titanic/core/resource_key.h
@@ -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
diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp
index 1c360c7571..afac3ec5d4 100644
--- a/engines/titanic/core/room_item.cpp
+++ b/engines/titanic/core/room_item.cpp
@@ -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");
}
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 15d187e194..15797438cb 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -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();
}
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 5f51498e93..da6048a663 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -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);