1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef BLADERUNNER_KIA_H 24 #define BLADERUNNER_KIA_H 25 26 #include "common/str.h" 27 28 #include "graphics/surface.h" 29 30 namespace Common { 31 struct KeyState; 32 } 33 34 namespace BladeRunner { 35 36 class BladeRunnerEngine; 37 class KIALog; 38 class KIAScript; 39 class KIASectionBase; 40 class KIASectionClues; 41 class KIASectionDiagnostic; 42 class KIASectionCrimes; 43 class KIASectionHelp; 44 class KIASectionLoad; 45 class KIASectionSettings; 46 class KIASectionPogo; 47 class KIASectionSave; 48 class KIASectionSuspects; 49 class Shape; 50 class Shapes; 51 class UIImagePicker; 52 class VQAPlayer; 53 54 enum KIASections { 55 kKIASectionNone = 0, 56 kKIASectionCrimes = 1, 57 kKIASectionSuspects = 2, 58 kKIASectionClues = 3, 59 kKIASectionSettings = 4, 60 kKIASectionHelp = 5, 61 kKIASectionSave = 6, 62 kKIASectionLoad = 7, 63 kKIASectionQuit = 8, 64 kKIASectionDiagnostic = 9, 65 kKIASectionPogo = 10 66 }; 67 68 class KIA { 69 static const char *kPogo; 70 static const int kPlayerActorDialogueQueueCapacity = 31; 71 72 struct ActorDialogueQueueEntry { 73 int actorId; 74 int sentenceId; 75 }; 76 77 BladeRunnerEngine *_vm; 78 79 int _transitionId; 80 81 uint32 _playerVqaTimeLast; 82 VQAPlayer *_playerVqaPlayer; 83 uint32 _playerVqaFrame; 84 uint32 _playerVisualizerState; 85 int _playerPhotographId; 86 Shapes *_playerPhotographs; 87 int _playerSliceModelId; 88 float _playerSliceModelAngle; 89 Graphics::Surface _playerImage; 90 uint32 _timeLast; 91 92 ActorDialogueQueueEntry _playerActorDialogueQueue[kPlayerActorDialogueQueueCapacity]; 93 int _playerActorDialogueQueuePosition; 94 int _playerActorDialogueQueueSize; 95 int _playerActorDialogueState; 96 97 KIASections _currentSectionId; 98 KIASections _lastSectionIdKIA; 99 KIASections _lastSectionIdOptions; 100 KIASectionBase *_currentSection; 101 102 KIASectionClues *_cluesSection; 103 KIASectionCrimes *_crimesSection; 104 KIASectionDiagnostic *_diagnosticSection; 105 KIASectionHelp *_helpSection; 106 KIASectionLoad *_loadSection; 107 KIASectionSettings *_settingsSection; 108 KIASectionPogo *_pogoSection; 109 KIASectionSave *_saveSection; 110 KIASectionSuspects *_suspectsSection; 111 112 UIImagePicker *_buttons; 113 114 VQAPlayer *_mainVqaPlayer; 115 116 int _pogoPos; 117 118 119 public: 120 bool _forceOpen; 121 122 KIALog *_log; 123 KIAScript *_script; 124 Shapes *_shapes; 125 126 Graphics::Surface _thumbnail; 127 128 public: 129 KIA(BladeRunnerEngine *vm); 130 ~KIA(); 131 132 void reset(); 133 134 void openLastOpened(); 135 void open(KIASections sectionId); 136 bool isOpen() const; 137 138 void tick(); 139 140 void resume(); 141 142 void handleMouseDown(int mouseX, int mouseY, bool mainButton); 143 void handleMouseUp(int mouseX, int mouseY, bool mainButton); 144 void handleMouseScroll(int mouseX, int mouseY, int direction); // Added by ScummVM team 145 void handleKeyUp(const Common::KeyState &kbd); 146 void handleKeyDown(const Common::KeyState &kbd); 147 148 void playerReset(); 149 void playActorDialogue(int actorId, int sentenceId); 150 void playSliceModel(int sliceModelId); 151 void playPhotograph(int photographId); 152 void playImage(const Graphics::Surface &image); 153 154 const char *scrambleSuspectsName(const char *name); 155 156 private: 157 static void mouseDownCallback(int buttonId, void *callbackData); 158 static void mouseUpCallback(int buttonId, void *callbackData); 159 static void loopEnded(void *callbackData, int frame, int loopId); 160 161 void init(); 162 void unload(); 163 void switchSection(int sectionId); 164 165 void createButtons(int sectionId); 166 void buttonClicked(int buttonId); 167 168 const char *getSectionVqaName(int sectionId); 169 int getVqaLoopMain(int sectionId); 170 int getVqaLoopTransition(int transitionId); 171 172 int getTransitionId(int oldSectionId, int newSectionId); 173 void playTransitionSound(int transitionId); 174 175 void playPrivateAddon(); 176 void playObjectDescription(); // for restored content mode 177 }; 178 179 } // End of namespace BladeRunner 180 #endif 181