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;rowtesselation;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;rowtesselation;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