mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 15:15:39 +00:00
Fix KMSDRM-related warnings
This commit is contained in:
parent
dfa64eadd3
commit
0e35f0be1f
|
@ -1373,10 +1373,14 @@ KMSDRM_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp)
|
|||
SDL_VideoData *viddata = (SDL_VideoData*)windata->viddata;
|
||||
SDL_VideoDisplay *disp = SDL_GetDisplayForWindow(window);
|
||||
SDL_DisplayData* dispdata = (SDL_DisplayData*)disp->driverdata;
|
||||
if (KMSDRM_drmModeCrtcSetGamma(viddata->drm_fd, dispdata->crtc->crtc_id, 256, &ramp[0*256], &ramp[1*256], &ramp[2*256]) == -1)
|
||||
Uint16* tempRamp = SDL_calloc(3 * 2,256);
|
||||
SDL_memcpy(tempRamp,ramp,3 * 2 * 256);
|
||||
if (KMSDRM_drmModeCrtcSetGamma(viddata->drm_fd, dispdata->crtc->crtc_id, 256, &tempRamp[0*256], &tempRamp[1*256], &tempRamp[2*256]) == -1)
|
||||
{
|
||||
SDL_free(tempRamp);
|
||||
return SDL_SetError("Failed to set gamma ramp");
|
||||
}
|
||||
SDL_free(tempRamp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue