From 3995f947d3fe73a9f31e6894d6ef7924bc23890e Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 11 Dec 2004 16:44:36 +0000 Subject: [PATCH] Byte swapping. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@631 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_alias.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/engine/gl/gl_alias.c b/engine/gl/gl_alias.c index e035a00eb..56bd5f8f5 100644 --- a/engine/gl/gl_alias.c +++ b/engine/gl/gl_alias.c @@ -2128,7 +2128,11 @@ void GL_LoadQ1Model (model_t *mod, void *buffer) pq1inmodel = (dmdl_t *)buffer; - version = LittleLong (pq1inmodel->version); + seamremap = (int*)pq1inmodel; //I like overloading locals. + for (i = 0; i < sizeof(dmdl_t)/4; i++) + seamremap[i] = LittleLong(seamremap[i]); + + version = pq1inmodel->version; if (version != ALIAS_VERSION) Sys_Error ("%s has wrong version number (%i should be %i)", mod->name, version, ALIAS_VERSION); @@ -2141,7 +2145,7 @@ void GL_LoadQ1Model (model_t *mod, void *buffer) pq1inmodel->skinwidth < 1) Sys_Error("Model %s has an invalid quantity\n", mod->name); - mod->flags = LittleLong (pq1inmodel->flags); + mod->flags = pq1inmodel->flags; size = sizeof(galiasinfo_t) + pq1inmodel->numframes*sizeof(galiasgroup_t) @@ -2269,11 +2273,11 @@ int Mod_ReadFlagsFromMD1(char *name, int md3version) if (!pinmodel) //not found return 0; - if (pinmodel->ident != IDPOLYHEADER) + if (LittleLong(pinmodel->ident) != IDPOLYHEADER) return 0; - if (pinmodel->version != ALIAS_VERSION) + if (LittleLong(pinmodel->version) != ALIAS_VERSION) return 0; - return pinmodel->flags; + return LittleLong(pinmodel->flags); } #ifdef MD2MODELS