ScummVM API documentation
raw_shape_frame.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 ULTIMA8_GFX_RAW_SHAPEFRAME_H
23 #define ULTIMA8_GFX_RAW_SHAPEFRAME_H
24 
25 namespace Ultima {
26 namespace Ultima8 {
27 
28 struct ConvertShapeFormat;
29 struct ConvertShapeFrame;
30 
37  friend class ShapeFrame;
38 public:
39 
40  // parse data.
41  //
42  // You will find this is quite similar to the ConvertShapeFrame except
43  // all the unknown crap is removed. It's designed to allow for painting
44  // only, and for speed when loading.
45 
46  RawShapeFrame(const uint8 *data, uint32 size, const ConvertShapeFormat *format = 0,
47  const uint8 special[256] = 0, ConvertShapeFrame *prev = 0);
48  ~RawShapeFrame();
49 
50  void getConvertShapeFrame(ConvertShapeFrame &csf);
51 
52 private:
53 
54  uint32 _compressed;
55  int32 _width, _height;
56  int32 _xoff, _yoff;
57 
58  uint32 *_line_offsets; // Note these are offsets into rle_data
59  const uint8 *_rle_data;
60 
61  // This will load a u8 style shape 'optimized'.
62  void loadU8Format(const uint8 *data, uint32 size);
63 
64  // This will load a pentagram style shape 'optimized'.
65  void loadPentagramFormat(const uint8 *data, uint32 size);
66 
67  // This will load any sort of shape via a ConvertShapeFormat struct
68  // Crusader shapes must be loaded this way
69  void loadGenericFormat(const uint8 *data, uint32 size, const ConvertShapeFormat *format);
70 
71  // This will load a u8-compressed shape
72  void loadU8CMPFormat(const uint8 *data, uint32 size, const ConvertShapeFormat *format, const uint8 special[256], ConvertShapeFrame *prev);
73 };
74 
75 } // End of namespace Ultima8
76 } // End of namespace Ultima
77 
78 #endif
Definition: shape_frame.h:33
Definition: convert_shape.h:65
Definition: convert_shape.h:35
Definition: detection.h:27
Definition: raw_shape_frame.h:36