# HG changeset patch # User Sam Lantinga # Date 1227940046 0 # Node ID 8fe261aae1bbe25c4ff25f20d3b841a1a5abc9c4 # Parent c2834344ca44ec0013814eac671bc5cae94513bb Fixed the texture format for the software fallback diff -r c2834344ca44 -r 8fe261aae1bb src/SDL_compat.c --- a/src/SDL_compat.c Sat Nov 29 00:11:35 2008 +0000 +++ b/src/SDL_compat.c Sat Nov 29 06:27:26 2008 +0000 @@ -1355,6 +1355,7 @@ SDL_SW_YUVTexture *sw; SDL_TextureID textureID; + Uint32 texture_format; }; SDL_Overlay * @@ -1449,14 +1450,16 @@ /* Create a supported RGB format texture for display */ SDL_GetCurrentDisplayMode(¤t_mode); + texture_format = current_mode.format; overlay->hwdata->textureID = - SDL_CreateTexture(current_mode.format, + SDL_CreateTexture(texture_format, SDL_TEXTUREACCESS_STREAMING, w, h); } if (!overlay->hwdata->textureID) { SDL_FreeYUVOverlay(overlay); return NULL; } + overlay->hwdata->texture_format = texture_format; return overlay; } @@ -1521,8 +1524,8 @@ srcrect.w = overlay->w; srcrect.h = overlay->h; SDL_SW_CopyYUVToRGB(overlay->hwdata->sw, &srcrect, - SDL_PIXELFORMAT_RGB888, overlay->w, - overlay->h, pixels, pitch); + overlay->hwdata->texture_format, + overlay->w, overlay->h, pixels, pitch); SDL_UnlockTexture(overlay->hwdata->textureID); } } else {