diff options
author | Gregory Montoir | 2003-10-28 19:55:12 +0000 |
---|---|---|
committer | Gregory Montoir | 2003-10-28 19:55:12 +0000 |
commit | 8eea63362ed29d888515512f965a298e5cb77bd6 (patch) | |
tree | 4660cf85b0f79e7a2a0dfb6014a527de88bd98c1 /queen/display.cpp | |
parent | 2fef2dcb84dc6d9ee2884ac6097fa9fb0bd24e20 (diff) | |
download | scummvm-rg350-8eea63362ed29d888515512f965a298e5cb77bd6.tar.gz scummvm-rg350-8eea63362ed29d888515512f965a298e5cb77bd6.tar.bz2 scummvm-rg350-8eea63362ed29d888515512f965a298e5cb77bd6.zip |
handle (x,y) negative coordinates in dynalum
svn-id: r10998
Diffstat (limited to 'queen/display.cpp')
-rw-r--r-- | queen/display.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/queen/display.cpp b/queen/display.cpp index 29654a7f11..0f4012851e 100644 --- a/queen/display.cpp +++ b/queen/display.cpp @@ -161,19 +161,25 @@ void Display::dynalumInit(Resource *resource, const char *roomName, uint16 roomN } -void Display::dynalumUpdate(int x, int y) { +void Display::dynalumUpdate(int16 x, int16 y) { if (!_dynalum.valid) return; - if (x >= _bdWidth) { + if (x < 0) { + x = 0; + } + else if (x >= _bdWidth) { x = _bdWidth; } - if (y >= ROOM_ZONE_HEIGHT - 1) { + if (y < 0) { + y = 0; + } + else if (y >= ROOM_ZONE_HEIGHT - 1) { y = ROOM_ZONE_HEIGHT - 1; } - unsigned offset = (y / 4) * 160 + (x / 4); + uint offset = (y / 4) * 160 + (x / 4); if (offset >= sizeof(_dynalum.msk)) { debug(0, "Graphics::dynalumUpdate(%d, %d) - invalid offset: %08x", x, y, offset); return; @@ -654,7 +660,7 @@ void Display::prepareUpdate() { } -void Display::update(bool dynalum, int dynaX, int dynaY) { +void Display::update(bool dynalum, int16 dynaX, int16 dynaY) { if (dynalum) { dynalumUpdate(dynaX, dynaY); |