From ddf170de4a33fac4cac3093bf6dd97d253216092 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sat, 11 Apr 2015 16:11:21 -0400 Subject: ZVISION: Silence gcc warnings --- engines/zvision/graphics/effects/fog.cpp | 6 +++--- engines/zvision/graphics/effects/wave.cpp | 2 +- engines/zvision/graphics/render_manager.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/zvision/graphics') diff --git a/engines/zvision/graphics/effects/fog.cpp b/engines/zvision/graphics/effects/fog.cpp index 32a01915d3..7b65f60f24 100644 --- a/engines/zvision/graphics/effects/fog.cpp +++ b/engines/zvision/graphics/effects/fog.cpp @@ -142,9 +142,9 @@ void FogFx::update() { for (uint8 i = 0; i < 31; i++) { float perc = (float)i / 31.0; - uint8 cr = (float)_r * perc; - uint8 cg = (float)_g * perc; - uint8 cb = (float)_b * perc; + uint8 cr = (uint8)((float)_r * perc); + uint8 cg = (uint8)((float)_g * perc); + uint8 cb = (uint8)((float)_b * perc); _colorMap[i] = _engine->_resourcePixelFormat.RGBToColor(cr << 3, cg << 3, cb << 3); } } diff --git a/engines/zvision/graphics/effects/wave.cpp b/engines/zvision/graphics/effects/wave.cpp index cec631611b..d2887b3112 100644 --- a/engines/zvision/graphics/effects/wave.cpp +++ b/engines/zvision/graphics/effects/wave.cpp @@ -54,7 +54,7 @@ WaveFx::WaveFx(ZVision *engine, uint32 key, Common::Rect region, bool ported, in int16 dx = (x - quarterWidth); int16 dy = (y - quarterHeight); - _ampls[i][x + y * _halfWidth] = ampl * sin(sqrt(dx * dx / (float)centerX + dy * dy / (float)centerY) / (-waveln * 3.1415926) + phase); + _ampls[i][x + y * _halfWidth] = (int8)(ampl * sin(sqrt(dx * dx / (float)centerX + dy * dy / (float)centerY) / (-waveln * 3.1415926) + phase)); } phase += spd; } diff --git a/engines/zvision/graphics/render_manager.cpp b/engines/zvision/graphics/render_manager.cpp index 3772d5909e..ce0a02a1ad 100644 --- a/engines/zvision/graphics/render_manager.cpp +++ b/engines/zvision/graphics/render_manager.cpp @@ -1108,7 +1108,7 @@ void RenderManager::updateRotation() { int16 newPosition = startPosition + _velocity; int16 screenHeight = getBkgSize().y; - int16 tiltGap = _renderTable.getTiltGap(); + int16 tiltGap = (int16)_renderTable.getTiltGap(); if (newPosition >= (screenHeight - tiltGap)) newPosition = screenHeight - tiltGap; @@ -1143,7 +1143,7 @@ void RenderManager::checkBorders() { int16 newPosition = startPosition; int16 screenHeight = getBkgSize().y; - int16 tiltGap = _renderTable.getTiltGap(); + int16 tiltGap = (int16)_renderTable.getTiltGap(); if (newPosition >= (screenHeight - tiltGap)) newPosition = screenHeight - tiltGap; -- cgit v1.2.3