diff options
author | Max Horn | 2011-12-02 21:08:57 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-12-03 13:58:34 +0100 |
commit | 91c9ecf7e1e335230cff6bebfa9f2a24e9f688cf (patch) | |
tree | cd880ec0a0a44585b5246ed204be6f31e6bb02ba /engines | |
parent | ebc3ff5b929cdd90a3b086d173a034cf7f4de758 (diff) | |
download | scummvm-rg350-91c9ecf7e1e335230cff6bebfa9f2a24e9f688cf.tar.gz scummvm-rg350-91c9ecf7e1e335230cff6bebfa9f2a24e9f688cf.tar.bz2 scummvm-rg350-91c9ecf7e1e335230cff6bebfa9f2a24e9f688cf.zip |
DREAMWEB: Simplify SegmentRef class
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/runtime.h | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 21d6c434cc..3fab4ecc60 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -158,19 +158,7 @@ public: SegmentRef(Context *ctx, uint16 value = 0, SegmentPtr segment = SegmentPtr()): _context(ctx), _value(value), _segment(segment) { } - inline void reset(uint16 value); - - inline SegmentRef& operator=(const uint16 id) { - reset(id); - return *this; - } - - inline SegmentRef& operator=(const SegmentRef &ref) { - _context = ref._context; - _value = ref._value; - _segment = ref._segment; - return *this; - } + inline SegmentRef& operator=(const uint16 id); inline uint8 &byte(unsigned index) { assert(_segment != 0); @@ -259,10 +247,10 @@ public: inline Context(): engine(0), al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx), cs(this), ds(this), es(this), data(this) { _segments[kDefaultDataSegment] = SegmentPtr(new Segment()); - cs.reset(kDefaultDataSegment); - ds.reset(kDefaultDataSegment); - es.reset(kDefaultDataSegment); - data.reset(kDefaultDataSegment); + cs = kDefaultDataSegment; + ds = kDefaultDataSegment; + es = kDefaultDataSegment; + data = kDefaultDataSegment; } SegmentRef getSegment(uint16 value) { @@ -565,8 +553,9 @@ public: } }; -inline void SegmentRef::reset(uint16 value) { - *this = _context->getSegment(value); +inline SegmentRef& SegmentRef::operator=(const uint16 id) { + *this = _context->getSegment(id); + return *this; } class StackChecker { |