r8366 - packages/trunk/supertuxkart/debian/patches

Peter De Wachter pdewacht-guest at alioth.debian.org
Mon Nov 10 20:51:54 UTC 2008


Author: pdewacht-guest
Date: 2008-11-10 20:51:54 +0000 (Mon, 10 Nov 2008)
New Revision: 8366

Modified:
   packages/trunk/supertuxkart/debian/patches/modesetting.patch
Log:
Changed SDL modesetting patch to the version that got accepted upstream.


Modified: packages/trunk/supertuxkart/debian/patches/modesetting.patch
===================================================================
--- packages/trunk/supertuxkart/debian/patches/modesetting.patch	2008-11-10 20:51:00 UTC (rev 8365)
+++ packages/trunk/supertuxkart/debian/patches/modesetting.patch	2008-11-10 20:51:54 UTC (rev 8366)
@@ -1,34 +1,72 @@
 --- a/src/sdldrv.cpp
 +++ b/src/sdldrv.cpp
-@@ -58,14 +58,13 @@
+@@ -58,15 +58,11 @@
  	: sensedInput(0), actionMap(0), mainSurface(0), flags(0), stickInfos(0),
  	mode(BOOTSTRAP), mouseValX(0), mouseValY(0)
  {
 -    SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER);
+-
+-    SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
+-    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
+-    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
+-    SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
+-    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+-    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
+-    SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);
 +    if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER) < 0)
 +    {
 +        fprintf(stderr, "SDL_Init failed: %s\n", SDL_GetError());
 +        exit(1);
 +    }
  
--    SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
--    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
--    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
--    SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
-     SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
--    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
-     SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);
- 
      flags = SDL_OPENGL | SDL_HWSURFACE;
-@@ -249,6 +248,13 @@
+         
+@@ -247,8 +243,50 @@
+ {
+     //Is SDL_FreeSurface necessary? SDL wiki says not??
      SDL_FreeSurface(mainSurface);
++
++    SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
++    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
++    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
++    SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
++    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
++    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
++    SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);
++
      mainSurface = SDL_SetVideoMode(user_config->m_width, user_config->m_height, 0, flags);
  
 +    if (!mainSurface)
 +    {
-+        fprintf(stderr, "SDL_SetVideoMode (%dx%d) failed: %s\n",
-+                user_config->m_width, user_config->m_height, SDL_GetError());
-+        exit(1);
++        //ask for lower quality as a fallback
++        SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
++        SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
++        SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
++        SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
++
++        mainSurface = SDL_SetVideoMode(user_config->m_width, user_config->m_height, 0, flags);
++        if (mainSurface)
++        {
++            fprintf(stderr, "Using fallback OpenGL settings\n");
++        }
++        else
++        {
++            //one last attempt: get rid of the alpha channel
++            SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0);
++
++            mainSurface = SDL_SetVideoMode(user_config->m_width, user_config->m_height, 0, flags);
++            if (mainSurface)
++            {
++                fprintf(stderr, "Using fallback OpenGL settings, without alpha channel\n");
++            }
++            else
++            {
++                fprintf(stderr, "SDL_SetVideoMode (%dx%d) failed: %s\n",
++                        user_config->m_width, user_config->m_height, SDL_GetError());
++                exit(1);
++            }
++        }
++
 +    }
 +
  #if defined(WIN32) || defined(__APPLE__)




More information about the Pkg-games-commits mailing list