ScummVM API documentation
pregob.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 * This file is dual-licensed.
22 * In addition to the GPLv3 license mentioned above, this code is also
23 * licensed under LGPL 2.1. See LICENSES/COPYING.LGPL file for the
24 * full text of the license.
25 *
26 */
27
28#ifndef GOB_PREGOB_PREGOB_H
29#define GOB_PREGOB_PREGOB_H
30
31#include "common/str.h"
32#include "common/array.h"
33
34#include "gob/util.h"
35#include "gob/aniobject.h"
36
37#include "gob/pregob/txtfile.h"
38
39namespace Gob {
40
41class GobEngine;
42class ANIFile;
43class Surface;
44class SoundDesc;
45
46class GCTFile;
47
48class PreGob {
49public:
50 PreGob(GobEngine *vm);
51 virtual ~PreGob();
52
53 virtual void run() = 0;
54
56 uint16 animation;
57 uint16 frame;
58
59 ANIObject::Mode mode;
60
61 bool visible;
62 bool paused;
63
64 bool hasPosition;
65 int16 x;
66 int16 y;
67 };
68
69protected:
71
72 static const char kLanguageSuffixShort[5];
73 static const char *kLanguageSuffixLong [5];
74
75
76 GobEngine *_vm;
77
78
79 // -- Graphics --
80
82 void initScreen();
83
84 void fadeOut();
85 void fadeIn();
86
87 void clearScreen();
88
94 void setPalette(const byte *palette, uint16 size);
95
97 void addCursor();
100
102 void setCursor(Surface &sprite, int16 hotspotX, int16 hotspotY);
104 void setCursor(Surface &sprite, int16 left, int16 top, int16 right, int16 bottom,
105 int16 hotspotX, int16 hotspotY);
106
111
113 bool isCursorVisible() const;
114
116 void clearAnim(ANIObject &anim);
118 void drawAnim(ANIObject &anim);
121
123 void clearAnim(const ANIList &anims);
125 void drawAnim(const ANIList &anims);
127 void redrawAnim(const ANIList &anims);
128
129 void loadAnims(ANIList &anims, ANIFile &ani, uint count, const AnimProperties *props) const;
130 void freeAnims(ANIList &anims) const;
131
132 void setAnim(ANIObject &anim, const AnimProperties &props) const;
133
135 void endFrame(bool doInput);
136
137
138 // -- Sound --
139
141 void loadSounds(const char * const *sounds, uint soundCount);
144
146 void playSound(uint sound, int16 frequency = 0, int16 repCount = 0);
148 void stopSound();
149
151 void playSoundFile(const Common::String &file, int16 frequency = 0, int16 repCount = 0, bool interruptible = true);
152
154 void beep(int16 frequency, int32 length);
155
156
157 // -- Input --
158
160 int16 checkInput(int16 &mouseX, int16 &mouseY, MouseButtons &mouseButtons);
162 int16 waitInput (int16 &mouseX, int16 &mouseY, MouseButtons &mouseButtons);
164 int16 waitInput();
166 bool hasInput();
167
168
169 // -- TXT helpers --
170
174 TXTFile *loadTXT(const Common::String &txtFile, TXTFile::Format format) const;
175
177 virtual void fixTXTStrings(TXTFile &txt) const;
178
179
180 // -- GCT helpers --
181
182 GCTFile *loadGCT(const Common::String &gctFile) const;
183
184
185private:
187 bool _fadedOut;
188
191
192
194 bool loadSound(SoundDesc &sound, const Common::String &file) const;
195};
196
197} // End of namespace Gob
198
199#endif // GOB_PREGOB_PREGOB_H
Definition: array.h:52
Definition: str.h:59
Definition: anifile.h:53
Definition: aniobject.h:42
Mode
Definition: aniobject.h:44
Definition: gctfile.h:47
Definition: gob.h:166
Definition: pregob.h:48
void drawAnim(ANIObject &anim)
void redrawAnim(const ANIList &anims)
void setPalette(const byte *palette, uint16 size)
Change the palette.
int16 waitInput(int16 &mouseX, int16 &mouseY, MouseButtons &mouseButtons)
int16 checkInput(int16 &mouseX, int16 &mouseY, MouseButtons &mouseButtons)
virtual void fixTXTStrings(TXTFile &txt) const
bool hasInput()
void removeCursor()
int16 waitInput()
void playSound(uint sound, int16 frequency=0, int16 repCount=0)
void playSoundFile(const Common::String &file, int16 frequency=0, int16 repCount=0, bool interruptible=true)
void showCursor()
void addCursor()
void beep(int16 frequency, int32 length)
Common::String getLocFile(const Common::String &file) const
void endFrame(bool doInput)
void loadSounds(const char *const *sounds, uint soundCount)
void freeSounds()
void redrawAnim(ANIObject &anim)
void clearAnim(ANIObject &anim)
void stopSound()
void fadeOut()
Fade to black.
bool isCursorVisible() const
void setCursor(Surface &sprite, int16 left, int16 top, int16 right, int16 bottom, int16 hotspotX, int16 hotspotY)
TXTFile * loadTXT(const Common::String &txtFile, TXTFile::Format format) const
void clearAnim(const ANIList &anims)
void initScreen()
void fadeIn()
Fade to the current palette.
void setCursor(Surface &sprite, int16 hotspotX, int16 hotspotY)
void hideCursor()
void drawAnim(const ANIList &anims)
Definition: sounddesc.h:43
Definition: surface.h:106
Definition: txtfile.h:46
Definition: pregob.h:55