summaryrefslogtreecommitdiff
path: root/games/kapooka/patches/patch-ab
blob: 97336c7ed2c681f1a580f1b4609f43f4cdb7dd8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$NetBSD: patch-ab,v 1.1 2004/11/29 20:16:59 wiz Exp $

--- helpers.c.orig	2004-10-20 21:40:31.000000000 +0200
+++ helpers.c
@@ -63,6 +63,8 @@ void HLP_UpdateSinWave(HLP_Wave *_wave)
 // Returns the value wrapped inside the range [min, max] inclusive
 int HLP_Wrap(int x, int min, int max)
 {
+	int diff = max-min;
+
 	#ifdef DEBUG_CHECKS
 	if (min >= max)
 	{
@@ -70,8 +72,6 @@ int HLP_Wrap(int x, int min, int max)
 	}
 	#endif
 
-	int diff = max-min;
-
 	while (x < min)
 	{
 		x += diff;