SDL_LowerBlit

I found out using a profiler that a lot of time in my game is spent in
SDL_UpperBlit (probably because of a quite small tile size). I now want to
use SDL_Lowerblit to bypass the clipping since I know which tiles should be
clipped (and in that case call SDL_BlitSurface). It says in the code that
you can do this “if you know exactly what you’re doing”… I don’t =) What
precausions must I take to use lowerblit?

  1. regarding clipping?
  2. regarding locked surfaces?


    n) …

All info is appreciated. Hm, maybe SDL should offer some way to bypass
clipping in a “nicer” way? Clipping is unneded in many applications. For
example, I have about 260 tiles on screen. Only 66 of them can possible be
effected by clipping (75% of tile clippings is unneeded).
To make things even worse, I have several layers of tiles…
Well, enough about this.

Thanks_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

What precausions must I take to use lowerblit?

  1. regarding clipping?
  2. regarding locked surfaces?


    n) …

If you really want to know all the details, look at the code:

http://www.libsdl.org/cgi/cvsweb.cgi/SDL12/src/video/SDL_surface.c?rev=1.8&
content-type=text/x-cvsweb-markup

All info is appreciated. Hm, maybe SDL should offer some way to bypass
clipping in a “nicer” way?

I can’t think of a nicer way, aside from SDL_NO_CLIP passed to
SDL_SetVideoMode(). Clipping is done by default because all of the
blitting routines (for all the different pixel formats, and perhaps
hardware blits) assume they have sane values, and don’t check them out.
This is why you’re really screwed if you pass bad values to
SDL_LowerBlit().On Sunday, June 9, 2002, at 07:57 AM, Niklas Pettersson wrote:

I can’t think of a nicer way, aside from SDL_NO_CLIP passed to
SDL_SetVideoMode().

I didn’t find this flag in SDL sources nor with google…