diff options
-rw-r--r-- | engines/dreamweb/runtime.h | 11 |
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); } |