Permalink
Browse files

updated

  • Loading branch information...
1 parent b67380d commit af56276d99537c41dde77858a797d58213e6c80e @RomainGailleton committed Dec 19, 2011
Showing with 43 additions and 16 deletions.
  1. +6 −2 src/block.h
  2. +6 −1 src/config.h
  3. +3 −3 src/display.cpp
  4. +6 −2 src/display.h
  5. +6 −2 src/game.h
  6. +5 −2 src/latlon.h
  7. +5 −2 src/latloncomp.h
  8. +6 −2 src/map.h
View
@@ -1,4 +1,6 @@
-
+ #ifndef BLOCK_H
+#define BLOCK_H
+
class Block {
private :
@@ -27,4 +29,6 @@ Block& Block::operator= (const Block& b)
x=b.x;
y=b.y;
return *this;
-}*/
+}*/
+
+#endif
View
@@ -1,3 +1,7 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+
+
extern "C" {
#include <lua.h>
#include <lauxlib.h>
@@ -6,7 +10,6 @@ extern "C" {
#include <string>
#include <iostream>
-
using namespace std;
class Config{
@@ -46,3 +49,5 @@ class Config{
void dx();
//--
};
+
+#endif
View
@@ -86,14 +86,14 @@ Display::blit_text(string t, string f, int s, SDL_Color c, SDL_Rect p){
}
void
-Display::blit_map(Map world){
+Display::blit_map(Map w){
SDL_Rect p;
Block bl;
int i=0, j=0;
-
+
for (i = 0; i<3;i++){
for (j=0; j<3; j++){
- bl = world[LatLon(i,j)];
+ bl = w.world[LatLon(i,j)];
p.x =i*16;
p.y = j*16;
if (bl.t == 1){
View
@@ -1,4 +1,6 @@
- // SDL libs
+ #ifndef DISPLAY_H
+#define DISPLAY_H
+// SDL libs
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_framerate.h>
@@ -34,4 +36,6 @@ class Display {
void Set_Surface(int w, int h, int d, Uint32 f);
//--
-};
+};
+
+#endif
View
@@ -1,4 +1,6 @@
- // SDL libs
+ #ifndef GAME_H
+#define GAME_H
+// SDL libs
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_framerate.h>
@@ -18,4 +20,6 @@ class Game {
void Loop();
void Set_Done();
-};
+};
+
+#endif
View
@@ -1,4 +1,5 @@
-
+ #ifndef LATLON_H
+#define LATLON_H
class LatLon {
private :
@@ -40,4 +41,6 @@ LatLon::Set_x(int xp){
void
LatLon::Set_y(int yp){
y = yp;
-}
+}
+
+#endif
View
@@ -1,9 +1,12 @@
-
+#ifndef LATLONCOMP_H
+#define LATLONCOMP_H
class LatLonComp {
public:
bool operator() (LatLon a, LatLon b) {
if (a.Get_x() == b.Get_x()) return a.Get_y()< b.Get_y() ;
if (a.Get_y() == b.Get_y()) return a.Get_x()< b.Get_x() ;
}
-};
+};
+
+#endif
View
@@ -1,4 +1,6 @@
-
+#ifndef MAP_H
+#define MAP_H
+
#include <iostream>
#include <map>
@@ -26,4 +28,6 @@ Map::Map(){
world[LatLon(i,j)] = Block();
}
}
-}
+}
+
+#endif

0 comments on commit af56276

Please sign in to comment.