/elec/propeller-clock

To get this branch, use:
bzr branch http://bzr.ed.am/elec/propeller-clock

« back to all changes in this revision

Viewing changes to src/text_renderer.cc

  • Committer: Tim Marston
  • Date: 2012-04-29 15:27:19 UTC
  • Revision ID: tim@ed.am-20120429152719-4cu2t9lx7bxpbml1
added adjustable text scaling factor

Show diffs side-by-side

added added

removed removed

Lines of Context:
358
358
}
359
359
 
360
360
 
361
 
int TextRenderer::get_width( int message_len )
 
361
int TextRenderer::get_width( int message_len, int scale )
362
362
{
363
 
        return message_len * 8 * TEXT_SCALE;
 
363
        return message_len * 8 * scale;
364
364
}
365
365
 
366
366
 
367
367
void TextRenderer::render( const char *message, int message_len, int x,
368
 
                                                   bool y_flip, int y_shift )
 
368
                                                   bool y_flip, int y_shift, int scale )
369
369
{
370
370
        char glyph_col = 0;
371
371
 
373
373
        if( x >= 0 )
374
374
        {
375
375
                // scale font
376
 
                x /= TEXT_SCALE;
 
376
                x /= scale;
377
377
 
378
378
                int pos = x / 8;
379
379
                if( pos < message_len )