summaryrefslogtreecommitdiff
path: root/apps/plugins/sdl/progs/quake
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/sdl/progs/quake')
-rw-r--r--apps/plugins/sdl/progs/quake/cl_input.c15
-rw-r--r--apps/plugins/sdl/progs/quake/d_iface.h3
-rw-r--r--apps/plugins/sdl/progs/quake/mathlib.h11
-rw-r--r--apps/plugins/sdl/progs/quake/net.h6
-rw-r--r--apps/plugins/sdl/progs/quake/server.h2
5 files changed, 22 insertions, 15 deletions
diff --git a/apps/plugins/sdl/progs/quake/cl_input.c b/apps/plugins/sdl/progs/quake/cl_input.c
index 5327b7363e..613ca431b9 100644
--- a/apps/plugins/sdl/progs/quake/cl_input.c
+++ b/apps/plugins/sdl/progs/quake/cl_input.c
@@ -172,35 +172,36 @@ float CL_KeyState (kbutton_t *key)
172{ 172{
173 float val; 173 float val;
174 qboolean impulsedown, impulseup, down; 174 qboolean impulsedown, impulseup, down;
175 175
176 impulsedown = key->state & 2; 176 impulsedown = key->state & 2;
177 impulseup = key->state & 4; 177 impulseup = key->state & 4;
178 down = key->state & 1; 178 down = key->state & 1;
179 val = 0; 179 val = 0;
180 180
181 if (impulsedown && !impulseup) 181 if (impulsedown && !impulseup) {
182 if (down) 182 if (down)
183 val = 0.5; // pressed and held this frame 183 val = 0.5; // pressed and held this frame
184 else 184 else
185 val = 0; // I_Error (); 185 val = 0; // I_Error ();
186 if (impulseup && !impulsedown) 186 } else if (impulseup && !impulsedown) {
187 if (down) 187 if (down)
188 val = 0; // I_Error (); 188 val = 0; // I_Error ();
189 else 189 else
190 val = 0; // released this frame 190 val = 0; // released this frame
191 if (!impulsedown && !impulseup) 191 } else if (!impulsedown && !impulseup) {
192 if (down) 192 if (down)
193 val = 1.0; // held the entire frame 193 val = 1.0; // held the entire frame
194 else 194 else
195 val = 0; // up the entire frame 195 val = 0; // up the entire frame
196 if (impulsedown && impulseup) 196 } else if (impulsedown && impulseup) {
197 if (down) 197 if (down)
198 val = 0.75; // released and re-pressed this frame 198 val = 0.75; // released and re-pressed this frame
199 else 199 else
200 val = 0.25; // pressed and released this frame 200 val = 0.25; // pressed and released this frame
201 }
201 202
202 key->state &= 1; // clear impulses 203 key->state &= 1; // clear impulses
203 204
204 return val; 205 return val;
205} 206}
206 207
diff --git a/apps/plugins/sdl/progs/quake/d_iface.h b/apps/plugins/sdl/progs/quake/d_iface.h
index 8dc5ce94bc..1dbc7f3580 100644
--- a/apps/plugins/sdl/progs/quake/d_iface.h
+++ b/apps/plugins/sdl/progs/quake/d_iface.h
@@ -182,6 +182,9 @@ extern byte *r_skysource;
182#define DR_TRANSPARENT 1 182#define DR_TRANSPARENT 1
183 183
184// !!! must be kept the same as in quakeasm.h !!! 184// !!! must be kept the same as in quakeasm.h !!!
185#ifdef TRANSPARENT_COLOR
186#undef TRANSPARENT_COLOR
187#endif
185#define TRANSPARENT_COLOR 0xFF 188#define TRANSPARENT_COLOR 0xFF
186 189
187extern void *acolormap; // FIXME: should go away 190extern void *acolormap; // FIXME: should go away
diff --git a/apps/plugins/sdl/progs/quake/mathlib.h b/apps/plugins/sdl/progs/quake/mathlib.h
index 5f7ae430f1..4a91274589 100644
--- a/apps/plugins/sdl/progs/quake/mathlib.h
+++ b/apps/plugins/sdl/progs/quake/mathlib.h
@@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
8 8
9This program is distributed in the hope that it will be useful, 9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of 10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 12
13See the GNU General Public License for more details. 13See the GNU General Public License for more details.
14 14
@@ -69,11 +69,13 @@ void CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross);
69//void VectorNormalizeNoRet (vec3_t v); // uses finvsqrt 69//void VectorNormalizeNoRet (vec3_t v); // uses finvsqrt
70//float VectorNormalize (vec3_t v); // returns vector length 70//float VectorNormalize (vec3_t v); // returns vector length
71 71
72#pragma GCC diagnostic push
73#pragma GCC diagnostic ignored "-Wstrict-aliasing"
72static inline float InvSqrt( float number ) { 74static inline float InvSqrt( float number ) {
73 long i; 75 long i;
74 float x2, y; 76 float x2, y;
75 const float threehalfs = 1.5F; 77 const float threehalfs = 1.5F;
76 78
77 x2 = number * 0.5F; 79 x2 = number * 0.5F;
78 y = number; 80 y = number;
79 i = * ( long * ) &y; // evil floating point bit level hacking 81 i = * ( long * ) &y; // evil floating point bit level hacking
@@ -84,13 +86,14 @@ static inline float InvSqrt( float number ) {
84 86
85 return y; 87 return y;
86} 88}
89#pragma GCC diagnostic pop
87 90
88static inline void VectorNormalizeNoRet (vec3_t v) 91static inline void VectorNormalizeNoRet (vec3_t v)
89{ 92{
90 float length, ilength; 93 float length, ilength;
91 94
92 ilength = InvSqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); 95 ilength = InvSqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
93 96
94 v[0] *= ilength; 97 v[0] *= ilength;
95 v[1] *= ilength; 98 v[1] *= ilength;
96 v[2] *= ilength; 99 v[2] *= ilength;
@@ -110,7 +113,7 @@ static inline float VectorNormalize (vec3_t v)
110 v[1] *= ilength; 113 v[1] *= ilength;
111 v[2] *= ilength; 114 v[2] *= ilength;
112 } 115 }
113 116
114 return length; 117 return length;
115 118
116} 119}
diff --git a/apps/plugins/sdl/progs/quake/net.h b/apps/plugins/sdl/progs/quake/net.h
index 813472c0c6..6b6be3d36e 100644
--- a/apps/plugins/sdl/progs/quake/net.h
+++ b/apps/plugins/sdl/progs/quake/net.h
@@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
8 8
9This program is distributed in the hope that it will be useful, 9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of 10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 12
13See the GNU General Public License for more details. 13See the GNU General Public License for more details.
14 14
@@ -126,7 +126,7 @@ typedef struct qsocket_s
126 qboolean disconnected; 126 qboolean disconnected;
127 qboolean canSend; 127 qboolean canSend;
128 qboolean sendNext; 128 qboolean sendNext;
129 129
130 int driver; 130 int driver;
131 int landriver; 131 int landriver;
132 int socket; 132 int socket;
@@ -314,7 +314,7 @@ typedef struct _PollProcedure
314{ 314{
315 struct _PollProcedure *next; 315 struct _PollProcedure *next;
316 double nextTime; 316 double nextTime;
317 void (*procedure)(); 317 void (*procedure)(void *);
318 void *arg; 318 void *arg;
319} PollProcedure; 319} PollProcedure;
320 320
diff --git a/apps/plugins/sdl/progs/quake/server.h b/apps/plugins/sdl/progs/quake/server.h
index 5fe33deca0..c0d879ec7d 100644
--- a/apps/plugins/sdl/progs/quake/server.h
+++ b/apps/plugins/sdl/progs/quake/server.h
@@ -250,7 +250,7 @@ void SV_MoveToGoal (void);
250 250
251void SV_CheckForNewClients (void); 251void SV_CheckForNewClients (void);
252void SV_RunClients (void); 252void SV_RunClients (void);
253void SV_SaveSpawnparms (); 253void SV_SaveSpawnparms (void);
254#ifdef QUAKE2 254#ifdef QUAKE2
255void SV_SpawnServer (char *server, char *startspot); 255void SV_SpawnServer (char *server, char *startspot);
256#else 256#else