瀏覽代碼

neercs: don't show the FPS information unless the setup is open.

master
Sam Hocevar 12 年之前
父節點
當前提交
20b291c48b
共有 3 個檔案被更改,包括 19 行新增2 行删除
  1. +0
    -1
      neercs/neercs.cpp
  2. +17
    -1
      neercs/video/render.cpp
  3. +2
    -0
      neercs/video/render.h

+ 0
- 1
neercs/neercs.cpp 查看文件

@@ -80,7 +80,6 @@ int main(int argc, char **argv)
#endif

new Neercs(argc, argv);
new DebugFps(2, 2);
app.ShowPointer(false);

app.Run();


+ 17
- 1
neercs/video/render.cpp 查看文件

@@ -601,6 +601,7 @@ int Render::CreateGLWindow()
Render::Render(caca_canvas_t *caca)
: m_cv_screen(caca),
m_cv_setup(caca_create_canvas(1, 1)),
m_fps_debug(0),
m_ready(false),
m_pause(false),
m_polygon(true),
@@ -735,6 +736,18 @@ void Render::TickDraw(float seconds)
if (g_setup) setup_n = calc_item_length();
sync_flag = true;
sync_angle = main_angle;

if (m_fps_debug)
{
Ticker::Unref(m_fps_debug);
m_fps_debug = NULL;
}

if (g_setup)
{
m_fps_debug = new DebugFps(2, 2);
Ticker::Ref(m_fps_debug);
}
}
if (Input::WasPressed(Key::F2))
{
@@ -1330,4 +1343,7 @@ void Render::Draw3D()

Render::~Render()
{
}
if (m_fps_debug)
Ticker::Unref(m_fps_debug);
}


+ 2
- 0
neercs/video/render.h 查看文件

@@ -33,6 +33,8 @@ private:
caca_canvas_t *m_cv_screen, *m_cv_setup;
class TextRender *m_txt_screen, *m_txt_setup;

Entity *m_fps_debug;

bool m_ready;
bool m_pause;
bool m_polygon;


Loading…
取消
儲存