File: 40-novert.patch

package info (click to toggle)
wolf4sdl 1.7%2Bsvn262%2Bdfsg1-5
  • links: PTS, VCS
  • area: contrib
  • in suites: bookworm, bullseye, buster
  • size: 4,112 kB
  • sloc: cpp: 34,696; ansic: 1,257; objc: 246; makefile: 159; sh: 44
file content (52 lines) | stat: -rw-r--r-- 1,795 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Subject: Suppress vertical mouse movement when the "--novert" parameter is given.
Author: Fabian Greffrath <fabian+debian@greffrath.com>

--- a/wl_def.h
+++ b/wl_def.h
@@ -934,6 +934,7 @@ extern  int      param_mission;
 extern  boolean  param_goodtimes;
 extern  boolean  param_ignorenumchunks;
 extern  boolean  param_shading;
+extern  boolean  param_novert;
 
 
 void            NewGame (int difficulty,int episode);
--- a/wl_main.cpp
+++ b/wl_main.cpp
@@ -102,6 +102,7 @@ int     param_mission = 0;
 boolean param_goodtimes = false;
 boolean param_ignorenumchunks = false;
 boolean param_shading = false;
+boolean param_novert = false;
 
 /*
 =============================================================================
@@ -1723,6 +1724,8 @@ void CheckParameters(int argc, char *arg
         else IFARG("--shading")
             param_shading = true;
 #endif
+        else IFARG("--novert")
+            param_novert = true;
         else IFARG("--res")
         {
             if(i + 2 >= argc)
@@ -1906,6 +1909,7 @@ void CheckParameters(int argc, char *arg
 #ifdef USE_SHADING
             " --shading              Enables shading support\n"
 #endif
+            " --novert               Suppresses vertical mouse movement\n"
             " --res <width> <height> Sets the screen resolution\n"
             "                        (must be multiple of 320x200 or 320x240)\n"
             " --resf <w> <h>         Sets any screen resolution >= 320x200\n"
--- a/wl_play.cpp
+++ b/wl_play.cpp
@@ -347,7 +347,8 @@ void PollMouseMove (void)
     mouseymove -= screenHeight / 2;
 
     controlx += mousexmove * 10 / (13 - mouseadjustment);
-    controly += mouseymove * 20 / (13 - mouseadjustment);
+    if (!param_novert)
+        controly += mouseymove * 20 / (13 - mouseadjustment);
 }