From 5ce0568ec71050d6de505c6583ee7bcfd33b59d9 Mon Sep 17 00:00:00 2001 From: Pieter Hulshoff Date: Wed, 6 Jul 2016 12:08:05 +0200 Subject: [PATCH] Fixed Windows compile errors. --- RetroFE/Source/Graphics/Component/ScrollingText.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/RetroFE/Source/Graphics/Component/ScrollingText.cpp b/RetroFE/Source/Graphics/Component/ScrollingText.cpp index 1efd166..b9641bd 100644 --- a/RetroFE/Source/Graphics/Component/ScrollingText.cpp +++ b/RetroFE/Source/Graphics/Component/ScrollingText.cpp @@ -337,7 +337,7 @@ void ScrollingText::draw( ) // Check if glyph falls partially outside the box at the back end if ((rect.x + static_cast( glyph.advance * scale * scaleX_ )) >= (static_cast( xOrigin ) + imageMaxWidth)) { - rect.w = static_cast( xOrigin ) + imageMaxWidth - rect.x; + rect.w = static_cast( xOrigin ) + static_cast( imageMaxWidth ) - rect.x; charRect.w = static_cast( rect.w / scale / scaleX_ ); } @@ -498,8 +498,8 @@ void ScrollingText::draw( ) std::istringstream iss(text[l]); std::string word; unsigned int wordCount = textWords[l]; - unsigned int spaceFill = imageMaxWidth - textWidth[l]; - unsigned int yAdvance = font->getHeight( ) * scale * scaleY_; + unsigned int spaceFill = static_cast( imageMaxWidth ) - textWidth[l]; + unsigned int yAdvance = static_cast( font->getHeight( ) * scale * scaleY_ ); while (iss >> word) { @@ -512,12 +512,12 @@ void ScrollingText::draw( ) SDL_Rect charRect = glyph.rect; rect.h = static_cast( charRect.h * scale * scaleY_ ); rect.w = static_cast( charRect.w * scale * scaleX_ ); - yAdvance = font->getHeight( ) * scale * scaleY_; + yAdvance = static_cast( font->getHeight( ) * scale * scaleY_ ); // Check if glyph falls partially outside the box at the bottom end if ((rect.y + rect.h) >= (static_cast( yOrigin ) + imageMaxHeight)) { - rect.h = static_cast( yOrigin ) + imageMaxHeight - rect.y; + rect.h = static_cast( yOrigin ) + static_cast( imageMaxHeight ) - rect.y; charRect.h = static_cast( rect.h / scale / scaleY_ ); }