diff options
author | Gregory Montoir | 2003-10-18 17:12:50 +0000 |
---|---|---|
committer | Gregory Montoir | 2003-10-18 17:12:50 +0000 |
commit | eadf6356d385e3be0c8fa793007fe9e4b13da3b4 (patch) | |
tree | 2aa908d73fd69d1f33ecd8ae01c417166403eaed /queen/structs.h | |
parent | 673b211fdadd3c10dc31b013edab2a207aeaab68 (diff) | |
download | scummvm-rg350-eadf6356d385e3be0c8fa793007fe9e4b13da3b4.tar.gz scummvm-rg350-eadf6356d385e3be0c8fa793007fe9e4b13da3b4.tar.bz2 scummvm-rg350-eadf6356d385e3be0c8fa793007fe9e4b13da3b4.zip |
fix bob clipping errors
svn-id: r10899
Diffstat (limited to 'queen/structs.h')
-rw-r--r-- | queen/structs.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/queen/structs.h b/queen/structs.h index 1d0234d14f..1c3d38605a 100644 --- a/queen/structs.h +++ b/queen/structs.h @@ -26,28 +26,28 @@ namespace Queen { struct Box { - uint16 x1, y1, x2, y2; + int16 x1, y1, x2, y2; void readFrom(byte *&ptr) { - x1 = READ_BE_UINT16(ptr); ptr += 2; - y1 = READ_BE_UINT16(ptr); ptr += 2; - x2 = READ_BE_UINT16(ptr); ptr += 2; - y2 = READ_BE_UINT16(ptr); ptr += 2; + x1 = (int16)READ_BE_UINT16(ptr); ptr += 2; + y1 = (int16)READ_BE_UINT16(ptr); ptr += 2; + x2 = (int16)READ_BE_UINT16(ptr); ptr += 2; + y2 = (int16)READ_BE_UINT16(ptr); ptr += 2; } int16 xDiff() const { - return (int16)(x2 - x1); + return x2 - x1; } int16 yDiff() const { - return (int16)(y2 - y1); + return y2 - y1; } - bool intersects(uint16 x, uint16 y, uint16 w, uint16 h) const { + bool intersects(int16 x, int16 y, uint16 w, uint16 h) const { return (x + w > x1) && (y + h > y1) && (x <= x2) && (y <= y2); } - bool contains(uint16 x, uint16 y) const { + bool contains(int16 x, int16 y) const { return (x >= x1) && (x <= x2) && (y >= y1) && (y <= y2); } }; |