mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 12:39:56 +00:00
ZVISION: Silence gcc warnings
This commit is contained in:
parent
75acef7566
commit
ddf170de4a
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user