r15480 - in packages/trunk/supertuxkart/debian: . patches

Vincent Cheng vcheng at moszumanska.debian.org
Sun Jul 26 01:00:36 UTC 2015


Author: vcheng
Date: 2015-07-26 01:00:35 +0000 (Sun, 26 Jul 2015)
New Revision: 15480

Added:
   packages/trunk/supertuxkart/debian/patches/support_windowed_mode_when_xrandr_not_available.patch
Modified:
   packages/trunk/supertuxkart/debian/changelog
   packages/trunk/supertuxkart/debian/patches/series
Log:
supertuxkart: Add patch to fix crash when xrandr is not available


Modified: packages/trunk/supertuxkart/debian/changelog
===================================================================
--- packages/trunk/supertuxkart/debian/changelog	2015-07-18 10:25:12 UTC (rev 15479)
+++ packages/trunk/supertuxkart/debian/changelog	2015-07-26 01:00:35 UTC (rev 15480)
@@ -1,8 +1,8 @@
-supertuxkart (0.9-5) UNRELEASED; urgency=medium
+supertuxkart (0.9-5) unstable; urgency=medium
 
-  * (update patch header for fix_angelscript_build_on_non-x86_arches.patch)
+  * Add patch to fix crash when xrandr is not available. (Closes: #793457)
 
- -- Vincent Cheng <vcheng at debian.org>  Thu, 04 Jun 2015 01:12:20 -0700
+ -- Vincent Cheng <vcheng at debian.org>  Sat, 25 Jul 2015 17:57:15 -0700
 
 supertuxkart (0.9-4) unstable; urgency=medium
 

Modified: packages/trunk/supertuxkart/debian/patches/series
===================================================================
--- packages/trunk/supertuxkart/debian/patches/series	2015-07-18 10:25:12 UTC (rev 15479)
+++ packages/trunk/supertuxkart/debian/patches/series	2015-07-26 01:00:35 UTC (rev 15480)
@@ -2,6 +2,7 @@
 link_against_system_libs.patch
 remove_irrlicht_embedded_libs.patch
 fix_angelscript_build_on_non-x86_arches.patch
+support_windowed_mode_when_xrandr_not_available.patch
 # Irrlicht patches taken directly from irrlicht source package in Debian
 irrlicht/arch-support.diff
 irrlicht/use-system-libs.diff

Added: packages/trunk/supertuxkart/debian/patches/support_windowed_mode_when_xrandr_not_available.patch
===================================================================
--- packages/trunk/supertuxkart/debian/patches/support_windowed_mode_when_xrandr_not_available.patch	                        (rev 0)
+++ packages/trunk/supertuxkart/debian/patches/support_windowed_mode_when_xrandr_not_available.patch	2015-07-26 01:00:35 UTC (rev 15480)
@@ -0,0 +1,98 @@
+From f019f8622c93e57c12c0763dba44416c580f85a7 Mon Sep 17 00:00:00 2001
+From: deve <deveee at gmail.com>
+Date: Mon, 4 May 2015 11:09:53 +0200
+Subject: [PATCH] Make sure that window size is larger than 0
+
+---
+ src/graphics/irr_driver.cpp | 36 ++++++++++++++++++++++++------------
+ 1 file changed, 24 insertions(+), 12 deletions(-)
+
+diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp
+index 9260891..d3409f2 100644
+--- a/src/graphics/irr_driver.cpp
++++ b/src/graphics/irr_driver.cpp
+@@ -109,7 +109,7 @@ IrrDriver::IrrDriver()
+     m_phase               = SOLID_NORMAL_AND_DEPTH_PASS;
+     m_device              = createDevice(video::EDT_NULL,
+                                          irr::core::dimension2d<u32>(640, 480),
+-                                         /*bits*/16U, /**fullscreen*/ false, 
++                                         /*bits*/16U, /**fullscreen*/ false,
+                                          /*stencilBuffer*/ false,
+                                          /*vsync*/false,
+                                          /*event receiver*/ NULL,
+@@ -349,8 +349,13 @@ void IrrDriver::initDevice()
+ 
+         video::IVideoModeList* modes = m_device->getVideoModeList();
+         const core::dimension2d<u32> ssize = modes->getDesktopResolution();
+-        if (UserConfigParams::m_width > (int)ssize.Width ||
+-            UserConfigParams::m_height > (int)ssize.Height)
++
++        if (ssize.Width < 1 || ssize.Height < 1)
++        {
++            Log::warn("irr_driver", "Unknown desktop resolution.");
++        }
++        else if (UserConfigParams::m_width > (int)ssize.Width ||
++                 UserConfigParams::m_height > (int)ssize.Height)
+         {
+             Log::warn("irr_driver", "The window size specified in "
+                       "user config is larger than your screen!");
+@@ -358,13 +363,13 @@ void IrrDriver::initDevice()
+             UserConfigParams::m_height = (int)ssize.Height;
+         }
+ 
+-        core::dimension2d<u32> res = core::dimension2du(UserConfigParams::m_width,
+-                                                    UserConfigParams::m_height);
+-
+         if (UserConfigParams::m_fullscreen)
+         {
+             if (modes->getVideoModeCount() > 0)
+             {
++                core::dimension2d<u32> res = core::dimension2du(
++                                                    UserConfigParams::m_width,
++                                                    UserConfigParams::m_height);
+                 res = modes->getVideoModeResolution(res, res);
+ 
+                 UserConfigParams::m_width = res.Width;
+@@ -372,13 +377,20 @@ void IrrDriver::initDevice()
+             }
+             else
+             {
+-                Log::verbose("irr_driver", "Cannot get information about "
+-                             "resolutions. Try to use the default one.");
+-                UserConfigParams::m_width = MIN_SUPPORTED_WIDTH;
+-                UserConfigParams::m_height = MIN_SUPPORTED_HEIGHT;
++                Log::warn("irr_driver", "Cannot get information about "
++                          "resolutions. Disable fullscreen.");
++                UserConfigParams::m_fullscreen = false;
+             }
+         }
+ 
++        if (UserConfigParams::m_width < 1 || UserConfigParams::m_height < 1)
++        {
++            Log::warn("irr_driver", "Invalid window size. "
++                         "Try to use the default one.");
++            UserConfigParams::m_width = MIN_SUPPORTED_WIDTH;
++            UserConfigParams::m_height = MIN_SUPPORTED_HEIGHT;
++        }
++
+         m_device->closeDevice();
+         m_video_driver  = NULL;
+         m_gui_env       = NULL;
+@@ -703,7 +715,7 @@ bool IrrDriver::moveWindow(int x, int y)
+     }
+ #elif defined(__linux__) && !defined(ANDROID)
+     const video::SExposedVideoData& videoData = m_video_driver->getExposedVideoData();
+-    
++
+     Display* display = (Display*)videoData.OpenGLLinux.X11Display;
+     int screen = DefaultScreen(display);
+     int screen_w = DisplayWidth(display, screen);
+@@ -713,7 +725,7 @@ bool IrrDriver::moveWindow(int x, int y)
+     {
+         x = screen_w - UserConfigParams::m_width;
+     }
+-    
++
+     if (y + UserConfigParams::m_height > screen_h)
+     {
+         y = screen_h - UserConfigParams::m_height;




More information about the Pkg-games-commits mailing list