# HG changeset patch # User Shinji KONO # Date 1280569030 -32400 # Node ID b2f7d2ad380460c9dbac2fbc5839f92b41a55e07 # Parent 0c11c2fd7e63d229158957146423e764601e04e1 FB mode is working again on Mac OS X. diff -r 0c11c2fd7e63 -r b2f7d2ad3804 Renderer/Engine/SceneGraph.cc --- a/Renderer/Engine/SceneGraph.cc Sat Jul 31 17:50:38 2010 +0900 +++ b/Renderer/Engine/SceneGraph.cc Sat Jul 31 18:37:10 2010 +0900 @@ -215,7 +215,6 @@ flag_drawable = 1; sgid = -1; gid = -1; - gl_tex = NULL; frame = 0; } @@ -465,7 +464,7 @@ texture_image = converted; } - this->gl_tex = SDL_GL_LoadTexture(texture_image); + // this->gl_tex = SDL_GL_LoadTexture(texture_image); return texture_image; } @@ -507,6 +506,7 @@ list[id].pixels_orig = (Uint32*)texture_image->pixels; list[id].pixels = tapestry; list[id].scale_max = scale; + list[id].texture_image = texture_image; return id; } @@ -552,6 +552,7 @@ texture_info.pixels_orig = list[texture_id].pixels_orig; texture_info.pixels = list[texture_id].pixels; texture_info.scale_max = list[texture_id].scale_max; + texture_info.texture_image = list[texture_id].texture_image; } diff -r 0c11c2fd7e63 -r b2f7d2ad3804 Renderer/Engine/SceneGraph.h --- a/Renderer/Engine/SceneGraph.h Sat Jul 31 17:50:38 2010 +0900 +++ b/Renderer/Engine/SceneGraph.h Sat Jul 31 18:37:10 2010 +0900 @@ -70,9 +70,6 @@ // Group ID int gid; - // GL ID - GLuint gl_tex; - // 関数ポインタ move_func move; collision_func collision; diff -r 0c11c2fd7e63 -r b2f7d2ad3804 Renderer/Engine/texture.h --- a/Renderer/Engine/texture.h Sat Jul 31 17:50:38 2010 +0900 +++ b/Renderer/Engine/texture.h Sat Jul 31 18:37:10 2010 +0900 @@ -4,8 +4,9 @@ #include #include -int power_of_two(int input); -GLuint SDL_GL_LoadTexture(SDL_Surface *surface); +extern int power_of_two(int input); +extern GLuint SDL_GL_LoadTexture(SDL_Surface *surface); + typedef struct texture_list { int t_w; @@ -13,7 +14,9 @@ uint32 *pixels_orig; uint32 *pixels; int scale_max; - int pad[3]; // 12 + SDL_Surface *texture_image; + GLuint gl_tex; + int pad[1]; // 12 } texture_list, *texture_list_ptr ; // 20 + pad(12) = 32 diff -r 0c11c2fd7e63 -r b2f7d2ad3804 Renderer/Engine/viewerGL.cc --- a/Renderer/Engine/viewerGL.cc Sat Jul 31 17:50:38 2010 +0900 +++ b/Renderer/Engine/viewerGL.cc Sat Jul 31 18:37:10 2010 +0900 @@ -198,7 +198,10 @@ while (sg) { if (sg->flag_drawable) { - texture = sg->gl_tex; + if (!sg->texture_info.gl_tex) { + sg->texture_info.gl_tex = SDL_GL_LoadTexture(sg->texture_info.texture_image); + } + texture = sg->texture_info.gl_tex; glBindTexture(GL_TEXTURE_2D, texture); glEnable(GL_TEXTURE_2D);