Update of /cvsroot/fink/dists/10.4/unstable/main/finkinfo/games
In directory vz-cvs-3.sog:/tmp/cvs-serv19623/10.4/unstable/main/finkinfo/games

Modified Files:
        sdl.info sdl.patch 
Log Message:
New SDL revision, hopefully fixes issues reported on 10.5 and 10.7

Index: sdl.patch
===================================================================
RCS file: /cvsroot/fink/dists/10.4/unstable/main/finkinfo/games/sdl.patch,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- sdl.patch   11 Jul 2011 17:32:03 -0000      1.13
+++ sdl.patch   5 Aug 2011 16:55:51 -0000       1.14
@@ -1,6 +1,6 @@
 diff -ru SDL-1.2.14/build-scripts/fatbuild.sh 
SDL-1.2.14-patched/build-scripts/fatbuild.sh
---- SDL-1.2.14/build-scripts/fatbuild.sh       2009-10-13 01:07:12.000000000 
+0200
-+++ SDL-1.2.14-patched/build-scripts/fatbuild.sh       2011-07-11 
11:23:52.000000000 +0200
+--- SDL-1.2.14/build-scripts/fatbuild.sh       2009-10-13 00:07:12.000000000 
+0100
++++ SDL-1.2.14-patched/build-scripts/fatbuild.sh       2011-07-11 
10:23:52.000000000 +0100
 @@ -70,6 +70,17 @@
  CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \
  --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
@@ -35,8 +35,8 @@
  
  #
 diff -ru SDL-1.2.14/build-scripts/makedep.sh 
SDL-1.2.14-patched/build-scripts/makedep.sh
---- SDL-1.2.14/build-scripts/makedep.sh        2009-10-13 01:07:12.000000000 
+0200
-+++ SDL-1.2.14-patched/build-scripts/makedep.sh        2011-07-11 
11:23:52.000000000 +0200
+--- SDL-1.2.14/build-scripts/makedep.sh        2009-10-13 00:07:12.000000000 
+0100
++++ SDL-1.2.14-patched/build-scripts/makedep.sh        2011-07-11 
10:23:52.000000000 +0100
 @@ -69,7 +69,7 @@
          ;;
          asm) cat >>${output}.new <<__EOF__
@@ -47,8 +47,8 @@
  __EOF__
          ;;
 diff -ru SDL-1.2.14/include/SDL_endian.h 
SDL-1.2.14-patched/include/SDL_endian.h
---- SDL-1.2.14/include/SDL_endian.h    2009-10-13 01:07:19.000000000 +0200
-+++ SDL-1.2.14-patched/include/SDL_endian.h    2011-07-11 11:23:52.000000000 
+0200
+--- SDL-1.2.14/include/SDL_endian.h    2009-10-13 00:07:19.000000000 +0100
++++ SDL-1.2.14-patched/include/SDL_endian.h    2011-07-11 10:23:52.000000000 
+0100
 @@ -94,7 +94,7 @@
  }
  #else
@@ -68,8 +68,8 @@
  #endif
  
 diff -ru SDL-1.2.14/src/cpuinfo/SDL_cpuinfo.c 
SDL-1.2.14-patched/src/cpuinfo/SDL_cpuinfo.c
---- SDL-1.2.14/src/cpuinfo/SDL_cpuinfo.c       2009-10-13 01:07:14.000000000 
+0200
-+++ SDL-1.2.14-patched/src/cpuinfo/SDL_cpuinfo.c       2011-07-11 
11:23:52.000000000 +0200
+--- SDL-1.2.14/src/cpuinfo/SDL_cpuinfo.c       2009-10-13 00:07:14.000000000 
+0100
++++ SDL-1.2.14-patched/src/cpuinfo/SDL_cpuinfo.c       2011-07-11 
10:23:52.000000000 +0100
 @@ -26,7 +26,7 @@
  #include "SDL.h"
  #include "SDL_cpuinfo.h"
@@ -257,8 +257,8 @@
        int hasVectorUnit = 0; 
        size_t length = sizeof(hasVectorUnit); 
 diff -ru SDL-1.2.14/src/events/SDL_quit.c 
