Slow frame rate blittingz!

Hi every one !!

Well my problem iz quite simple :
I have a Celeron 333 / 128 Mo / TNT2 16 Mo config and i only get a 16 Frames Per Second when my computer performs 20 blits !!

First i register all my blit in a list like this :
if (p_blt = GetBlt(20)) { //
for (i = 0 ; i < 20 ; i++, p_blt++) {
p_blt->srcrect.x = 0;
p_blt->srcrect.y = 0;
p_blt->srcrect.w = 320;
p_blt->srcrect.h = 48;
p_blt->dstrect.x = (i % 2) * 320;
p_blt->dstrect.y = (i / 2) * 48;
p_blt->dstrect.w = 320;
p_blt->dstrect.h = 48;
p_blt->p_src = p_image;
p_blt->p_dst = p_mglobal->p_screen;
}
}

Later when i actually perform the blit :

p_blt = &p_mglobal->blt_info[0];
for (i = 0 ; i < p_mglobal->nb_blt ; i++, p_blt++)
SDL_BlitSurface(p_blt->p_src, &p_blt->srcrect, p_blt->p_dst, &p_blt->dstrect);

// Update !!

rect.x = 0;
rect.y = 0;
rect.w = p_mglobal->video_mode[0];
rect.h = p_mglobal->video_mode[1];
SDL_ShowCursor(0);
SDL_UpdateRects(p_mglobal->p_screen, 1, &rect);
SDL_ShowCursor(1);
if (p_mglobal->screen_f & SDL_DOUBLEBUF)
SDL_Flip(p_mglobal->p_screen);

Result 20 FPS :frowning:
Well i hope the code is understandable, if you have comments or suggestions : they are welcome !!

Olivier bucher aka Shogun