22 #ifndef FREESCAPE_GAMES_3DCK_8BIT_H 23 #define FREESCAPE_GAMES_3DCK_8BIT_H 25 #include "freescape/freescape.h" 26 #include "freescape/language/execution_3dck8.h" 34 void loadAssets()
override;
35 void initGameState()
override;
36 void gotoArea(uint16 areaID,
int entranceID)
override;
37 Math::Vector3d clipPosition(
const Math::Vector3d &position)
const override;
38 void checkIfStillInArea()
override;
39 bool checkIfGameEnded()
override {
return false; }
40 void borderScreen()
override {}
41 void drawUI()
override;
44 void updatePlayerMovement(
float deltaTime)
override;
45 void updateTimeVariables()
override;
46 void checkSensors()
override;
47 void updateScripts()
override;
48 void playSound(
int index,
bool sync, Sound::Type type = Sound::kTypeNormal)
override;
49 bool executeObjectConditions(
GeometricObject *obj,
bool shot,
bool collided,
bool activated)
override;
50 void executeLocalGlobalConditions(
bool shot,
bool collided,
bool timer)
override {}
56 static const uint kFrameDuration = 100;
58 struct ConditionData {
72 void loadPresentation();
73 void loadPresentationZX();
74 void loadPresentationC64();
77 void playPendingSound();
79 void applyPaletteZX();
80 void applyPaletteC64();
81 void setAttributesZX(
const Common::Rect &rect, byte color);
82 void setMovementMode(byte mode);
83 void readSystemVariables();
84 void writeSystemVariables();
86 bool isFrameReady()
const {
return int32(_lastTime - _nextFrameTime) >= 0; }
87 void pauseEngineIntern(
bool pause)
override;
88 void beginScriptFrame();
90 FCLExecutionResult executeCode(ScriptState &script, uint &budget);
91 void executeArithmetic(
const FCLInstruction &instruction, ScriptState &script);
92 void executeComparison(
const FCLInstruction &instruction, ScriptState &script);
93 void executeConditional(
const FCLInstruction &instruction, ScriptState &script);
97 void executeCall(
const FCLInstruction &instruction, ScriptState &script);
100 void getObjectReference(
const FCLInstruction &instruction, uint16 &area, uint16 &
id)
const;
101 Object *scriptObject(uint16 area, uint16
id);
102 void interact(
bool shot);
103 void printMessage(byte
id, byte x, byte y);
104 void printText(
const Common::String &text, byte x, byte y, byte color);
105 void updateInstruments();
112 uint _conditionIndex = 0;
113 bool _initialScriptPending =
true, _scriptFrameActive =
false, _globalPhase =
false;
114 bool _redrawPending =
false;
115 byte _kitVariables[128] = {};
116 uint16 _changedVariables = 0;
117 byte _currentKey = 255;
118 byte _palette[4] = {};
119 byte _colorPatterns[15][4] = {};
120 byte _zxPalette[16 * 3] = {};
121 byte _borderAttributes[32 * 24] = {}, _attributes[32 * 24] = {};
122 byte _instruments[8][6] = {};
123 byte _textColor = 7, _movementMode = 1;
124 bool _textOutputEnabled =
false;
125 byte _climbHeight = 0, _fallHeight = 0, _walkSpeed = 0, _activationRange = 0;
126 byte _shotObject = 0, _hitObject = 0, _activatedObject = 0;
127 bool _fallen =
false, _crushed =
false, _crossVisible =
true;
128 bool _timerTriggered =
false, _pendingTimer =
false;
129 byte _pendingSound = 0;
130 bool _soundSyncReady =
false;
131 uint32 _lastTime = 0, _timerTicks = 0, _timerInterval = 0, _delayUntil = 0;
132 uint32 _nextFrameTime = 0, _pauseStartTime = 0;
133 byte _fontData[96][8] = {};
134 bool _hasFont =
false;
Definition: geometricobject.h:34
Definition: managed_surface.h:51
Definition: execution_3dck8.h:30
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: 8bit.h:51
Definition: advancedDetector.h:164
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: 8bit.h:52
Definition: freescape.h:191
Definition: instruction.h:49