SDL-1.2.14-patched/src/events/SDL_quit.c
---- SDL-1.2.14/src/events/SDL_quit.c   2009-10-13 01:07:14.000000000 +0200
-+++ SDL-1.2.14-patched/src/events/SDL_quit.c   2011-07-11 11:23:52.000000000 
+0200
+--- SDL-1.2.14/src/events/SDL_quit.c   2009-10-13 00:07:14.000000000 +0100
++++ SDL-1.2.14-patched/src/events/SDL_quit.c   2011-07-11 10:23:52.000000000 
+0100
 @@ -45,7 +45,19 @@
  /* Public functions */
  int SDL_QuitInit(void)
@@ -302,8 +302,8 @@
  
        ohandler = signal(SIGINT, SIG_DFL);
 diff -ru SDL-1.2.14/src/joystick/SDL_joystick.c 
SDL-1.2.14-patched/src/joystick/SDL_joystick.c
---- SDL-1.2.14/src/joystick/SDL_joystick.c     2009-10-13 01:07:13.000000000 
+0200
-+++ SDL-1.2.14-patched/src/joystick/SDL_joystick.c     2011-07-11 
11:23:52.000000000 +0200
+--- SDL-1.2.14/src/joystick/SDL_joystick.c     2009-10-13 00:07:13.000000000 
+0100
++++ SDL-1.2.14-patched/src/joystick/SDL_joystick.c     2011-07-11 
10:23:52.000000000 +0100
 @@ -113,6 +113,7 @@
        /* Create and initialize the joystick */
        joystick = (SDL_Joystick *)SDL_malloc((sizeof *joystick));
@@ -313,8 +313,8 @@
        }
  
 diff -ru SDL-1.2.14/src/stdlib/SDL_iconv.c 
SDL-1.2.14-patched/src/stdlib/SDL_iconv.c
---- SDL-1.2.14/src/stdlib/SDL_iconv.c  2009-10-13 01:07:13.000000000 +0200
-+++ SDL-1.2.14-patched/src/stdlib/SDL_iconv.c  2011-07-11 11:23:52.000000000 
+0200
+--- SDL-1.2.14/src/stdlib/SDL_iconv.c  2009-10-13 00:07:13.000000000 +0100
++++ SDL-1.2.14-patched/src/stdlib/SDL_iconv.c  2011-07-11 10:23:52.000000000 
+0100
 @@ -383,7 +383,7 @@
                                                */
                                                ch = UNKNOWN_UNICODE;
@@ -325,8 +325,8 @@
                                                }
                                                ch = (Uint32)(p[0] & 0x1F);
 diff -ru SDL-1.2.14/src/thread/pthread/SDL_syssem.c 
SDL-1.2.14-patched/src/thread/pthread/SDL_syssem.c
---- SDL-1.2.14/src/thread/pthread/SDL_syssem.c 2009-10-13 01:07:16.000000000 
+0200
-+++ SDL-1.2.14-patched/src/thread/pthread/SDL_syssem.c 2011-07-11 
11:23:52.000000000 +0200
+--- SDL-1.2.14/src/thread/pthread/SDL_syssem.c 2009-10-13 00:07:16.000000000 
+0100
++++ SDL-1.2.14-patched/src/thread/pthread/SDL_syssem.c 2011-07-11 
10:23:52.000000000 +0100
 @@ -97,6 +97,8 @@
  int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
  {
@@ -381,8 +381,8 @@
        return retval;
  }
 diff -ru SDL-1.2.14/src/video/SDL_blit.c 
SDL-1.2.14-patched/src/video/SDL_blit.c
---- SDL-1.2.14/src/video/SDL_blit.c    2009-10-13 01:07:15.000000000 +0200
-+++ SDL-1.2.14-patched/src/video/SDL_blit.c    2011-07-11 11:23:52.000000000 
+0200
+--- SDL-1.2.14/src/video/SDL_blit.c    2009-10-13 00:07:15.000000000 +0100
++++ SDL-1.2.14-patched/src/video/SDL_blit.c    2011-07-11 10:23:52.000000000 
+0100
 @@ -214,7 +214,7 @@
        dstskip = w+info->d_skip;
        if ( dst < src ) {
@@ -393,8 +393,8 @@
                        dst += dstskip;
                }
 diff -ru SDL-1.2.14/src/video/SDL_stretch.c 
