[Scummvm-git-logs] scummvm master -> 27c80f012a15d0255881df363041217c2a8a7836

dreammaster dreammaster at scummvm.org
Tue Feb 28 01:45:03 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

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


Commit: 27c80f012a15d0255881df363041217c2a8a7836
    https://github.com/scummvm/scummvm/commit/27c80f012a15d0255881df363041217c2a8a7836
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-27T19:45:00-05:00

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

Changed paths:
    engines/titanic/core/resource_key.cpp
    engines/titanic/core/resource_key.h
    engines/titanic/core/room_item.cpp
    engines/titanic/core/view_item.cpp
    engines/titanic/game_manager.cpp


diff --git a/engines/titanic/core/resource_key.cpp b/engines/titanic/core/resource_key.cpp
index 3db5812..e10b3be 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 27b23ed..f9c37a7 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 1c360c7..afac3ec 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 15d187e..1579743 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 5f51498..da6048a 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);





More information about the Scummvm-git-logs mailing list