Ticket #2996: 0008-SDL_SetWindowGammaRamp-fails-on-Andorid-so-don-t-bot.patch

File 0008-SDL_SetWindowGammaRamp-fails-on-Andorid-so-don-t-bot.patch, 1.2 KB (added by BogDan, 9 years ago)
  • source/ps/VideoMode.cpp

    From c50502a5bd6071fab0bc569f8415e40684037ab5 Mon Sep 17 00:00:00 2001
    From: BogDan Vatra <bogdan@kde.org>
    Date: Sun, 28 Dec 2014 00:19:00 +0200
    Subject: [PATCH 08/11] SDL_SetWindowGammaRamp fails on Andorid, so don't
     bother to use it.
    
    Set SDL_WINDOW_ALLOW_HIGHDPI even it seems it has no effect.
    ---
     source/ps/VideoMode.cpp | 5 +++++
     1 file changed, 5 insertions(+)
    
    diff --git a/source/ps/VideoMode.cpp b/source/ps/VideoMode.cpp
    index 7ff6870..531123c 100644
    a b bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)  
    7373{
    7474#if SDL_VERSION_ATLEAST(2, 0, 0)
    7575    Uint32 flags = 0;
     76#if OS_ANDROID
     77    flags |= SDL_WINDOW_ALLOW_HIGHDPI;
     78#endif
    7679    if (fullscreen)
    7780        flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
    7881
    bool CVideoMode::InitSDL()  
    291294    // (TODO: does that mean we need to call this when toggling fullscreen later?)
    292295
    293296#if SDL_VERSION_ATLEAST(2, 0, 0)
     297#if !OS_ANDROID
    294298    u16 ramp[256];
    295299    SDL_CalculateGammaRamp(g_Gamma, ramp);
    296300    if (SDL_SetWindowGammaRamp(m_Window, ramp, ramp, ramp) < 0)
    297301        LOGWARNING(L"SDL_SetWindowGammaRamp failed");
     302#endif
    298303#else
    299304# if OS_MACOSX
    300305    // Workaround for crash on Mavericks, see http://trac.wildfiregames.com/ticket/2272