aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorrichiesams2013-08-29 01:59:13 -0500
committerWillem Jan Palenstijn2013-09-24 13:59:38 +0200
commit94378d064405992905a9ffcb24c72f0c86d51bd4 (patch)
tree924181ee0e1c57493d9221dcb70da86c6e557222 /engines/zvision
parent0271a2c59dd553b79cae95376b40654a70190089 (diff)
downloadscummvm-rg350-94378d064405992905a9ffcb24c72f0c86d51bd4.tar.gz
scummvm-rg350-94378d064405992905a9ffcb24c72f0c86d51bd4.tar.bz2
scummvm-rg350-94378d064405992905a9ffcb24c72f0c86d51bd4.zip
ZVISION: Force comparison to be between signed ints and ensure CLIP happens on a signed int
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/render_table.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/zvision/render_table.cpp b/engines/zvision/render_table.cpp
index ee3628299a..55285b45e6 100644
--- a/engines/zvision/render_table.cpp
+++ b/engines/zvision/render_table.cpp
@@ -62,9 +62,9 @@ void RenderTable::setRenderState(RenderState newState) {
const Common::Point RenderTable::convertWarpedCoordToFlatCoord(const Common::Point &point) {
// If we're outside the range of the RenderTable, no warping is happening. Return the maximum image coords
- if (point.x >= _numColumns || point.y >= _numRows) {
- int16 x = CLIP<int16>(point.x, 0, _numColumns);
- int16 y = CLIP<int16>(point.y, 0, _numRows);
+ if (point.x >= (int16)_numColumns || point.y >= (int16)_numRows || point.x < 0 || point.y , 0) {
+ int16 x = CLIP<int16>(point.x, 0, (int16)_numColumns);
+ int16 y = CLIP<int16>(point.y, 0, (int16)_numRows);
return Common::Point(x, y);
}