Changeset 406 for trunk/src/gui/gui_ascii_renderer.cc
- Timestamp:
- 06/20/15 00:05:17 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/gui_ascii_renderer.cc
r395 r406 18 18 bool clear; 19 19 bool border; 20 charborder_chars[8];20 uchar8 border_chars[8]; 21 21 uint32 border_color; 22 22 uint32 text_color; … … 42 42 } 43 43 else 44 er = (ascii_render_data*)( e->m_render_data );44 er = static_cast< ascii_render_data* >( e->m_render_data ); 45 45 46 46 rectangle abs = e->m_absolute; … … 68 68 er->border_color = uint32( border_color ); 69 69 for ( uint32 i = 0; i < 8 && i < path.length(); ) 70 er->border_chars[i] = path[i];70 er->border_chars[i] = static_cast< uchar8 >( path[i] ); 71 71 } 72 72 } … … 75 75 void ascii_renderer::draw( element* e ) 76 76 { 77 ascii_render_data* er = (ascii_render_data*)( e->m_render_data );77 ascii_render_data* er = static_cast< ascii_render_data* >( e->m_render_data ); 78 78 rectangle abs = e->m_absolute; 79 79 if ( er->clear ) m_terminal->clear( abs ); … … 82 82 for ( int x = 0; x < abs.get_width(); ++x ) 83 83 { 84 m_terminal->print( position( abs.ul.y, abs.ul.x + x ), er->border_color, (unsigned char)er->border_chars[0] );85 m_terminal->print( position( abs.lr.y, abs.ul.x + x ), er->border_color, (unsigned char)er->border_chars[1] );84 m_terminal->print( position( abs.ul.y, abs.ul.x + x ), er->border_color, er->border_chars[0] ); 85 m_terminal->print( position( abs.lr.y, abs.ul.x + x ), er->border_color, er->border_chars[1] ); 86 86 } 87 87 88 88 for ( int y = 0; y < abs.get_height(); ++y ) 89 89 { 90 m_terminal->print( position( abs.ul.y + y, abs.ul.x ), er->border_color, (unsigned char)er->border_chars[2] );91 m_terminal->print( position( abs.ul.y + y, abs.lr.x ), er->border_color, (unsigned char)er->border_chars[3] );90 m_terminal->print( position( abs.ul.y + y, abs.ul.x ), er->border_color, er->border_chars[2] ); 91 m_terminal->print( position( abs.ul.y + y, abs.lr.x ), er->border_color, er->border_chars[3] ); 92 92 } 93 93 94 m_terminal->print( abs.ul, er->border_color, (unsigned char)er->border_chars[4] );95 m_terminal->print( abs.ur(), er->border_color, (unsigned char)er->border_chars[5] );96 m_terminal->print( abs.ll(), er->border_color, (unsigned char)er->border_chars[6] );97 m_terminal->print( abs.lr, er->border_color, (unsigned char)er->border_chars[7] );94 m_terminal->print( abs.ul, er->border_color, er->border_chars[4] ); 95 m_terminal->print( abs.ur(), er->border_color, er->border_chars[5] ); 96 m_terminal->print( abs.ll(), er->border_color, er->border_chars[6] ); 97 m_terminal->print( abs.lr, er->border_color, er->border_chars[7] ); 98 98 } 99 99 if ( !e->m_text.empty() ) … … 102 102 for ( char c : e->m_text ) 103 103 { 104 m_terminal->print( p, er->text_color, (unsigned char)c);104 m_terminal->print( p, er->text_color, static_cast< unsigned char >( c ) ); 105 105 ++p.x; 106 106 }
Note: See TracChangeset
for help on using the changeset viewer.