aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichieSams2013-09-06 22:45:41 -0500
committerRichieSams2013-09-06 22:50:34 -0500
commitb6366a2697f9d604fbb19ed38f1a1e51cf0d2b7f (patch)
treec7f4b7aba711cc3ed352584a0469f32f47489d50
parent6ce62475ca19e4c395ad0e341d9875fb8825fde4 (diff)
downloadscummvm-rg350-b6366a2697f9d604fbb19ed38f1a1e51cf0d2b7f.tar.gz
scummvm-rg350-b6366a2697f9d604fbb19ed38f1a1e51cf0d2b7f.tar.bz2
scummvm-rg350-b6366a2697f9d604fbb19ed38f1a1e51cf0d2b7f.zip
ZVISION: Fix signed/unsigned mismatch
-rw-r--r--engines/zvision/render_table.cpp18
-rw-r--r--engines/zvision/render_table.h2
2 files changed, 10 insertions, 10 deletions
diff --git a/engines/zvision/render_table.cpp b/engines/zvision/render_table.cpp
index c72775b1ab..3e7a86e348 100644
--- a/engines/zvision/render_table.cpp
+++ b/engines/zvision/render_table.cpp
@@ -100,24 +100,24 @@ uint16 mixTwoRGB(uint16 colorOne, uint16 colorTwo, float percentColorOne) {
return returnColor;
}
-void RenderTable::mutateImage(uint16 *sourceBuffer, uint16* destBuffer, uint16 destWidth) {
+void RenderTable::mutateImage(uint16 *sourceBuffer, uint16* destBuffer, uint32 destWidth) {
uint32 destColumnOffset = 0;
- for (int16 y = 0; y < _numRows; y++) {
- int32 sourceColumnOffset = y * _numColumns;
+ for (uint32 y = 0; y < _numRows; y++) {
+ uint32 sourceColumnOffset = y * _numColumns;
- for (int16 x = 0; x < _numColumns; x++) {
- int32 index = sourceColumnOffset + x;
+ for (uint32 x = 0; x < _numColumns; x++) {
+ uint32 index = sourceColumnOffset + x;
// RenderTable only stores offsets from the original coordinates
- int32 sourceYIndex = y + _internalBuffer[index].y;
- int32 sourceXIndex = x + _internalBuffer[index].x;
+ uint32 sourceYIndex = y + _internalBuffer[index].y;
+ uint32 sourceXIndex = x + _internalBuffer[index].x;
// Clamp the yIndex to the size of the image
- sourceYIndex = CLIP<int32>(sourceYIndex, 0, _numRows - 1);
+ sourceYIndex = CLIP<uint32>(sourceYIndex, 0, _numRows - 1);
// Clamp the xIndex to the size of the image
- sourceXIndex = CLIP<int32>(sourceXIndex, 0, _numColumns - 1);
+ sourceXIndex = CLIP<uint32>(sourceXIndex, 0, _numColumns - 1);
destBuffer[destColumnOffset + x] = sourceBuffer[sourceYIndex * _numColumns + sourceXIndex];
}
diff --git a/engines/zvision/render_table.h b/engines/zvision/render_table.h
index 737fc84bfc..ba3c7d2f5d 100644
--- a/engines/zvision/render_table.h
+++ b/engines/zvision/render_table.h
@@ -66,7 +66,7 @@ public:
const Common::Point convertWarpedCoordToFlatCoord(const Common::Point &point);
- void mutateImage(uint16 *sourceBuffer, uint16* destBuffer, uint16 destWidth);
+ void mutateImage(uint16 *sourceBuffer, uint16* destBuffer, uint32 destWidth);
void generateRenderTable();
void setPanoramaFoV(float fov);