diff options
author | Bendegúz Nagy | 2016-08-16 10:22:18 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | 4f916a08d23e05c445c7dc42807b3d61a1beb3e9 (patch) | |
tree | 19e376952fc9fd1aa7251274b4d9b815def2ced0 | |
parent | b5eb075a66a1f064fe8f8479c63bd99a518b1da4 (diff) | |
download | scummvm-rg350-4f916a08d23e05c445c7dc42807b3d61a1beb3e9.tar.gz scummvm-rg350-4f916a08d23e05c445c7dc42807b3d61a1beb3e9.tar.bz2 scummvm-rg350-4f916a08d23e05c445c7dc42807b3d61a1beb3e9.zip |
DM: Add support for uncompressed dungeon.dat
-rw-r--r-- | engines/dm/TODOs/todo.txt | 9 | ||||
-rw-r--r-- | engines/dm/dungeonman.cpp | 12 |
2 files changed, 9 insertions, 12 deletions
diff --git a/engines/dm/TODOs/todo.txt b/engines/dm/TODOs/todo.txt index 5509e69bd0..44cc616f65 100644 --- a/engines/dm/TODOs/todo.txt +++ b/engines/dm/TODOs/todo.txt @@ -6,12 +6,6 @@ Bugs: Logic: Items thrown on the right side end up on the left side - -Possible bugs: - - k1_LeftMouseButton and k2_RightMouseButton have values 1 and 2 respectively, contrary to the original in the original: MASK0x0001_MOUSE_RIGHT_BUTTON, MASK0x0002_MOUSE_LEFT_BUTTON - - possible garbage value return in f140_getObjectWeight - - Todo: Add wiki entry for DM @@ -20,8 +14,7 @@ Todo: I forgot to add a bunch of warning for show/hide mouse pointer and other mouse functions Code stuff todo: - Complete stub methods(blitShrink, etc.) - Add scroller + Complete stub methods(blitShrink, blitmask, scroller, etc.) Save file f433_processCommand140_saveGame fails silently, add error checking Clean up f113_drawField diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index b745a99527..a70077c008 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -427,11 +427,11 @@ DungeonMan::~DungeonMan() { void DungeonMan::f455_decompressDungeonFile() { Common::File f; f.open("Dungeon.dat"); - if (f.readUint16BE() == 0x8104) { + if (f.readUint16BE() == 0x8104) { // if dungeon is compressed _rawDunFileDataSize = f.readUint32BE(); delete[] _rawDunFileData; _rawDunFileData = new byte[_rawDunFileDataSize]; - f.readUint16BE(); + f.readUint16BE(); // discard byte common[4]; for (uint16 i = 0; i < 4; ++i) common[i] = f.readByte(); @@ -475,8 +475,12 @@ void DungeonMan::f455_decompressDungeonFile() { bitsUsedInWord += 10; } } - } else { - warning(false, "TODO: if the dungeon is uncompressed, read it here"); + } else { // read uncompressed Dungeon.dat + f.seek(0); + _rawDunFileDataSize = f.size(); + delete[] _rawDunFileData; + _rawDunFileData = new byte[_rawDunFileDataSize]; + f.read(_rawDunFileData, _rawDunFileDataSize); } f.close(); } |