From 7b141912c710472069d855beb97dc8c94d24ec52 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 2 Jan 2006 12:37:40 +0000 Subject: [PATCH] Quartz driver: Correctly handle SDL_DOUBLEBUF|SDL_FULLSCREEN when the resolution is too small and thus emulated by SDL. Fixes http://www.devolution.com/pipermail/sdl/2005-December/071765.html ... --- src/video/quartz/SDL_QuartzVideo.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/video/quartz/SDL_QuartzVideo.m b/src/video/quartz/SDL_QuartzVideo.m index 6ff8f4c3f..001845cff 100644 --- a/src/video/quartz/SDL_QuartzVideo.m +++ b/src/video/quartz/SDL_QuartzVideo.m @@ -975,8 +975,14 @@ static int QZ_ThreadFlip (_THIS) { if (quit_thread) return 0; - dst = CGDisplayBaseAddress (display_id); - src = current_buffer; + /* + * We have to add SDL_VideoSurface->offset here, since we might be a + * smaller surface in the center of the framebuffer (you asked for + * a fullscreen resolution smaller than the hardware could supply + * so SDL is centering it in a bigger resolution)... + */ + dst = CGDisplayBaseAddress (display_id) + SDL_VideoSurface->offset; + src = current_buffer + SDL_VideoSurface->offset; len = SDL_VideoSurface->w * SDL_VideoSurface->format->BytesPerPixel; h = SDL_VideoSurface->h; skip = SDL_VideoSurface->pitch;