* final merge fixes

This commit is contained in:
end 2016-09-28 07:57:10 +02:00
parent 648d7999c8
commit 14dc7ff4ed
4 changed files with 19 additions and 1 deletions

View file

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

View file

@ -118,6 +118,14 @@ void endofthejedi::GLWindow::poll() {
sleeptime = sleeptime - (unsigned int)(sleeptime/1000.0);
}
}
clock_gettime(CLOCK_MONOTONIC_RAW, &current);
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; }

View file

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

View file

@ -1,3 +1,5 @@
#define ASIO_STANDALONE
#include "session.hpp"
#include "game.hpp"
#include "state/commands.hpp"