Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 449692 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/video/SDL_gamma.c (-14 / +2 lines)
Lines 92-113 static void CalculateGammaFromRamp(float *gamma, Uint16 *ramp) Link Here
92
92
93
int SDL_SetGamma(float red, float green, float blue)
93
int SDL_SetGamma(float red, float green, float blue)
94
{
94
{
95
	int succeeded;
95
	int succeeded = -1;
96
	SDL_VideoDevice *video = current_video;
96
	SDL_VideoDevice *video = current_video;
97
	SDL_VideoDevice *this  = current_video;	
97
	SDL_VideoDevice *this  = current_video;	
98
98
99
	succeeded = -1;
99
	if ( video->SetGamma ) {
100
	/* Prefer using SetGammaRamp(), as it's more flexible */
101
	{
102
		Uint16 ramp[3][256];
103
104
		CalculateGammaRamp(red, ramp[0]);
105
		CalculateGammaRamp(green, ramp[1]);
106
		CalculateGammaRamp(blue, ramp[2]);
107
		succeeded = SDL_SetGammaRamp(ramp[0], ramp[1], ramp[2]);
108
	}
109
	if ( (succeeded < 0) && video->SetGamma ) {
110
		SDL_ClearError();
111
		succeeded = video->SetGamma(this, red, green, blue);
100
		succeeded = video->SetGamma(this, red, green, blue);
112
	}
101
	}
113
	return succeeded;
102
	return succeeded;
114
- 

Return to bug 449692