[Scummvm-git-logs] scummvm master -> 8f5fb5bb48630623a5c9339c6155fc9fcbca4dbf
neuromancer
noreply at scummvm.org
Wed Feb 8 07:51:57 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:
8f5fb5bb48 FREESCAPE: load some? global objects in dark for dos (and demo)
Commit: 8f5fb5bb48630623a5c9339c6155fc9fcbca4dbf
https://github.com/scummvm/scummvm/commit/8f5fb5bb48630623a5c9339c6155fc9fcbca4dbf
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-02-08T08:53:15+01:00
Commit Message:
FREESCAPE: load some? global objects in dark for dos (and demo)
Changed paths:
engines/freescape/freescape.h
engines/freescape/games/dark.cpp
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 2388a153ddc..ac30334df92 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -466,6 +466,9 @@ public:
void drawFullscreenMessage(Common::String message);
Common::Error saveGameStreamExtended(Common::WriteStream *stream, bool isAutosave = false) override;
Common::Error loadGameStreamExtended(Common::SeekableReadStream *stream) override;
+
+private:
+ void loadGlobalObjects(Common::SeekableReadStream *file, int offset);
};
class EclipseEngine : public FreescapeEngine {
diff --git a/engines/freescape/games/dark.cpp b/engines/freescape/games/dark.cpp
index 5b200097680..edd1d0bcfe4 100644
--- a/engines/freescape/games/dark.cpp
+++ b/engines/freescape/games/dark.cpp
@@ -67,6 +67,7 @@ void DarkEngine::loadAssetsDemo() {
loadMessagesFixedSize(&file, 0x4525, 16, 27);
loadMessagesFixedSize(&file, 0x9959, 307, 5);
loadFonts(&file, 0xa598);
+ loadGlobalObjects(&file, 0x3d04);
load8bitBinary(&file, 0xa700, 16);
} else if (isDOS() && _renderMode == Common::kRenderCGA) {
//loadBundledImages();
@@ -80,6 +81,23 @@ void DarkEngine::loadAssetsDemo() {
error("Invalid or unsupported render mode %s for Dark Side", Common::getRenderModeDescription(_renderMode));
}
+
+void DarkEngine::loadGlobalObjects(Common::SeekableReadStream *file, int offset) {
+ assert(!_areaMap.contains(255));
+ ObjectMap *globalObjectsByID = new ObjectMap;
+ file->seek(offset);
+ for (int i = 0; i < 22; i++) {
+ Object *gobj = load8bitObject(file);
+ assert(gobj);
+ assert(!globalObjectsByID->contains(gobj->getObjectID()));
+ debugC(1, kFreescapeDebugParser, "Adding global object: %d", gobj->getObjectID());
+ (*globalObjectsByID)[gobj->getObjectID()] = gobj;
+ }
+
+ _areaMap[255] = new Area(255, 0, globalObjectsByID, nullptr);
+}
+
+
void DarkEngine::initGameState() {
_flyMode = false;
_noClipMode = false;
@@ -119,7 +137,14 @@ void DarkEngine::loadAssetsFullGame() {
loadFonts(&file, 0xa113);
loadMessagesFixedSize(&file, 0x4525, 16, 27);
+ loadGlobalObjects(&file, 0x3d04);
load8bitBinary(&file, 0xa280, 16);
+ // TODO: load objects
+ /*for (auto &it : _areaMap) {
+ if (!it._value->entranceWithID(255))
+ continue;
+ it._value->addStructure(_areaMap[255]);
+ }*/
} else if (_renderMode == Common::kRenderCGA) {
loadBundledImages();
file.open("DSIDEC.EXE");
More information about the Scummvm-git-logs
mailing list