ScummVM API documentation
u6_shape.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_FILES_U6_SHAPE_H
23 #define NUVIE_FILES_U6_SHAPE_H
24 
25 /*
26  * ==========
27  * Includes
28  * ==========
29  */
30 #include "ultima/shared/std/string.h"
31 
32 
33 namespace Ultima {
34 namespace Nuvie {
35 
36 class U6Lib_n;
37 class Configuration;
38 
39 /*
40  * ==================
41  * Class definition
42  * ==================
43  *
44  * U6Shape can load Ultima VI shape files and return the shapes
45  * stored into these files either as a Graphics::ManagedSurface or as raw data.
46  */
47 class U6Shape {
48 private:
49  uint16 hotx, hoty;
50 
51 protected:
52  unsigned char *raw;
53  uint16 width, height;
54 
55 public:
56  U6Shape();
57  virtual ~U6Shape();
58 
59  bool init(uint16 w, uint16 h, uint16 hx = 0, uint16 hy = 0);
60  virtual bool load(const Common::Path &filename);
61  bool load(U6Lib_n *file, uint32 index);
62  virtual bool load(unsigned char *buf);
63  bool load_from_lzc(const Common::Path &filename, uint32 idx, uint32 sub_idx);
64  bool load_WoU_background(const Configuration *config, nuvie_game_t game_type);
65 
66  const unsigned char *get_data() const;
67  unsigned char *get_data();
68  Graphics::ManagedSurface *get_shape_surface();
69  bool get_hot_point(uint16 *x, uint16 *y);
70  bool get_size(uint16 *w, uint16 *h);
71 
72  void draw_line(uint16 sx, uint16 sy, uint16 ex, uint16 ey, uint8 color);
73  bool blit(U6Shape *shp, uint16 x, uint16 y);
74  void fill(uint8 color);
75 };
76 
77 } // End of namespace Nuvie
78 } // End of namespace Ultima
79 
80 #endif
Definition: managed_surface.h:51
Definition: configuration.h:61
Definition: path.h:52
Definition: u6_shape.h:47
Definition: detection.h:27
Definition: u6_lib_n.h:46