Fixed a crash in the vertical text scroller. Mike, pls review.
This commit is contained in:
@@ -64,14 +64,14 @@ void TextScroller::Update(float dt){
|
|||||||
ostringstream scrollerText;
|
ostringstream scrollerText;
|
||||||
if ( timer == 0 )
|
if ( timer == 0 )
|
||||||
{
|
{
|
||||||
for ( int idx = 0; idx < 2; idx ++ )
|
for ( int idx = 0; idx < (MIN(2, strings.size())); idx ++ )
|
||||||
{
|
{
|
||||||
scrollerText << strings[currentId + idx];
|
scrollerText << strings[currentId + idx];
|
||||||
}
|
}
|
||||||
currentId++;
|
currentId++;
|
||||||
if ( currentId >= (strings.size()-1) )
|
if ( currentId >= (strings.size()-1) )
|
||||||
currentId = 0;
|
currentId = 0;
|
||||||
mText = scrollerText.str();
|
mText = scrollerText.str();
|
||||||
}
|
}
|
||||||
timer = ++timer % ((int) mSpeed);
|
timer = ++timer % ((int) mSpeed);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user