diff --git a/CHANGELOG b/CHANGELOG index ca14fd52..8ef72304 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,8 @@ Quake II 4.03 to 4.10 - Reenable support for gamma via SDL, since the upstream bug was fixed with SDL 1.2.15. Gamma via X11 can be forced by defining X11GAMMA at compile time. +- Add support for big endian architectures and enable + the build on SPARC64 CPUs. (by Kieron Gillespie) Quake II 4.02 to 4.03 - Fix wrong function call in the Quake II file system. diff --git a/Makefile b/Makefile index b4647039..50a0c9e0 100644 --- a/Makefile +++ b/Makefile @@ -30,9 +30,11 @@ ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/amd64/x86_64/) # (You'll need some #ifdef for your unsupported plattform!) ifneq ($(ARCH),i386) ifneq ($(ARCH),x86_64) +ifneq ($(ARCH),sparc64) $(error arch $(ARCH) is currently not supported) endif endif +endif # ---------- diff --git a/src/common/header/common.h b/src/common/header/common.h index f7ad6d18..6da64c1d 100644 --- a/src/common/header/common.h +++ b/src/common/header/common.h @@ -32,7 +32,7 @@ #include "shared.h" #include "crc.h" -#define VERSION 4.03 +#define VERSION 4.10 #define BASEDIRNAME "baseq2" #if defined __linux__ @@ -47,6 +47,8 @@ #define CPUSTRING "i386" #elif defined __x86_64__ #define CPUSTRING "amd64" +#elif defined __sparc__ +#define CPUSTRING "sparc64" #else #define CPUSTRING "Unknown" #endif diff --git a/src/common/model/cm_areaportals.c b/src/common/model/cm_areaportals.c index d6781771..4e8e3bf5 100644 --- a/src/common/model/cm_areaportals.c +++ b/src/common/model/cm_areaportals.c @@ -48,8 +48,8 @@ void FloodArea_r (carea_t *area, int floodnum) for (i=0 ; inumareaportals ; i++, p++) { - if (portalopen[p->portalnum]) - FloodArea_r (&map_areas[p->otherarea], floodnum); + if (portalopen[LittleLong(p->portalnum)]) + FloodArea_r (&map_areas[LittleLong(p->otherarea)], floodnum); } } diff --git a/src/common/model/cm_vis.c b/src/common/model/cm_vis.c index 6977be1d..47263a04 100644 --- a/src/common/model/cm_vis.c +++ b/src/common/model/cm_vis.c @@ -87,7 +87,7 @@ byte *CM_ClusterPVS (int cluster) memset (pvsrow, 0, (numclusters+7)>>3); else - CM_DecompressVis (map_visibility + map_vis->bitofs[cluster][DVIS_PVS], pvsrow); + CM_DecompressVis (map_visibility + LittleLong(map_vis->bitofs[cluster][DVIS_PVS]), pvsrow); return pvsrow; } @@ -98,7 +98,7 @@ byte *CM_ClusterPHS (int cluster) memset (phsrow, 0, (numclusters+7)>>3); else - CM_DecompressVis (map_visibility + map_vis->bitofs[cluster][DVIS_PHS], phsrow); + CM_DecompressVis (map_visibility + LittleLong(map_vis->bitofs[cluster][DVIS_PHS]), phsrow); return phsrow; } diff --git a/src/common/shared/shared.c b/src/common/shared/shared.c index e4f22065..9d1a2974 100644 --- a/src/common/shared/shared.c +++ b/src/common/shared/shared.c @@ -791,8 +791,8 @@ BigShort(short l) short LittleShort(short l) -{return - _LittleShort(l); +{ + return _LittleShort(l); } int @@ -904,6 +904,9 @@ Swap_Init(void) _BigFloat = FloatNoSwap; _LittleFloat = FloatSwap; } + + if (LittleShort(*(short *)swaptest) != 1) + assert("Error in the endian conversion!"); } /* diff --git a/src/game/savegame/savegame.c b/src/game/savegame/savegame.c index fcc47233..743f5a2d 100644 --- a/src/game/savegame/savegame.c +++ b/src/game/savegame/savegame.c @@ -96,6 +96,8 @@ #define ARCH "i386" #elif defined(__x86_64__) #define ARCH "amd64" +#elif defined(__sparc__) + #define ARCH "sparc64" #else #define ARCH "unknown" #endif diff --git a/src/refresh/r_main.c b/src/refresh/r_main.c index c6105b22..3186e413 100644 --- a/src/refresh/r_main.c +++ b/src/refresh/r_main.c @@ -500,7 +500,7 @@ R_DrawParticles ( void ) qglEnable( GL_BLEND ); qglDisable( GL_TEXTURE_2D ); - qglPointSize( gl_particle_size->value ); + qglPointSize( LittleFloat(gl_particle_size->value) ); qglBegin( GL_POINTS );