22 #ifndef LASTEXPRESS_LASTEXPRESS_H 23 #define LASTEXPRESS_LASTEXPRESS_H 25 #include "lastexpress/debug.h" 26 #include "lastexpress/game/beetle.h" 27 #include "lastexpress/game/vcr.h" 28 #include "lastexpress/game/savegame.h" 29 #include "lastexpress/sound/slot.h" 30 #include "lastexpress/sound/sound.h" 31 #include "lastexpress/sound/subtitle.h" 32 #include "lastexpress/game/logic.h" 33 #include "lastexpress/data/sprites.h" 34 #include "lastexpress/game/nis.h" 35 #include "lastexpress/game/otis.h" 36 #include "lastexpress/game/events.h" 37 #include "lastexpress/fight/fight.h" 38 #include "lastexpress/menu/menu.h" 39 #include "lastexpress/graphics.h" 40 #include "lastexpress/memory.h" 42 #include "common/random.h" 43 #include "common/file.h" 45 #include "engines/engine.h" 47 #include "graphics/pixelformat.h" 76 class GoldArchiveManager;
87 class ResourceManager;
92 class SubtitleManager;
98 GF_COMPRESSED = 1 << 0
162 uint16 *colorPalette;
170 byte copyScreenAndRedrawFlag;
172 byte ticksToWaitUntilCycleRestart;
181 uint16 visibilityDist;
182 uint16 hotspotPriority;
188 colorPalette =
nullptr;
195 copyScreenAndRedrawFlag = 0;
197 ticksToWaitUntilCycleRestart = 0;
208 nextSprite =
nullptr;
222 memset(gap, 0,
sizeof(gap));
223 rawSeqData =
nullptr;
240 for (
int i = 0; i < 32; i++) {
252 int8 attachedConductor;
255 int16 waitedTicksUntilCycleRestart;
256 int16 currentFrameSeq1;
257 int16 currentFrameSeq2;
263 int8 doProcessEntity;
265 int8 needsSecondaryPosFudge;
266 int8 directionSwitch;
267 char sequenceName[13];
268 char sequenceName2[13];
269 char sequenceNamePrefix[7];
270 char sequenceNameCopy[13];
282 memset(callbacks, 0,
sizeof(callbacks));
285 attachedConductor = 0;
288 waitedTicksUntilCycleRestart = 0;
289 currentFrameSeq1 = 0;
290 currentFrameSeq2 = 0;
298 needsSecondaryPosFudge = 0;
301 memset(sequenceName, 0,
sizeof(sequenceName));
302 memset(sequenceName2, 0,
sizeof(sequenceName2));
303 memset(sequenceNamePrefix, 0,
sizeof(sequenceNamePrefix));
304 memset(sequenceNameCopy, 0,
sizeof(sequenceNameCopy));
384 void copyFrom(
Link *otherLink) {
385 left = otherLink->left;
386 right = otherLink->right;
387 top = otherLink->top;
388 bottom = otherLink->bottom;
390 scene = otherLink->scene;
391 location = otherLink->location;
392 action = otherLink->action;
393 param1 = otherLink->param1;
394 param2 = otherLink->param2;
395 param3 = otherLink->param3;
396 cursor = otherLink->cursor;
402 char sceneFilename[9];
412 memset(sceneFilename, 0,
sizeof(sceneFilename));
429 #include "common/pack-start.h" 434 uint16 colorMapFirstEntryIndex;
435 uint16 colorMapLength;
436 uint8 colorMapEntrySize;
442 uint8 imageDescriptor;
449 colorMapFirstEntryIndex = 0;
451 colorMapEntrySize = 0;
458 rawDataPtr =
nullptr;
461 #include "common/pack-end.h" 466 uint8 charKerning[256];
470 memset(palette, 0,
sizeof(palette));
471 memset(charMap, 0,
sizeof(charMap));
472 memset(charKerning, 0,
sizeof(charKerning));
477 memset(palette, 0,
sizeof(palette));
478 memset(charMap, 0,
sizeof(charMap));
479 memset(charKerning, 0,
sizeof(charKerning));
491 uint16 *colorPalette;
493 uint16 gammaPalette[128];
499 colorPalette =
nullptr;
500 memset(gammaPalette, 0,
sizeof(gammaPalette));
517 #define MEM_PAGE_SIZE 0x800 519 #define DEMO_TIMEOUT 2700 521 typedef uint16 PixMap;
547 NISManager *getNISManager()
const {
return _nisMan; }
548 SoundManager *getSoundManager()
const {
return _soundMan; }
549 LogicManager *getLogicManager()
const {
return _logicMan; }
550 OtisManager *getOtisManager()
const {
return _otisMan; }
551 SpriteManager *getSpriteManager()
const {
return _spriteMan; }
552 SaveManager *getSaveManager()
const {
return _saveMan; }
554 VCR *getVCR()
const {
return _vcr; }
555 Menu *getMenu()
const {
return _menu; }
556 Clock *getClock()
const {
return _clock; }
562 bool isGoldEdition()
const;
563 bool isCompressed()
const;
568 static void soundTimerHandler(
void *refCon);
570 int32 _soundFrameCounter = 0;
573 const char *_savegameFilename =
nullptr;
574 const char *_savegameTempNames[7] = {
584 const char *_savegameNames[6] = {
595 int32 _currentGameFileColorId = -1;
596 int32 _gracePeriodTimer = 0;
597 bool _eventTickInternal =
false;
599 bool _doShowCredits =
false;
600 int32 _currentSavePoint = 0;
601 int32 _lastSavePointIdInFile = 0;
602 int32 _gameTimeOfLastSavePointInFile = 0;
603 int32 _gracePeriodIndex = 0;
604 int32 _fightSkipCounter = 0;
606 bool _navigationEngineIsRunning =
false;
607 bool _stopUpdatingCharacters =
false;
608 bool _charactersUpdateRecursionFlag =
false;
609 bool _mouseHasLeftClicked =
false;
610 bool _mouseHasRightClicked =
false;
611 bool _fastWalkJustDeactivated =
false;
613 int32 _cursorX = 320;
614 int32 _cursorY = 240;
615 int32 _cursorXOffscreenOffset = 0;
616 int32 _cursorYOffscreenOffset = 0;
619 bool _systemEventLeftMouseDown =
false;
620 bool _systemEventRightMouseDown =
false;
623 bool _pendingExitEvent =
false;
624 bool _exitFromMenuButton =
false;
625 int32 _lastForcedScreenUpdateTicks = 0;
627 Seq *_doorSeqs[8] = {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr };
628 Seq *_clockHandsSeqs[2] = {
nullptr,
nullptr };
629 int32 _clockHandsValues[2] = { 0, 0 };
631 int32 _fudgePosition[41] = {
632 0, 851, 1430, 2110, 0, 2410, 2980, 3450,
633 3760, 4100, 4680, 5140, 5440, 5810, 6410, 6850,
634 7160, 7510, 8514, 0, 0, 0, 2086, 2690,
635 0, 3110, 3390, 3890, 4460, 4770, 5090, 5610,
636 6160, 6460, 6800, 7320, 7870, 8160, 8500, 9020,
641 byte *_globalMemoryPool =
nullptr;
642 byte *_soundMemoryPool =
nullptr;
643 byte *_cursorsMemoryPool =
nullptr;
652 void waitForTimer(
int millis);
655 void engineEventHandler(
Event *event);
657 int32 getSoundFrameCounter();
659 bool getEventTickInternal();
660 void setEventTickInternal(
bool flag);
662 void mouseSetLeftClicked(
bool hasClicked);
663 void mouseSetRightClicked(
bool hasClicked);
664 bool mouseHasLeftClicked();
665 bool mouseHasRightClicked();
676 void creditsMouse(
Event *event);
677 void creditsTimer(
Event *event);
678 int32 readTGAIntoMemory(
const char *filename,
TGAHeader *tgaHeader);
679 void constructPalette(
TGAHeader *tgaHeader, uint16 *palette);
682 bool demoEnding(
bool wonGame);
683 void demoEndingMouse(
Event *event);
684 void demoEndingTimer(
Event *event);
687 void engineEventHandlerWrapper(
Event *event);
689 void nodeStepMouseWrapper(
Event *event);
690 void nodeStepTimerWrapper(
Event *event);
692 void eggMouseWrapper(
Event *event);
693 void eggTimerWrapper(
Event *event);
695 void nisMouseWrapper(
Event *event);
696 void nisTimerWrapper(
Event *event);
698 void creditsMouseWrapper(
Event *event);
699 void creditsTimerWrapper(
Event *event);
701 void demoEndingMouseWrapper(
Event *event);
702 void demoEndingTimerWrapper(
Event *event);
704 void fightMouseWrapper(
Event *event);
705 void fightTimerWrapper(
Event *event);
707 void emptyHandler(
Event *event);
709 int _savedFrameCounter = 0;
710 int32 _savedFrameInterval = 0;
717 int doFight(
int fightId);
723 void showEngineInfo();
725 bool _lockGracePeriod =
false;
736 Menu *_menu =
nullptr;
737 Clock *_clock =
nullptr;
756 #endif // LASTEXPRESS_LASTEXPRESS_H
EngineFeature
Definition: engine.h:260
Definition: subtitle.h:57
Definition: cvcrfile.h:61
Definition: lastexpress.h:523
Definition: lastexpress.h:101
Definition: lastexpress.h:143
Definition: lastexpress.h:123
Definition: advancedDetector.h:164
Definition: lastexpress.h:319
Definition: lastexpress.h:315
Definition: lastexpress.h:488
Definition: lastexpress.h:463
Definition: lastexpress.h:232
Definition: lastexpress.h:246
Definition: graphics.h:64
Definition: lastexpress.h:212
Definition: savegame.h:34
Definition: lastexpress.h:159
Definition: lastexpress.h:401
Definition: graphics.h:38
Definition: lastexpress.h:341
Definition: lastexpress.h:505