ScummVM API documentation
portrait.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 SCI_GRAPHICS_PORTRAIT_H
23 #define SCI_GRAPHICS_PORTRAIT_H
24 
25 #include "sci/util.h"
26 
27 namespace Sci {
28 
30  int16 width, height;
31  int16 extraBytesPerLine;
32  uint16 displaceX, displaceY;
33  SciSpan<const byte> rawBitmap;
34 };
35 
41 class Portrait {
42 public:
43  Portrait(ResourceManager *resMan, EventManager *event, GfxScreen *screen, GfxPalette *palette, AudioPlayer *audio, const Common::String &resourceName);
44 
45  void setupAudio(uint16 resourceId, uint16 noun, uint16 verb, uint16 cond, uint16 seq);
46  void doit(Common::Point position, uint16 resourceId, uint16 noun, uint16 verb, uint16 cond, uint16 seq);
47 
48  Common::String getResourceName() { return _resourceName; }
49 
50 private:
51  void init();
52  void drawBitmap(uint16 bitmapNr, bool show);
53 
54  int16 raveGetTicks(Resource *resource, uint *offset);
55  uint16 raveGetID(Resource *resource, uint *offset);
56  SciSpan<const byte> raveGetLipSyncData(const uint16 raveID);
57 
58  ResourceManager *_resMan;
59  EventManager *_event;
60  GfxPalette *_palette;
61  GfxScreen *_screen;
62  AudioPlayer *_audio;
63 
64  uint16 _height;
65  uint16 _width;
66  Palette _portraitPalette;
67 
69 
70  Common::String _resourceName;
71 
73 
74  uint32 _lipSyncIDCount;
75  SciSpan<const byte> _lipSyncIDTable;
76 
77  SciSpan<const byte> _lipSyncData;
78  Common::Array<uint16> _lipSyncDataOffsetTable;
79 
80  Common::Point _position;
81 };
82 
83 } // End of namespace Sci
84 
85 #endif // SCI_GRAPHICS_PORTRAIT_H
Definition: str.h:59
Definition: portrait.h:29
Definition: array.h:52
Definition: span.h:892
Definition: resource.h:327
Definition: palette.h:41
Definition: audio.h:55
Definition: rect.h:45
Definition: resource.h:256
Definition: console.h:28
Definition: portrait.h:41
Definition: screen.h:70
Definition: helpers.h:247
Definition: event.h:151