Changeset 2176


Ignore:
Timestamp:
Dec 23, 2012, 11:57:24 AM (7 years ago)
Author:
sam
Message:

neercs: fix rendering issues and tweak timings so that large fullscreen
apps such as cacademo no longer appear to lag.

Location:
trunk/tools/neercs
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/term/ansi.cpp

    r1859 r2176  
    273273    if (!m_init)
    274274    {
    275         m_dfg = CACA_LIGHTGRAY;
    276         m_dbg = CACA_BLACK;
     275        m_fg = m_dfg = CACA_LIGHTGRAY;
     276        m_bg = m_dbg = CACA_BLACK;
     277
     278        m_bold = m_blink = m_italics = m_negative = m_concealed
     279         = m_underline = m_faint = m_strike = m_proportional = 0;
    277280
    278281        caca_set_color_ansi(m_caca, m_dfg, m_dbg);
  • trunk/tools/neercs/term/pty.cpp

    r2159 r2176  
    4747    m_eof(false),
    4848    m_unread_data(0),
    49     m_unread_len(0)
     49    m_unread_len(0),
     50    m_size(-1, -1)
    5051{
    5152    ;
     
    111112}
    112113
     114/* Read data from the PTY. We only perform one read() call so that the
     115 * caller can decide whether to ask for more data or not. This lets us
     116 * prioritise data in some way. */
    113117size_t Pty::ReadData(char *data, size_t maxlen)
    114118{
  • trunk/tools/neercs/term/term.cpp

    r2039 r2176  
    3131    m_size(size),
    3232    m_title(0),
     33    m_bell(0),
     34    m_init(0),
     35    m_report_mouse(0),
     36    m_changed(0),
    3337    m_time(0.f),
    3438    m_debug(false)
     
    134138        if (current <= 0)
    135139            break;
    136         total += current;
     140        /* FIXME: by the time we're finished decoding the ANSI data, some
     141         * new data may be available. We need to avoid reading it because
     142         * it's time rendering the canvas isntead. */
    137143        size_t processed = ReadAnsi(buf, current);
    138144        if (processed < current)
    139145            m_pty->UnreadData(buf + processed, current - processed);
    140         if (current < BUFSIZ)
     146        total += processed;
     147        if (processed == 0)
    141148            break;
    142 //        if (total > 10000)
    143 //            break;
     149
     150        /* FIXME: when do we know when to stop? If we read too much
     151         * data, some of our frames will not be rendered because they'll
     152         * be overwritten by new data. If we don't read enough, we will
     153         * start rendering even if a frame isn't finished. */
     154        if (total > 12000)
     155            break;
    144156    }
    145157
  • trunk/tools/neercs/video/text-render.cpp

    r2158 r2176  
    122122    /* Upload libcaca canvas contents to the vertex buffers */
    123123    uint32_t *colors = (uint32_t *)m_vbo1->Lock(0, 0);
     124    uint32_t savedattr = caca_get_attr(m_caca, -1, -1);
    124125    for (int j = 0; j < m_canvas_size.y; j++)
    125126    for (int i = 0; i < m_canvas_size.x; i++)
     
    132133        caca_put_attr(m_caca, i, j, attr);
    133134    }
     135    caca_set_attr(m_caca, savedattr);
    134136    memcpy(colors, caca_get_canvas_attrs(m_caca),
    135137           m_cells * sizeof(uint32_t));
Note: See TracChangeset for help on using the changeset viewer.