We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 842

Summary: Wrong blitting in testbitmap test
Product: SDL Reporter: Mike Gorchak <mike>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED WONTFIX QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2 CC: rodrigo.alfenas
Version: HG 2.0   
Hardware: All   
OS: All   
Attachments: Screenshot of the issue

Description Mike Gorchak 2009-10-12 09:30:09 UTC
If you clicks left mouse button very close to the left border of the window of testbitmap test the blitted bitmap has been drawn incorrect.

The test was ran on QNX, but this is a crossplatform issue, since the software renderer is in use.

See the attached image.
Comment 1 Mike Gorchak 2009-10-12 09:32:05 UTC
Created attachment 414 [details]
Screenshot of the issue
Comment 2 Sam Lantinga 2009-12-16 20:55:05 UTC
This bug looks like it's always been there.  Here's the code that's wrong:
SDL_blit.c, line 70:
        info->src = (Uint8 *) src->pixels +
            (Uint16) srcrect->y * src->pitch +
            (Uint16) srcrect->x * info->src_fmt->BytesPerPixel;
and of course:
        info->src_skip =
            info->src_pitch - info->src_w * info->src_fmt->BytesPerPixel;

The fix is non-trivial.  Is this affecting something you're working on?
Comment 3 Sam Lantinga 2013-05-21 01:08:10 UTC
No response in 4 years.  Closing bug.