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/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 _objInteractionListFlag;
88 kSceneOpChangeScene = 1,
91 kSceneOpSegmentStateOps = 4,
92 kSceneOpSetItemAttr = 5,
93 kSceneOpSetDragItem = 6,
94 kSceneOpOpenInventory = 7,
96 kSceneOpShowInvButton = 9,
97 kSceneOpHideInvButton = 10,
98 kSceneOpEnableTrigger = 11,
99 kSceneOpChangeSceneToStored = 12,
100 kSceneOpAddFlagToDragItem = 13,
101 kSceneOpOpenInventoryZoom = 14,
102 kSceneOpMoveItemsBetweenScenes = 15,
103 kSceneOpShowClock = 16,
104 kSceneOpHideClock = 17,
105 kSceneOpShowMouse = 18,
106 kSceneOpHideMouse = 19,
109 kSceneOpLoadTalkDataAndSetFlags = 20,
110 kSceneOpDrawVisibleTalkHeads = 21,
111 kSceneOpLoadTalkData = 22,
112 kSceneOpLoadDDSData = 24,
113 kSceneOpFreeDDSData = 25,
114 kSceneOpFreeTalkData = 26,
117 kSceneOpPasscode = 100,
118 kSceneOpMeanwhile = 101,
119 kSceneOpOpenGameOverMenu = 102,
120 kSceneOpTiredDialog = 103,
121 kSceneOpArcadeTick = 104,
122 kSceneOpDrawDragonCountdown1 = 105,
123 kSceneOpDrawDragonCountdown2 = 106,
124 kSceneOpOpenPlaySkipIntroMenu = 107,
125 kSceneOpOpenBetterSaveGameMenu = 108,
128 kSceneOpOpenChinaTankMenu = 102,
129 kSceneOpShellGameEnd = 109,
130 kSceneOpShellGameTick = 110,
131 kSceneOpOpenChinaTrainMenu = 113,
132 kSceneOpOpenChinaOpenGameOverMenu = 114,
133 kSceneOpOpenChinaOpenSkipCreditsMenu = 115,
134 kSceneOpOpenChinaStartIntro = 116,
135 kSceneOpChina117 = 117,
136 kSceneOpChina118 = 118,
139 kSceneOpOpenBeamishGameOverMenu = 100,
140 kSceneOpOpenBeamishOpenSkipCreditsMenu = 101,
142 kSceneOpMaxCode = 255,
180 MouseCursor(uint16 hotX, uint16 hotY) : _hot(hotX, hotY) {}
193 ObjectInteraction(uint16 dropped, uint16 target) : _droppedItemNum(dropped), _targetItemNum(target) {}
197 bool matches(uint16 droppedItemNum, uint16 targetItemNum)
const {
198 return _droppedItemNum == droppedItemNum && _targetItemNum == targetItemNum;
204 uint16 _droppedItemNum;
205 uint16 _targetItemNum;
211 SceneTrigger(uint16 num) : _num(num), _enabled(
false), _timesToCheckBeforeRunning(0) {}
217 uint16 _timesToCheckBeforeRunning;
219 uint16 getNum()
const {
return _num; }
230 PerSceneGlobal(uint16 num, uint16 scene) : _num(num), _sceneNo(scene), _val(0) {}
233 bool matches(uint16 num, uint16 scene)
const {
return num == _num && (_sceneNo == 0 || _sceneNo == scene); }
234 bool numMatches(uint16 num)
const {
return num == _num; }
262 kHeadFlagVisible = 0x20,
269 TalkDataHead() : _num(0), _drawType(0), _drawCol(0), _val3(0), _flags(kHeadFlagNone) {}
305 bool isVersionOver(
const char *version)
const;
306 bool isVersionUnder(
const char *version)
const;
308 uint32 getMagic()
const {
return _magic; }
310 bool runPreTickOps() {
return runOps(_preTickOps); }
311 bool runPostTickOps() {
return runOps(_postTickOps); }
315 virtual void enableTrigger(uint16 numm,
bool enable =
true) {}
332 virtual void showDialog(uint16 fileNum, uint16 dlgNum) {}
339 bool runSceneOp(
const SceneOp &op);
340 bool runDragonOp(
const SceneOp &op);
341 bool runChinaOp(
const SceneOp &op);
342 bool runBeamishOp(
const SceneOp &op);
366 void runStartGameOps() { runOps(_startGameOps); }
367 void runQuitGameOps() { runOps(_quitGameOps); }
368 void runChangeSceneOps() { runOps(_onChangeSceneOps); }
370 int16 getGlobal(uint16 num);
371 int16 setGlobal(uint16 num, int16 val);
376 int countItemsInScene2()
const;
382 void initIconSizes();
385 uint16 getDefaultMouseCursor()
const {
return _defaultMouseCursor; }
386 uint16 getInvIconNum()
const {
return _invIconNum; }
387 uint16 getInvIconMouseCursor()
const {
return _invIconMouseCursor; }
401 uint16 _defaultMouseCursor;
404 uint16 _invIconMouseCursor;
417 void runEnterSceneOps() { runOps(_enterSceneOps); }
418 void runLeaveSceneOps() { runOps(_leaveSceneOps); }
419 void checkTriggers();
421 int getNum()
const {
return _num; }
424 bool checkDialogActive();
427 bool checkForClearedDialogs();
437 void addInvButtonToHotAreaList();
438 void removeInvButtonFromHotAreaList();
442 const GameItem *getDragItem()
const {
return _dragItem; }
443 GameItem *getDragItem() {
return _dragItem; }
444 void setDragItem(
GameItem *item) { _dragItem = item; }
449 bool hasVisibleDialog();
450 bool hasVisibleOrOpeningDialog()
const;
455 void enableTrigger(uint16 num,
bool enable =
true)
override;
457 Dialog *loadDialogData(uint16 num);
458 void freeDialogData(uint16 num);
459 bool loadTalkData(uint16 num);
460 void freeTalkData(uint16 num);
461 void updateVisibleTalkers();
462 void loadTalkDataAndSetFlags(uint16 talknum, uint16 headnum);
466 void addAndShowTiredDialog();
467 void sceneOpUpdatePasscodeGlobal();
471 void activateChoice();
472 bool isTriggerEnabled(uint16 num);
478 void showDialog(uint16 fileNum, uint16 dlgNum)
override;
479 Dialog *getVisibleDialog();
507 bool _shouldClearDlg;
511 static bool _dlgWithFlagLo8IsClosing;
512 static DialogFlags _sceneDialogFlags;
517 #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