ScummVM API documentation
shape_archive.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_SHAPEARCHIVE_H
23 #define ULTIMA8_GFX_SHAPEARCHIVE_H
24 
25 #include "ultima/ultima8/filesys/archive.h"
26 
27 namespace Ultima {
28 namespace Ultima8 {
29 
30 class Shape;
31 struct ConvertShapeFormat;
32 class Palette;
33 
34 class ShapeArchive : public Archive {
35 public:
36  ShapeArchive(uint16 id, const Palette *pal = 0,
37  const ConvertShapeFormat *format = 0)
38  : Archive(), _id(id), _format(format), _palette(pal) { }
39  ShapeArchive(Common::SeekableReadStream *rs, uint16 id, const Palette *pal = 0,
40  const ConvertShapeFormat *format = 0)
41  : Archive(rs), _id(id), _format(format), _palette(pal) { }
42 
43  ~ShapeArchive() override;
44 
45  Shape *getShape(uint32 shapenum);
46 
47  void cache(uint32 shapenum) override;
48  void uncache(uint32 shapenum) override;
49  bool isCached(uint32 shapenum) const override;
50 
51 protected:
52  uint16 _id;
53  const ConvertShapeFormat *_format;
54  const Palette *_palette;
55  Std::vector<Shape *> _shapes;
56 };
57 
58 } // End of namespace Ultima8
59 } // End of namespace Ultima
60 
61 #endif
void cache()
Cache all objects.
Definition: shape_archive.h:34
Definition: convert_shape.h:35
Definition: stream.h:745
Archive()
create Archive without any input sources
Definition: detection.h:27
Definition: archive.h:30
bool isCached(uint32 shapenum) const override
Check if an object is cached.
Definition: shape.h:38
Definition: containers.h:38
Definition: palette.h:35
Definition: atari-screen.h:44