From 14dc7ff4edcdd86b311a37a81497a5c65aa7bd7b Mon Sep 17 00:00:00 2001 From: end Date: Wed, 28 Sep 2016 07:57:10 +0200 Subject: [PATCH] * final merge fixes --- game/game_window.hpp | 8 ++++++++ game/opengl.cpp | 8 ++++++++ game/renderer_simple.cpp | 2 +- game/session.cpp | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/game/game_window.hpp b/game/game_window.hpp index 5f741ba..e54f39f 100644 --- a/game/game_window.hpp +++ b/game/game_window.hpp @@ -7,6 +7,14 @@ #include "game.hpp" +#include "state/trace.hpp" +#include "state/object.hpp" +#include "state/missile.hpp" +#include "state/player.hpp" +#include "state/planet.hpp" +#include "state/ship.hpp" +#include "state/explosion.hpp" + class GameWindow : public endofthejedi::GLWindow { private: Game* m_game; diff --git a/game/opengl.cpp b/game/opengl.cpp index f1644de..ee32a5c 100644 --- a/game/opengl.cpp +++ b/game/opengl.cpp @@ -118,6 +118,14 @@ void endofthejedi::GLWindow::poll() { sleeptime = sleeptime - (unsigned int)(sleeptime/1000.0); } } + + clock_gettime(CLOCK_MONOTONIC_RAW, ¤t); + delta = diff(prev, current).tv_nsec; + prev = current; + if(delta > 0.0) { + m_fps = (1000000000.0/delta); + //std::cout << m_fps << "\n"; + } } void endofthejedi::GLWindow::stop() { m_running = false; } diff --git a/game/renderer_simple.cpp b/game/renderer_simple.cpp index 2c42c9a..197001c 100644 --- a/game/renderer_simple.cpp +++ b/game/renderer_simple.cpp @@ -4,9 +4,9 @@ void endofthejedi::RendererSimple::drawCircle(float x, float y, float radius, float r, float g, float b, int numSides) { glBegin(GL_TRIANGLE_FAN); + glColor3f(r, g, b); glVertex2f(x, y); // center of circle for (int i = 0; i <= numSides; i++) { - glColor3f(r, g, b); glVertex2f(x + (radius * cos(i * 2 * M_PI / numSides)), y + (radius * sin(i * 2 * M_PI / numSides))); } diff --git a/game/session.cpp b/game/session.cpp index 261140b..ef62b5a 100644 --- a/game/session.cpp +++ b/game/session.cpp @@ -1,3 +1,5 @@ +#define ASIO_STANDALONE + #include "session.hpp" #include "game.hpp" #include "state/commands.hpp"