ScummVM API documentation
head.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 DGDS_HEAD_H
23 #define DGDS_HEAD_H
24 
25 #include "common/str.h"
26 #include "common/types.h"
27 #include "common/ptr.h"
28 #include "common/array.h"
29 
30 #include "graphics/managed_surface.h"
31 
32 #include "dgds/dgds_rect.h"
33 #include "dgds/ttm.h"
34 
35 // Classes related to talking heads and conversations.
36 
37 namespace Dgds {
38 
39 class Image;
40 class SoundRaw;
41 
42 
44 public:
45  TalkDataHeadFrame() : _xoff(0), _yoff(0), _frameNo(0), _flipFlags(0) {}
46  Common::String dump(const Common::String &indent) const;
47 
48  uint16 _frameNo;
49  int16 _xoff;
50  int16 _yoff;
51  uint16 _flipFlags;
52 };
53 
54 enum HeadFlags {
55  kHeadFlagNone = 0,
56  kHeadFlag1 = 1,
57  kHeadFlag2 = 2,
58  kHeadFlag4 = 4,
59  kHeadFlag8 = 8,
60  kHeadFlag10 = 0x10,
61  kHeadFlagVisible = 0x20,
62  kHeadFlag40 = 0x40,
63  kHeadFlag80 = 0x80,
64 };
65 
66 class TalkData;
67 
68 class TalkDataHead {
69 public:
70  TalkDataHead() : _num(0), _drawType(0), _drawCol(0), _flags(kHeadFlagNone) {}
71  Common::String dump(const Common::String &indent) const;
72 
73  void updateHead();
74 
75  void drawHead(Graphics::ManagedSurface *dst, const TalkData &data) const;
76  void drawHeadType1(Graphics::ManagedSurface *dst, const Image &img) const;
77  void drawHeadType2(Graphics::ManagedSurface *dst, const Image &img) const;
78  void drawHeadType3(Graphics::ManagedSurface *dst, const Image &img) const;
79  void drawHeadType3Beamish(Graphics::ManagedSurface *dst, const TalkData &data) const;
80 
81  uint16 _num;
82  uint16 _drawType;
83  uint16 _drawCol;
84  DgdsRect _rect;
86  Common::String _bmpFile;
87  HeadFlags _flags;
89 };
90 
92 class TalkData {
93 public:
94  TalkData() : _num(0), _val(0) {}
95  Common::String dump(const Common::String &indent) const;
96 
97  uint16 _num;
100  uint16 _val;
101  Common::String _bmpFile;
102 
103  void updateVisibleHeads();
104  void drawVisibleHeads(Graphics::ManagedSurface *dst) const;
105  bool hasVisibleHead() const;
106 };
107 
110 public:
111  Conversation() : _nextExec(0) {}
112 
113  void unload();
114  void runScript();
115  void loadData(uint16 num, uint16 num2, int16 sub);
116 
121  TTMEnviro _ttmEnv;
122  uint32 _nextExec;
123  DgdsRect _drawRect;
124 };
125 
126 
127 } // end namespace Dgds
128 
129 #endif // DGDS_HEAD_H
Definition: managed_surface.h:51
Definition: str.h:59
Definition: ttm.h:40
Definition: array.h:52
Definition: ads.h:28
Definition: head.h:43
Definition: head.h:92
Definition: dgds_rect.h:32
Definition: head.h:68
Definition: head.h:109
Definition: ptr.h:159
Definition: movie_decoder.h:32