Mercurial > sdl-ios-xcode
changeset 1071:24470ffe8ee4
SDL will center surface on screen for us
author | Patrice Mandin <patmandin@gmail.com> |
---|---|
date | Mon, 06 Jun 2005 16:36:18 +0000 |
parents | 75e8378103a9 |
children | 5dbcac12f22b |
files | src/video/gem/SDL_gemvideo.c src/video/xbios/SDL_xbios.c |
diffstat | 2 files changed, 15 insertions(+), 64 deletions(-) [+] |
line wrap: on
line diff
--- a/src/video/gem/SDL_gemvideo.c Mon Jun 06 10:45:53 2005 +0000 +++ b/src/video/gem/SDL_gemvideo.c Mon Jun 06 16:36:18 2005 +0000 @@ -777,8 +777,6 @@ current->pitch = width * VDI_pixelsize; } else { current->pixels = VDI_screen; - current->pixels += VDI_pitch * ((VDI_h - height) >> 1); - current->pixels += VDI_pixelsize * ((VDI_w - width) >> 1); current->pitch = VDI_pitch; } @@ -844,13 +842,7 @@ int destpitch; if (GEM_bufops & B2S_C2P_1TOS) { - int destx; - destscr = VDI_screen; - destscr += VDI_pitch * ((VDI_h - surface->h) >> 1); - destx = (VDI_w - surf_width) >> 1; - destx &= ~15; - destscr += destx; destpitch = VDI_pitch; } else { destscr = GEM_buffer2; @@ -902,15 +894,10 @@ } for ( i=0; i<numrects; ++i ) { - blitcoords[0] = rects[i].x; - blitcoords[1] = rects[i].y; - blitcoords[2] = blitcoords[0] + rects[i].w - 1; - blitcoords[3] = blitcoords[1] + rects[i].h - 1; - - blitcoords[4] = rects[i].x + ((VDI_w - surface->w) >> 1); - blitcoords[5] = rects[i].y + ((VDI_h - surface->h) >> 1); - blitcoords[6] = blitcoords[4] + rects[i].w - 1; - blitcoords[7] = blitcoords[5] + rects[i].h - 1; + blitcoords[0] = blitcoords[4] = rects[i].x; + blitcoords[1] = blitcoords[5] = rects[i].y; + blitcoords[2] = blitcoords[6] = rects[i].x + rects[i].w - 1; + blitcoords[3] = blitcoords[7] = rects[i].y + rects[i].h - 1; vro_cpyfm(VDI_handle, S_ONLY, blitcoords, &mfdb_src, &VDI_dst_mfdb); } @@ -968,13 +955,7 @@ int destpitch; if (GEM_bufops & B2S_C2P_1TOS) { - int destx; - destscr = VDI_screen; - destscr += VDI_pitch * ((VDI_h - surface->h) >> 1); - destx = (VDI_w - surf_width) >> 1; - destx &= ~15; - destscr += destx; destpitch = VDI_pitch; } else { destscr = GEM_buffer2; @@ -1007,15 +988,10 @@ mfdb_src.fd_addr=GEM_buffer2; } - blitcoords[0] = 0; - blitcoords[1] = 0; - blitcoords[2] = surface->w - 1; - blitcoords[3] = surface->h - 1; - - blitcoords[4] = (VDI_w - surface->w) >> 1; - blitcoords[5] = (VDI_h - surface->h) >> 1; - blitcoords[6] = blitcoords[4] + surface->w - 1; - blitcoords[7] = blitcoords[5] + surface->h - 1; + blitcoords[0] = blitcoords[4] = 0; + blitcoords[1] = blitcoords[5] = 0; + blitcoords[2] = blitcoords[6] = surface->w - 1; + blitcoords[3] = blitcoords[7] = surface->h - 1; vro_cpyfm(VDI_handle, S_ONLY, blitcoords, &mfdb_src, &VDI_dst_mfdb); }
--- a/src/video/xbios/SDL_xbios.c Mon Jun 06 10:45:53 2005 +0000 +++ b/src/video/xbios/SDL_xbios.c Mon Jun 06 16:36:18 2005 +0000 @@ -727,17 +727,8 @@ surface = this->screen; if ((surface->format->BitsPerPixel) == 8) { - void *destscr; - int destx; int i; - /* Center on destination screen */ - destscr = XBIOS_screens[XBIOS_fbnum]; - destscr += XBIOS_pitch * ((XBIOS_height - surface->h) >> 1); - destx = (XBIOS_width - surface->w) >> 1; - destx &= ~15; - destscr += destx; - for (i=0;i<numrects;i++) { void *source,*destination; int x1,x2; @@ -752,19 +743,16 @@ source += surface->pitch * rects[i].y; source += x1; - destination = destscr; + destination = XBIOS_screens[XBIOS_fbnum]; destination += XBIOS_pitch * rects[i].y; destination += x1; /* Convert chunky to planar screen */ SDL_Atari_C2pConvert( - source, - destination, - x2-x1, - rects[i].h, + source, destination, + x2-x1, rects[i].h, XBIOS_doubleline, - surface->pitch, - XBIOS_pitch + surface->pitch, XBIOS_pitch ); } } @@ -785,25 +773,12 @@ static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface) { if ((surface->format->BitsPerPixel) == 8) { - void *destscr; - int destx; - - /* Center on destination screen */ - destscr = XBIOS_screens[XBIOS_fbnum]; - destscr += XBIOS_pitch * ((XBIOS_height - surface->h) >> 1); - destx = (XBIOS_width - surface->w) >> 1; - destx &= ~15; - destscr += destx; - /* Convert chunky to planar screen */ SDL_Atari_C2pConvert( - surface->pixels, - destscr, - surface->w, - surface->h, + surface->pixels, XBIOS_screens[XBIOS_fbnum], + surface->w, surface->h, XBIOS_doubleline, - surface->pitch, - XBIOS_pitch + surface->pitch, XBIOS_pitch ); }