From 0e2b75976a3673eedc23c8fc241fe5f236c3cff0 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Mon, 2 May 2011 14:52:37 +0100 Subject: [PATCH] More tidying, turn on -ffast-math --- src/Font.cpp | 2 +- src/Makefile.am | 2 +- src/Mine.cpp | 7 +++---- src/ObjectGrid.hpp | 3 +-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Font.cpp b/src/Font.cpp index 74eed55..d19e2a5 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -187,7 +187,7 @@ void Font::SplitIntoLines(vector &lines, const char* fmt, va_list ap) } } - if (start_line) { + if (start_line) { string line; for (const char* n = start_line; n < c; n++) line.append(1, *n); diff --git a/src/Makefile.am b/src/Makefile.am index 94c8fb0..ac5cb86 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ bin_PROGRAMS = lander # Add -pg for profiling -AM_CXXFLAGS=$(LANDER_CFLAGS) $(SDL_CFLAGS) -Wall +AM_CXXFLAGS=$(LANDER_CFLAGS) $(SDL_CFLAGS) -Wall -ffast-math AM_LDFLAGS=$(LANDER_LIBS) $(SDL_LIBS) $(BOOST_FILESYSTEM_LIB) \ $(BOOST_SYSTEM_LIB) $(GL_LIBS) $(GLU_LIBS) $(LTLIBINTL) lander_SOURCES = Main.cpp Game.hpp Game.cpp \ diff --git a/src/Mine.cpp b/src/Mine.cpp index 81d9f22..4dd8a26 100644 --- a/src/Mine.cpp +++ b/src/Mine.cpp @@ -23,7 +23,9 @@ #include Mine::Mine(ObjectGrid* o, Viewport* v, int x, int y) - : objgrid(o), viewport(v), + : StaticObject(x, y), + objgrid(o), + viewport(v), image("images/mine.png", 64, 64, MINE_FRAME_COUNT) { current = 0; @@ -34,9 +36,6 @@ Mine::Mine(ObjectGrid* o, Viewport* v, int x, int y) dir = dirNone; movetimeout = 1; - xpos = x; - ypos = y; - // Free space on object grid objgrid->UnlockSpace(xpos, ypos); objgrid->UnlockSpace(xpos + 1, ypos); diff --git a/src/ObjectGrid.hpp b/src/ObjectGrid.hpp index 1a85595..5bb97f6 100644 --- a/src/ObjectGrid.hpp +++ b/src/ObjectGrid.hpp @@ -39,7 +39,7 @@ public: static void Offset(int ox, int oy, int* x, int* y); static const int OBJ_GRID_SIZE = 32; - static const int OBJ_GRID_TOP = 100; + static const int OBJ_GRID_TOP = 100; private: bool* grid; @@ -51,7 +51,6 @@ class StaticObject { public: StaticObject(int xpos, int ypos, int width=1, int height=1) : xpos(xpos), ypos(ypos), width(width), height(height) {} - StaticObject() { StaticObject(0, 0, 1, 1); } virtual ~StaticObject() {} bool ObjectInScreen(Viewport* viewport) const; -- 2.39.2