mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-18 02:08:42 +00:00
DREAMWEB: Work around runtime limitation
The WordRef accessor writes back its value too late. Example: in the call printDirect(data.word(kLastxpos), .....) the destructor isn't called until after printDirect returns. This destroys the modifications to lastXPos that printDirect makes.
This commit is contained in:
parent
9fdb38d395
commit
3185dac25e
@ -56,6 +56,11 @@ public:
|
||||
}
|
||||
|
||||
inline ~WordRef() {
|
||||
// FIXME: This is _too late_ to write back the
|
||||
// value. Example: in the call
|
||||
// printDirect(data.word(kLastxpos), .....)
|
||||
// the destructor isn't called until after printDirect returns. This
|
||||
// destroys the modifications to lastXPos that printDirect makes.
|
||||
_data[0] = _value & 0xff;
|
||||
_data[1] = _value >> 8;
|
||||
_value = _data[0] | (_data[1] << 8);
|
||||
|
@ -1581,7 +1581,8 @@ void DreamGenContext::withWhat() {
|
||||
|
||||
copyName(data.byte(kObjecttype), data.byte(kCommand), commandLine);
|
||||
printMessage2(100, 21, 63, 200, false, 2);
|
||||
printDirect(commandLine, data.word(kLastxpos) + 5, 21, 220, false);
|
||||
uint16 x = data.word(kLastxpos) + 5;
|
||||
printDirect(commandLine, x, 21, 220, false);
|
||||
printMessage2(data.word(kLastxpos) + 5, 21, 63, 200, false, 3);
|
||||
|
||||
fillRyan();
|
||||
|
Loading…
x
Reference in New Issue
Block a user