Bladeren bron

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

master
Sam Hocevar 12 jaren geleden
bovenliggende
commit
20b291c48b
3 gewijzigde bestanden met toevoegingen van 19 en 2 verwijderingen
  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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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;


Laden…
Annuleren
Opslaan