ScummVM API documentation
speech.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#ifndef SLUDGE_TALK_H
22#define SLUDGE_TALK_H
23
24#include "sludge/sprites.h"
25
26namespace Sludge {
27
28struct ObjectType;
29
30struct SpeechLine {
31 Common::String textLine;
32 int x;
33};
34
36
38 OnScreenPerson *currentTalker;
39 SpeechLineList allSpeech;
40 int speechY, lastFile, lookWhosTalking;
41 SpritePalette talkCol;
42};
43
45public:
46 SpeechManager(SludgeEngine *vm) : _vm(vm) { init(); }
47 ~SpeechManager() { kill(); }
48
49 void init();
50 void kill();
51
52 int wrapSpeech(const Common::String &theText, int objT, int sampleFile, bool);
53 void display();
54
55 int isThereAnySpeechGoingOn();
56 bool isCurrentTalker(OnScreenPerson *person) { return person == _speech->currentTalker; }
57 int getLastSpeechSound();
58
59 // setters & getters
60 void setObjFontColour(ObjectType *t);
61 void setSpeechSpeed(float speed) { _speechSpeed = speed; }
62 float getSpeechSpeed() { return _speechSpeed; }
63 void setSpeechMode(int speechMode) { _speechMode = speechMode; }
64
65 // load & save
66 void save(Common::WriteStream *stream);
67 bool load(Common::SeekableReadStream *stream);
68
69 // freeze & restore
70 void freeze(FrozenStuffStruct *frozenStuff);
71 void restore(FrozenStuffStruct *frozenStuff);
72
73private:
74 SludgeEngine *_vm;
75 int _speechMode;
76 SpeechStruct *_speech;
77 float _speechSpeed;
78
79 void addSpeechLine(const Common::String &theLine, int x, int &offset);
80 int wrapSpeechXY(const Common::String &theText, int x, int y, int wrap, int sampleFile);
81 int wrapSpeechPerson(const Common::String &theText, OnScreenPerson &thePerson, int sampleFile, bool animPerson);
82};
83
84} // End of namespace Sludge
85
86#endif
Definition: stream.h:745
Definition: str.h:59
Definition: stream.h:77
Definition: sludge.h:70
Definition: speech.h:44
Definition: sprites.h:34
Definition: freeze.h:41
Definition: objtypes.h:32
Definition: people.h:76
Definition: speech.h:30
Definition: speech.h:37