SDL-1.2.14-patched/src/video/SDL_stretch.c
---- SDL-1.2.14/src/video/SDL_stretch.c 2009-10-19 10:08:00.000000000 +0200
-+++ SDL-1.2.14-patched/src/video/SDL_stretch.c 2011-07-11 11:23:52.000000000 
+0200
+--- SDL-1.2.14/src/video/SDL_stretch.c 2009-10-19 09:08:00.000000000 +0100
++++ SDL-1.2.14-patched/src/video/SDL_stretch.c 2011-07-11 10:23:52.000000000 
+0100
 @@ -78,7 +78,7 @@
  
        int i;
@@ -440,8 +440,8 @@
        /* Make the code executable but not writeable */
        if ( mprotect(copy_row, sizeof(copy_row), PROT_READ|PROT_EXEC) < 0 ) {
 diff -ru SDL-1.2.14/src/video/mmx.h SDL-1.2.14-patched/src/video/mmx.h
---- SDL-1.2.14/src/video/mmx.h 2009-10-13 01:07:15.000000000 +0200
-+++ SDL-1.2.14-patched/src/video/mmx.h 2011-07-11 11:23:52.000000000 +0200
+--- SDL-1.2.14/src/video/mmx.h 2009-10-13 00:07:15.000000000 +0100
++++ SDL-1.2.14-patched/src/video/mmx.h 2011-07-11 10:23:52.000000000 +0100
 @@ -355,7 +355,7 @@
  
  #define       mmx_r2m(op, reg, mem) \
@@ -452,8 +452,8 @@
  
  #define       mmx_r2r(op, regs, regd) \
 diff -ru SDL-1.2.14/src/video/quartz/SDL_QuartzGL.m 
SDL-1.2.14-patched/src/video/quartz/SDL_QuartzGL.m
---- SDL-1.2.14/src/video/quartz/SDL_QuartzGL.m 2009-10-13 01:07:14.000000000 
+0200
-+++ SDL-1.2.14-patched/src/video/quartz/SDL_QuartzGL.m 2011-07-11 
11:23:52.000000000 +0200
+--- SDL-1.2.14/src/video/quartz/SDL_QuartzGL.m 2009-10-13 00:07:14.000000000 
+0100
++++ SDL-1.2.14-patched/src/video/quartz/SDL_QuartzGL.m 2011-07-11 
10:23:52.000000000 +0100
 @@ -153,7 +153,7 @@
       * http://lists.apple.com/archives/mac-opengl/2006/Jan/msg00080.html )
       */
@@ -491,8 +491,8 @@
              *value = val;
              return 0;
 diff -ru SDL-1.2.14/src/video/quartz/SDL_QuartzVideo.m 
SDL-1.2.14-patched/src/video/quartz/SDL_QuartzVideo.m
---- SDL-1.2.14/src/video/quartz/SDL_QuartzVideo.m      2009-10-17 
09:45:42.000000000 +0200
-+++ SDL-1.2.14-patched/src/video/quartz/SDL_QuartzVideo.m      2011-07-11 
11:23:52.000000000 +0200
+--- SDL-1.2.14/src/video/quartz/SDL_QuartzVideo.m      2009-10-17 
08:45:42.000000000 +0100
++++ SDL-1.2.14-patched/src/video/quartz/SDL_QuartzVideo.m      2011-08-02 
21:47:57.000000000 +0100
 @@ -24,7 +24,7 @@
  #include "SDL_QuartzVideo.h"
  #include "SDL_QuartzWindow.h"
@@ -502,16 +502,432 @@
  /*
      Add methods to get at private members of NSScreen. 
      Since there is a bug in Apple's screen switching code
-@@ -479,6 +479,8 @@
+@@ -84,25 +84,13 @@
+ static int          QZ_SetColors        (_THIS, int first_color,
+                                          int num_colors, SDL_Color *colors);
+ 
+-static int          QZ_LockDoubleBuffer   (_THIS, SDL_Surface *surface);
+-static void         QZ_UnlockDoubleBuffer (_THIS, SDL_Surface *surface);
+-static int          QZ_ThreadFlip         (_THIS);
+-static int          QZ_FlipDoubleBuffer   (_THIS, SDL_Surface *surface);
+-static void         QZ_DoubleBufferUpdate (_THIS, int num_rects, SDL_Rect 
*rects);
+-
+-static void         QZ_DirectUpdate     (_THIS, int num_rects, SDL_Rect 
*rects);
+ static void         QZ_UpdateRects      (_THIS, int num_rects, SDL_Rect 
*rects);
+ static void         QZ_VideoQuit        (_THIS);
+ 
+-/* Hardware surface functions (for fullscreen mode only) */
+-#if 0 /* Not used (apparently, it's really slow) */
+-static int  QZ_FillHWRect (_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 
color);
+-#endif
+ static int  QZ_LockHWSurface(_THIS, SDL_Surface *surface);
+ static void QZ_UnlockHWSurface(_THIS, SDL_Surface *surface);
+ static int QZ_AllocHWSurface(_THIS, SDL_Surface *surface);
+ static void QZ_FreeHWSurface (_THIS, SDL_Surface *surface);
+-/* static int  QZ_FlipHWSurface (_THIS, SDL_Surface *surface); */
+ 
+ /* Bootstrap binding, enables entry point into the driver */
+ VideoBootStrap QZ_bootstrap = {
+@@ -140,14 +128,13 @@
+     device->ToggleFullScreen = QZ_ToggleFullScreen;
+     device->UpdateMouse      = QZ_UpdateMouse;
+     device->SetColors        = QZ_SetColors;
+-    /* device->UpdateRects      = QZ_UpdateRects; this is determined by 
SetVideoMode() */
++    device->UpdateRects      = QZ_UpdateRects;
+     device->VideoQuit        = QZ_VideoQuit;
+ 
+     device->LockHWSurface   = QZ_LockHWSurface;
+     device->UnlockHWSurface = QZ_UnlockHWSurface;
+     device->AllocHWSurface   = QZ_AllocHWSurface;
+     device->FreeHWSurface   = QZ_FreeHWSurface;
+-    /* device->FlipHWSurface   = QZ_FlipHWSurface */;
+ 
+     device->SetGamma     = QZ_SetGamma;
+     device->GetGamma     = QZ_GetGamma;
+@@ -398,10 +385,6 @@
+ {
+     /* Reset values that may change between switches */
+     this->info.blit_fill  = 0;
+-    this->FillHWRect      = NULL;
+-    this->UpdateRects     = NULL;
+-    this->LockHWSurface   = NULL;
+-    this->UnlockHWSurface = NULL;
+     
+     if (cg_context) {
+         CGContextFlush (cg_context);
+@@ -414,16 +397,6 @@
+ 
+         NSRect screen_rect;
+         
+-        /*  Release double buffer stuff */
+-        if ( mode_flags & SDL_DOUBLEBUF) {
+-            quit_thread = YES;
+-            SDL_SemPost (sem1);
+-            SDL_WaitThread (thread, NULL);
+-            SDL_DestroySemaphore (sem1);
+-            SDL_DestroySemaphore (sem2);
+-            SDL_free (sw_buffers[0]);
+-        }
+-        
+         /* If we still have a valid window, close it. */
+         if ( qz_window ) {
+             NSCAssert([ qz_window delegate ] == nil, @"full screen window 
shouldn't have a delegate"); /* if that should ever change, we'd have to 
release it here */
+@@ -479,6 +452,12 @@
      NSRect contentRect;
      CGDisplayFadeReservationToken fade_token = 
kCGDisplayFadeReservationInvalidToken;
  
++    current->flags = SDL_FULLSCREEN;
++    current->w = width;
++    current->h = height;
++
 +    contentRect = NSMakeRect (0, 0, width, height);
 +
      /* Fade to black to hide resolution-switching flicker (and garbage
         that is displayed by a destroyed OpenGL context, if applicable) */
      if ( CGAcquireDisplayFadeReservation (5, &fade_token) == kCGErrorSuccess 
) {
-@@ -1192,7 +1194,6 @@
+@@ -522,72 +501,19 @@
+         goto ERR_NO_SWITCH;
+     }
+ 
+-    current->pixels = (Uint32*) CGDisplayBaseAddress (display_id);
+-    current->pitch  = CGDisplayBytesPerRow (display_id);
+-
+-    current->flags = 0;
+-    current->w = width;
+-    current->h = height;
+-    current->flags |= SDL_FULLSCREEN;
+-    current->flags |= SDL_HWSURFACE;
+-    current->flags |= SDL_PREALLOC;
+-    /* current->hwdata = (void *) CGDisplayGetDrawingContext (display_id); */
+-
+-    this->UpdateRects     = QZ_DirectUpdate;
+-    this->LockHWSurface   = QZ_LockHWSurface;
+-    this->UnlockHWSurface = QZ_UnlockHWSurface;
+-
+-    /* Setup double-buffer emulation */
+-    if ( flags & SDL_DOUBLEBUF ) {
+-        
+-        /*
+-            Setup a software backing store for reasonable results when
+-            double buffering is requested (since a single-buffered hardware
+-            surface looks hideous).
+-            
+-            The actual screen blit occurs in a separate thread to allow 
+-            other blitting while waiting on the VBL (and hence results in 
higher framerates).
+-        */
+-        this->LockHWSurface = NULL;
+-        this->UnlockHWSurface = NULL;
+-        this->UpdateRects = NULL;
+-        
+-        current->flags |= (SDL_HWSURFACE|SDL_DOUBLEBUF);
+-        this->UpdateRects = QZ_DoubleBufferUpdate;
+-        this->LockHWSurface = QZ_LockDoubleBuffer;
+-        this->UnlockHWSurface = QZ_UnlockDoubleBuffer;
+-        this->FlipHWSurface = QZ_FlipDoubleBuffer;
+-
+-        current->pixels = SDL_malloc (current->pitch * current->h * 2);
+-        if (current->pixels == NULL) {
+-            SDL_OutOfMemory ();
+-            goto ERR_DOUBLEBUF;
+-        }
+-        
+-        sw_buffers[0] = current->pixels;
+-        sw_buffers[1] = (Uint8*)current->pixels + current->pitch * current->h;
+-        
+-        quit_thread = NO;
+-        sem1 = SDL_CreateSemaphore (0);
+-        sem2 = SDL_CreateSemaphore (1);
+-        thread = SDL_CreateThread ((int (*)(void *))QZ_ThreadFlip, this);
+-    }
+-
+-    if ( CGDisplayCanSetPalette (display_id) )
+-        current->flags |= SDL_HWPALETTE;
+-
+     /* Check if we should recreate the window */
+     if (qz_window == nil) {
+         /* Manually create a window, avoids having a nib file resource */
+         qz_window = [ [ SDL_QuartzWindow alloc ] 
+             initWithContentRect:contentRect
+-                styleMask:0
++                styleMask:NSBorderlessWindowMask
+                     backing:NSBackingStoreBuffered
+                         defer:NO ];
+ 
+         if (qz_window != nil) {
+             [ qz_window setAcceptsMouseMovedEvents:YES ];
+             [ qz_window setViewsNeedDisplay:NO ];
++            [ qz_window setContentView: [ [ [ SDL_QuartzView alloc ] init ] 
autorelease ] ];
+         }
+     }
+     /* We already have a window, just change its size */
+@@ -603,6 +529,9 @@
+         CGLError err;
+         CGLContextObj ctx;
+ 
++        /* CGLSetFullScreen() will handle this for us. */
++        [ qz_window setLevel:NSNormalWindowLevel ];
++
+         if ( ! QZ_SetupOpenGL (this, bpp, flags) ) {
+             goto ERR_NO_GL;
+         }
+@@ -629,6 +558,38 @@
+ 
+         current->flags |= SDL_OPENGL;
+     }
++    /* For 2D, we build a CGBitmapContext */
++    else {
++        CGColorSpaceRef cgColorspace;
++
++        /* Only recreate the view if it doesn't already exist */
++        if (window_view == nil) {
++            window_view = [ [ NSView alloc ] initWithFrame:contentRect ];
++            [ window_view setAutoresizingMask: NSViewWidthSizable | 
NSViewHeightSizable ];
++            [ [ qz_window contentView ] addSubview:window_view ];
++            [ window_view release ];
++        }
++
++        cgColorspace = CGColorSpaceCreateDeviceRGB();
++        current->pitch = 4 * current->w;
++        current->pixels = SDL_malloc (current->h * current->pitch);
++        
++        cg_context = CGBitmapContextCreate (current->pixels, current->w, 
current->h,
++                        8, current->pitch, cgColorspace,
++                        kCGImageAlphaNoneSkipFirst);
++        CGColorSpaceRelease (cgColorspace);
++        
++        current->flags |= SDL_SWSURFACE;
++        current->flags |= SDL_ASYNCBLIT;
++        current->hwdata = (void *) cg_context;
++
++        /* Force this window to draw above _everything_. */
++        [ qz_window setLevel:CGShieldingWindowLevel() ];
++    }
++
++    [ qz_window setHasShadow:NO];
++    [ qz_window setOpaque:YES];
++    [ qz_window makeKeyAndOrderFront:nil ];
+ 
+     /* If we don't hide menu bar, it will get events and interrupt the 
program */
+     HideMenuBar ();
+@@ -819,10 +780,6 @@
+         current->flags |= SDL_SWSURFACE;
+         current->flags |= SDL_ASYNCBLIT;
+         current->hwdata = (void *) cg_context;
+-        
+-        this->UpdateRects     = QZ_UpdateRects;
+-        this->LockHWSurface   = QZ_LockHWSurface;
+-        this->UnlockHWSurface = QZ_UnlockHWSurface;
+     }
+ 
+     /* Save flags to ensure correct teardown */
+@@ -843,6 +800,9 @@
+     current->flags = 0;
+     current->pixels = NULL;
+ 
++    /* Force bpp to 32 */
++    bpp = 32;
++
+     /* Setup full screen video */
+     if ( flags & SDL_FULLSCREEN ) {
+         current = QZ_SetVideoFullScreen (this, current, width, height, bpp, 
flags );
+@@ -851,8 +811,6 @@
+     }
+     /* Setup windowed video */
+     else {
+-        /* Force bpp to 32 */
+-        bpp = 32;
+         current = QZ_SetVideoWindowed (this, current, width, height, &bpp, 
flags);
+         if (current == NULL)
+             return NULL;
+@@ -877,14 +835,6 @@
+                 return NULL;
+             case 32:   /* (8)-8-8-8 ARGB */
+                 amask = 0x00000000;
+-              if ( flags & SDL_FULLSCREEN )
+-              {
+-                      rmask = 0x00FF0000;
+-                      gmask = 0x0000FF00;
+-                      bmask = 0x000000FF;
+-              }
+-              else
+-              {
+ #if SDL_BYTEORDER == SDL_LIL_ENDIAN
+                       rmask = 0x0000FF00;
+                       gmask = 0x00FF0000;
+@@ -894,7 +844,6 @@
+                       gmask = 0x0000FF00;
+                       bmask = 0x000000FF;
+ #endif
+-              }
+                 break;
+         }
+ 
+@@ -940,164 +889,6 @@
+     return 1;
+ }
+ 
+-static int QZ_LockDoubleBuffer (_THIS, SDL_Surface *surface)
+-{
+-    return 1;
+-}
+-
+-static void QZ_UnlockDoubleBuffer (_THIS, SDL_Surface *surface)
+-{
+-}
+-
+-/* The VBL delay is based on code by Ian R Ollmann's RezLib 
<[email protected]> */
+-static AbsoluteTime QZ_SecondsToAbsolute ( double seconds )
+-{
+-    union
+-    {
+-        UInt64 i;
+-        Nanoseconds ns;
+-    } temp;
+-        
+-    temp.i = seconds * 1000000000.0;
+-    
+-    return NanosecondsToAbsolute ( temp.ns );
+-}
+-
+-static int QZ_ThreadFlip (_THIS)
+-{
+-    Uint8 *src, *dst;
+-    int skip, len, h;
+-    
+-    /*
+-        Give this thread the highest scheduling priority possible,
+-        in the hopes that it will immediately run after the VBL delay
+-    */
+-    {
+-        pthread_t current_thread;
+-        int policy;
+-        struct sched_param param;
+-        
+-        current_thread = pthread_self ();
+-        pthread_getschedparam (current_thread, &policy, &param);
+-        policy = SCHED_RR;
+-        param.sched_priority = sched_get_priority_max (policy);
+-        pthread_setschedparam (current_thread, policy, &param);
+-    }
+-    
+-    while (1) {
+-    
+-        SDL_SemWait (sem1);
+-        if (quit_thread)
+-            return 0;
+-                
+-        /*
+-         * 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 = (Uint8 *)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;
+-    
+-        /* Wait for the VBL to occur (estimated since we don't have a 
hardware interrupt) */
+-        {
+-            
+-            /* The VBL delay is based on Ian Ollmann's RezLib 
<[email protected]> */
+-            double refreshRate;
+-            double linesPerSecond;
+-            double target;
+-            double position;
+-            double adjustment;
+-            AbsoluteTime nextTime;        
+-            CFNumberRef refreshRateCFNumber;
+-            
+-            refreshRateCFNumber = CFDictionaryGetValue (mode, 
kCGDisplayRefreshRate);
+-            if ( NULL == refreshRateCFNumber ) {
+-                SDL_SetError ("Mode has no refresh rate");
+-                goto ERROR;
+-            }
+-            
+-            if ( 0 == CFNumberGetValue (refreshRateCFNumber, 
kCFNumberDoubleType, &refreshRate) ) {
+-                SDL_SetError ("Error getting refresh rate");
+-                goto ERROR;
+-            }
+-            
+-            if ( 0 == refreshRate ) {
+-               
+-               SDL_SetError ("Display has no refresh rate, using 60hz");
+-                
+-                /* ok, for LCD's we'll emulate a 60hz refresh, which may or 
may not look right */
+-                refreshRate = 60.0;
+-            }
+-            
+-            linesPerSecond = refreshRate * h;
+-            target = h;
+-        
+-            /* Figure out the first delay so we start off about right */
+-            position = CGDisplayBeamPosition (display_id);
+-            if (position > target)
+-                position = 0;
+-            
+-            adjustment = (target - position) / linesPerSecond; 
+-            
+-            nextTime = AddAbsoluteToAbsolute (UpTime (), QZ_SecondsToAbsolute 
(adjustment));
+-        
+-            MPDelayUntil (&nextTime);
+-        }
+-        
+-        
+-        /* On error, skip VBL delay */
+-        ERROR:
+-        
+-        /* TODO: use CGContextDrawImage here too!  Create two CGContextRefs 
the same way we
+-           create two buffers, replace current_buffer with current_context 
and set it
+-           appropriately in QZ_FlipDoubleBuffer.  */
+-        while ( h-- ) {
+-        
+-            SDL_memcpy (dst, src, len);
+-            src += skip;
+-            dst += skip;
+-        }
+-        
+-        /* signal flip completion */
+-        SDL_SemPost (sem2);
+-    }
+-    
+-    return 0;
+-}
+-        
+-static int QZ_FlipDoubleBuffer (_THIS, SDL_Surface *surface)
+-{
+-    /* wait for previous flip to complete */
+-    SDL_SemWait (sem2);
+-    
+-    current_buffer = surface->pixels;
+-        
+-    if (surface->pixels == sw_buffers[0])
+-        surface->pixels = sw_buffers[1];
+-    else
+-        surface->pixels = sw_buffers[0];
+-    
+-    /* signal worker thread to do the flip */
+-    SDL_SemPost (sem1);
+-    
+-    return 0;
+-}
+-
+-static void QZ_DoubleBufferUpdate (_THIS, int num_rects, SDL_Rect *rects)
+-{
+-    /* perform a flip if someone calls updaterects on a doublebuferred 
surface */
+-    this->FlipHWSurface (this, SDL_VideoSurface);
+-}
+-
+-static void QZ_DirectUpdate (_THIS, int num_rects, SDL_Rect *rects)
+-{
+-#pragma unused(this,num_rects,rects)
+-}
+-
+ 
+ /* Resize icon, BMP format */
+ static const unsigned char QZ_ResizeIcon[] = {
+@@ -1192,7 +983,6 @@
          CGContextDrawImage (cgc, rectangle, image);
          CGImageRelease(image);
          CGContextFlush (cgc);
@@ -519,26 +935,38 @@
      }
  }
  
-@@ -1247,6 +1248,16 @@
+@@ -1236,15 +1026,6 @@
+     }
+ }
  
