From: Ingo Ruhnke Date: Sat, 1 May 2004 16:39:08 +0000 (+0000) Subject: - fixed compile with opengl disabled X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8c5e4f19aea4732baa90c615d588d8da664f009b;p=supertux.git - fixed compile with opengl disabled SVN-Revision: 913 --- diff --git a/src/setup.cpp b/src/setup.cpp index 319b01e3d..59982d5a8 100644 --- a/src/setup.cpp +++ b/src/setup.cpp @@ -391,7 +391,7 @@ void st_menu(void) #ifndef NOOPENGL options_menu->additem(MN_TOGGLE,"OpenGL",use_gl,0, MNID_OPENGL); #else - options_menu->additem(MN_DEACTIVE,"OpenGL (not supported)",use_gl,MNID_OPENGL); + options_menu->additem(MN_DEACTIVE,"OpenGL (not supported)",use_gl, 0, MNID_OPENGL); #endif options_menu->additem(MN_TOGGLE,"Fullscreen",use_fullscreen,0, MNID_FULLSCREEN); if(audio_device) diff --git a/src/texture.cpp b/src/texture.cpp index f708113ed..a62b60f07 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -66,10 +66,14 @@ SurfaceData::~SurfaceData() SurfaceImpl* SurfaceData::create() { +#ifndef NOOPENGL if (use_gl) return create_SurfaceOpenGL(); else return create_SurfaceSDL(); +#else + return create_SurfaceSDL(); +#endif } SurfaceSDL* @@ -90,6 +94,7 @@ SurfaceData::create_SurfaceSDL() SurfaceOpenGL* SurfaceData::create_SurfaceOpenGL() { +#ifndef NOOPENGL switch(type) { case LOAD: @@ -99,10 +104,11 @@ SurfaceData::create_SurfaceOpenGL() case SURFACE: return new SurfaceOpenGL(surface, use_alpha); } +#endif assert(0); } - +#ifndef NOOPENGL /* Quick utility function for texture creation */ static int power_of_two(int input) { @@ -113,6 +119,7 @@ static int power_of_two(int input) } return value; } +#endif Surface::Surface(SDL_Surface* surf, int use_alpha) : data(surf, use_alpha), w(0), h(0) diff --git a/src/texture.h b/src/texture.h index c3d7cd757..e5b5060fa 100644 --- a/src/texture.h +++ b/src/texture.h @@ -123,6 +123,7 @@ public: int draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, bool update); }; +#ifndef NOOPENGL class SurfaceOpenGL : public SurfaceImpl { public: @@ -141,6 +142,7 @@ public: private: void create_gl(SDL_Surface * surf, GLuint * tex); }; +#endif #endif /*SUPERTUX_TEXTURE_H*/