[Scummvm-git-logs] scummvm branch-2-7 -> a27436186ab36722cf79752247b638d7004c24fd

sev- noreply at scummvm.org
Mon Feb 13 20:02:14 UTC 2023


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:
a27436186a FTA2: Load ResImportTable in a portable way


Commit: a27436186ab36722cf79752247b638d7004c24fd
    https://github.com/scummvm/scummvm/commit/a27436186ab36722cf79752247b638d7004c24fd
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-02-13T21:02:07+01:00

Commit Message:
FTA2: Load ResImportTable in a portable way

Changed paths:
    engines/saga2/towerfta.cpp


diff --git a/engines/saga2/towerfta.cpp b/engines/saga2/towerfta.cpp
index 304dd1652e6..3b29d59e96a 100644
--- a/engines/saga2/towerfta.cpp
+++ b/engines/saga2/towerfta.cpp
@@ -210,9 +210,24 @@ INITIALIZER(initResourceHandles) {
 		return false;
 	if (g_vm->getGameId() == GID_FTA2) {
 		// Only FTA2 has resource imports
-		resImports = (ResImportTable *)LoadResource(listRes, MKTAG('I', 'M', 'P', 'O'), "res imports");
-		if (!resImports)
+		Common::SeekableReadStream *stream = loadResourceToStream(listRes, MKTAG('I', 'M', 'P', 'O'), "res imports");
+
+		if (!stream)
 			return false;
+
+		resImports = (ResImportTable *)malloc(sizeof(ResImportTable));
+		resImports->deadActorProto = (int16)stream->readSint16LE();
+		(void)stream->readSint16LE();
+		(void)stream->readSint16LE();
+		resImports->EXP_spellEffect_CreateFireWisp = stream->readSint16LE();
+		resImports->EXP_spellEffect_CreateWindWisp = stream->readSint16LE();
+		resImports->EXP_spellEffect_CreateWraith = stream->readSint16LE();
+		resImports->EXP_spellEffect_TeleportToShrine = stream->readSint16LE();
+		resImports->EXP_spellEffect_Rejoin = stream->readSint16LE();
+		resImports->EXP_spellEffect_Timequake = stream->readSint16LE();
+		resImports->EXP_spellEffect_CreateFood = stream->readSint16LE();
+
+		delete stream;
 	}
 	return true;
 }




More information about the Scummvm-git-logs mailing list