Browse Source

neercs: F3 toggles fancy shit drawing.

master
Sam Hocevar 12 years ago
parent
commit
a1df6fe36a
2 changed files with 14 additions and 2 deletions
  1. +13
    -2
      neercs/term/term.cpp
  2. +1
    -0
      neercs/term/term.h

+ 13
- 2
neercs/term/term.cpp View File

@@ -30,7 +30,8 @@ Term::Term(ivec2 size)
m_caca(caca_create_canvas(size.x, size.y)),
m_size(size),
m_title(0),
m_time(0.f)
m_time(0.f),
m_debug(false)
{
#if defined HAVE_PTY_H || defined HAVE_UTIL_H || defined HAVE_LIBUTIL_H
m_pty = new Pty();
@@ -141,6 +142,16 @@ void Term::TickGame(float seconds)
// if (total > 10000)
// break;
}

/* Some fancy shit if we press F3 */
if (Input::WasPressed(Key::F3))
m_debug = !m_debug;

if (m_debug)
{
m_time += seconds;
DrawFancyShit();
}
#else
/* Unsupported platform - draw some fancy shit instead */
m_time += seconds;
@@ -253,4 +264,4 @@ void Term::DrawFancyShit()
caca_put_str(m_caca, 0, 2, "root@lol:~/ echo LOL");
caca_put_str(m_caca, 0, 3, "LOL");
caca_put_str(m_caca, 0, 4, "root@lol:~/");
}
}

+ 1
- 0
neercs/term/term.h View File

@@ -126,6 +126,7 @@ private:
/* Mostly for fancy shit */
void DrawFancyShit();
float m_time;
bool m_debug;
};

#endif // __TERM_TERM_H__


Loading…
Cancel
Save