30 #include "engines/engine.h" 31 #include "engines/savestate.h" 33 #include "common/random.h" 34 #include "common/savefile.h" 35 #include "common/str.h" 36 #include "common/memstream.h" 38 #include "advancedDetector.h" 40 #include "dm/console.h" 41 #include "dm/detection.h" 62 kActionToggleInventoryChampion0,
63 kActionToggleInventoryChampion1,
64 kActionToggleInventoryChampion2,
65 kActionToggleInventoryChampion3,
86 kDMThingTypeParty = -1,
88 kDMThingTypeTeleporter = 1,
89 kDMstringTypeText = 2,
90 kDMThingTypeSensor = 3,
91 kDMThingTypeGroup = 4,
92 kDMThingTypeWeapon = 5,
93 kDMThingTypeArmour = 6,
94 kDMThingTypeScroll = 7,
95 kDMThingTypePotion = 8,
96 kDMThingTypeContainer = 9,
97 kDMThingTypeJunk = 10,
98 kDMThingTypeProjectile = 14,
99 kDMThingTypeExplosion = 15,
100 kDMThingTypeTotal = 16
105 kDMCellNorthWest = 0,
106 kDMCellNorthEast = 1,
107 kDMCellSouthEast = 2,
112 kDMModeLoadSavedGame = 0,
113 kDMModeLoadDungeon = 1,
114 kDMModeWaitingOnEntrance = 99,
115 kDMModeEntranceDrawCredits = 202
118 enum LoadgameResult {
119 kDMLoadgameFailure = -1,
120 kDMLoadgameSuccess = 1
124 kDMMapIndexNone = -1,
125 kDMMapIndexEntrance = 255
128 #define kDMMaskDecodeEvenIfInvisible 0x8000 // @ MASK0x8000_DECODE_EVEN_IF_INVISIBLE 129 #define kDMMaskMergeCycles 0x8000 // @ MASK0x8000_MERGE_CYCLES 131 #define kDMSlotBoxInventoryFirstSlot 8 // @ C08_SLOT_BOX_INVENTORY_FIRST_SLOT 132 #define kDMSlotBoxInventoryActionHand 9 // @ C09_SLOT_BOX_INVENTORY_ACTION_HAND 133 #define kDMSlotBoxChestFirstSlot 38 // @ C38_SLOT_BOX_CHEST_FIRST_SLOT 139 Thing() : _data(0) {}
140 explicit Thing(uint16 d) {
set(d); }
146 byte getCell()
const {
return _data >> 14; }
147 ThingType getType()
const {
return (ThingType)((_data >> 10) & 0xF); }
148 uint16 getIndex()
const {
return _data & 0x3FF; }
150 void setCell(uint16 cell) { _data = (_data & ~(0x3 << 14)) | ((cell & 0x3) << 14); }
151 void setType(uint16 type) { _data = (_data & ~(0xF << 10)) | ((type & 0xF) << 10); }
152 void setIndex(uint16 index) { _data = (_data & ~0x3FF) | (index & 0x3FF); }
154 uint16 getTypeAndIndex() {
return _data & 0x3FFF; }
155 uint16 toUint16()
const {
return _data; }
156 bool operator==(
const Thing &rhs)
const {
return _data == rhs._data; }
157 bool operator!=(
const Thing &rhs)
const {
return _data != rhs._data; }
160 #define setFlag(val, mask) ((val) |= (mask)) 161 #define getFlag(val, mask) ((val) & (mask)) 162 #define clearFlag(val, mask) ((val) &= (~(mask))) // @ M09_CLEAR 166 #define CALL_MEMBER_FN(object, ptrToMember) ((object).*(ptrToMember)) 176 void processNewPartyMap(uint16 mapIndex);
177 void initializeGame();
178 void initMemoryManager();
180 void initConstants();
183 bool writeCompleteSaveFile(int16 slot,
Common::String &desc, int16 saveAndPlayChoice);
185 void fuseSequenceUpdate();
186 void processEntrance();
187 void openEntranceDoors();
200 void delay(uint16 verticalBlank);
201 uint16 getScaledProduct(uint16 val, uint16
scale, uint16 vale2);
202 uint16 getRandomNumber(uint32 max) {
return _rnd->getRandomNumber(max - 1); }
203 int16 ordinalToIndex(int16 val);
204 int16 indexToOrdinal(int16 val);
207 LoadgameResult loadgame(int16 slot);
208 void endGame(
bool doNotDrawCreditsOnly);
210 void entranceDrawCredits();
214 Direction turnDirRight(int16 dir);
215 Direction turnDirLeft(int16 dir);
216 Direction returnOppositeDir(int16 dir);
217 bool isOrientedWestEast(int16 dir);
218 uint16 normalizeModulo4(int16 dir);
220 int32 filterTime(int32 mapTime);
221 int32 setMapAndTime(uint32 map, uint32 time);
222 uint16 getMap(int32 mapTime);
223 Thing thingWithNewCell(
Thing thing, int16 cell);
224 int16 getDistance(int16 mapx1, int16 mapy1, int16 mapx2, int16 mapy2);
225 int32 setMap(int32 mapTime, uint32 map);
230 byte *_entranceDoorAnimSteps[10];
231 byte *_interfaceCredits;
234 byte *_savedScreenForOpenEntranceDoors;
236 bool _canLoadFromGMM;
256 bool _engineShouldQuit;
257 int _loadSaveSlotAtRuntime;
260 bool _restartGameRequest;
262 bool _stopWaitingForPlayerInput;
263 bool _gameTimeTicking;
264 bool _restartGameAllowed;
266 bool _stopPressingEye;
268 bool _stopPressingMouth;
269 bool _highlightBoxInversionRequested;
270 int16 _projectileDisableMovementTicks;
271 int16 _lastProjectileDisabledMovementDirection;
273 int16 _newPartyMapIndex;
274 bool _setMousePointerToObjectInMainLoop;
275 int16 _disabledMovementTicks;
277 int8 _dirIntoStepCountEast[4];
278 int8 _dirIntoStepCountNorth[4];
280 char _stringBuildBuffer[128];
281 int16 _waitForInputMaxVerticalBlankCount;
284 Thing _thingEndOfList;
285 Thing _thingFirstExplosion;
286 Thing _thingExplFireBall;
287 Thing _thingExplSlime;
288 Thing _thingExplLightningBolt;
289 Thing _thingExplHarmNonMaterial;
290 Thing _thingExplOpenDoor;
291 Thing _thingExplPoisonBolt;
292 Thing _thingExplPoisonCloud;
293 Thing _thingExplSmoke;
294 Thing _thingExplFluxcage;
295 Thing _thingExplRebirthStep1;
296 Thing _thingExplRebirthStep2;
Definition: projexpl.h:43
EngineFeature
Definition: engine.h:260
Definition: savefile.h:54
Definition: movesens.h:45
Definition: memstream.h:194
Definition: eventman.h:199
Definition: savestate.h:56
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
bool skipThumbnail(Common::SeekableReadStream &in)
Definition: detection.h:70
Definition: dungeonman.h:607
Definition: champion.h:35
Definition: champion.h:479
Definition: inventory.h:53
Definition: objectman.h:48
Definition: timeline.h:151
Language
Definition: language.h:45