Fix warnings, fix crash, add asserts.
This commit is contained in:
@@ -208,9 +208,11 @@ void BitmapText::BuildChars()
|
|||||||
void BitmapText::DrawChars()
|
void BitmapText::DrawChars()
|
||||||
{
|
{
|
||||||
unsigned uNumGlyphs = tex.size();
|
unsigned uNumGlyphs = tex.size();
|
||||||
unsigned uStartGlyph = SCALE( m_temp.crop.left, 0.f, 1.f, 0, uNumGlyphs );
|
unsigned uStartGlyph = (unsigned) SCALE( m_temp.crop.left, 0.f, 1.f, 0, (float) uNumGlyphs );
|
||||||
unsigned uEndGlyph = SCALE( m_temp.crop.right, 0.f, 1.f, uNumGlyphs, 0 );
|
unsigned uEndGlyph = (unsigned) SCALE( m_temp.crop.right, 0.f, 1.f, (float) uNumGlyphs, 0 );
|
||||||
|
|
||||||
|
ASSERT( uStartGlyph <= uNumGlyphs );
|
||||||
|
ASSERT( uEndGlyph <= uNumGlyphs );
|
||||||
for(unsigned start = uStartGlyph; start < uEndGlyph; )
|
for(unsigned start = uStartGlyph; start < uEndGlyph; )
|
||||||
{
|
{
|
||||||
unsigned end = start;
|
unsigned end = start;
|
||||||
|
|||||||
Reference in New Issue
Block a user