ScummVM API documentation
scumm_v7.h
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 modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (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, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef SCUMM_SCRIPT_V7_H
23 #define SCUMM_SCRIPT_V7_H
24 
25 #ifdef ENABLE_SCUMM_7_8
26 
27 #include "scumm/scumm_v6.h"
28 #include "scumm/charset_v7.h"
29 #include "scumm/insane/insane.h"
30 
31 namespace Scumm {
32 
33 class Insane;
34 class SmushMixer;
35 class SmushPlayer;
36 class TextRenderer_v7;
37 
38 class ScummEngine_v7 : public ScummEngine_v6 {
39  friend class SmushPlayer;
40  friend class Insane;
41 public:
42  ScummEngine_v7(OSystem *syst, const DetectorResult &dr);
43  ~ScummEngine_v7() override;
44 
45 
46 protected:
47  int _smushFrameRate;
48 
53  bool _smushVideoShouldFinish;
54 
55  bool _smushActive;
56 
57  Insane *_insane;
58 
59 public:
60  SmushMixer *_smixer;
61  SmushPlayer *_splayer;
62 
63 
64  struct LangIndexNode {
65  char tag[12+1];
66  int32 offset;
67  };
68 
69 protected:
70  TextRenderer_v7 *_textV7;
71  Common::Rect _defaultTextClipRect;
72  Common::Rect _wrappedTextClipRect;
73  bool _newTextRenderStyle;
74  int _blastTextRectsQueue = 0;
75 
76  int _verbLineSpacing;
77  bool _existLanguageFile;
78  char *_languageBuffer;
79  LangIndexNode *_languageIndex;
80  int _languageIndexSize;
81  char _lastStringTag[12+1];
82 
83  struct SubtitleText : TextObject {
84  void clear() {
85  TextObject::clear();
86  actorSpeechMsg = center = wrap = false;
87  }
88  bool actorSpeechMsg;
89  bool center;
90  bool wrap;
91  };
92 
93  friend void syncWithSerializer(Common::Serializer &, SubtitleText &);
94 
95  int _subtitleQueuePos;
96  SubtitleText _subtitleQueue[20];
97 
98 public:
99  void processSubtitleQueue();
100  void addSubtitleToQueue(const byte *text, const Common::Point &pos, byte color, byte charset, bool center, bool wrap);
101  void clearSubtitleQueue();
102  void CHARSET_1() override;
103  bool isSmushActive() override { return _smushActive; }
104  bool isInsaneActive() override { return _insane ? _insane->isInsaneActive() : false; }
105  void removeBlastTexts() override;
106  void restoreBlastTextsRects();
107 
108 protected:
109 
110  void scummLoop_handleSound() override;
111  void scummLoop_handleDrawing() override;
112  void processInput() override;
113  void processKeyboard(Common::KeyState lastKeyHit) override;
114 
115  void setupScumm(const Common::Path &macResourceFile) override;
116  void resetScumm() override;
117 
118  void setupScummVars() override;
119  void resetScummVars() override;
120 
121  void akos_processQueue() override;
122 
123  void saveLoadWithSerializer(Common::Serializer &s) override;
124 
125  void readMAXS(int blockSize) override;
126  void readGlobalObjects() override;
127  void readIndexBlock(uint32 blocktype, uint32 itemsize) override;
128 
129  void setCameraAt(int pos_x, int pos_y) override;
130  void setCameraFollows(Actor *a, bool setCamera = false) override;
131  void moveCamera() override;
132  void panCameraTo(int x, int y) override;
133 
134  int getObjectIdFromOBIM(const byte *obim) override;
135 
136  void createTextRenderer(GlyphRenderer_v7 *gr) override;
137  void enqueueText(const byte *text, int x, int y, byte color, byte charset, TextStyleFlags flags);
138  void drawTextImmediately(const byte *text, Common::Rect *clipRect, int x, int y, byte color, byte charset, TextStyleFlags flags);
139  void drawBlastTexts() override;
140  void showMessageDialog(const byte *msg) override;
141 
142  void actorTalk(const byte *msg) override;
143  void translateText(const byte *text, byte *trans_buff, int transBufferSize) override;
144  void loadLanguageBundle() override;
145  void playSpeech(const byte *ptr);
146 
147  void queryQuit(bool returnToLauncher) override;
148  int getBannerColor(int bannerId) override;
149  const char *getGUIString(int stringId) override;
150  int getGUIStringHeight(const char *str) override;
151  int getGUIStringWidth(const char *str) override;
152  void drawGUIText(const char *buttonString, Common::Rect *clipRect, int textXPos, int textYPos, int textColor, bool centerFlag) override;
153  int getMusicVolume() override;
154  int getSpeechVolume() override;
155  int getSFXVolume() override;
156  void setMusicVolume(int volume) override;
157  void setSpeechVolume(int volume) override;
158  void setSFXVolume(int volume) override;
159  void toggleVoiceMode() override;
160  void handleLoadDuringSmush() override;
161 
162  void setDefaultCursor() override;
163  void updateCursor() override;
164  void setCursorTransparency(int a) override;
165  void setCursorFromImg(uint img, uint room, uint imgindex) override;
166 
167  void drawVerb(int verb, int mode) override;
168 
169  void pauseEngineIntern(bool pause) override;
170 
171  void o6_kernelSetFunctions() override;
172 
173  struct BlastText : TextObject {
174  Common::Rect rect;
175  TextStyleFlags flags;
176 
177  void clear() {
178  this->TextObject::clear();
179  rect = Common::Rect();
180  }
181  };
182 
183  int _blastTextQueuePos;
184  BlastText _blastTextQueue[50];
185 
186  byte *_guiStringTransBuff = nullptr;
187 };
188 
189 
190 } // End of namespace Scumm
191 
192 #endif // ENABLE_SCUMM_7_8
193 
194 #endif
Definition: rect.h:144
Definition: path.h:52
Definition: serializer.h:79
Definition: rect.h:45
Definition: keyboard.h:294
Definition: system.h:167
Definition: actor.h:30