| Summary: | Under SDL 1.3 some images in TGA format do not display correctly. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ken Rogoway <Ken> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | blocker | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Windows (XP) | ||
| Attachments: | 3 Image files to show the issue | ||
I am able to reproduce this here. I'm looking into it. Thanks! This was a simple fix, committed in revision 5433. Thanks! |
Created attachment 467 [details] 3 Image files to show the issue There are 3 images in the attached ZIP: "Image 1 - Original.tga" "Image 2 - This is what it DOES look like.png" "Image 3 - This is what it SHOULD look like.png" If I use IMG_Load() to load the 1st image then when I display it using the new native SDL 1.3 API it looks like Image 2. If I convert the image to a PNG (Image 3) and load it, it looks correct. This may be a SDL_image issue and not an SDL 1.3 issue, but since it displays correctly if I use SDL-1.2.14 I am filing it as and SDL 1.3 issue. Code snippet: SDL_TextureID LoadImage( char *pFile, int& nW, int& nH ) { SDL_TextureID nID = 0; SDL_Surface *pSurface = IMG_Load( "Image 1 - Original.tga" ); if ( NULL != pSurface ) { nID = SDL_CreateTextureFromSurface( NULL, pSurface ); // Save the width and height of the image nW = pSurface->w; nH = pSurface->h; SDL_FreeSurface( pSurface ); } return nID; } void DrawImage( SDL_TextureID nSrcID, int nX, int nY, int nW, int nH ) { SDL_Rect dstRect; dstRect.x = nX; dstRect.y = nY; dstRect.w = nW; dstRect.h = nH; SDL_RenderCopy( nSrcID, NULL, &dstRect ); }