25 #if defined(ENABLE_EOB) || defined(ENABLE_LOL) 27 #include "kyra/kyra_v1.h" 28 #include "kyra/graphics/screen_eob.h" 29 #include "kyra/gui/gui_eob.h" 30 #include "kyra/text/text_lol.h" 32 #include "common/keyboard.h" 33 #include "backends/keymapper/action.h" 41 struct LevelDecorationProperty {
42 uint16 shapeIndex[10];
50 struct LevelBlockProperty {
52 uint16 assignedObjects;
58 struct OpenDoorState {
64 struct LevelTempData {
70 uint8 monsterDifficulty;
73 struct EoBFlyingObject {
86 Item projectileWeapon;
89 struct KyraRpgGUISettings {
90 struct DialogueButtons {
121 uint8 inactiveTabFrame1;
122 uint8 inactiveTabFrame2;
126 uint8 guiColorLightRed;
127 uint8 guiColorDarkRed;
128 uint8 guiColorLightBlue;
130 uint8 guiColorDarkBlue;
131 uint8 guiColorYellow;
132 uint8 guiColorLightGreen;
133 uint8 guiColorDarkGreen;
134 uint8 guiColorPurple;
139 struct CharacterBoxCoords {
148 int16 weaponSlotX[3];
149 int16 weaponSlotY[6];
154 int16 hpFoodBarX_2[3];
155 int16 hpFoodBarY_2[3];
156 uint8 hpFoodBarWidth_2[2];
157 uint8 hpFoodBarHeight_2;
158 int16 nameLabelOffsetX;
159 int16 nameLabelOffsetY;
160 int16 exchangeLabelOffsetX;
161 int16 exchangeLabelOffsetY;
162 int16 redSplatOffsetX;
163 int16 redSplatOffsetY;
166 struct StatsPageCoords {
172 int16 statsGroup1StringsX;
173 int16 statsGroup1StringsY;
174 int16 statsGroup2StringsX;
175 int16 statsGroup2StringsY;
176 uint8 statsStringsYInc;
177 int16 statsGroup1StatsX;
178 int16 statsGroup1StatsY;
179 int16 statsGroup2StatsX;
180 int16 statsGroup2StatsY;
181 uint8 statsStatsYInc;
200 uint8 classStringsXInc;
201 uint8 classStringsYInc;
204 struct StatsPageColors {
215 struct SpellbookCoords {
235 uint8 gridCoordsX[4];
236 uint8 gridCoordsY[3];
240 class KyraRpgEngine :
public KyraEngine_v1 {
241 friend class TextDisplayer_rpg;
243 KyraRpgEngine(
OSystem *system,
const GameFlags &flags);
244 ~KyraRpgEngine()
override;
246 Screen *screen()
override = 0;
247 GUI *gui()
const override = 0;
255 void initStaticResource();
260 const uint8 **_itemIconShapes;
263 virtual void update() = 0;
264 void snd_updateEnvironmentalSfx(
int soundId);
267 void setupTimers()
override = 0;
268 virtual void enableSysTimer(
int sysTimer);
269 virtual void disableSysTimer(
int sysTimer);
270 void enableTimer(
int id);
271 virtual uint8 getClock2Timer(
int index) = 0;
272 virtual uint8 getNumClock2Timers() = 0;
274 void timerProcessDoors(
int timerNum);
277 bool posWithinRect(
int posX,
int posY,
int x1,
int y1,
int x2,
int y2);
278 void setHandItem(Item itemIndex)
override = 0;
282 int _updatePortraitSpeechAnimDuration;
284 int _resetPortraitAfterSpeechAnim;
285 int _needSceneRestore;
291 int getBlockDistance(uint16 block1, uint16 block2);
293 uint8 **_monsterPalettes;
294 uint8 **_monsterShapes;
299 int _monsterStepCounter;
300 int _monsterStepMode;
303 virtual void addLevelItems() = 0;
304 virtual void loadBlockProperties(
const char *file) = 0;
306 virtual const uint8 *getBlockFileData(
int levelIndex) = 0;
307 void setLevelShapesDim(
int index, int16 &x1, int16 &x2,
int dim);
308 void setDoorShapeDim(
int index, int16 &y1, int16 &y2,
int dim);
309 void drawLevelModifyScreenDim(
int dim, int16 x1, int16 y1, int16 x2, int16 y2);
310 void generateBlockDrawingBuffer();
311 void generateVmpTileData(int16 startBlockX, uint8 startBlockY, uint8 wllVmpIndex, int16 vmpOffset, uint8 numBlocksX, uint8 numBlocksY);
312 void generateVmpTileDataFlipped(int16 startBlockX, uint8 startBlockY, uint8 wllVmpIndex, int16 vmpOffset, uint8 numBlocksX, uint8 numBlocksY);
313 bool hasWall(
int index);
314 void assignVisibleBlocks(
int block,
int direction);
315 bool checkSceneUpdateNeed(
int block);
316 uint16 calcNewBlockPosition(uint16 curBlock, uint16 direction);
318 void drawVcnBlocks();
319 void vcnDraw_fw_4bit(uint8 *&dst,
const uint8 *&src);
320 void vcnDraw_bw_4bit(uint8 *&dst,
const uint8 *&src);
321 void vcnDraw_fw_trans_4bit(uint8 *&dst,
const uint8 *&src);
322 void vcnDraw_bw_trans_4bit(uint8 *&dst,
const uint8 *&src);
323 void vcnDraw_fw_hiCol(uint8 *&dst,
const uint8 *&src);
324 void vcnDraw_bw_hiCol(uint8 *&dst,
const uint8 *&src);
325 void vcnDraw_fw_trans_hiCol(uint8 *&dst,
const uint8 *&src);
326 void vcnDraw_bw_trans_hiCol(uint8 *&dst,
const uint8 *&src);
327 void vcnDraw_fw_planar(uint8 *&dst,
const uint8 *&src);
328 void vcnDraw_bw_planar(uint8 *&dst,
const uint8 *&src);
329 void vcnDraw_fw_trans_planar(uint8 *&dst,
const uint8 *&src);
330 void vcnDraw_bw_trans_planar(uint8 *&dst,
const uint8 *&src);
333 struct VcnLineDrawingMethods {
334 VcnLineDrawingMethods(VcnDrawProc *fw, VcnDrawProc *bw, VcnDrawProc *fw_t, VcnDrawProc *bw_t) : forward(fw), backwards(bw), forward_trans(fw_t), backwards_trans(bw_t) {}
335 ~VcnLineDrawingMethods() {
338 delete forward_trans;
339 delete backwards_trans;
342 VcnDrawProc *forward;
343 VcnDrawProc *backwards;
344 VcnDrawProc *forward_trans;
345 VcnDrawProc *backwards_trans;
347 VcnLineDrawingMethods *_vcnDrawLine;
349 virtual int clickedDoorSwitch(uint16 block, uint16 direction) = 0;
350 int clickedWallShape(uint16 block, uint16 direction);
351 int clickedLeverOn(uint16 block, uint16 direction);
352 int clickedLeverOff(uint16 block, uint16 direction);
353 int clickedWallOnlyScript(uint16 block);
354 virtual int clickedNiche(uint16 block, uint16 direction) = 0;
356 void processDoorSwitch(uint16 block,
int openClose);
357 void openCloseDoor(
int block,
int openClose);
358 void completeDoorOperations();
359 bool isSpecialDoor(
int block);
363 uint8 *_specialWallTypes;
364 uint8 *_wllWallFlags;
369 LevelBlockProperty *_levelBlockProperties;
370 LevelBlockProperty *_visibleBlocks[18];
371 LevelDecorationProperty *_levelDecorationData;
372 uint16 _levelDecorationDataSize;
373 LevelDecorationProperty *_levelDecorationProperties;
374 const uint8 **_levelDecorationShapes;
375 uint16 _decorationCount;
376 int16 _mappedDecorationsCount;
380 uint8 *_vcnTransitionMask;
385 uint8 _vcnSrcBitsPerPixel;
387 uint16 *_blockDrawingBuffer;
388 uint8 *_sceneWindowBuffer;
389 uint8 _blockBrightness;
391 uint8 _wllVcnOffset2;
392 uint8 _wllVcnRmdOffset;
397 uint16 _currentBlock;
398 uint16 _currentDirection;
399 int _sceneDefaultUpdate;
400 bool _sceneUpdateRequired;
402 int16 _visibleBlockIndex[18];
403 int16 *_lvlShapeLeftRight;
405 int16 *_lvlShapeBottom;
408 uint32 _hasTempDataFlags;
410 int16 _sceneDrawVarDown;
411 int16 _sceneDrawVarRight;
412 int16 _sceneDrawVarLeft;
415 OpenDoorState _openDoorState[3];
420 const int8 *_dscShapeIndex;
421 const uint8 *_dscDimMap;
422 const int8 *_dscDim1;
423 const int8 *_dscDim2;
424 const int16 *_dscShapeX;
425 const uint8 *_dscDoorScaleOffs;
426 const uint8 *_dscBlockMap;
427 const int8 *_dscBlockIndex;
428 const uint8 *_dscTileIndex;
430 const uint8 *_dscDoorShpIndex;
431 int _dscDoorShpIndexSize;
432 const uint8 *_dscDoorY2;
433 const uint8 *_dscDoorFrameY1;
434 const uint8 *_dscDoorFrameY2;
435 const uint8 *_dscDoorFrameIndex1;
436 const uint8 *_dscDoorFrameIndex2;
438 const uint16 *_vmpVisOffs;
439 static const uint16 _vmpOffsetsDefault[9];
440 static const uint16 _vmpOffsetsSegaCD[9];
443 virtual void runLevelScript(
int block,
int flags) = 0;
446 void removeInputTop();
447 void gui_drawBox(
int x,
int y,
int w,
int h,
int frameColor1,
int frameColor2,
int fillColor);
448 virtual void gui_drawHorizontalBarGraph(
int x,
int y,
int w,
int h, int32 curVal, int32 maxVal,
int col1,
int col2);
449 void gui_initButtonsFromList(
const uint8 *list);
450 virtual void gui_initButton(
int index,
int x = -1,
int y = -1,
int val = -1) = 0;
451 void gui_resetButtonList();
452 void gui_notifyButtonListChanged();
454 bool clickedShape(
int shapeIndex);
456 virtual const KyraRpgGUISettings *guiSettings()
const = 0;
457 virtual void useMainMenuGUISettings(
bool toggle) {};
459 int _clickedShapeXOffs;
460 int _clickedShapeYOffs;
463 Button _activeButtonData[70];
468 bool _preserveEvents;
469 bool _buttonListChanged;
472 int _clickedSpecialFlag;
474 int _compassDirection;
476 static const uint8 _dropItemDirIndex[];
479 virtual void drawDialogueButtons();
480 uint16 processDialogue();
482 TextDisplayer_rpg *_txt;
483 virtual TextDisplayer_rpg *txt() {
return _txt; }
486 bool _dialogueFieldAmiga;
487 Screen::FontId _buttonFont;
489 const char *_dialogueButtonString[9];
490 const uint16 *_dialogueButtonPosX;
491 const uint8 *_dialogueButtonPosY;
492 int16 _dialogueButtonXoffs;
493 int16 _dialogueButtonYoffs;
494 uint16 _dialogueButtonWidth;
495 int _dialogueNumButtons;
496 int _dialogueHighlightedButton;
497 int _currentControlMode;
498 int _specialSceneFlag;
499 uint8 _dialogueButtonLabelColor1;
500 uint8 _dialogueButtonLabelColor2;
502 const char *
const *_moreStrings;
504 static const uint16 _dlgButtonPosX_Def[14];
505 static const uint8 _dlgButtonPosY_Def[14];
508 void delay(uint32 millis,
bool doUpdate =
false,
bool isMainLoop =
false)
override = 0;
509 void delayUntil(uint32 time,
bool unused =
false,
bool doUpdate =
false,
bool isMainLoop =
false)
override;
510 int rollDice(
int times,
int pips,
int inc = 0);
515 void generateTempData();
516 virtual void restoreBlockTempData(
int levelIndex);
517 void releaseTempData();
518 virtual void *generateMonsterTempData(LevelTempData *tmp) = 0;
519 virtual void restoreMonsterTempData(LevelTempData *tmp) = 0;
520 virtual void releaseMonsterTempData(LevelTempData *tmp) = 0;
521 void restoreFlyingObjectTempData(LevelTempData *tmp);
522 void *generateFlyingObjectTempData(LevelTempData *tmp);
523 void releaseFlyingObjectTempData(LevelTempData *tmp);
524 virtual void *generateWallOfForceTempData(LevelTempData *tmp) {
return 0; }
525 virtual void restoreWallOfForceTempData(LevelTempData *tmp) {}
526 virtual void releaseWallOfForceTempData(LevelTempData *tmp) {}
528 LevelTempData *_lvlTempData[29];
529 const int _numFlyingObjects;
530 uint32 _flyingObjectStructSize;
531 void *_flyingObjectsPtr;
536 virtual bool snd_processEnvironmentalSoundEffect(
int soundId,
int block);
537 virtual void snd_stopSpeech(
bool) {}
538 virtual int snd_updateCharacterSpeech() {
return 0; }
539 virtual void stopPortraitSpeechAnim() {}
540 void setupOpcodeTable()
override {}
541 void snd_playVoiceFile(
int)
override {}
544 int _environmentSfxVol;
545 int _envSfxDistThreshold;
547 uint32 _activeVoiceFileTotalTime;
550 void setWalkspeed(uint8)
override {}
551 void removeHandItem()
override {}
552 bool lineIsPassable(
int,
int)
override {
return false; }
557 #endif // ENABLE_EOB || ENABLE_LOL
Definition: atari-screen.h:60
Definition: detection.h:27
signed char * fill(signed char *first, signed char *last, Value val)
Definition: algorithm.h:168
Definition: keyboard.h:294