From: Marek Moeckel Date: Fri, 25 Jul 2008 14:38:17 +0000 (+0000) Subject: some GP2X-related workarounds X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2cc6d246e1ff259b7580707847abf9f139d3d22c;p=supertux.git some GP2X-related workarounds SVN-Revision: 5692 --- diff --git a/src/tinygettext/tinygettext.cpp b/src/tinygettext/tinygettext.cpp index bb872e394..e324745f9 100644 --- a/src/tinygettext/tinygettext.cpp +++ b/src/tinygettext/tinygettext.cpp @@ -27,7 +27,10 @@ #include #include + +#ifndef GP2X #include +#endif #include "tinygettext.hpp" #include "log.hpp" @@ -43,6 +46,7 @@ std::string convert(const std::string& text, const std::string& from_charset, const std::string& to_charset) { +#ifndef GP2X if (from_charset == to_charset) return text; @@ -58,6 +62,10 @@ std::string convert(const std::string& text, std::string ret(out); SDL_free(out); return ret; +#else + log_warning << "FIXME: Char conversion not supported on GP2X!" << std::endl; + return ""; +#endif #if 0 iconv_t cd = SDL_iconv_open(to_charset.c_str(), from_charset.c_str()); diff --git a/src/video/gl_renderer.cpp b/src/video/gl_renderer.cpp index c39744a9d..13522fbf2 100644 --- a/src/video/gl_renderer.cpp +++ b/src/video/gl_renderer.cpp @@ -151,10 +151,13 @@ Renderer::Renderer() if(texture_manager != 0) texture_manager->save_textures(); +#ifndef GP2X + //FIXME: This is not supported on the GP2X if(config->try_vsync) { /* we want vsync for smooth scrolling */ SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); } +#endif SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); @@ -330,6 +333,7 @@ Renderer::draw_filled_rect(const DrawingRequest& request) int n = 8; + //FIXME: This doesn't work with OpenGL ES glBegin(GL_QUAD_STRIP); for(int i = 0; i <= n; ++i) { diff --git a/src/video/glutil.hpp b/src/video/glutil.hpp index 85200bdd6..3a5845ab3 100644 --- a/src/video/glutil.hpp +++ b/src/video/glutil.hpp @@ -26,12 +26,17 @@ #include #include -#ifndef MACOSX -#include -#include -#else +#ifdef MACOSX #include #include +#else +#ifdef GP2X +#include +#include +#else +#include +#include +#endif #endif static inline void check_gl_error(const char* message) diff --git a/src/video/texture_manager.cpp b/src/video/texture_manager.cpp index 407245968..c8088de1d 100644 --- a/src/video/texture_manager.cpp +++ b/src/video/texture_manager.cpp @@ -189,6 +189,9 @@ TextureManager::save_texture(GL::Texture* texture) SavedTexture saved_texture; saved_texture.texture = texture; glBindTexture(GL_TEXTURE_2D, texture->get_handle()); + + //this doesn't work with OpenGL ES (but we don't need it on the GP2X anyway) +#ifndef GP2X glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &saved_texture.width); glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, @@ -209,6 +212,7 @@ TextureManager::save_texture(GL::Texture* texture) glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, saved_texture.pixels); +#endif saved_textures.push_back(saved_texture);