Blit problems

Hi!

When I’m updating a rect with
rect.x=0 rect.y=0 rect.w=0 and rect.h=0
via SDL_UpdateRects() the next update in the SDL_Rect array doesn’t work.

Example:

    rect[0].x=0;                                                            
    rect[0].y=0;                                                            
    rect[0].w=0;                                                            
    rect[0].h=0;                                                            
    rect[1].x=150;                                                          
    rect[1].y=150;                                                          
    rect[1].w=pic->w;                                                       
    rect[1].h=pic->h;                                                       
                                                                            
    SDL_BlitSurface(pic, &rect[1], screen, &rect[1]);                       
                                                                            
    // Update doesn't work!                                                 
    SDL_UpdateRects(screen, 2, rect);                                       

I prepared an example for download:
http://members.linuxstart.com/~karlb/bug.tar.gz

Bye, Karl.

Hello !
I am not sure if I understand you right !
So don’t blame me, if this answer can’t help you !

Try this one:

SDL_UpdateRects(pic,NULL,screen,&rect[0]);
SDL_UpdateRects(pic,NULL,screen,&rect[1]);

You will only see the second blit, cause the first is outside
the visibvle view !

Hope this helps!
Regards
paines

Hi!

You’re right. But I thought the other way should do exactly the same. So it
could be a bug…

Bye, Karl.> Hello !

I am not sure if I understand you right !
So don’t blame me, if this answer can’t help you !

Try this one:

SDL_UpdateRects(pic,NULL,screen,&rect[0]);
SDL_UpdateRects(pic,NULL,screen,&rect[1]);

You will only see the second blit, cause the first is outside
the visibvle view !

Hope this helps!
Regards
paines

Yeah Karl, maybe it is a bug. One time I saw my app crashed when doing
it
your way,by giving the rect as Second Pramaeter.So I am doing it now
with NULL as the second parameter.

Regards
Anes

When I’m updating a rect with
rect.x=0 rect.y=0 rect.w=0 and rect.h=0
via SDL_UpdateRects() the next update in the SDL_Rect array doesn’t work.

I prepared an example for download:
http://members.linuxstart.com/~karlb/bug.tar.gz

This isn’t a bug. You are blitting from (150,150) in an image that is
only 100x100 big. Thus the blit is completely clipped.

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software