+-#if 0 /* Not used (apparently, it's really slow) */
+-static int  QZ_FillHWRect (_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 
color)
+-{
+-    CGSDisplayHWFill (display_id, rect->x, rect->y, rect->w, rect->h, color);
+-
+-    return 0;
+-}
+-#endif
+-
  static int  QZ_LockHWSurface(_THIS, SDL_Surface *surface)
  {
-+    /*
-+     * Always get latest bitmap address and rowbytes for the screen surface;
-+     *  they can change dynamically (user has multiple monitors, etc).
-+     */
-+    if (surface == SDL_VideoSurface) {
-+        surface->pixels = (void*) CGDisplayBaseAddress (kCGDirectMainDisplay);
-+        surface->pitch  = CGDisplayBytesPerRow (kCGDirectMainDisplay);
-+        return (surface->pixels != NULL);
-+    }
-+
      return 1;
+@@ -1263,12 +1044,6 @@
+ {
  }
  
+-/*
+- int QZ_FlipHWSurface (_THIS, SDL_Surface *surface) {
+-     return 0;
+- }
+- */
+-
+ /* Gamma functions */
+ int QZ_SetGamma (_THIS, float red, float green, float blue)
+ {
 diff -ru SDL-1.2.14/src/video/quartz/SDL_QuartzWM.m 
SDL-1.2.14-patched/src/video/quartz/SDL_QuartzWM.m
---- SDL-1.2.14/src/video/quartz/SDL_QuartzWM.m 2009-10-13 01:07:14.000000000 
+0200
-+++ SDL-1.2.14-patched/src/video/quartz/SDL_QuartzWM.m 2011-07-11 
11:23:52.000000000 +0200
+--- SDL-1.2.14/src/video/quartz/SDL_QuartzWM.m 2009-10-13 00:07:14.000000000 
+0100
++++ SDL-1.2.14-patched/src/video/quartz/SDL_QuartzWM.m 2011-07-11 
10:23:52.000000000 +0100
 @@ -151,14 +151,16 @@
  /* Convert Cocoa screen coordinate to Cocoa window coordinate */
  void QZ_PrivateGlobalToLocal (_THIS, NSPoint *p) {

Index: sdl.info
===================================================================
RCS file: /cvsroot/fink/dists/10.4/unstable/main/finkinfo/games/sdl.info,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- sdl.info    11 Jul 2011 17:32:03 -0000      1.26
+++ sdl.info    5 Aug 2011 16:55:51 -0000       1.27
@@ -16,7 +16,7 @@
 
 Package: sdl
 Version: 1.2.14
-Revision: 7
+Revision: 8
 BuildDependsOnly: True
 Depends: %N-shlibs (= %v-%r)
 BuildDepends: x11-dev, fink (>= 0.24.12), (%m = x86_64) gcc4.2
@@ -24,7 +24,7 @@
 Source: http://www.libsdl.org/release/SDL-%v.tar.gz
 Source-MD5: e52086d1b508fa0b76c52ee30b55bec4
 PatchFile: %n.patch
-PatchFile-MD5: 8cb48834fc5be8ee008fb84d1a700e63
+PatchFile-MD5: 0f88d799bcb4af8c6632614cb49efe7c
 ConfigureParams: --mandir=%p/share/man
 CompileScript: ./configure %c; DISTCC_HOSTS='' MAKEFLAGS='-j1' make
 InstallScript: make install DESTDIR=%d


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Fink-commits mailing list
[email protected]
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to