aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/shape.h
diff options
context:
space:
mode:
authorPeter Kohaut2019-10-13 14:08:49 +0200
committerPeter Kohaut2019-10-13 14:09:47 +0200
commitcd7e44f9f92c3aee7b99ecf44e8dbfbb252904d0 (patch)
tree2fb470e0166eaf4f125778b1675b4a49c20232e4 /engines/bladerunner/shape.h
parent2b0bce60908ec7fb2d1e2c950d4a967bc16e158a (diff)
downloadscummvm-rg350-cd7e44f9f92c3aee7b99ecf44e8dbfbb252904d0.tar.gz
scummvm-rg350-cd7e44f9f92c3aee7b99ecf44e8dbfbb252904d0.tar.bz2
scummvm-rg350-cd7e44f9f92c3aee7b99ecf44e8dbfbb252904d0.zip
BLADERUNNER: Group shapes loading
Diffstat (limited to 'engines/bladerunner/shape.h')
-rw-r--r--engines/bladerunner/shape.h33
1 files changed, 28 insertions, 5 deletions
diff --git a/engines/bladerunner/shape.h b/engines/bladerunner/shape.h
index 79037b7173..04a214c233 100644
--- a/engines/bladerunner/shape.h
+++ b/engines/bladerunner/shape.h
@@ -23,8 +23,14 @@
#ifndef BLADERUNNER_SHAPE_H
#define BLADERUNNER_SHAPE_H
+#include "common/array.h"
#include "common/str.h"
+
+namespace Common {
+class SeekableReadStream;
+}
+
namespace Graphics {
struct Surface;
}
@@ -34,24 +40,41 @@ namespace BladeRunner {
class BladeRunnerEngine;
class Shape {
- BladeRunnerEngine *_vm;
+ friend class Shapes;
int _width;
int _height;
byte *_data;
+ bool load(Common::SeekableReadStream *stream);
+
public:
- Shape(BladeRunnerEngine *vm);
~Shape();
- bool open(const Common::String &container, int index);
-
void draw(Graphics::Surface &surface, int x, int y) const;
- int getWidth() const { return _width; }
+ int getWidth() const { return _width; }
int getHeight() const { return _height; }
};
+class Shapes {
+ BladeRunnerEngine *_vm;
+
+ Common::Array<Shape> _shapes;
+
+public:
+ Shapes(BladeRunnerEngine *vm);
+ ~Shapes();
+
+ bool load(const Common::String &container);
+ void unload();
+
+ const Shape *get(uint32 index) const {
+ assert(index < _shapes.size());
+ return &_shapes[index];
+ }
+};
+
} // End of namespace BladeRunner
#endif