summaryrefslogtreecommitdiff
path: root/games/jfsw/patches/jfbuild_src_20051009.patch
blob: 5cf0cb2feb022183a2167abe07ddaff41048b2e8 (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
diff -Nur jfbuild_src_20051009.orig/include/editor.h jfbuild_src_20051009/include/editor.h
--- jfbuild_src_20051009.orig/include/editor.h	2005-10-09 15:23:02.000000000 +0200
+++ jfbuild_src_20051009/include/editor.h	2005-10-10 15:06:18.000000000 +0200
@@ -18,7 +18,7 @@
 
 extern short temppicnum, tempcstat, templotag, temphitag, tempextra;
 extern char tempshade, temppal, tempxrepeat, tempyrepeat;
-extern char somethingintab;
+static char somethingintab;
 
 extern char buildkeys[NUMBUILDKEYS];
 
diff -Nur jfbuild_src_20051009.orig/Makefile jfbuild_src_20051009/Makefile
--- jfbuild_src_20051009.orig/Makefile	2005-10-09 15:23:00.000000000 +0200
+++ jfbuild_src_20051009/Makefile	2005-10-10 15:06:22.000000000 +0200
@@ -27,7 +27,7 @@
 # Debugging options
 #  RELEASE - 1 = no debugging
 #  EFENCE  - 1 = compile with Electric Fence for malloc() debugging
-RELEASE?=0
+RELEASE?=1
 EFENCE?=0
 
 # SDK locations - adjust to match your setup
diff -Nur jfbuild_src_20051009.orig/src/build.c jfbuild_src_20051009/src/build.c
--- jfbuild_src_20051009.orig/src/build.c	2005-10-09 15:23:00.000000000 +0200
+++ jfbuild_src_20051009/src/build.c	2005-10-10 15:06:18.000000000 +0200
@@ -86,7 +86,7 @@
 
 short temppicnum, tempcstat, templotag, temphitag, tempextra;
 char tempshade, temppal, tempvis, tempxrepeat, tempyrepeat;
-char somethingintab = 255;
+static char somethingintab = 255;
 
 static char boardfilename[BMAX_PATH], selectedboardfilename[BMAX_PATH];
 static struct _directoryitem {
diff -Nur jfbuild_src_20051009.orig/src/crc32.c jfbuild_src_20051009/src/crc32.c
--- jfbuild_src_20051009.orig/src/crc32.c	2005-10-09 15:23:00.000000000 +0200
+++ jfbuild_src_20051009/src/crc32.c	2005-10-10 15:06:18.000000000 +0200
@@ -73,16 +73,6 @@
 	}
 }
 
-
-unsigned long crc32(unsigned char *blk, unsigned long len)
-{
-	unsigned long crc;
-	
-	crc32init(&crc);
-	crc32block(&crc, blk, len);
-	return crc32finish(&crc);
-}
-
 void crc32init(unsigned long *crcvar)
 {
 	if (!crcvar) return;
diff -Nur jfbuild_src_20051009.orig/src/sdlayer.c jfbuild_src_20051009/src/sdlayer.c
--- jfbuild_src_20051009.orig/src/sdlayer.c	2005-10-09 15:23:00.000000000 +0200
+++ jfbuild_src_20051009/src/sdlayer.c	2005-10-10 15:06:22.000000000 +0200
@@ -24,6 +24,10 @@
 // undefine to restrict windowed resolutions to conventional sizes
 #define ANY_WINDOWED_SIZE
 
+// fix for mousewheel
+#define MWHEELTICKS 10
+static unsigned long mwheelup, mwheeldown;
+
 int   _buildargc = 1;
 char **_buildargv = NULL;
 extern long app_main(long argc, char *argv[]);
@@ -486,8 +490,8 @@
 	initprintf("Initialising mouse\n");
 
 	// grab input
-	grabmouse(1);
 	moustat=1;
+	grabmouse(1);
 
 	return 0;
 }
@@ -1363,14 +1367,22 @@
 					case SDL_BUTTON_LEFT: j = 0; break;
 					case SDL_BUTTON_RIGHT: j = 1; break;
 					case SDL_BUTTON_MIDDLE: j = 2; break;
-					default: j = -1; break;
+					default: j = ev.button.button; break;
 				}
 				if (j<0) break;
 				
-				if (ev.button.state == SDL_PRESSED)
+				if (ev.button.state == SDL_PRESSED) {
+					if (ev.button.button == SDL_BUTTON_WHEELUP) {
+						mwheelup = totalclock;
+					}
+					if (ev.button.button == SDL_BUTTON_WHEELDOWN) {
+						mwheeldown = totalclock;
+					}
 					mouseb |= (1<<j);
-				else
-					mouseb &= ~(1<<j);
+				}
+				else {
+					if (j < 4) mouseb &= ~(1<<j);
+				}
 
 				if (mousepresscallback)
 					mousepresscallback(j+1, ev.button.state == SDL_PRESSED);
@@ -1435,6 +1447,17 @@
 
 	sampletimer();
 
+	if (moustat) {
+		if ((mwheelup) && (mwheelup <= (totalclock - MWHEELTICKS))) {
+			mouseb &= ~16;
+			mwheelup = 0;
+		}
+		if ((mwheeldown) && (mwheeldown <= (totalclock - MWHEELTICKS))) {
+			mouseb &= ~32;
+			mwheeldown = 0;
+		}
+	}
+
 #ifdef HAVE_GTK2
 	if (gtkenabled) update_startwin();
 #endif