From bce4df937c9a2ba8a313ecdbbb86977bbcaa4538 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 13 Sep 2003 19:47:28 +0000 Subject: [PATCH] make BitmapText crop-aware --- stepmania/src/BitmapText.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 85ff548f33..045a796fd2 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -207,13 +207,22 @@ void BitmapText::BuildChars() void BitmapText::DrawChars() { - for(unsigned start = 0; start < tex.size(); ) + unsigned uNumGlyphs = tex.size(); + unsigned uStartGlyph = SCALE( m_temp.crop.left, 0.f, 1.f, 0, uNumGlyphs ); + unsigned uEndGlyph = SCALE( m_temp.crop.right, 0.f, 1.f, uNumGlyphs, 0 ); + + if( m_temp.crop.right > 0 ) + int skjdks = 0; + + for(unsigned start = uStartGlyph; start < uEndGlyph; ) { unsigned end = start; - while(end < tex.size() && tex[end] == tex[start]) + while(end < uEndGlyph && tex[end] == tex[start]) end++; DISPLAY->SetTexture( tex[start] ); - DISPLAY->DrawQuads( &verts[start*4], (end-start)*4 ); + RageSpriteVertex &start_vertex = verts[start*4]; + int iNumVertsToDraw = (end-start)*4; + DISPLAY->DrawQuads( &start_vertex, iNumVertsToDraw ); start = end; }