25 #include "common/stream.h" 26 #include "common/array.h" 27 #include "common/serializer.h" 29 #include "dgds/dialog.h" 30 #include "dgds/dgds_rect.h" 31 #include "dgds/minigames/shell_game.h" 35 class ResourceManager;
41 kSceneCondLessThan = 1,
46 kSceneCondNeedItemSceneNum = 0x20,
47 kSceneCondNeedItemQuality = 0x40,
48 kSceneCondSceneState = 0x80
53 SceneConditions(uint16 num, SceneCondition cond, uint16 val) : _num(num), _flags(cond), _val(val) {}
56 uint16 getNum()
const {
return _num; }
57 SceneCondition getCond()
const {
return _flags; }
58 uint16 getVal()
const {
return _val; }
62 SceneCondition _flags;
73 uint16 _otherCursorNum;
74 uint16 _objInteractionRectNum;
95 kSceneOpChangeScene = 1,
98 kSceneOpSegmentStateOps = 4,
99 kSceneOpSetItemAttr = 5,
100 kSceneOpSetDragItem = 6,
101 kSceneOpOpenInventory = 7,
103 kSceneOpShowInvButton = 9,
104 kSceneOpHideInvButton = 10,
105 kSceneOpEnableTrigger = 11,
106 kSceneOpChangeSceneToStored = 12,
107 kSceneOpAddFlagToDragItem = 13,
108 kSceneOpOpenInventoryZoom = 14,
109 kSceneOpMoveItemsBetweenScenes = 15,
110 kSceneOpShowClock = 16,
111 kSceneOpHideClock = 17,
112 kSceneOpShowMouse = 18,
113 kSceneOpHideMouse = 19,
116 kSceneOpLoadTalkDataAndSetFlags = 20,
117 kSceneOpDrawVisibleTalkHeads = 21,
118 kSceneOpLoadTalkData = 22,
119 kSceneOpLoadDDSData = 24,
120 kSceneOpFreeDDSData = 25,
121 kSceneOpFreeTalkData = 26,
124 kSceneOpPasscode = 100,
125 kSceneOpMeanwhile = 101,
126 kSceneOpOpenGameOverMenu = 102,
127 kSceneOpTiredDialog = 103,
128 kSceneOpArcadeTick = 104,
129 kSceneOpDrawDragonCountdown1 = 105,
130 kSceneOpDrawDragonCountdown2 = 106,
131 kSceneOpOpenPlaySkipIntroMenu = 107,
132 kSceneOpOpenBetterSaveGameMenu = 108,
135 kSceneOpChinaTankInit = 100,
136 kSceneOpChinaTankEnd = 101,
137 kSceneOpChinaTankTick = 102,
138 kSceneOpChinaSetLanding = 103,
139 kSceneOpChinaScrollIntro = 104,
140 kSceneOpChinaScrollLeft = 105,
141 kSceneOpChinaScrollRight = 107,
142 kSceneOpShellGameInit = 108,
143 kSceneOpShellGameEnd = 109,
144 kSceneOpShellGameTick = 110,
145 kSceneOpChinaTrainInit = 111,
146 kSceneOpChinaTrainEnd = 112,
147 kSceneOpChinaTrainTick = 113,
148 kSceneOpChinaOpenGameOverMenu = 114,
149 kSceneOpChinaOpenSkipCreditsMenu = 115,
150 kSceneOpChinaOnIntroTick = 116,
151 kSceneOpChinaOnIntroInit = 117,
152 kSceneOpChinaOnIntroEnd = 118,
155 kSceneOpOpenBeamishGameOverMenu = 100,
156 kSceneOpOpenBeamishOpenSkipCreditsMenu = 101,
158 kSceneOpMaxCode = 255,
160 kSceneOpHasConditionalOpsFlag = 0x8000,
198 MouseCursor(uint16 hotX, uint16 hotY) : _hot(hotX, hotY) {}
211 ObjectInteraction(uint16 dropped, uint16 target) : _droppedItemNum(dropped), _targetItemNum(target) {}
215 bool matches(uint16 droppedItemNum, uint16 targetItemNum)
const {
216 return (_droppedItemNum == 0xFFFF || _droppedItemNum == droppedItemNum)
217 && _targetItemNum == targetItemNum;
223 uint16 _droppedItemNum;
224 uint16 _targetItemNum;
230 SceneTrigger(uint16 num) : _num(num), _enabled(
false), _timesToCheckBeforeRunning(0) {}
236 uint16 _timesToCheckBeforeRunning;
238 uint16 getNum()
const {
return _num; }
249 PerSceneGlobal(uint16 num, uint16 scene) : _num(num), _sceneNo(scene), _val(0) {}
252 bool matches(uint16 num, uint16 scene)
const {
return num == _num && (_sceneNo == 0 || _sceneNo == scene); }
253 bool numMatches(uint16 num)
const {
return num == _num; }
282 kHeadFlagVisible = 0x20,
289 TalkDataHead() : _num(0), _drawType(0), _drawCol(0), _flags(kHeadFlagNone) {}
326 bool isVersionOver(
const char *version)
const;
327 bool isVersionUnder(
const char *version)
const;
329 uint32 getMagic()
const {
return _magic; }
332 bool runPreTickOps() {
return runOps(_preTickOps); }
333 bool runPostTickOps() {
return runOps(_postTickOps); }
358 static bool runSceneOp(
const SceneOp &op);
359 static bool runDragonOp(
const SceneOp &op);
360 static bool runChinaOp(
const SceneOp &op);
361 static bool runBeamishOp(
const SceneOp &op);
385 void runStartGameOps() { runOps(_startGameOps); }
386 void runQuitGameOps() { runOps(_quitGameOps); }
387 void runChangeSceneOps() { runOps(_onChangeSceneOps); }
389 int16 getGlobal(uint16 num);
390 int16 setGlobal(uint16 num, int16 val);
395 int countItemsInScene2()
const;
401 void initIconSizes();
404 uint16 getDefaultMouseCursor()
const {
return _defaultMouseCursor; }
405 uint16 getInvIconNum()
const {
return _invIconNum; }
406 uint16 getInvIconMouseCursor()
const {
return _invIconMouseCursor; }
420 uint16 _defaultMouseCursor;
423 uint16 _invIconMouseCursor;
436 void runEnterSceneOps() { runOps(_enterSceneOps); }
437 void runLeaveSceneOps() { runOps(_leaveSceneOps); }
438 void checkTriggers();
440 int getNum()
const {
return _num; }
443 bool checkDialogActive();
446 bool checkForClearedDialogs();
454 void addInvButtonToHotAreaList();
455 void removeInvButtonFromHotAreaList();
459 const GameItem *getDragItem()
const {
return _dragItem; }
460 GameItem *getDragItem() {
return _dragItem; }
461 void setDragItem(
GameItem *item) { _dragItem = item; }
466 bool hasVisibleDialog();
467 bool hasVisibleOrOpeningDialog()
const;
472 void enableTrigger(uint16 num,
bool enable =
true);
474 Dialog *loadDialogData(uint16 num);
475 void freeDialogData(uint16 num);
476 bool loadTalkData(uint16 num);
477 void freeTalkData(uint16 num);
478 void updateVisibleTalkers();
479 void loadTalkDataAndSetFlags(uint16 talknum, uint16 headnum);
481 bool hasVisibleHead()
const;
484 void addAndShowTiredDialog();
488 void activateChoice();
489 bool isTriggerEnabled(uint16 num);
490 bool isLButtonDown()
const {
return _lbuttonDown; }
491 bool isRButtonDown()
const {
return _rbuttonDown; }
492 void showDialog(uint16 fileNum, uint16 dlgNum);
494 void updateHotAreasFromDynamicRects();
495 void setDynamicSceneRect(int16 num, int16 x, int16 y, int16 width, int16 height);
496 void setSceneNum(int16 num) { _num = num; }
502 Dialog *getVisibleDialog();
532 bool _shouldClearDlg;
537 static bool _dlgWithFlagLo8IsClosing;
538 static DialogFlags _sceneDialogFlags;
543 #endif // DGDS_SCENE_H Definition: managed_surface.h:51
Definition: serializer.h:79
Definition: dgds_rect.h:32
Definition: movie_decoder.h:32
Definition: decompress.h:67
Definition: resource.h:49