aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/zvision/render_table.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/zvision/render_table.cpp b/engines/zvision/render_table.cpp
index ba506b1206..aab4735d81 100644
--- a/engines/zvision/render_table.cpp
+++ b/engines/zvision/render_table.cpp
@@ -61,6 +61,13 @@ 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);
+ return Common::Point(x, y);
+ }
+
uint32 index = point.y * _numColumns + point.x;
Common::Point newPoint(point);