This is an automated email from the git hooks/post-receive script.

fabian pushed a commit to branch master
in repository yquake2.

commit 1aa77f75179e0abb9d19fa5f764b572a916e39d5
Author: Fabian Greffrath <[email protected]>
Date:   Tue Sep 29 10:22:28 2015 +0200

    Backport two commits from upstream GIT to fix crosshair scaling (CLoses: 
#799952)
---
 debian/patches/0001-Fix-crosshair_scale.patch      | 103 +++++++++++++++++++++
 ...ename-SCR_GetScale-to-SCR_GetDefaultScale.patch |  61 ++++++++++++
 debian/patches/series                              |   2 +
 3 files changed, 166 insertions(+)

diff --git a/debian/patches/0001-Fix-crosshair_scale.patch 
b/debian/patches/0001-Fix-crosshair_scale.patch
new file mode 100644
index 0000000..3845c52
--- /dev/null
+++ b/debian/patches/0001-Fix-crosshair_scale.patch
@@ -0,0 +1,103 @@
+From f2e53e657b4275343d0d03a94799539e9bcb9723 Mon Sep 17 00:00:00 2001
+From: Yamagi Burmeister <[email protected]>
+Date: Mon, 14 Sep 2015 19:05:08 +0200
+Subject: [PATCH 1/3] Fix crosshair_scale
+
+The crosshair_scale cvar was broken a long time ago at Icculus Q2 or
+even back at it. The fix is easy... This is part of issue #87.
+---
+ src/client/cl_screen.c | 58 +++++++++++++++++++++++---------------------------
+ 1 file changed, 27 insertions(+), 31 deletions(-)
+
+diff --git a/src/client/cl_screen.c b/src/client/cl_screen.c
+index 5acf9e0..9f541b1 100644
+--- a/src/client/cl_screen.c
++++ b/src/client/cl_screen.c
+@@ -1550,9 +1550,29 @@ SCR_UpdateScreen(void)
+       GLimp_EndFrame();
+ }
+ 
++float
++SCR_GetScale(void)
++{
++      int i = viddef.width / 640;
++      int j = viddef.height / 240;
++
++      if (i > j)
++      {
++              i = j;
++      }
++      if (i < 1)
++      {
++              i = 1;
++      }
++
++      return i;
++}
++
+ void
+ SCR_DrawCrosshair(void)
+ {
++      float scale;
++
+       if (!crosshair->value)
+       {
+               return;
+@@ -1564,47 +1584,23 @@ SCR_DrawCrosshair(void)
+               SCR_TouchPics();
+       }
+ 
+-      if (crosshair_scale->modified)
+-      {
+-              crosshair_scale->modified = false;
+-
+-              if (crosshair_scale->value > 5)
+-              {
+-                      Cvar_SetValue("crosshair_scale", 5);
+-              }
+-
+-              else if (crosshair_scale->value < 0.25)
+-              {
+-                      Cvar_SetValue("crosshair_scale", 0.25);
+-              }
+-      }
+-
+       if (!crosshair_pic[0])
+       {
+               return;
+       }
+ 
+-      Draw_Pic(scr_vrect.x + ((scr_vrect.width - crosshair_width) >> 1),
+-                      scr_vrect.y + ((scr_vrect.height - crosshair_height) >> 
1),
+-                      crosshair_pic);
+-}
+-
+-float
+-SCR_GetScale(void)
+-{
+-      int i = viddef.width / 640;
+-      int j = viddef.height / 240;
+-
+-      if (i > j)
++      if (crosshair_scale->value < 0)
+       {
+-              i = j;
++              scale = SCR_GetScale();
+       }
+-      if (i < 1)
++      else
+       {
+-              i = 1;
++              scale = crosshair_scale->value;
+       }
+ 
+-      return i;
++      Draw_PicScaled(scr_vrect.x + ((scr_vrect.width - crosshair_width) >> 1),
++                      scr_vrect.y + ((scr_vrect.height - crosshair_height) >> 
1),
++                      crosshair_pic, scale);
+ }
+ 
+ float
+-- 
+2.5.3
+
diff --git 
a/debian/patches/0002-Rename-SCR_GetScale-to-SCR_GetDefaultScale.patch 
b/debian/patches/0002-Rename-SCR_GetScale-to-SCR_GetDefaultScale.patch
new file mode 100644
index 0000000..19c61ff
--- /dev/null
+++ b/debian/patches/0002-Rename-SCR_GetScale-to-SCR_GetDefaultScale.patch
@@ -0,0 +1,61 @@
+From eba4ce95d4088c436920a5be85cbd48fa39a33cf Mon Sep 17 00:00:00 2001
+From: Yamagi Burmeister <[email protected]>
+Date: Mon, 14 Sep 2015 19:23:11 +0200
+Subject: [PATCH 2/3] Rename SCR_GetScale() to SCR_GetDefaultScale()
+
+---
+ src/client/cl_screen.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/client/cl_screen.c b/src/client/cl_screen.c
+index 9f541b1..8100a74 100644
+--- a/src/client/cl_screen.c
++++ b/src/client/cl_screen.c
+@@ -1551,7 +1551,7 @@ SCR_UpdateScreen(void)
+ }
+ 
+ float
+-SCR_GetScale(void)
++SCR_GetDefaultScale(void)
+ {
+       int i = viddef.width / 640;
+       int j = viddef.height / 240;
+@@ -1591,7 +1591,7 @@ SCR_DrawCrosshair(void)
+ 
+       if (crosshair_scale->value < 0)
+       {
+-              scale = SCR_GetScale();
++              scale = SCR_GetDefaultScale();
+       }
+       else
+       {
+@@ -1610,7 +1610,7 @@ SCR_GetHUDScale(void)
+ 
+       if (gl_hudscale->value < 0)
+       {
+-              scale = SCR_GetScale();
++              scale = SCR_GetDefaultScale();
+       }
+       else
+       {
+@@ -1627,7 +1627,7 @@ SCR_GetConsoleScale(void)
+ 
+       if (gl_consolescale->value < 0)
+       {
+-              scale = SCR_GetScale();
++              scale = SCR_GetDefaultScale();
+       }
+       else
+       {
+@@ -1644,7 +1644,7 @@ SCR_GetMenuScale(void)
+ 
+       if (gl_menuscale->value < 0)
+       {
+-              scale = SCR_GetScale();
++              scale = SCR_GetDefaultScale();
+       }
+       else
+       {
+-- 
+2.5.3
+
diff --git a/debian/patches/series b/debian/patches/series
index 5f01473..3d16204 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,5 @@ Append-to-C-LD-FLAGS-instead-of-overriding-them-to-o.patch
 Fix-spelling-errors-detected-by-lintian.patch
 Optionally-link-libopenal-at-compile-time.patch
 Add-BUILDDATE-macro-which-overrides-__DATE__-for-rep.patch
+0001-Fix-crosshair_scale.patch
+0002-Rename-SCR_GetScale-to-SCR_GetDefaultScale.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-games/yquake2.git

_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to