aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2010-07-27 09:34:11 +0000
committerMax Horn2010-07-27 09:34:11 +0000
commit691d7cff2831d7d3a1674c59718fcb56657d3ad7 (patch)
tree9abe8b24756b5221cc3e482b05e33fa210c05a2b
parent2636ac4f36b412a8d6c62267393a19e8ba181388 (diff)
downloadscummvm-rg350-691d7cff2831d7d3a1674c59718fcb56657d3ad7.tar.gz
scummvm-rg350-691d7cff2831d7d3a1674c59718fcb56657d3ad7.tar.bz2
scummvm-rg350-691d7cff2831d7d3a1674c59718fcb56657d3ad7.zip
Fix warnings about cast removing constness, and about implict conversion from float to int
svn-id: r51352
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index a0ffa1fcd2..0526a791ee 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -498,7 +498,7 @@ void OpenGLGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch
if (_overlayFormat.aBits() == 1) {
// Copy buffer with the alpha bit on for all pixels for correct
// overlay drawing.
- const uint16 *src = (uint16 *)buf;
+ const uint16 *src = (const uint16 *)buf;
uint16 *dst = (uint16 *)_overlayData.pixels + y * _overlayData.w + x;
for (int i = 0; i < h; i++) {
for (int e = 0; e < w; e++)
@@ -508,7 +508,7 @@ void OpenGLGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch
}
} else {
// Copy buffer data to internal overlay surface
- const byte *src = (byte *)buf;
+ const byte *src = (const byte *)buf;
byte *dst = (byte *)_overlayData.pixels + y * _overlayData.pitch;
for (int i = 0; i < h; i++) {
memcpy(dst + x * _overlayData.bytesPerPixel, src, w * _overlayData.bytesPerPixel);
@@ -816,17 +816,18 @@ void OpenGLGraphicsManager::refreshCursorScale() {
} else {
// Otherwise, scale the cursor for the overlay
float targetScaleFactor = MIN(_cursorTargetScale, _videoMode.scaleFactor);
- _cursorState.rW = _cursorState.w * (screenScaleFactor - targetScaleFactor + 1);
- _cursorState.rH = _cursorState.h * (screenScaleFactor - targetScaleFactor + 1);
- _cursorState.rHotX = _cursorState.hotX * (screenScaleFactor - targetScaleFactor + 1);
- _cursorState.rHotY = _cursorState.hotY * (screenScaleFactor - targetScaleFactor + 1);
+ float actualFactor = (screenScaleFactor - targetScaleFactor + 1);
+ _cursorState.rW = (int16)(_cursorState.w * actualFactor);
+ _cursorState.rH = (int16)(_cursorState.h * actualFactor);
+ _cursorState.rHotX = (int16)(_cursorState.hotX * actualFactor);
+ _cursorState.rHotY = (int16)(_cursorState.hotY * actualFactor);
}
// Always scale the cursor for the game
- _cursorState.vW = _cursorState.w * screenScaleFactor;
- _cursorState.vH = _cursorState.h * screenScaleFactor;
- _cursorState.vHotX = _cursorState.hotX * screenScaleFactor;
- _cursorState.vHotY = _cursorState.hotY * screenScaleFactor;
+ _cursorState.vW = (int16)(_cursorState.w * screenScaleFactor);
+ _cursorState.vH = (int16)(_cursorState.h * screenScaleFactor);
+ _cursorState.vHotX = (int16)(_cursorState.hotX * screenScaleFactor);
+ _cursorState.vHotY = (int16)(_cursorState.hotY * screenScaleFactor);
}
void OpenGLGraphicsManager::refreshAspectRatio() {