removed some compiler warnings

changed variables to float where appropriate
This commit is contained in:
techdragon.nguyen@gmail.com
2010-11-05 08:07:50 +00:00
parent 91cf0c8d37
commit 8908e86857
15 changed files with 100 additions and 80 deletions

View File

@@ -11,7 +11,7 @@ enum {
};
TextScroller::TextScroller(int fontId, float x, float y, float width, float speed, int scrollerType, int numItems ): JGuiObject(0), fontId(fontId){
TextScroller::TextScroller(int fontId, float x, float y, float width, float speed, int scrollerType, size_t numItems ): JGuiObject(0), fontId(fontId){
mWidth = width;
mSpeed = speed;
minimumItems = numItems;
@@ -65,7 +65,7 @@ void TextScroller::Update(float dt){
ostringstream scrollerText;
if ( timer == 0 )
{
size_t nbItemsToDisplay = ( static_cast <unsigned> (minimumItems) < strings.size() ? minimumItems : strings.size()); //MIN(minimumItems, strings.size())
size_t nbItemsToDisplay = ( minimumItems < strings.size() ? minimumItems : strings.size());
for ( size_t idx = 0; idx < nbItemsToDisplay; idx ++ )
{
scrollerText << strings[currentId + idx];
@@ -73,7 +73,7 @@ void TextScroller::Update(float dt){
currentId++;
if ( currentId >= (strings.size()-1) )
currentId = 0;
mText = wordWrap( scrollerText.str(), mWidth );
mText = wordWrap( scrollerText.str(), (int) mWidth );
}
timer = ++timer % ((int) mSpeed);
}