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 NUVIE_PORTRAIT_PORTRAIT_H
23#define NUVIE_PORTRAIT_PORTRAIT_H
24
25namespace Ultima {
26namespace Nuvie {
27
28class Configuration;
29class Actor;
30class U6Lib_n;
31class NuvieIO;
32
33#define PORTRAIT_WIDTH 56
34#define PORTRAIT_HEIGHT 64
35
36#define NO_PORTRAIT_FOUND 255
37
38Portrait *newPortrait(nuvie_game_t gametype, const Configuration *cfg);
39
40class Portrait {
41protected:
42 const Configuration *config;
43
44 uint8 avatar_portrait_num;
45 uint8 width;
46 uint8 height;
47public:
48
49 Portrait(const Configuration *cfg);
50 virtual ~Portrait() {};
51
52 virtual bool init() = 0;
53 virtual bool load(NuvieIO *objlist) = 0;
54 virtual unsigned char *get_portrait_data(Actor *actor) = 0;
55
56 uint8 get_portrait_width() const {
57 return width;
58 }
59 uint8 get_portrait_height() const {
60 return height;
61 }
62
63 bool has_portrait(Actor *actor) const {
64 return (get_portrait_num(actor) != NO_PORTRAIT_FOUND);
65 }
66
67 uint8 get_avatar_portrait_num() const;
68
69protected:
70
71 unsigned char *get_wou_portrait_data(U6Lib_n *lib, uint8 num);
72
73private:
74
75 virtual uint8 get_portrait_num(Actor *actor) const = 0;
76
77};
78
79} // End of namespace Nuvie
80} // End of namespace Ultima
81
82#endif
Definition: actor.h:174
Definition: configuration.h:60
Definition: nuvie_io.h:32
Definition: portrait.h:40
Definition: u6_lib_n.h:42