- first = last = text;
- while( len ) {
- // iterate until we get the next color tag or reach the end of the text part to draw
- for( ; len && *last != _draw_color_tag ; len--, last++ )
- ;
- // only draw the partial string if we have read anything
- if( last != first ) {
- // draw the string
- DrawQ_String( x, y, first, last - first, scalex, scaley, basered * color[0], basegreen * color[1], baseblue * color[2], basealpha * color[3], flags );
- // update x to be at the new start position
- x += (last - first) * scalex;
- // if we have reached the end, we have finished
- if( !len )
+ start = current = text;
+ while( len > 0 ) {
+ // check for color control char
+ if( *current == _draw_color_tag ) {
+ // get next char
+ current++;
+ len--;
+ if( len == 0 ) {