# HG changeset patch # User Sam Lantinga # Date 1233297616 0 # Node ID aa34d1180d30ecee26d78fc255896a16a89cb970 # Parent b7197d7e856688ed1ff7e4dbeaeacf02192214ce When creating a software texture, synchronize the surface with the texture. When creating a texture from a surface, synchronize the texture with the surface. diff -r b7197d7e8566 -r aa34d1180d30 src/video/SDL_renderer_sw.c --- a/src/video/SDL_renderer_sw.c Fri Jan 30 06:38:44 2009 +0000 +++ b/src/video/SDL_renderer_sw.c Fri Jan 30 06:40:16 2009 +0000 @@ -380,6 +380,12 @@ texture->driverdata = SDL_CreateRGBSurface(0, texture->w, texture->h, bpp, Rmask, Gmask, Bmask, Amask); + SDL_SetSurfaceColorMod(texture->driverdata, texture->r, texture->g, + texture->b); + SDL_SetSurfaceAlphaMod(texture->driverdata, texture->a); + SDL_SetSurfaceBlendMode(texture->driverdata, texture->blendMode); + SDL_SetSurfaceScaleMode(texture->driverdata, texture->scaleMode); + if (texture->access == SDL_TEXTUREACCESS_STATIC) { SDL_SetSurfaceRLE(texture->driverdata, 1); } diff -r b7197d7e8566 -r aa34d1180d30 src/video/SDL_video.c --- a/src/video/SDL_video.c Fri Jan 30 06:38:44 2009 +0000 +++ b/src/video/SDL_video.c Fri Jan 30 06:40:16 2009 +0000 @@ -1635,6 +1635,24 @@ } } + { + Uint8 r, g, b, a; + int blendMode; + int scaleMode; + + SDL_GetSurfaceColorMod(surface, &r, &g, &b); + SDL_SetTextureColorMod(textureID, r, g, b); + + SDL_GetSurfaceAlphaMod(surface, &a); + SDL_SetTextureAlphaMod(textureID, a); + + SDL_GetSurfaceBlendMode(surface, &blendMode); + SDL_SetTextureBlendMode(textureID, blendMode); + + SDL_GetSurfaceScaleMode(surface, &scaleMode); + SDL_SetTextureScaleMode(textureID, scaleMode); + } + if (SDL_ISPIXELFORMAT_INDEXED(format) && fmt->palette) { SDL_SetTexturePalette(textureID, fmt->palette->colors, 0, fmt->palette->ncolors);