Commit 51bddc2d authored by Ryan C. Gordon's avatar Ryan C. Gordon

Support for Gamma Ramps on Mac OS Classic in both the macrom and macdsp video

 targets, thanks to Gregory Smith!

   Fixes Bugzilla #431.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402351
parent 2a55f0a3
This diff is collapsed.
......@@ -26,3 +26,16 @@
/* Functions to be exported */
extern void Mac_SetCaption(_THIS, const char *title, const char *icon);
/*
* There's no Carbonized gamma support in Mac OS X, since PBStatusSync() and
* Control() aren't supported in OS X's Carbonlib. Use the Quartz driver
* instead.
*/
#define SDL_MACCLASSIC_GAMMA_SUPPORT ((defined(__APPLE__) && defined(__MACH__)) == 0)
#if SDL_MACCLASSIC_GAMMA_SUPPORT
extern void Mac_QuitGamma(_THIS);
extern int Mac_SetGammaRamp(_THIS, Uint16 *ramp);
extern int Mac_GetGammaRamp(_THIS, Uint16 *ramp);
#endif
......@@ -297,6 +297,10 @@ static SDL_VideoDevice *DSp_CreateDevice(int devindex)
device->UnlockHWSurface = DSp_UnlockHWSurface;
device->FlipHWSurface = DSp_FlipHWSurface;
device->FreeHWSurface = DSp_FreeHWSurface;
#if SDL_MACCLASSIC_GAMMA_SUPPORT
device->SetGammaRamp = Mac_SetGammaRamp;
device->GetGammaRamp = Mac_GetGammaRamp;
#endif
#if SDL_VIDEO_OPENGL
device->GL_MakeCurrent = Mac_GL_MakeCurrent;
device->GL_SwapBuffers = DSp_GL_SwapBuffers;
......@@ -1381,6 +1385,10 @@ void DSp_VideoQuit(_THIS)
/* Free Palette and restore original */
DSp_DestroyPalette (this);
#if SDL_MACCLASSIC_GAMMA_SUPPORT
Mac_QuitGamma(this);
#endif
/* Free list of video modes */
if ( SDL_modelist != NULL ) {
for ( i=0; SDL_modelist[i]; i++ ) {
......
......@@ -158,6 +158,10 @@ static SDL_VideoDevice *ROM_CreateDevice(int devindex)
device->UnlockHWSurface = ROM_UnlockHWSurface;
device->FlipHWSurface = NULL;
device->FreeHWSurface = ROM_FreeHWSurface;
#if SDL_MACCLASSIC_GAMMA_SUPPORT
device->SetGammaRamp = Mac_SetGammaRamp;
device->GetGammaRamp = Mac_GetGammaRamp;
#endif
#if SDL_VIDEO_OPENGL
device->GL_MakeCurrent = Mac_GL_MakeCurrent;
device->GL_SwapBuffers = Mac_GL_SwapBuffers;
......@@ -725,6 +729,10 @@ void ROM_VideoQuit(_THIS)
}
RestoreDeviceClut(GetMainDevice());
#if SDL_MACCLASSIC_GAMMA_SUPPORT
Mac_QuitGamma(this);
#endif
/* Free list of video modes */
if ( SDL_modelist != NULL ) {
for ( i=0; SDL_modelist[i]; ++i ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment