22 #ifndef BLADERUNNER_BLADERUNNER_H 23 #define BLADERUNNER_BLADERUNNER_H 25 #include "bladerunner/archive.h" 27 #include "common/array.h" 28 #include "common/random.h" 29 #include "common/stream.h" 30 #include "common/keyboard.h" 31 #include "common/events.h" 33 #include "engines/engine.h" 35 #include "graphics/surface.h" 37 #include "math/cosinetables.h" 38 #include "math/sinetables.h" 41 #define BLADERUNNER_DEBUG_CONSOLE 0 42 #define BLADERUNNER_ORIGINAL_SETTINGS 0 43 #define BLADERUNNER_ORIGINAL_BUGS 0 59 kDebugScript = 1 << 0,
61 kDebugAnimation = 1 << 2
65 class ActorDialogueQueue;
100 class SliceAnimations;
104 class SuspectsDatabase;
115 static const int kArchiveCount = 12;
116 static const int kActorCount = 100;
117 static const int kActorVoiceOver = kActorCount - 1;
118 static const int kMaxCustomConcurrentRepeatableEvents = 20;
120 static const int16 kOriginalGameWidth = 640;
121 static const int16 kOriginalGameHeight = 480;
122 static const int16 kDemoGameWidth = 320;
123 static const int16 kDemoGameHeight = 200;
132 static const int kBladeRunnerScummVMVersion = 2;
134 static const char *kGameplayKeymapId;
135 static const char *kKiaKeymapId;
136 static const char *kCommonKeymapId;
139 bool _windowIsActive;
140 int _playerLosesControlCounter;
203 Actor *_actors[kActorCount];
210 bool _surfaceFrontCreated;
211 bool _surfaceBackCreated;
216 uint32 _newGameRandomSeed;
220 Math::CosineTable *_cosTable1024;
221 Math::SineTable *_sinTable1024;
223 bool _isWalkingInterruptible;
224 bool _interruptWalking;
225 bool _playerActorIdle;
227 bool _actorIsSpeaking;
228 bool _actorSpeakStopIsRequested;
230 bool _gameJustLaunched;
231 int _gameAutoSaveTextId;
232 bool _gameIsAutoSaving;
234 bool _sceneIsLoading;
236 bool _vqaStopIsRequested;
237 bool _subtitlesEnabled;
238 bool _showSubtitlesForTextCrawl;
241 bool _noDelayMillisFramelimiter;
242 bool _framesPerSecondMax;
243 bool _disableStaminaDrain;
244 bool _spanishCreditsCorrection;
246 bool _enhancedEdition;
247 bool _validBootParam;
250 int _walkSoundVolume;
254 uint32 _mouseClickTimeLast;
255 uint32 _mouseClickTimeDiff;
257 int _walkingToExitId;
258 bool _isInsideScriptExit;
259 int _walkingToRegionId;
260 bool _isInsideScriptRegion;
261 int _walkingToObjectId;
262 bool _isInsideScriptObject;
263 int _walkingToItemId;
264 bool _isInsideScriptItem;
265 bool _walkingToEmpty;
266 int _walkingToEmptyX;
267 int _walkingToEmptyY;
268 bool _isInsideScriptEmpty;
269 int _walkingToActorId;
270 bool _isInsideScriptActor;
272 int _actorUpdateCounter;
273 uint32 _actorUpdateTimeLast;
275 uint32 _timeOfMainGameLoopTickPrevious;
277 bool _isNonInteractiveDemo;
283 kKeyRepeatInitialDelay = 400,
284 kKeyRepeatSustainDelay = 100
288 uint32 _keyRepeatTimeLast;
289 uint32 _keyRepeatTimeDelay;
291 uint32 _customEventRepeatTimeLast;
292 uint32 _customEventRepeatTimeDelay;
300 ActiveCustomEventsArray _activeCustomEvents;
323 enum BladeRunnerEngineMappableAction {
325 kMpActionToggleCombat,
326 kMpActionCutsceneSkip,
327 kMpActionDialogueSkip,
328 kMpActionToggleKiaOptions,
329 kMpActionOpenKiaDatabase,
330 kMpActionOpenKIATabHelp,
331 kMpActionOpenKIATabSaveGame,
332 kMpActionOpenKIATabLoadGame,
333 kMpActionOpenKIATabCrimeSceneDatabase,
334 kMpActionOpenKIATabSuspectDatabase,
335 kMpActionOpenKIATabClueDatabase,
336 kMpActionOpenKIATabQuitGame,
340 kMpDeleteSelectedSvdGame,
341 kMpActionToggleCluePrivacy
371 void pauseEngineIntern(
bool pause)
override;
377 bool startup(
bool hasSavegames =
false);
378 void initChapterAndScene();
384 bool isMouseButtonDown()
const;
396 void handleMouseAction(
int x,
int y,
bool mainButton,
bool buttonDown,
int scrollDirection = 0);
397 void handleMouseClickExit(
int exitId,
int x,
int y,
bool buttonDown);
398 void handleMouseClickRegion(
int regionId,
int x,
int y,
bool buttonDown);
399 void handleMouseClickItem(
int itemId,
bool buttonDown);
400 void handleMouseClickActor(
int actorId,
bool mainButton,
bool buttonDown,
Vector3 &scenePosition,
int x,
int y);
401 void handleMouseClick3DObject(
int objectId,
bool buttonDown,
bool isClickable,
bool isTarget);
402 void handleMouseClickEmpty(
int x,
int y,
Vector3 &scenePosition,
bool buttonDown);
408 bool isAllowedRepeatedCustomEvent(
const Common::Event &currEvent);
411 void cleanupPendingRepeatingEvents(
const Common::String &keymapperId);
413 void gameWaitForActive();
414 void loopActorSpeaking();
415 void loopQueuedDialogueStillPlaying();
417 void outtakePlay(
int id,
bool no_localization,
int container = -1);
418 void outtakePlay(
const Common::String &basenameNoExt,
bool no_localization,
int container = -3);
424 bool openArchiveEnhancedEdition();
426 void syncSoundSettings()
override;
427 bool isSubtitlesEnabled();
428 void setSubtitlesEnabled(
bool newVal);
432 bool playerHasControl();
433 void playerLosesControl();
434 void playerGainsControl(
bool force =
false);
439 void newGame(
int difficulty);
440 void autoSaveGame(
int textId,
bool endgame);
449 uint8 getExtraCNotify();
450 void setExtraCNotify(uint8 val);
457 static inline void getGameDataColor(uint16 color, uint8 &a, uint8 &r, uint8 &g, uint8 &b) {
460 uint8 r5 = (color >> 10) & 0x1F;
461 uint8 g5 = (color >> 5) & 0x1F;
462 uint8 b5 = (color ) & 0x1F;
464 r = (r5 << 3) | (r5 >> 2);
465 g = (g5 << 3) | (g5 >> 2);
466 b = (b5 << 3) | (b5 >> 2);
473 static inline void drawPixel(
Graphics::Surface &surface,
void* dst, uint32 value) {
476 *(uint8*)dst = (uint8)value;
479 *(uint16*)dst = (uint16)value;
482 *(uint32*)dst = (uint32)value;
489 static inline void getPixel(
Graphics::Surface &surface,
void* dst, uint32 &value) {
492 value = (uint8)(*(uint8*)dst);
495 value = (uint16)(*(uint16*)dst);
498 value = (uint32)(*(uint32*)dst);
Definition: crimes_database.h:34
Definition: police_maze.h:80
EngineFeature
Definition: engine.h:253
Definition: obstacles.h:34
Definition: waypoints.h:35
Definition: subtitles.h:40
Definition: advancedDetector.h:163
Definition: suspects_database.h:101
Definition: ambient_sounds.h:38
Definition: end_credits.h:29
Definition: chapters.h:29
Definition: game_info.h:32
Definition: audio_player.h:45
Definition: ai_script.h:533
Definition: framelimiter.h:31
Definition: audio_speech.h:34
Definition: archive.h:141
Definition: scene_objects.h:43
Definition: game_flags.h:32
Definition: audio_mixer.h:43
Definition: algorithm.h:29
int getAutosaveSlot() const override
Definition: bladerunner.h:369
Definition: overlays.h:39
Definition: scene_script.h:526
Definition: elevator.h:34
Definition: debugger.h:56
Definition: actor_dialogue_queue.h:33
Definition: text_resource.h:32
Definition: keyboard.h:294
Definition: audio_cache.h:33
PixelFormat format
Definition: surface.h:95
Definition: slice_renderer.h:45
Definition: bladerunner.h:113
Definition: settings.h:31
Definition: item_pickup.h:31
Definition: screen_effects.h:39
Definition: slice_animations.h:39
Language
Definition: language.h:45