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 ++-- .../zvision/scripting/effects/distort_effect.cpp | 2 +- engines/zvision/scripting/effects/music_effect.cpp | 2 +- engines/zvision/scripting/menu.cpp | 26 +++++++++++----------- engines/zvision/text/truetype_font.cpp | 8 +++---- 7 files changed, 25 insertions(+), 25 deletions(-) (limited to 'engines') 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; diff --git a/engines/zvision/scripting/effects/distort_effect.cpp b/engines/zvision/scripting/effects/distort_effect.cpp index 78c4a1b9a8..113b5d048d 100644 --- a/engines/zvision/scripting/effects/distort_effect.cpp +++ b/engines/zvision/scripting/effects/distort_effect.cpp @@ -52,7 +52,7 @@ DistortNode::DistortNode(ZVision *engine, uint32 key, int16 speed, float startAn _diffLinScale = endLineScale - startLineScale; _frmSpeed = (float)speed / 15.0; - _frames = ceil((5.0 - _frmSpeed * 2.0) / _frmSpeed); + _frames = (int)ceil((5.0 - _frmSpeed * 2.0) / _frmSpeed); if (_frames <= 0) _frames = 1; diff --git a/engines/zvision/scripting/effects/music_effect.cpp b/engines/zvision/scripting/effects/music_effect.cpp index ad3c0f6d22..e3fdc96dba 100644 --- a/engines/zvision/scripting/effects/music_effect.cpp +++ b/engines/zvision/scripting/effects/music_effect.cpp @@ -140,7 +140,7 @@ bool MusicNode::process(uint32 deltaTimeInMillis) { if (_crossfadeTime > 0) { if ((int32)deltaTimeInMillis > _crossfadeTime) deltaTimeInMillis = _crossfadeTime; - _newvol += floor(((float)(_crossfadeTarget - _newvol) / (float)_crossfadeTime)) * (float)deltaTimeInMillis; + _newvol += (int)(floor(((float)(_crossfadeTarget - _newvol) / (float)_crossfadeTime)) * (float)deltaTimeInMillis); _crossfadeTime -= deltaTimeInMillis; } else { _crossfade = false; diff --git a/engines/zvision/scripting/menu.cpp b/engines/zvision/scripting/menu.cpp index 16aa57e3ae..e7775cbe3f 100644 --- a/engines/zvision/scripting/menu.cpp +++ b/engines/zvision/scripting/menu.cpp @@ -50,9 +50,9 @@ MenuZGI::MenuZGI(ZVision *engine) : scrolled[0] = false; scrolled[1] = false; scrolled[2] = false; - scrollPos[0] = 0.0; - scrollPos[1] = 0.0; - scrollPos[2] = 0.0; + scrollPos[0] = 0; + scrollPos[1] = 0; + scrollPos[2] = 0; mouseOnItem = -1; redraw = false; clean = false; @@ -361,11 +361,11 @@ void MenuZGI::process(uint32 deltatime) { if (scrl == 0) scrl = 1.0; - scrollPos [kMenuItem] += scrl; + scrollPos[kMenuItem] += (int)scrl; if (scrollPos[kMenuItem] >= 0) { scrolled[kMenuItem] = true; - scrollPos [kMenuItem] = 0; + scrollPos[kMenuItem] = 0; } } if (redraw) { @@ -430,11 +430,11 @@ void MenuZGI::process(uint32 deltatime) { if (scrl == 0) scrl = 1.0; - scrollPos [kMenuMagic] += scrl; + scrollPos[kMenuMagic] += (int)scrl; if (scrollPos[kMenuMagic] >= 600) { scrolled[kMenuMagic] = true; - scrollPos [kMenuMagic] = 600; + scrollPos[kMenuMagic] = 600; } } if (redraw) { @@ -495,11 +495,11 @@ void MenuZGI::process(uint32 deltatime) { if (scrl == 0) scrl = 1.0; - scrollPos [kMenuMain] += scrl; + scrollPos[kMenuMain] += (int)scrl; if (scrollPos[kMenuMain] >= 0) { scrolled[kMenuMain] = true; - scrollPos [kMenuMain] = 0; + scrollPos[kMenuMain] = 0; } } if (redraw) { @@ -553,7 +553,7 @@ MenuNemesis::MenuNemesis(ZVision *engine) : MenuHandler(engine) { inmenu = false; scrolled = false; - scrollPos = 0.0; + scrollPos = 0; mouseOnItem = -1; redraw = false; delay = 0; @@ -696,7 +696,7 @@ void MenuNemesis::process(uint32 deltatime) { if (scrl == 0) scrl = 1.0; - scrollPos += scrl; + scrollPos += (int)scrl; redraw = true; } @@ -743,10 +743,10 @@ void MenuNemesis::process(uint32 deltatime) { if (scrl == 0) scrl = 1.0; - Common::Rect cl(64, 32 + scrollPos - scrl, 64 + 512, 32 + scrollPos + 1); + Common::Rect cl(64, (int16)(32 + scrollPos - scrl), 64 + 512, 32 + scrollPos + 1); _engine->getRenderManager()->clearMenuSurface(cl); - scrollPos -= scrl; + scrollPos -= (int)scrl; redraw = true; } else scrollPos = -32; diff --git a/engines/zvision/text/truetype_font.cpp b/engines/zvision/text/truetype_font.cpp index 7ad8d6db61..acb053ea8d 100644 --- a/engines/zvision/text/truetype_font.cpp +++ b/engines/zvision/text/truetype_font.cpp @@ -199,12 +199,12 @@ void StyledTTFont::drawChar(Graphics::Surface *dst, byte chr, int x, int y, uint if (_font) { _font->drawChar(dst, chr, x, y, color); if (_style & TTF_STYLE_UNDERLINE) { - int16 pos = floor(_font->getFontHeight() * 0.87); + int16 pos = (int16)floor(_font->getFontHeight() * 0.87); int thk = MAX((int)(_font->getFontHeight() * 0.05), 1); dst->fillRect(Common::Rect(x, y + pos, x + _font->getCharWidth(chr), y + pos + thk), color); } if (_style & TTF_STYLE_STRIKETHROUGH) { - int16 pos = floor(_font->getFontHeight() * 0.60); + int16 pos = (int16)floor(_font->getFontHeight() * 0.60); int thk = MAX((int)(_font->getFontHeight() * 0.05), 1); dst->fillRect(Common::Rect(x, y + pos, x + _font->getCharWidth(chr), y + pos + thk), color); } @@ -216,7 +216,7 @@ void StyledTTFont::drawString(Graphics::Surface *dst, const Common::String &str, Common::U32String u32str = convertUtf8ToUtf32(str); _font->drawString(dst, u32str, x, y, w, color, align); if (_style & TTF_STYLE_UNDERLINE) { - int16 pos = floor(_font->getFontHeight() * 0.87); + int16 pos = (int16)floor(_font->getFontHeight() * 0.87); int16 wd = MIN(_font->getStringWidth(u32str), w); int16 stX = x; if (align == Graphics::kTextAlignCenter) @@ -229,7 +229,7 @@ void StyledTTFont::drawString(Graphics::Surface *dst, const Common::String &str, dst->fillRect(Common::Rect(stX, y + pos, stX + wd, y + pos + thk), color); } if (_style & TTF_STYLE_STRIKETHROUGH) { - int16 pos = floor(_font->getFontHeight() * 0.60); + int16 pos = (int16)floor(_font->getFontHeight() * 0.60); int16 wd = MIN(_font->getStringWidth(u32str), w); int16 stX = x; if (align == Graphics::kTextAlignCenter) -- cgit v1.2.3