From d71040af7a8de26ea67ba8df1ff4a418f3207730 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 9 Apr 2006 15:35:50 +0000 Subject: [PATCH] Fixes halflife sprites on big-endian machines. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2185 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_model.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/gl/gl_model.c b/engine/gl/gl_model.c index 391b5a73c..5bf074218 100644 --- a/engine/gl/gl_model.c +++ b/engine/gl/gl_model.c @@ -3013,7 +3013,7 @@ qboolean GLMod_LoadSpriteModel (model_t *mod, void *buffer) sptype = LittleLong (pin->type); - if (pin->version == SPRITEHL_VERSION) + if (LittleLong(pin->version) == SPRITEHL_VERSION) { pin = (dsprite_t*)((char*)pin + 4); rendertype = LittleLong (pin->type); @@ -3044,7 +3044,7 @@ qboolean GLMod_LoadSpriteModel (model_t *mod, void *buffer) int i; short *numi = (short*)(pin+1); unsigned char *src = (unsigned char *)(numi+1); - if (*numi != 256) + if (LittleShort(*numi) != 256) { Con_Printf(S_ERROR "%s has wrong number of palette indexes (we only support 256)\n", mod->name); Hunk_FreeToLowMark(hunkstart);