summaryrefslogtreecommitdiff
path: root/games/blobAndConquer/blobandconquer_0.93-2.patch
blob: b9625606bf974a229e372f8d26960e391d77fb8a (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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
diff -Naur blobAndConquer-0.93.orig/icons/blobAndConquer.desktop blobAndConquer-0.93/icons/blobAndConquer.desktop
--- blobAndConquer-0.93.orig/icons/blobAndConquer.desktop	2008-06-01 01:20:49.000000000 -0500
+++ blobAndConquer-0.93/icons/blobAndConquer.desktop	2008-06-01 02:29:30.000000000 -0500
@@ -1,10 +1,9 @@
 [Desktop Entry]
-Version=0.7
-Encoding=UTF-8
-Name=Blob Wars : Blob And Conquer
-GenericName=Game
+Categories=ArcadeGame;Game;
+X-Desktop-File-Install-Version=1.0
+Name=Blob And Conquer
 Comment=Mission and Objective based 3D Action Game
-Type=Application
-Exec=blobAndConquer
 Icon=blobAndConquer
-Categories=Game;ArcadeGame;
+Exec=blobAndConquer
+Terminal=false
+Type=Application
diff -Naur blobAndConquer-0.93.orig/makefile blobAndConquer-0.93/makefile
--- blobAndConquer-0.93.orig/makefile	2008-06-01 01:20:49.000000000 -0500
+++ blobAndConquer-0.93/makefile	2008-06-01 02:29:24.000000000 -0500
@@ -79,7 +79,7 @@
 LOCALE_MO = $(patsubst %.po,%.mo,$(wildcard locale/*.po))
 
 # top-level rule to create the program.
-all: $(PROG) pak
+all: $(PROG)
 
 %.o: %.cpp %.h data/gameDefs/defines.h defs.h headers.h
 	$(CXX) $(CXXFLAGS) -c $<
diff -Naur blobAndConquer-0.93.orig/src/3d/CBSP.h blobAndConquer-0.93/src/3d/CBSP.h
--- blobAndConquer-0.93.orig/src/3d/CBSP.h	2008-06-01 01:20:48.000000000 -0500
+++ blobAndConquer-0.93/src/3d/CBSP.h	2008-06-01 02:29:24.000000000 -0500
@@ -42,18 +42,18 @@
 	kMaxLumps
 };
 
-typedef struct BSPHeader {
+struct BSPHeader {
 	
 	char strID[4];
 	int version;
 };
 
-typedef struct BSPLump {
+struct BSPLump {
 	
 	int offset, length;
 };
 
-typedef struct BSPVertex {
+struct BSPVertex {
 	
 	Vector position;
 	Point textureCoord;
@@ -62,7 +62,7 @@
 	unsigned char color[4];
 };
 
-typedef struct BSPFace {
+struct BSPFace {
 	
 	int textureID, effect, type;
 	int startVertIndex, numOfVerts, meshVertIndex;
@@ -75,18 +75,18 @@
 	int size[2];
 };
 
-typedef struct BSPTexture {
+struct BSPTexture {
 	
 	char strName[64];
 	int flags, contents;
 };
 
-typedef struct BSPLightmap {
+struct BSPLightmap {
 	
 	unsigned char lightmapData[128*128*3];
 };
 
-typedef struct BSPNode {
+struct BSPNode {
 	
 	int plane;
 	int children[2];
@@ -94,7 +94,7 @@
 	Vectori max;
 };
 
-typedef struct BSPLeaf {
+struct BSPLeaf {
 	
 	int cluster, area;
 	Vectori min, max;
@@ -102,53 +102,53 @@
 	int leafBrush, numOfLeafBrushes;
 };
 
-typedef struct BSPBrush {
+struct BSPBrush {
 	
 	int brushSide, numOfBrushSides, textureID;
 };
 
-typedef struct BSPBrushSide {
+struct BSPBrushSide {
 	
 	int plane, textureID;
 };
 
-typedef struct BSPShader {
+struct BSPShader {
 	
 	char strName[64];
 	int brushID, unknown;
 };
 
-typedef struct BSPVisData {
+struct BSPVisData {
 	
 	int numOfClusters, bytesPerCluster;
 	unsigned char *pBitsets;
 };
 
-typedef struct Bitset {
+struct Bitset {
 	
 	unsigned int *bits;
 	int size;
 };
 
-typedef struct BSPBiQuadraticPatch {
+struct BSPBiQuadraticPatch {
 	
 	int *trianglesPerRow;
 	unsigned int **rowIndexPointers, *indices;
 	BSPVertex controlPoints[9], *verts;
 };
 
-typedef struct BSPPatch {
+struct BSPPatch {
 	
 	int textureID, lightmapID;
 	int width, height, numQuadPatches;
 	BSPBiQuadraticPatch *quadPatches;
 };
 
-typedef struct BSPModel {
+struct BSPModel {
 	Vector mins, maxs;
 	int faceIndex, numOfFaces;
 	int brushIndex, numOfBrushes;
-} BSPModel;
+};
 
 typedef union {
 	unsigned char i[sizeof(float)];
diff -Naur blobAndConquer-0.93.orig/src/defs.h blobAndConquer-0.93/src/defs.h
--- blobAndConquer-0.93.orig/src/defs.h	2008-06-01 01:20:48.000000000 -0500
+++ blobAndConquer-0.93/src/defs.h	2008-06-01 02:29:11.000000000 -0500
@@ -337,9 +337,9 @@
 /* ############# debug ################## */
 
 //#if USEPAK
-//	#define debug(x)
+	#define debug(x)
 //#else
-	#define debug(x) {printf("[DEBUG (%d)] ", SDL_GetTicks()); printf x; fflush(stdout);}
+//	#define debug(x) {printf("[DEBUG (%d)] ", SDL_GetTicks()); printf x; fflush(stdout);}
 //#endif
 
 #ifndef IGNORE_FLAGTOKEN_ERRORS
diff -Naur blobAndConquer-0.93.orig/src/game/CGame.h blobAndConquer-0.93/src/game/CGame.h
--- blobAndConquer-0.93.orig/src/game/CGame.h	2008-06-01 01:20:48.000000000 -0500
+++ blobAndConquer-0.93/src/game/CGame.h	2008-06-01 02:29:24.000000000 -0500
@@ -20,7 +20,7 @@
 
 #include "../attributes.h"
 
-typedef struct InfoMessage {
+struct InfoMessage {
 
 	bool redraw;
 	String message;
diff -Naur blobAndConquer-0.93.orig/src/world/bsp.cpp blobAndConquer-0.93/src/world/bsp.cpp
--- blobAndConquer-0.93.orig/src/world/bsp.cpp	2008-06-01 01:20:48.000000000 -0500
+++ blobAndConquer-0.93/src/world/bsp.cpp	2008-06-01 02:29:24.000000000 -0500
@@ -20,9 +20,19 @@
 
 #include "bsp.h"
 
-#define TESSELATION 10
+#if SDL_BYTEORDER != SDL_LIL_ENDIAN
+static float swapBytes(float f)
+{
+	union { float f; uint32_t u; } fu;
 
-float swapBytes(float);
+	fu.f = f;
+	fu.u = SDL_Swap32(fu.u);
+
+	return fu.f;
+}
+#endif
+
+#define TESSELATION 10
 
 TextureSpec *getTextureSpec(const char *basename)
 {
@@ -101,7 +111,7 @@
 
 	if (quadPatch->verts == NULL)
 	{
-		graphics->showErrorAndExit("BSP - Failed to allocate %u bytes for tesselation", (bsp->tesselation + 1) * (bsp->tesselation + 1) * sizeof(BSPVertex));
+		graphics->showErrorAndExit("BSP - Failed to allocate %lu bytes for tesselation", (bsp->tesselation + 1) * (bsp->tesselation + 1) * sizeof(BSPVertex));
 	}
 
 	for (v=0;v<=bsp->tesselation;v++)
@@ -193,7 +203,7 @@
 
 	if (quadPatch->indices == NULL)
 	{
-		graphics->showErrorAndExit("BSP - Failed to allocate %u bytes for indices", bsp->tesselation * (bsp->tesselation + 1) * 2 * sizeof(unsigned int));
+		graphics->showErrorAndExit("BSP - Failed to allocate %lu bytes for indices", bsp->tesselation * (bsp->tesselation + 1) * 2 * sizeof(unsigned int));
 	}
 
 	for (row=0;row<bsp->tesselation;row++)
@@ -211,12 +221,12 @@
 
 	if (quadPatch->trianglesPerRow == NULL)
 	{
-		graphics->showErrorAndExit("BSP - Failed to allocate %d bytes for trianglesPerRow", bsp->tesselation * sizeof(int));
+		graphics->showErrorAndExit("BSP - Failed to allocate %lu bytes for trianglesPerRow", bsp->tesselation * sizeof(int));
 	}
 
 	if (quadPatch->rowIndexPointers == NULL)
 	{
-		graphics->showErrorAndExit("BSP - Failed to allocate %u bytes for rowIndexPointers", bsp->tesselation * sizeof(unsigned int));
+		graphics->showErrorAndExit("BSP - Failed to allocate %lu bytes for rowIndexPointers", bsp->tesselation * sizeof(unsigned int));
 	}
 
 	for (row=0;row<bsp->tesselation;row++)
@@ -369,7 +379,7 @@
 	if (bsp->textures == NULL)
 	{
 
-		graphics->showErrorAndExit("BSP - Failed to allocate %u bytes for textures", bsp->numOfTextures * sizeof(BSPTexture));
+		graphics->showErrorAndExit("BSP - Failed to allocate %lu bytes for textures", bsp->numOfTextures * sizeof(BSPTexture));
 	}
 
 	bsp->textureSpec = (TextureSpec **)malloc(bsp->numOfTextures * sizeof(TextureSpec *));
@@ -377,7 +387,7 @@
 	if (bsp->textureSpec == NULL)
 	{
 
-		graphics->showErrorAndExit("BSP - Failed to allocate %u bytes for texture validation", bsp->numOfTextures * sizeof(TextureSpec));
+		graphics->showErrorAndExit("BSP - Failed to allocate %lu bytes for texture validation", bsp->numOfTextures * sizeof(TextureSpec));
 	}
 
 	buffer += lumps[kTextures].offset;
@@ -834,7 +844,7 @@
 
 		if (bsp->patches == NULL)
 		{
-			printf("Failed to allocate %u bytes for patches\n", bsp->numOfPatches * sizeof(BSPPatch));
+			printf("Failed to allocate %lu bytes for patches\n", bsp->numOfPatches * sizeof(BSPPatch));
 	
 			exit(1);
 		}
@@ -1536,18 +1546,3 @@
 	
 	debug(("loadBSP() :: Done\n"));
 }
-
-float swapBytes(float f)
-{
-	unsigned int i;
-	Convert c1, c2;
-	
-	c1.f = f;
-	
-	for (i=0;i<sizeof(float);i++)
-	{
-		c2.i[sizeof(float) - (i + 1)] = c1.i[i];
-	}
-	
-	return c2.f;
-}