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" 68 kDMThingTypeParty = -1,
70 kDMThingTypeTeleporter = 1,
71 kDMstringTypeText = 2,
72 kDMThingTypeSensor = 3,
73 kDMThingTypeGroup = 4,
74 kDMThingTypeWeapon = 5,
75 kDMThingTypeArmour = 6,
76 kDMThingTypeScroll = 7,
77 kDMThingTypePotion = 8,
78 kDMThingTypeContainer = 9,
79 kDMThingTypeJunk = 10,
80 kDMThingTypeProjectile = 14,
81 kDMThingTypeExplosion = 15,
82 kDMThingTypeTotal = 16
94 kDMModeLoadSavedGame = 0,
95 kDMModeLoadDungeon = 1,
96 kDMModeWaitingOnEntrance = 99,
97 kDMModeEntranceDrawCredits = 202
100 enum LoadgameResult {
101 kDMLoadgameFailure = -1,
102 kDMLoadgameSuccess = 1
106 kDMMapIndexNone = -1,
107 kDMMapIndexEntrance = 255
110 #define kDMMaskDecodeEvenIfInvisible 0x8000 // @ MASK0x8000_DECODE_EVEN_IF_INVISIBLE 111 #define kDMMaskMergeCycles 0x8000 // @ MASK0x8000_MERGE_CYCLES 113 #define kDMSlotBoxInventoryFirstSlot 8 // @ C08_SLOT_BOX_INVENTORY_FIRST_SLOT 114 #define kDMSlotBoxInventoryActionHand 9 // @ C09_SLOT_BOX_INVENTORY_ACTION_HAND 115 #define kDMSlotBoxChestFirstSlot 38 // @ C38_SLOT_BOX_CHEST_FIRST_SLOT 121 Thing() : _data(0) {}
122 explicit Thing(uint16 d) {
set(d); }
128 byte getCell()
const {
return _data >> 14; }
129 ThingType getType()
const {
return (ThingType)((_data >> 10) & 0xF); }
130 uint16 getIndex()
const {
return _data & 0x3FF; }
132 void setCell(uint16 cell) { _data = (_data & ~(0x3 << 14)) | ((cell & 0x3) << 14); }
133 void setType(uint16 type) { _data = (_data & ~(0xF << 10)) | ((type & 0xF) << 10); }
134 void setIndex(uint16 index) { _data = (_data & ~0x3FF) | (index & 0x3FF); }
136 uint16 getTypeAndIndex() {
return _data & 0x3FFF; }
137 uint16 toUint16()
const {
return _data; }
138 bool operator==(
const Thing &rhs)
const {
return _data == rhs._data; }
139 bool operator!=(
const Thing &rhs)
const {
return _data != rhs._data; }
142 #define setFlag(val, mask) ((val) |= (mask)) 143 #define getFlag(val, mask) ((val) & (mask)) 144 #define clearFlag(val, mask) ((val) &= (~(mask))) // @ M09_CLEAR 148 #define CALL_MEMBER_FN(object, ptrToMember) ((object).*(ptrToMember)) 158 void processNewPartyMap(uint16 mapIndex);
159 void initializeGame();
160 void initMemoryManager();
162 void initConstants();
165 bool writeCompleteSaveFile(int16 slot,
Common::String &desc, int16 saveAndPlayChoice);
167 void fuseSequenceUpdate();
168 void processEntrance();
169 void openEntranceDoors();
182 void delay(uint16 verticalBlank);
183 uint16 getScaledProduct(uint16 val, uint16
scale, uint16 vale2);
184 uint16 getRandomNumber(uint32 max) {
return _rnd->getRandomNumber(max - 1); }
185 int16 ordinalToIndex(int16 val);
186 int16 indexToOrdinal(int16 val);
189 LoadgameResult loadgame(int16 slot);
190 void endGame(
bool doNotDrawCreditsOnly);
192 void entranceDrawCredits();
196 Direction turnDirRight(int16 dir);
197 Direction turnDirLeft(int16 dir);
198 Direction returnOppositeDir(int16 dir);
199 bool isOrientedWestEast(int16 dir);
200 uint16 normalizeModulo4(int16 dir);
202 int32 filterTime(int32 mapTime);
203 int32 setMapAndTime(uint32 map, uint32 time);
204 uint16 getMap(int32 mapTime);
205 Thing thingWithNewCell(
Thing thing, int16 cell);
206 int16 getDistance(int16 mapx1, int16 mapy1, int16 mapx2, int16 mapy2);
207 int32 setMap(int32 mapTime, uint32 map);
212 byte *_entranceDoorAnimSteps[10];
213 byte *_interfaceCredits;
216 byte *_savedScreenForOpenEntranceDoors;
218 bool _canLoadFromGMM;
238 bool _engineShouldQuit;
239 int _loadSaveSlotAtRuntime;
242 bool _restartGameRequest;
244 bool _stopWaitingForPlayerInput;
245 bool _gameTimeTicking;
246 bool _restartGameAllowed;
248 bool _stopPressingEye;
250 bool _stopPressingMouth;
251 bool _highlightBoxInversionRequested;
252 int16 _projectileDisableMovementTicks;
253 int16 _lastProjectileDisabledMovementDirection;
255 int16 _newPartyMapIndex;
256 bool _setMousePointerToObjectInMainLoop;
257 int16 _disabledMovementTicks;
259 int8 _dirIntoStepCountEast[4];
260 int8 _dirIntoStepCountNorth[4];
262 char _stringBuildBuffer[128];
263 int16 _waitForInputMaxVerticalBlankCount;
266 Thing _thingEndOfList;
267 Thing _thingFirstExplosion;
268 Thing _thingExplFireBall;
269 Thing _thingExplSlime;
270 Thing _thingExplLightningBolt;
271 Thing _thingExplHarmNonMaterial;
272 Thing _thingExplOpenDoor;
273 Thing _thingExplPoisonBolt;
274 Thing _thingExplPoisonCloud;
275 Thing _thingExplSmoke;
276 Thing _thingExplFluxcage;
277 Thing _thingExplRebirthStep1;
278 Thing _thingExplRebirthStep2;
Definition: projexpl.h:43
EngineFeature
Definition: engine.h:253
Definition: savefile.h:54
Definition: movesens.h:45
Definition: memstream.h:194
Definition: eventman.h:200
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