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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef ULTIMA8_GRAPHICS_SHAPEARCHIVE_H
24 #define ULTIMA8_GRAPHICS_SHAPEARCHIVE_H
25 
26 #include "ultima/ultima8/filesys/archive.h"
27 
28 namespace Ultima {
29 namespace Ultima8 {
30 
31 class Shape;
32 struct ConvertShapeFormat;
33 struct Palette;
34 
35 class ShapeArchive : public Archive {
36 public:
37 	ShapeArchive(uint16 id, Palette *pal = 0,
38 	             const ConvertShapeFormat *format = 0)
Archive()39 		: Archive(), _id(id), _format(format), _palette(pal) { }
40 	ShapeArchive(ArchiveFile *af, uint16 id, Palette *pal = 0,
41 	             const ConvertShapeFormat *format = 0)
Archive(af)42 		: Archive(af), _id(id), _format(format), _palette(pal) { }
43 	ShapeArchive(Common::SeekableReadStream *rs, uint16 id, Palette *pal = 0,
44 	             const ConvertShapeFormat *format = 0)
Archive(rs)45 		: Archive(rs), _id(id), _format(format), _palette(pal) { }
46 
47 	~ShapeArchive() override;
48 
49 	Shape *getShape(uint32 shapenum);
50 
51 	void cache(uint32 shapenum) override;
52 	void uncache(uint32 shapenum) override;
53 	bool isCached(uint32 shapenum) const override;
54 
55 protected:
56 	uint16 _id;
57 	const ConvertShapeFormat *_format;
58 	Palette *_palette;
59 	Std::vector<Shape *> _shapes;
60 };
61 
62 } // End of namespace Ultima8
63 } // End of namespace Ultima
64 
65 #endif
66