From e19c3838a4d89fb0640ed563ffdf58cd125cde7f Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sat, 9 Apr 2011 15:04:32 +0200 Subject: #include cleanup --- gl.h | 7 +++++++ main.cpp | 6 +----- quadtree.cpp | 7 +++---- quadtree.h | 2 -- scene.cpp | 2 +- shader.h | 4 +--- video.cpp | 3 +-- 7 files changed, 14 insertions(+), 17 deletions(-) create mode 100644 gl.h diff --git a/gl.h b/gl.h new file mode 100644 index 0000000..bb28c20 --- /dev/null +++ b/gl.h @@ -0,0 +1,7 @@ +#ifndef GL_H +#define GL_H + +#define GL_GLEXT_PROTOTYPES +#include + +#endif diff --git a/main.cpp b/main.cpp index c0871a5..97abb46 100644 --- a/main.cpp +++ b/main.cpp @@ -9,11 +9,7 @@ #include #include -#define GL_GLEXT_PROTOTYPES -#include -//#include -#include -//#include +#include "gl.h" #include #include diff --git a/quadtree.cpp b/quadtree.cpp index 8082ba7..1f2dd4a 100644 --- a/quadtree.cpp +++ b/quadtree.cpp @@ -4,8 +4,7 @@ #include #include -#define GL_GLEXT_PROTOTYPES -#include +#include "gl.h" #include #include @@ -170,10 +169,10 @@ Quadtree::QuadChunk::QuadChunk(Quadtree *tree, float x, float y, float width, fl this->y = y; this->width = width; this->height = height; + this->vbo_object = this->node_count = this->vertices = 0; + this->nodes = NULL; if(width / chunk_size > 1) { - node_count = 0; - nodes = NULL; for(int i = 0; i < 4; i++) { float nx = x + ((i & 1) ^((i & 2) >> 1)) * width / 2; float ny = y + ((i & 2) >> 1) * height / 2; diff --git a/quadtree.h b/quadtree.h index d6d1e8e..36e92ad 100644 --- a/quadtree.h +++ b/quadtree.h @@ -3,8 +3,6 @@ #include "vector.h" -#include - class Quadtree { public: struct QuadChunk; diff --git a/scene.cpp b/scene.cpp index 9e606f1..d6cfd80 100644 --- a/scene.cpp +++ b/scene.cpp @@ -1,7 +1,7 @@ #include "scene.h" #include -#include +#include "gl.h" #include diff --git a/shader.h b/shader.h index 70f2361..1e11028 100644 --- a/shader.h +++ b/shader.h @@ -1,9 +1,7 @@ #ifndef SHADER_H #define SHADER_H -#define GL_GLEXT_PROTOTYPES -#include -#include +#include "gl.h" class GLBaseShader { friend class GLShaderProgram; diff --git a/video.cpp b/video.cpp index 565a930..ab9b9d3 100644 --- a/video.cpp +++ b/video.cpp @@ -1,7 +1,6 @@ #include "video.h" -#include -#include +#include "gl.h" SDL_Surface *video::surface = NULL; int video::width = 800; -- cgit v1.2.3