Ignore:
Timestamp:
08/08/16 18:25:48 (9 years ago)
Author:
epyon
Message:
  • term_color implementation
  • support for background color
  • support for RGBA encoding
  • initial gfx_terminal implementation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/ascii_printer.cc

    r487 r514  
    1515}
    1616
    17 void ascii_printer::print( const string_view& text, const position& p, uint32 color )
     17void ascii_printer::print( const string_view& text, const position& p, term_color color )
    1818{
    1919        position coord( p );
    2020        for ( char c : text )
    2121        {
    22                 m_terminal->print( coord, color, c );
     22                m_terminal->print( coord, color, term_color(), c );
    2323                ++coord.x;
    2424                if ( coord.x >= m_terminal->get_size().x ) break;
     
    2626}
    2727
    28 void nv::ascii_printer::frame( const nv::rectangle& area, const nv::string_view& border_chars, uint32 color )
     28void nv::ascii_printer::frame( const nv::rectangle& area, const nv::string_view& border_chars, term_color color )
    2929{
    3030        if ( border_chars.length() < 8 )
    3131        {
    32                 m_terminal->clear( area );
     32                m_terminal->clear( area, color, term_color() );
    3333                return;
    3434        }
    35         m_terminal->clear( area.shrinked( 1 ) );
     35        m_terminal->clear( area.shrinked( 1 ), color, term_color() );
    3636        for ( int x = 0; x < area.get_width(); ++x )
    3737        {
    38                 m_terminal->print( position( area.ul.x + x, area.ul.y ), color, border_chars[0] );
    39                 m_terminal->print( position( area.ul.x + x, area.lr.y ), color, border_chars[1] );
     38                m_terminal->print( position( area.ul.x + x, area.ul.y ), color, term_color(), border_chars[0] );
     39                m_terminal->print( position( area.ul.x + x, area.lr.y ), color, term_color(), border_chars[1] );
    4040        }
    4141
    4242        for ( int y = 0; y < area.get_height(); ++y )
    4343        {
    44                 m_terminal->print( position( area.ul.x, area.ul.y + y ), color, border_chars[2] );
    45                 m_terminal->print( position( area.lr.x, area.ul.y + y ), color, border_chars[3] );
     44                m_terminal->print( position( area.ul.x, area.ul.y + y ), color, term_color(), border_chars[2] );
     45                m_terminal->print( position( area.lr.x, area.ul.y + y ), color, term_color(), border_chars[3] );
    4646        }
    4747
    48         m_terminal->print( area.ul, color, border_chars[4] );
    49         m_terminal->print( area.ur(), color, border_chars[5] );
    50         m_terminal->print( area.ll(), color, border_chars[6] );
    51         m_terminal->print( area.lr, color, border_chars[7] );
     48        m_terminal->print( area.ul, color,   term_color(), border_chars[4] );
     49        m_terminal->print( area.ur(), color, term_color(), border_chars[5] );
     50        m_terminal->print( area.ll(), color, term_color(), border_chars[6] );
     51        m_terminal->print( area.lr, color,   term_color(), border_chars[7] );
    5252}
Note: See TracChangeset for help on using the changeset viewer.