+ unsigned char *sptr = gfx->pixmap->pixels + (rect.y * gfx->screen_rect.width + rect.x) * 4;
+ unsigned char *dptr = (unsigned char*)fbsurf->pixels + (rect.y * gfx->screen_rect.width + rect.x) * 4;
+
+ for(int i=0; i<rect.height; i++) {
+ memcpy(dptr, sptr, rect.width * 4);
+ sptr += gfx->screen_rect.width * 4;
+ dptr += gfx->screen_rect.width * 4;
+ }
+
+ if(SDL_MUSTLOCK(fbsurf)) {
+ SDL_UnlockSurface(fbsurf);
+ }
+ SDL_UpdateRect(fbsurf, rect.x, rect.y, rect.width, rect.height);