25 #include "common/scummsys.h" 26 #include "common/system.h" 27 #include "common/error.h" 28 #include "common/fs.h" 29 #include "common/random.h" 30 #include "common/serializer.h" 31 #include "common/util.h" 32 #include "common/keyboard.h" 33 #include "engines/engine.h" 34 #include "graphics/screen.h" 36 #include "darkseed/animation.h" 37 #include "darkseed/console.h" 38 #include "darkseed/cursor.h" 39 #include "darkseed/cutscene.h" 40 #include "darkseed/detection.h" 41 #include "darkseed/inventory.h" 42 #include "darkseed/nsp.h" 43 #include "darkseed/objects.h" 44 #include "darkseed/player.h" 45 #include "darkseed/room.h" 46 #include "darkseed/sound.h" 47 #include "darkseed/sprites.h" 48 #include "darkseed/tostext.h" 49 #include "darkseed/usecode.h" 53 struct DarkseedGameDescription;
55 enum ActionMode : uint8 {
60 kUseHammerAction = 27,
63 enum class FadeDirection : uint8 {
72 Pic *_fullscreenPic =
nullptr;
73 bool _timeAdvanceEventSelected =
false;
74 uint8 _delbertspeech = 0;
76 bool _normalWorldSpritesLoaded =
true;
77 bool _redrawFrame =
true;
78 bool _restartGame =
false;
80 FadeDirection _fadeDirection = FadeDirection::NONE;
81 uint8 _fadeStepCounter = 0;
83 Pal _fadeTargetPalette;
91 bool _ct_voice_status =
false;
92 bool _isRightMouseClicked =
false;
93 bool _isLeftMouseClicked =
false;
94 Common::KeyCode _lastKeyPressed = Common::KeyCode::KEYCODE_INVALID;
96 Sound *_sound =
nullptr;
102 Room *_room =
nullptr;
103 int _actionMode = kPointerAction;
104 Player *_player =
nullptr;
112 uint8 _currentDay = 1;
113 int _currentTimeInSeconds = 0x7e8e;
116 uint8 _previousRoomNumber = 0;
117 uint16 _targetRoomNumber = 0;
119 uint16 _headAcheMessageCounter = 0;
120 uint8 _headacheMessageIdx = 0;
122 int _sprite_y_scaling_threshold_maybe = 0xf0;
123 int _scaledWalkSpeed_maybe = 0;
124 uint16 _scaledSpriteWidth = 0;
125 uint16 _scaledSpriteHeight = 0;
127 int _frameBottom = 0;
130 bool _doorEnabled =
false;
131 bool _useDoorTarget =
false;
133 int16 _counter_2c85_888b = 0;
135 uint8 _targetPlayerDirection = 0;
137 uint8 _systemTimerCounter = 0;
139 bool _debugShowWalkPath =
false;
140 int _phoneStatus = 0;
142 int16 _soundTimer = 0;
143 bool _printedcomeheredawson =
false;
144 void zeroMouseButtons();
147 void gotoNextMorning();
149 void playDayChangeCutscene();
151 void removeFullscreenPic();
155 void waitForSpeech();
156 void waitForSpeechOrSfx();
158 void syncSoundSettings()
override;
163 uint32 getFeatures()
const;
177 bool isDosVersion()
const {
178 return _gameDescription->
platform == Common::kPlatformDOS;
181 bool isCdVersion()
const {
182 return getFeatures() &
ADGF_CD;
185 bool isDosFloppy()
const {
186 return isDosVersion() && !isCdVersion();
191 (f == kSupportsLoadingDuringRuntime) ||
192 (f == kSupportsSavingDuringRuntime) ||
193 (f == kSupportsReturnToLauncher);
197 return !_animation->_isPlayingAnimation_maybe && !_player->_isAutoWalkingToBed && !_player->_heroWaiting;
201 return !_animation->_isPlayingAnimation_maybe && !_player->_isAutoWalkingToBed && !_player->_heroWaiting;
219 changeToRoom(_room->_roomNumber);
227 void fadeIn(
const Pal &palette);
234 void updateDisplay();
235 void debugTeleportToRoom(
int newRoomNumber,
int entranceNumber);
237 void drawFullscreenPic();
238 void lookCode(
int objNum);
239 void handleObjCollision(
int targetObjNum);
240 void playSound(uint8 sfxId, uint8 unk1, int16 unk2);
241 void nextFrame(
int nspAminIdx);
243 void throwmikeinjail();
245 void getPackageObj(
int packageType);
247 void changeToRoom(
int newRoomNumber,
bool placeDirectly =
false);
248 void waitxticks(
int ticks);
253 void updateBaseSprites();
257 void handlePointerAction();
258 void loadRoom(
int roomNumber);
260 void gotoSleepInJail();
262 void updateHeadache();
264 void initDelbertAtSide();
265 void movePlayerToDelbert();
266 void delbertThrowStick(int16 spriteNum);
272 #define SHOULD_QUIT ::Darkseed::g_engine->shouldQuit()
EngineFeature
Definition: engine.h:253
ErrorCode getCode() const
Definition: error.h:115
Definition: advancedDetector.h:163
No error occurred.
Definition: error.h:48
uint getRandomNumber(uint max)
Definition: serializer.h:79
uint32 getRandomNumber(uint maxNum)
Definition: darkseed.h:173
Definition: darkseed.h:69
bool hasFeature(EngineFeature f) const override
Definition: darkseed.h:189
Add "-cd" to gameid.
Definition: advancedDetector.h:154
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave=false) override
Definition: darkseed.h:210
Definition: cutscene.h:31
bool canLoadGameStateCurrently(Common::U32String *msg) override
Definition: darkseed.h:196
Definition: animation.h:28
Common::Platform platform
Definition: advancedDetector.h:198
Definition: inventory.h:27
Definition: adlib_worx.h:27
bool canSaveGameStateCurrently(Common::U32String *msg) override
Definition: darkseed.h:200
Common::Error loadGameStream(Common::SeekableReadStream *stream) override
Definition: darkseed.h:215