diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-26 18:51:06 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-26 18:51:06 +0200 |
commit | ea9f93442a3e073b47ead4d98076f2fb6e3dcb33 (patch) | |
tree | 17868b917ac1354443436928f646c52f5d388f0b /src | |
parent | 02d6bcd53e06e1caeb335bd9b12bb16cc982d656 (diff) | |
download | manaverse-ea9f93442a3e073b47ead4d98076f2fb6e3dcb33.tar.gz manaverse-ea9f93442a3e073b47ead4d98076f2fb6e3dcb33.tar.bz2 manaverse-ea9f93442a3e073b47ead4d98076f2fb6e3dcb33.tar.xz manaverse-ea9f93442a3e073b47ead4d98076f2fb6e3dcb33.zip |
Fix complilation without opengl.
Diffstat (limited to 'src')
-rw-r--r-- | src/graphicsvertexes.cpp | 8 | ||||
-rw-r--r-- | src/graphicsvertexes.h | 17 | ||||
-rw-r--r-- | src/opengl1graphics.cpp | 5 |
3 files changed, 21 insertions, 9 deletions
diff --git a/src/graphicsvertexes.cpp b/src/graphicsvertexes.cpp index 1170d55fd..6beb41a88 100644 --- a/src/graphicsvertexes.cpp +++ b/src/graphicsvertexes.cpp @@ -29,7 +29,6 @@ int GraphicsVertexes::mUseOpenGL = 0; const unsigned int vertexBufSize = 500; #endif - SDLGraphicsVertexes::SDLGraphicsVertexes() { @@ -40,7 +39,7 @@ SDLGraphicsVertexes::~SDLGraphicsVertexes() delete_all(mList); } - +#ifdef USE_OPENGL OpenGLGraphicsVertexes::OpenGLGraphicsVertexes() : mFloatTexArray(0), mIntTexArray(0), @@ -94,6 +93,7 @@ void OpenGLGraphicsVertexes::switchVp(int n) { mVp.push_back(n); } +#endif GraphicsVertexes::GraphicsVertexes() : mX(0), mY(0), @@ -116,14 +116,18 @@ void GraphicsVertexes::init(int x, int y, int w, int h) for (int f = 0; f < 10; f ++) { sdl[mPtr].mList.clear(); +#ifdef USE_OPENGL ogl[mPtr].init(); +#endif } } +#ifdef USE_OPENGL void GraphicsVertexes::setLoadAsOpenGL(int useOpenGL) { mUseOpenGL = useOpenGL; } +#endif void GraphicsVertexes::pushSDL(SDL_Rect r1, SDL_Rect r2) { diff --git a/src/graphicsvertexes.h b/src/graphicsvertexes.h index 1efb74f01..2ab54197d 100644 --- a/src/graphicsvertexes.h +++ b/src/graphicsvertexes.h @@ -55,7 +55,7 @@ class SDLGraphicsVertexes std::list<DoubleRect*> mList; }; - +#ifdef USE_OPENGL class OpenGL1GraphicsVertexes { }; @@ -73,10 +73,6 @@ class OpenGLGraphicsVertexes GLint *switchIntTexArray(); - void init(); - - void clear(); - std::vector<GLfloat*> &getFloatTexPool() { return mFloatTexPool; } @@ -91,6 +87,10 @@ class OpenGLGraphicsVertexes std::vector<int> &getVp() { return mVp; } + void init(); + + void clear(); + private: GLfloat *mFloatTexArray; GLint *mIntTexArray; @@ -100,6 +100,7 @@ class OpenGLGraphicsVertexes std::vector<GLint*> mIntTexPool; std::vector<int> mVp; }; +#endif class GraphicsVertexes { @@ -112,9 +113,11 @@ class GraphicsVertexes SDLGraphicsVertexes sdl[5]; +#ifdef USE_OPENGL OpenGL1GraphicsVertexes ogl1[5]; OpenGLGraphicsVertexes ogl[5]; +#endif void init(int x, int y, int w, int h); @@ -130,8 +133,10 @@ class GraphicsVertexes void setPtr(int num) { mPtr = num; } +#ifdef USE_OPENGL OpenGLGraphicsVertexes* getOGL() { return &ogl[mPtr]; } +#endif int getX() { return mX; } @@ -149,7 +154,9 @@ class GraphicsVertexes int mPtr; private: +#ifdef USE_OPENGL static int mUseOpenGL; +#endif }; #endif // GRAPHICSVERTEXES_H diff --git a/src/opengl1graphics.cpp b/src/opengl1graphics.cpp index 4a1322e6d..30d54e754 100644 --- a/src/opengl1graphics.cpp +++ b/src/opengl1graphics.cpp @@ -20,6 +20,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "main.h" + +#ifdef USE_OPENGL #include "opengl1graphics.h" #include "graphicsvertexes.h" @@ -27,8 +30,6 @@ #include "resources/image.h" -#ifdef USE_OPENGL - #ifdef __APPLE__ #include <OpenGL/OpenGL.h> #endif |