Ignore:
Timestamp:
Jul 21, 2012, 12:22:10 AM (8 years ago)
Author:
sam
Message:

neercs: add a way to activate the old neercs code for testing purposes.

File:
1 edited

Legend:

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

    r1658 r1660  
    4040#include "video/render.h"
    4141
     42#define USE_OLD_NEERCS 0
     43
    4244extern "C"
    4345{
     
    5254{
    5355    Ticker::Ref(m_render);
     56
     57#if USE_OLD_NEERCS
     58    m_buf = NULL;
     59    m_screen_list = init_neercs(argc, argv);
     60    if (!m_screen_list)
     61        exit(-1);
     62    m_screen_list->last_key_time = get_us();
     63#endif
    5464}
    5565
    5666int Neercs::hex_color(float r, float g, float b)
    5767{
    58 return ((int)(r * 15.99f) << 8) | ((int)(g * 15.99f) << 4) | (int)(b * 15.99f);
     68    return ((int)(r * 15.99f) << 8) | ((int)(g * 15.99f) << 4) | (int)(b * 15.99f);
    5969}
    6070
     
    6272{
    6373    WorldEntity::TickGame(seconds);
     74
     75#if USE_OLD_NEERCS
     76    mainloop_tick(&m_buf, m_screen_list);
     77#endif
    6478
    6579    m_time += seconds;
     
    129143Neercs::~Neercs()
    130144{
     145#if USE_OLD_NEERCS
     146    free(m_buf);
     147    free_screen_list(m_screen_list);
     148#endif
     149
    131150    Ticker::Unref(m_render);
    132151}
Note: See TracChangeset for help on using the changeset viewer.