aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2011-12-02 20:55:23 +0100
committerWillem Jan Palenstijn2011-12-03 13:58:32 +0100
commitebc3ff5b929cdd90a3b086d173a034cf7f4de758 (patch)
tree4a76dd1799934a66a898f320b10e7dae7d89f640
parentba9eb8bffdf7cfdf085528442a66a265aa394842 (diff)
downloadscummvm-rg350-ebc3ff5b929cdd90a3b086d173a034cf7f4de758.tar.gz
scummvm-rg350-ebc3ff5b929cdd90a3b086d173a034cf7f4de758.tar.bz2
scummvm-rg350-ebc3ff5b929cdd90a3b086d173a034cf7f4de758.zip
DREAMWEB: Turn Segment into a class, make members private
-rw-r--r--engines/dreamweb/runtime.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h
index cd171a04c7..21d6c434cc 100644
--- a/engines/dreamweb/runtime.h
+++ b/engines/dreamweb/runtime.h
@@ -117,9 +117,15 @@ public:
}
};
-struct Segment {
+class Segment {
Common::Array<uint8> data;
+public:
+ Segment(uint size = 0) {
+ if (size > 0)
+ data.resize(size);
+ }
+
inline void assign(const uint8 *b, const uint8 *e) {
data.assign(b, e);
}
@@ -276,8 +282,7 @@ public:
_freeSegments.pop_front();
}
assert(!_segments.contains(id));
- SegmentPtr seg(new Segment());
- seg->data.resize(size);
+ SegmentPtr seg(new Segment(size));
_segments[id] = seg;
return SegmentRef(this, id, seg);
}