[Scummvm-git-logs] scummvm master -> 38573ecbb53b705d49859b0216fc371b3a31ffb6

bluegr noreply at scummvm.org
Mon Oct 21 11:59:04 UTC 2024


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:
38573ecbb5 TINSEL: Initial work on the early DW2 Windows demo (dw2-win-demo-2-en)


Commit: 38573ecbb53b705d49859b0216fc371b3a31ffb6
    https://github.com/scummvm/scummvm/commit/38573ecbb53b705d49859b0216fc371b3a31ffb6
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-10-21T14:58:23+03:00

Commit Message:
TINSEL: Initial work on the early DW2 Windows demo (dw2-win-demo-2-en)

This demo has different file names for the globals and index.
It now progresses a bit further, before crashing because of
differences in opcodes

Changed paths:
    engines/tinsel/handle.cpp
    engines/tinsel/pcode.cpp


diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp
index 73b56923cc6..b729b262487 100644
--- a/engines/tinsel/handle.cpp
+++ b/engines/tinsel/handle.cpp
@@ -90,7 +90,10 @@ void Handle::SetupHandleTable() {
 	MEMHANDLE *pH;
 	TinselFile f(TinselV1Mac || TinselV1Saturn);
 
-	const char *indexFileName = TinselV1PSX ? PSX_INDEX_FILENAME : INDEX_FILENAME;
+	Common::String indexFileName = TinselV1PSX ? PSX_INDEX_FILENAME : INDEX_FILENAME;
+
+	if (Common::File::exists("index_"))
+		indexFileName = "index_";
 
 	if (f.open(indexFileName)) {
 		// get size of index file
@@ -99,7 +102,7 @@ void Handle::SetupHandleTable() {
 		if (len > 0) {
 			if ((len % RECORD_SIZE) != 0) {
 				// index file is corrupt
-				error(FILE_IS_CORRUPT, indexFileName);
+				error(FILE_IS_CORRUPT, indexFileName.c_str());
 			}
 
 			// calc number of handles
@@ -125,16 +128,16 @@ void Handle::SetupHandleTable() {
 
 			if (f.eos() || f.err()) {
 				// index file is corrupt
-				error(FILE_IS_CORRUPT, indexFileName);
+				error(FILE_IS_CORRUPT, indexFileName.c_str());
 			}
 
 			// close the file
 			f.close();
 		} else {	// index file is corrupt
-			error(FILE_IS_CORRUPT, indexFileName);
+			error(FILE_IS_CORRUPT, indexFileName.c_str());
 		}
 	} else {	// cannot find the index file
-		error(CANNOT_FIND_FILE, indexFileName);
+		error(CANNOT_FIND_FILE, indexFileName.c_str());
 	}
 
 	// allocate memory nodes and load all permanent graphics
diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp
index 7b61f9ee520..b7d85d2ebfb 100644
--- a/engines/tinsel/pcode.cpp
+++ b/engines/tinsel/pcode.cpp
@@ -462,19 +462,21 @@ void RegisterGlobals(int num) {
 		// read initial values
 		CdCD(Common::nullContext);
 
+		const char *globalsFile = Common::File::exists("gdata_") ? "gdata_" : GLOBALS_FILENAME;
+
 		Common::File f;
-		if (!f.open(GLOBALS_FILENAME))
-			error(CANNOT_FIND_FILE, GLOBALS_FILENAME);
+		if (!f.open(globalsFile))
+			error(CANNOT_FIND_FILE, globalsFile);
 
 		int32 length = f.readSint32LE();
 		if (length != num)
-			error(FILE_IS_CORRUPT, GLOBALS_FILENAME);
+			error(FILE_IS_CORRUPT, globalsFile);
 
 		for (int i = 0; i < length; ++i)
 			g_pGlobals[i] = f.readSint32LE();
 
 		if (f.eos() || f.err())
-			error(FILE_IS_CORRUPT, GLOBALS_FILENAME);
+			error(FILE_IS_CORRUPT, globalsFile);
 
 		f.close();
 	}




More information about the Scummvm-git-logs mailing list