aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBendegúz Nagy2016-06-30 19:59:35 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commitd312ac086d0a1cd19c784e1fd7752652f8896ad8 (patch)
treed66745594e2e1d90ee71ca6e2fd0d11a0e89458d
parent6d2d839d2721917e2c512511da544a07a9382322 (diff)
downloadscummvm-rg350-d312ac086d0a1cd19c784e1fd7752652f8896ad8.tar.gz
scummvm-rg350-d312ac086d0a1cd19c784e1fd7752652f8896ad8.tar.bz2
scummvm-rg350-d312ac086d0a1cd19c784e1fd7752652f8896ad8.zip
DM: Add dependencies for F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF
-rw-r--r--engines/dm/TODOs/methodtree.txt55
-rw-r--r--engines/dm/dm.cpp4
-rw-r--r--engines/dm/dm.h2
-rw-r--r--engines/dm/dungeonman.cpp6
-rw-r--r--engines/dm/dungeonman.h4
-rw-r--r--engines/dm/gfx.cpp176
-rw-r--r--engines/dm/gfx.h11
-rw-r--r--engines/dm/loadsave.cpp3
-rw-r--r--engines/dm/module.mk3
-rw-r--r--engines/dm/timeline.cpp55
-rw-r--r--engines/dm/timeline.h162
11 files changed, 431 insertions, 50 deletions
diff --git a/engines/dm/TODOs/methodtree.txt b/engines/dm/TODOs/methodtree.txt
index 894ea89bc5..f790d50c6e 100644
--- a/engines/dm/TODOs/methodtree.txt
+++ b/engines/dm/TODOs/methodtree.txt
@@ -12,45 +12,22 @@ F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF
F0145_DUNGEON_GetGroupCells // done
F0147_DUNGEON_GetGroupDirections // done
GROUP // done
- CreatureType // done
- G0017_auc_Graphic562_PaletteChanges_NoChanges
- G0075_apuc_PaletteChanges_Projectile
- G0077_B_DoNotDrawFluxcagesDuringEndgame
- G0105_s_Graphic558_Box_ExplosionPattern_D0C
- G0163_as_Graphic558_Frame_Walls
- G0188_as_Graphic558_FieldAspects
- G0209_as_Graphic558_ObjectAspects
- G0210_as_Graphic558_ProjectileAspects
- G0212_auc_Graphic558_PaletteChanges_Smoke
- G0213_auc_Graphic558_PaletteChanges_FloorOrnament_D3
- G0214_auc_Graphic558_PaletteChanges_FloorOrnament_D2
- G0215_auc_Graphic558_ProjectileScales
- G0216_auc_Graphic558_ExplosionBaseScales
- G0217_aauc_Graphic558_ObjectPileShiftSetIndices
- G0218_aaaauc_Graphic558_ObjectCoordinateSets
- G0219_as_Graphic558_CreatureAspects
- G0221_auc_Graphic558_PaletteChanges_Creature_D3
- G0222_auc_Graphic558_PaletteChanges_Creature_D2
- G0223_aac_Graphic558_ShiftSets
- G0224_aaaauc_Graphic558_CreatureCoordinateSets
- G0225_aai_Graphic558_CenteredExplosionCoordinates
- G0226_aaai_Graphic558_ExplosionCoordinates
- G0227_aai_Graphic558_RebirthStep2ExplosionCoordinates
- G0228_aai_Graphic558_RebirthStep1ExplosionCoordinates
- G0237_as_Graphic559_ObjectInfo
- G0243_as_Graphic559_CreatureInfo
- G0291_aauc_DungeonViewClickableBoxes
- G0292_aT_PileTopObject
- G0370_ps_Events
- G0375_ps_ActiveGroups
- OBJECT_ASPECT
- GROUP // done
- ACTIVE_GROUP
- CREATURE_INFO // done
- CREATURE_ASPECT // done
- PROJECTILE
- EXPLOSION
- FIELD_ASPECT // done
+ CreatureType // done
+ G0077_B_DoNotDrawFluxcagesDuringEndgame // done
+ G0105_s_Graphic558_Box_ExplosionPattern_D0C // one
+ G0188_as_Graphic558_FieldAspects // done
+ G0216_auc_Graphic558_ExplosionBaseScales // done
+ G0217_aauc_Graphic558_ObjectPileShiftSetIndices // done
+ G0218_aaaauc_Graphic558_ObjectCoordinateSets // done
+ G0223_aac_Graphic558_ShiftSets // done
+ G0224_aaaauc_Graphic558_CreatureCoordinateSets // done
+ G0225_aai_Graphic558_CenteredExplosionCoordinates // done
+ G0226_aaai_Graphic558_ExplosionCoordinates // done
+ G0227_aai_Graphic558_RebirthStep2ExplosionCoordinates // done
+ G0228_aai_Graphic558_RebirthStep1ExplosionCoordinates // done
+ G0292_aT_PileTopObject // done
+ G0370_ps_Events // done
+
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index 924988d39d..66a11250e8 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -50,6 +50,7 @@
#include "text.h"
#include "movesens.h"
#include "group.h"
+#include "timeline.h"
namespace DM {
@@ -104,6 +105,7 @@ DMEngine::DMEngine(OSystem *syst) : Engine(syst), _console(nullptr) {
_textMan = nullptr;
_movsens = nullptr;
_groupMan = nullptr;
+ _timeline = nullptr;
_stopWaitingForPlayerInput = false;
_gameTimeTicking = false;
_restartGameAllowed = false;
@@ -133,6 +135,7 @@ DMEngine::~DMEngine() {
delete _textMan;
delete _movsens;
delete _groupMan;
+ delete _timeline;
// clear debug channels
DebugMan.clearAllDebugChannels();
@@ -216,6 +219,7 @@ Common::Error DMEngine::run() {
_textMan = new TextMan(this);
_movsens = new MovesensMan(this);
_groupMan = new GroupMan(this);
+ _timeline = new Timeline(this);
_displayMan->setUpScreens(320, 200);
initializeGame(); // @ F0463_START_InitializeGame_CPSADEF
diff --git a/engines/dm/dm.h b/engines/dm/dm.h
index b0d063125b..814b89da4e 100644
--- a/engines/dm/dm.h
+++ b/engines/dm/dm.h
@@ -47,6 +47,7 @@ class InventoryMan;
class TextMan;
class MovesensMan;
class GroupMan;
+class Timeline;
enum direction {
@@ -165,6 +166,7 @@ public:
TextMan *_textMan;
MovesensMan *_movsens;
GroupMan *_groupMan;
+ Timeline *_timeline;
bool _stopWaitingForPlayerInput; // G0321_B_StopWaitingForPlayerInput
bool _gameTimeTicking; // @ G0301_B_GameTimeTicking
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index e513e58f44..8d5c99bde5 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -29,6 +29,7 @@
#include "common/memstream.h"
#include "dungeonman.h"
+#include "timeline.h"
@@ -369,7 +370,6 @@ void DungeonMan::mapCoordsAfterRelMovement(direction dir, int16 stepsForward, in
DungeonMan::DungeonMan(DMEngine *dmEngine) : _vm(dmEngine), _rawDunFileData(NULL), _maps(NULL), _rawMapData(NULL) {
_dunData._columCount = 0;
- _dunData._eventMaximumCount = 0;
_dunData._mapsFirstColumnIndex = nullptr;
_dunData._columnsCumulativeSquareThingCount = nullptr;
@@ -652,7 +652,7 @@ void DungeonMan::loadDungeonFile() {
// TODO: ??? what this
if (_messages._newGame)
- _dunData._eventMaximumCount = 100;
+ _vm->_timeline->_eventMaxCount = 100;
// load things
for (uint16 thingType = kDoorThingType; thingType < kThingTypeTotal; ++thingType) {
@@ -699,7 +699,7 @@ void DungeonMan::loadDungeonFile() {
if (_messages._newGame) {
if ((thingType == kGroupThingType) || thingType >= kProjectileThingType)
- _dunData._eventMaximumCount += _fileHeader._thingCounts[thingType];
+ _vm->_timeline->_eventMaxCount += _fileHeader._thingCounts[thingType];
for (uint16 i = 0; i < gAdditionalThingCounts[thingType]; ++i) {
_dunData._thingsData[thingType][thingCount + i][0] = Thing::_none.toUint16();
}
diff --git a/engines/dm/dungeonman.h b/engines/dm/dungeonman.h
index ec04aa8c8f..f3faafdf21 100644
--- a/engines/dm/dungeonman.h
+++ b/engines/dm/dungeonman.h
@@ -589,9 +589,6 @@ struct DungeonData {
uint16 **_thingsData[16]; // @ G0284_apuc_ThingData
byte ***_mapData; // @ G0279_pppuc_DungeonMapData
-
- // TODO: ??? is this doing here
- uint16 _eventMaximumCount; // @ G0369_ui_EventMaximumCount
}; // @ AGGREGATE
struct CurrMapData {
@@ -676,6 +673,7 @@ public:
bool _isFacingViAltar; // @ G0287_B_FacingViAltar
bool _isFacingFountain; // @ G0288_B_FacingFountain
ElementType _squareAheadElement; // @ G0285_i_SquareAheadElement
+ Thing _pileTopObject[5]; // @ G0292_aT_PileTopObject
};
}
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 67604f9ef0..4506f3ec36 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -37,6 +37,21 @@
namespace DM {
+FieldAspect gFieldAspects[12] = { // @ G0188_as_Graphic558_FieldAspects
+ /* { NativeBitmapRelativeIndex, BaseStartUnitIndex, Transparent color, Mask, ByteWidth, Height, X, BitPlaneWordCount } */
+ FieldAspect(0, 63, 0x8A, 0xFF, 0, 0, 0, 64), /* D3C */
+ FieldAspect(0, 63, 0x0A, 0x80, 48, 51, 11, 64), /* D3L */
+ FieldAspect(0, 63, 0x0A, 0x00, 48, 51, 0, 64), /* D3R */
+ FieldAspect(0, 60, 0x8A, 0xFF, 0, 0, 0, 64), /* D2C */
+ FieldAspect(0, 63, 0x0A, 0x81, 40, 71, 5, 64), /* D2L */
+ FieldAspect(0, 63, 0x0A, 0x01, 40, 71, 0, 64), /* D2R */
+ FieldAspect(0, 61, 0x8A, 0xFF, 0, 0, 0, 64), /* D1C */
+ FieldAspect(0, 63, 0x0A, 0x82, 32, 111, 0, 64), /* D1L */
+ FieldAspect(0, 63, 0x0A, 0x02, 32, 111, 0, 64), /* D1R */
+ FieldAspect(0, 59, 0x8A, 0xFF, 0, 0, 0, 64), /* D0C */
+ FieldAspect(0, 63, 0x0A, 0x83, 16, 136, 0, 64), /* D0L */
+ FieldAspect(0, 63, 0x0A, 0x03, 16, 136, 0, 64)}; /* D0R */
+
Box gBoxMovementArrows = Box(224, 319, 124, 168);
byte gPalChangeSmoke[16] = {0, 10, 20, 30, 40, 50, 120, 10, 80, 90, 100, 110, 120, 130, 140, 150}; // @ G0212_auc_Graphic558_PaletteChanges_Smoke
@@ -1790,6 +1805,167 @@ int16 DisplayMan::getScaledDimension(int16 dimension, int16 scale) {
return (dimension * scale + scale / 2) / 32;
}
+/* This is the full dungeon view */
+Box gBoxExplosionPattern_D0C = Box(0, 223, 0, 135); // @ G0105_s_Graphic558_Box_ExplosionPattern_D0C
+
+byte gExplosionBaseScales[5] = { // @ G0216_auc_Graphic558_ExplosionBaseScales
+ 10,/* D4 */ 16,/* D3 */ 23,/* D2 */ 32,/* D1 */ 32};/* D0 */
+
+byte gObjectPileShiftSetIndices[16][2] = { // @ G0217_aauc_Graphic558_ObjectPileShiftSetIndices
+ /* { X shift index, Y shift index } */
+ {2, 5},
+ {0, 6},
+ {5, 7},
+ {3, 0},
+ {7, 1},
+ {1, 2},
+ {6, 3},
+ {3, 3},
+ {5, 5},
+ {2, 6},
+ {7, 7},
+ {1, 0},
+ {3, 1},
+ {6, 2},
+ {1, 3},
+ {5, 3}}; /* 16 pairs of X and Y shift values */
+
+byte gObjectCoordinateSets[3][10][5][2] = { // @ G0218_aaaauc_Graphic558_ObjectCoordinateSets
+ /* { {X, Y }, {X, Y }, {X, Y }, {X, Y }, {X, Y } } */
+ {{{0, 0},{0, 0},{125, 72},{95, 72},{112, 64}}, /* D3C */
+ {{0, 0},{0, 0},{62, 72},{25, 72},{24, 64}}, /* D3L */
+ {{0, 0},{0, 0},{200, 72},{162, 72},{194, 64}}, /* D3R */
+ {{92, 78},{132, 78},{136, 86},{88, 86},{112, 74}}, /* D2C */
+ {{10, 78},{53, 78},{41, 86},{0, 0},{3, 74}}, /* D2L */
+ {{171, 78},{218, 78},{0, 0},{183, 86},{219, 74}}, /* D2R */
+ {{83, 96},{141, 96},{148, 111},{76, 111},{112, 94}}, /* D1C */
+ {{0, 0},{26, 96},{5, 111},{0, 0},{0, 0}}, /* D1L */
+ {{197, 96},{0, 0},{0, 0},{220, 111},{0, 0}}, /* D1R */
+ {{66, 131},{158, 131},{0, 0},{0, 0},{0, 0}}}, /* D0C */
+ {{{0, 0},{0, 0},{125, 72},{95, 72},{112, 63}}, /* D3C */
+ {{0, 0},{0, 0},{62, 72},{25, 72},{24, 63}}, /* D3L */
+ {{0, 0},{0, 0},{200, 72},{162, 72},{194, 63}}, /* D3R */
+ {{92, 78},{132, 78},{136, 86},{88, 86},{112, 73}}, /* D2C */
+ {{10, 78},{53, 78},{41, 86},{0, 0},{3, 73}}, /* D2L */
+ {{171, 78},{218, 78},{0, 0},{183, 86},{219, 73}}, /* D2R */
+ {{83, 96},{141, 96},{148, 111},{76, 111},{112, 89}}, /* D1C */
+ {{0, 0},{26, 96},{5, 111},{0, 0},{0, 0}}, /* D1L */
+ {{197, 96},{0, 0},{0, 0},{220, 111},{0, 0}}, /* D1R */
+ {{66, 131},{158, 131},{0, 0},{0, 0},{0, 0}}}, /* D0C */
+ {{{0, 0},{0, 0},{125, 75},{95, 75},{112, 65}}, /* D3C */
+ {{0, 0},{0, 0},{62, 75},{25, 75},{24, 65}}, /* D3L */
+ {{0, 0},{0, 0},{200, 75},{162, 75},{194, 65}}, /* D3R */
+ {{92, 81},{132, 81},{136, 88},{88, 88},{112, 76}}, /* D2C */
+ {{10, 81},{53, 81},{41, 88},{0, 0},{3, 76}}, /* D2L */
+ {{171, 81},{218, 81},{0, 0},{183, 88},{219, 76}}, /* D2R */
+ {{83, 98},{141, 98},{148, 115},{76, 115},{112, 98}}, /* D1C */
+ {{0, 0},{26, 98},{5, 115},{0, 0},{0, 0}}, /* D1L */
+ {{197, 98},{0, 0},{0, 0},{220, 115},{0, 0}}, /* D1R */
+ {{66, 135},{158, 135},{0, 0},{0, 0},{0, 0}}}}; /* D0C */
+
+
+int16 gShiftSets[3][8] = { // @ G0223_aac_Graphic558_ShiftSets
+ {0, 1, 2, 3, 0, -3, -2, -1}, /* D0 Back or D1 Front */
+ {0, 1, 1, 2, 0, -2, -1, -1}, /* D1 Back or D2 Front */
+ {0, 1, 1, 1, 0, -1, -1, -1}}; /* D2 Back or D3 Front */
+
+byte gCreatureCoordinateSets[3][11][5][2] = { // @ G0224_aaaauc_Graphic558_CreatureCoordinateSets
+ /* { { X, Y }, { X, Y }, { X, Y }, { X, Y }, { X, Y } } */
+ {{{95, 70},{127, 70},{129, 75},{93, 75},{111, 72}}, /* D3C */
+ {{131, 70},{163, 70},{158, 75},{120, 75},{145, 72}}, /* D3L */
+ {{59, 70},{91, 70},{107, 75},{66, 75},{79, 72}}, /* D3R */
+ {{92, 81},{131, 81},{132, 90},{91, 90},{111, 85}}, /* D2C */
+ {{99, 81},{146, 81},{135, 90},{80, 90},{120, 85}}, /* D2L */
+ {{77, 81},{124, 81},{143, 90},{89, 90},{105, 85}}, /* D2R */
+ {{83, 103},{141, 103},{148, 119},{76, 119},{109, 111}}, /* D1C */
+ {{46, 103},{118, 103},{101, 119},{0, 0},{79, 111}}, /* D1L */
+ {{107, 103},{177, 103},{0, 0},{123, 119},{144, 111}}, /* D1R */
+ {{0, 0},{67, 135},{0, 0},{0, 0},{0, 0}}, /* D0L */
+ {{156, 135},{0, 0},{0, 0},{0, 0},{0, 0}}}, /* D0R */
+ {{{94, 75},{128, 75},{111, 70},{111, 72},{111, 75}}, /* D3C */
+ {{120, 75},{158, 75},{149, 70},{145, 72},{150, 75}}, /* D3L */
+ {{66, 75},{104, 75},{75, 70},{79, 72},{73, 75}}, /* D3R */
+ {{91, 90},{132, 90},{111, 83},{111, 85},{111, 90}}, /* D2C */
+ {{80, 90},{135, 90},{125, 83},{120, 85},{125, 90}}, /* D2L */
+ {{89, 90},{143, 90},{99, 83},{105, 85},{98, 90}}, /* D2R */
+ {{81, 119},{142, 119},{111, 105},{111, 111},{111, 119}}, /* D1C */
+ {{0, 0},{101, 119},{84, 105},{70, 111},{77, 119}}, /* D1L */
+ {{123, 119},{0, 0},{139, 105},{153, 111},{146, 119}}, /* D1R */
+ {{0, 0},{83, 130},{57, 121},{47, 126},{57, 130}}, /* D0L */
+ {{140, 130},{0, 0},{166, 121},{176, 126},{166, 130}}}, /* D0R */
+ {{{95, 59},{127, 59},{129, 61},{93, 61},{111, 60}}, /* D3C */
+ {{131, 59},{163, 59},{158, 61},{120, 61},{145, 60}}, /* D3L */
+ {{59, 59},{91, 59},{107, 61},{66, 61},{79, 60}}, /* D3R */
+ {{92, 65},{131, 65},{132, 67},{91, 67},{111, 66}}, /* D2C */
+ {{99, 65},{146, 65},{135, 67},{80, 67},{120, 66}}, /* D2L */
+ {{77, 65},{124, 65},{143, 67},{89, 67},{105, 66}}, /* D2R */
+ {{83, 79},{141, 79},{148, 85},{76, 85},{111, 81}}, /* D1C */
+ {{46, 79},{118, 79},{101, 85},{0, 0},{79, 81}}, /* D1L */
+ {{107, 79},{177, 79},{0, 0},{123, 85},{144, 81}}, /* D1R */
+ {{0, 0},{67, 96},{0, 0},{0, 0},{0, 0}}, /* D0L */
+ {{156, 96},{0, 0},{0, 0},{0, 0},{0, 0}}}}; /* D0R */
+
+int16 gExplosionCoordinates[15][2][2] = { // @ G0226_aaai_Graphic558_ExplosionCoordinates
+ /* { { Front Left X, Front Left Y }, { Front Right X, Front Right Y } } */
+ {{100, 47},{122, 47}}, /* D4C */
+ {{52, 47},{76, 47}}, /* D4L */
+ {{148, 47},{172, 47}}, /* D4R */
+ {{95, 50},{127, 50}}, /* D3C */
+ {{31, 50},{63, 50}}, /* D3L */
+ {{159, 50},{191, 50}}, /* D3R */
+ {{92, 53},{131, 53}}, /* D2C */
+ {{-3, 53},{46, 53}}, /* D2L */
+ {{177, 53},{226, 53}}, /* D2R */
+ {{83, 57},{141, 57}}, /* D1C */
+ {{-54, 57},{18, 57}}, /* D1L */
+ {{207, 57},{277, 57}}, /* D1R */
+ {{0, 0},{0, 0}}, /* D0C */
+ {{-73, 60},{-33, 60}}, /* D0L */
+ {{256, 60},{296, 60}}}; /* D0R */
+int16 gRebirthStep2ExplosionCoordinates[7][3] = { // @ G0227_aai_Graphic558_RebirthStep2ExplosionCoordinates
+ /* { X, Y, Scale } */
+ {113, 57, 12}, /* D3C */
+ {24, 57, 12}, /* D3L */
+ {195, 57, 12}, /* D3R */
+ {111, 63, 16}, /* D2C */
+ {12, 63, 16}, /* D2L */
+ {213, 63, 16}, /* D2R */
+ {112, 76, 24}}; /* D1C */
+int16 gRebirthStep1ExplosionCoordinates[7][3] = { // @ G0228_aai_Graphic558_RebirthStep1ExplosionCoordinates
+ /* { X, Y, Scale } */
+ {112, 53, 15}, /* D3C */
+ {24, 53, 15}, /* D3L */
+ {194, 53, 15}, /* D3R */
+ {112, 59, 20}, /* D2C */
+ {15, 59, 20}, /* D2L */
+ {208, 59, 20}, /* D2R */
+ {112, 70, 32}}; /* D1C */
+
+int16 gCenteredExplosionCoordinates[15][2] = { // @ G0225_aai_Graphic558_CenteredExplosionCoordinates
+ /* { X, Y } */
+ {111, 47}, /* D4C */
+ {57, 47}, /* D4L */
+ {167, 47}, /* D4R */
+ {111, 50}, /* D3C */
+ {45, 50}, /* D3L */
+ {179, 50}, /* D3R */
+ {111, 53}, /* D2C */
+ {20, 53}, /* D2L */
+ {205, 53}, /* D2R */
+ {111, 57}, /* D1C */
+ {-30, 57}, /* D1L */
+ {253, 57}, /* D1R */
+ {111, 60}, /* D0C */
+ {-53, 60}, /* D0L */
+ {276, 60}}; /* D0R */
+
+void DisplayMan::drawObjectsCreaturesProjectilesExplosions(Thing thingParam, direction directionParam, int16 mapXpos,
+ int16 mapYpos, int16 viewSquareIndex, uint16 orderedViewCellOrdinals) {
+
+}
+
+
+
bool DisplayMan::isDerivedBitmapInCache(int16 derivedBitmapIndex) {
if (_derivedBitmaps == nullptr) {
_derivedBitmaps[derivedBitmapIndex] = new byte[_derivedBitmapByteCount[derivedBitmapIndex]];
diff --git a/engines/dm/gfx.h b/engines/dm/gfx.h
index 3d5d46ea3c..07a0806ea4 100644
--- a/engines/dm/gfx.h
+++ b/engines/dm/gfx.h
@@ -275,14 +275,15 @@ class FieldAspect {
public:
uint16 _nativeBitmapRelativeIndex;
uint16 _baseStartUnitIndex; /* Index of the unit (16 pixels = 8 bytes) in bitmap where blit will start from. A random value of 0 or 1 is added to this base index */
- Color _transparentColor; /* Bit 7: Do not use mask if set, Bits 6-0: Transparent color index. 0xFF = no transparency */
+ uint16 _transparentColor; /* Bit 7: Do not use mask if set, Bits 6-0: Transparent color index. 0xFF = no transparency */
byte _mask; /* Bit 7: Flip, Bits 6-0: Mask index. 0xFF = no mask */
uint16 _pixelWidth;
uint16 _height;
uint16 _xPos;
- FieldAspect(uint16 native, uint16 base, Color transparent, byte mask, uint16 byteWidth, uint16 height, uint16 xPos)
+ uint16 _bitplaneWordCount;
+ FieldAspect(uint16 native, uint16 base, uint16 transparent, byte mask, uint16 byteWidth, uint16 height, uint16 xPos, uint16 bitplane)
: _nativeBitmapRelativeIndex(native), _baseStartUnitIndex(base), _transparentColor(transparent), _mask(mask),
- _pixelWidth(byteWidth * 2), _height(height), _xPos(xPos) {}
+ _pixelWidth(byteWidth * 2), _height(height), _xPos(xPos), _bitplaneWordCount(bitplane) {}
}; // @ FIELD_ASPECT
@@ -472,6 +473,9 @@ public:
int16 getScaledBitmapPixelCount(int16 pixelWidth, int16 pixelHeight, int16 scale); // @ F0459_START_GetScaledBitmapByteCount
int16 getScaledDimension(int16 dimension, int16 scale); // @ M78_SCALED_DIMENSION
+ void drawObjectsCreaturesProjectilesExplosions(Thing thingParam, direction directionParam,
+ int16 mapXpos, int16 mapYpos, int16 viewSquareIndex,
+ uint16 orderedViewCellOrdinals); // @ F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF
int16 _championPortraitOrdinal; // @ G0289_i_DungeonView_ChampionPortraitOrdinal
int16 _currMapAlcoveOrnIndices[kAlcoveOrnCount]; // @ G0267_ai_CurrentMapAlcoveOrnamentIndices
@@ -489,6 +493,7 @@ public:
Thing _inscriptionThing; // @ G0290_T_DungeonView_InscriptionThing
bool _useByteBoxCoordinates; // @ G0578_B_UseByteBoxCoordinates
+ bool _doNotDrawFluxcagesDuringEndgame; // @ G0077_B_DoNotDrawFluxcagesDuringEndgame
bool isDerivedBitmapInCache(int16 derivedBitmapIndex); // @ F0491_CACHE_IsDerivedBitmapInCache
byte *getDerivedBitmap(int16 derivedBitmapIndex); // @ F0492_CACHE_GetDerivedBitmap
diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp
index 583762c9db..463e02dade 100644
--- a/engines/dm/loadsave.cpp
+++ b/engines/dm/loadsave.cpp
@@ -29,6 +29,7 @@
#include "dungeonman.h"
#include "champion.h"
#include "group.h"
+#include "timeline.h"
@@ -54,7 +55,7 @@ LoadgameResponse LoadsaveMan::loadgame() {
if (newGame) {
- warning("MISSING CODE: Timline init");
+ _vm->_timeline->initTimeline();
_vm->_groupMan->initActiveGroups();
} else {
assert(false);
diff --git a/engines/dm/module.mk b/engines/dm/module.mk
index 721eb43db9..a1460ae944 100644
--- a/engines/dm/module.mk
+++ b/engines/dm/module.mk
@@ -42,7 +42,8 @@ MODULE_OBJS := \
menus.o \
movesens.o \
objectman.o \
- text.o
+ text.o \
+ timeline.o
MODULE_DIRS += \
engines/dm
diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp
new file mode 100644
index 0000000000..150c3c2ed6
--- /dev/null
+++ b/engines/dm/timeline.cpp
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+/*
+* Based on the Reverse Engineering work of Christophe Fontanel,
+* maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/)
+*/
+
+#include "timeline.h"
+#include "dungeonman.h"
+
+
+namespace DM {
+
+Timeline::Timeline(DMEngine* vm) : _vm(vm) {
+ _events = nullptr;
+ _timeline = nullptr;
+}
+
+Timeline::~Timeline() {
+ delete[] _events;
+ delete[] _timeline;
+}
+
+void Timeline::initTimeline() {
+ _events = new TimelineEvent[_eventMaxCount];
+ _timeline = new uint16[_eventMaxCount];
+ if (_vm->_dungeonMan->_messages._newGame) {
+ for (int16 i = 0; i < _eventMaxCount; ++i)
+ _events->_type = kTMEventTypeNone;
+ _eventCount = 0;
+ _firstUnusedEventIndex = 0;
+ }
+}
+
+}
diff --git a/engines/dm/timeline.h b/engines/dm/timeline.h
new file mode 100644
index 0000000000..f773530917
--- /dev/null
+++ b/engines/dm/timeline.h
@@ -0,0 +1,162 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+/*
+* Based on the Reverse Engineering work of Christophe Fontanel,
+* maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/)
+*/
+
+#ifndef DM_TIMELINE_H
+#define DM_TIMELINE_H
+
+#include "dm.h"
+
+namespace DM {
+
+/* Event types */
+enum TimelineEventType {
+/* Used when a creature in a group was damaged or killed by a Poison Cloud or by a closing door or if Lord Chaos is surrounded by = 3, Fluxcages */
+kTMEventTypeCreateReactionEvent29DangerOnSquare = 253, // @ CM3_EVENT_CREATE_REACTION_EVENT_29_DANGER_ON_SQUARE
+/* Used when a projectile impacts with a creature in a group */
+kTMEventTypeCreateReactionEvent30HitByProjectile = 254, // @ CM2_EVENT_CREATE_REACTION_EVENT_30_HIT_BY_PROJECTILE
+/* Used when the party bumps into a group or performs a melee attack */
+kTMEventTypeCreateReactionEvent31ParyIsAdjacent = 255, // @ CM1_EVENT_CREATE_REACTION_EVENT_31_PARTY_IS_ADJACENT
+kTMEventTypeNone = 0, // @ C00_EVENT_NONE
+kTMEventTypeDoorAnimation = 1, // @ C01_EVENT_DOOR_ANIMATION
+kTMEventTypeDoorDestruction = 2, // @ C02_EVENT_DOOR_DESTRUCTION
+kTMEventTypeCorridor = 5, // @ C05_EVENT_CORRIDOR
+kTMEventTypeWall = 6, // @ C06_EVENT_WALL
+kTMEventTypeFakeWall = 7, // @ C07_EVENT_FAKEWALL
+kTMEventTypeTeleporter = 8, // @ C08_EVENT_TELEPORTER
+kTMEventTypePit = 9, // @ C09_EVENT_PIT
+kTMEventTypeDoor = 10, // @ C10_EVENT_DOOR
+kTMEventTypeEnableChampionAction = 11, // @ C11_EVENT_ENABLE_CHAMPION_ACTION
+kTMEventTypeHideDamageReceived = 12, // @ C12_EVENT_HIDE_DAMAGE_RECEIVED
+kTMEventTypeViAltarRebirth = 13, // @ C13_EVENT_VI_ALTAR_REBIRTH
+kTMEventTypePlaySound = 20, // @ C20_EVENT_PLAY_SOUND
+kTMEventTypeCPSE = 22, // @ C22_EVENT_CPSE
+kTMEventTypeRemoveFluxcage = 24, // @ C24_EVENT_REMOVE_FLUXCAGE
+kTMEventTypeExplosion = 25, // @ C25_EVENT_EXPLOSION
+kTMEventTypeGroupReactionDangerOnSquare = 29, // @ C29_EVENT_GROUP_REACTION_DANGER_ON_SQUARE
+kTMEventTypeGroupReacionHitByProjectile = 30, // @ C30_EVENT_GROUP_REACTION_HIT_BY_PROJECTILE
+kTMEventTypeGroupReactionPartyIsAdjecent = 31, // @ C31_EVENT_GROUP_REACTION_PARTY_IS_ADJACENT
+kTMEventTypeUpdateAspectGroup = 32, // @ C32_EVENT_UPDATE_ASPECT_GROUP
+/* Events = 33,-36 and = 38,-41 are used for individual creatures only while the group is attacking the party */
+kTMEventTypeUpdateAspectCreature_0 = 33, // @ C33_EVENT_UPDATE_ASPECT_CREATURE_0
+kTMEventTypeUpdateAspectCreature_1 = 34, // @ C34_EVENT_UPDATE_ASPECT_CREATURE_1
+kTMEventTypeUpdateAspectCreature_2 = 35, // @ C35_EVENT_UPDATE_ASPECT_CREATURE_2
+kTMEventTypeUpdateAspectCreature_3 = 36, // @ C36_EVENT_UPDATE_ASPECT_CREATURE_3
+kTMEventTypeUpdateBehaviourGroup = 37, // @ C37_EVENT_UPDATE_BEHAVIOR_GROUP
+kTMEventTypeUpdateBehaviour_0 = 38, // @ C38_EVENT_UPDATE_BEHAVIOR_CREATURE_0
+kTMEventTypeUpdateBehaviour_1 = 39, // @ C39_EVENT_UPDATE_BEHAVIOR_CREATURE_1
+kTMEventTypeUpdateBehaviour_2 = 40, // @ C40_EVENT_UPDATE_BEHAVIOR_CREATURE_2
+kTMEventTypeUpdateBehaviour_3 = 41, // @ C41_EVENT_UPDATE_BEHAVIOR_CREATURE_3
+/* Projectiles created by a champion (by casting a spell, shooting a weapon or throwing an object) or by a creature (by casting a spell) ignore impacts during their first movement otherwise an impact would always occur immediately as these projectiles are created on the champion or creature square */
+kTMEventTypeMoveProjectileIgnoreImpacts = 48, // @ C48_EVENT_MOVE_PROJECTILE_IGNORE_IMPACTS
+/* Projectiles created by projectile launcher sensors never ignore impacts as well as all other projectiles after their first movement */
+kTMEventTypeMoveProjectile = 49, // @ C49_EVENT_MOVE_PROJECTILE
+kTMEventTypeWatchdoge = 53, // @ C53_EVENT_WATCHDOG
+kTMEventTypeMoveGroupSilent = 60, // @ C60_EVENT_MOVE_GROUP_SILENT
+kTMEventTypeMoveGroupAudible = 61, // @ C61_EVENT_MOVE_GROUP_AUDIBLE
+kTMEventTypeEnableGroupGenerator = 65, // @ C65_EVENT_ENABLE_GROUP_GENERATOR
+kTMEventTypeLight = 70, // @ C70_EVENT_LIGHT
+kTMEventTypeInvisibility = 71, // @ C71_EVENT_INVISIBILITY
+kTMEventTypeChampionShield = 72, // @ C72_EVENT_CHAMPION_SHIELD
+kTMEventTypeThievesEye = 73, // @ C73_EVENT_THIEVES_EYE
+kTMEventTypePartyShield = 74, // @ C74_EVENT_PARTY_SHIELD
+kTMEventTypePoisonChampion = 75, // @ C75_EVENT_POISON_CHAMPION
+kTMEventTypeSpellShield = 77, // @ C77_EVENT_SPELLSHIELD
+kTMEventTypeFireShield = 78, // @ C78_EVENT_FIRESHIELD
+kTMEventTypeFootprints = 79, // @ C79_EVENT_FOOTPRINTS
+kTMEventTypeMagicMap_C80 = 80, // @ C80_EVENT_MAGIC_MAP
+kTMEventTypeMagicMap_C81 = 81, // @ C81_EVENT_MAGIC_MAP
+kTMEventTypeMagicMap_C82 = 82, // @ C82_EVENT_MAGIC_MAP
+kTMEventTypeMagicMap_C83 = 83 // @ C83_EVENT_MAGIC_MAP
+};
+
+class TimelineEvent {
+public:
+ int32 _mapTime;
+ byte _type;
+ byte _priority;
+
+ uint16 getTypePriority() { return (_type << 8) + _priority; }
+
+ union B_unionTimelineEvent {
+ struct {
+ byte _mapX;
+ byte _mapY;
+ } _location;
+ int16 _attack;
+ int16 _defense;
+ int16 _lightPower;
+ Thing _slot;
+ int16 _slotOrdinal;
+ B_unionTimelineEvent() {}
+ } _B;
+
+ int16 getMapXY() { return (_B._location._mapX << 8) + _B._location._mapY; }
+
+ union C_uionTimelineEvent {
+ struct {
+ byte _cell;
+ byte _effect;
+ } A;
+
+ class {
+ uint16 _backing;
+ public:
+ uint16 getMapX() { return _backing & 0x1F; }
+ uint16 getMapY() { return (_backing >> 5) & 0x1F; }
+ direction getDir() { return (direction)((_backing >> 10) & 0x3); }
+ uint16 getStepEnergy() { return (_backing >> 12) & 0xF; }
+ void setMapX(uint16 val) { _backing = (_backing & ~0x1F) | (val & 0x1F); }
+ void setMapY(uint16 val) { _backing = (_backing & ~(0x1F << 5)) | ((val & 0x1F) << 5); }
+ void setDir(direction val) { _backing = (_backing & ~(0x3 << 10)) | ((val & 0x3) << 10); }
+ void setStepEnergy(uint16 val) { _backing = (_backing & ~(0xF << 12)) | ((val & 0xF) << 12); }
+ } _projectile;
+
+ Thing _slot;
+ int16 _soundIndex;
+ byte _ticks;
+ C_uionTimelineEvent() {}
+ } _C;
+}; // @ EVENT
+
+class Timeline {
+ DMEngine *_vm;
+public:
+ uint16 _eventMaxCount; // @ G0369_ui_EventMaximumCount
+ TimelineEvent *_events; // @ G0370_ps_Events
+ uint16 _eventCount; // @ G0372_ui_EventCount
+ uint16 *_timeline; // @ G0371_pui_Timeline
+ uint16 _firstUnusedEventIndex; // @ G0373_ui_FirstUnusedEventIndex
+
+ Timeline(DMEngine *vm);
+ ~Timeline();
+ void initTimeline(); // @ F0233_TIMELINE_Initialize
+};
+
+
+}
+
+#endif