From 0fc98d50213ff50b8ebd31041e0d8c1a271e8051 Mon Sep 17 00:00:00 2001 From: Mark Olsen Date: Wed, 18 May 2005 23:52:55 +0000 Subject: [PATCH] Note to self: Do it right the first time next time. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1030 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/gl_q2bsp.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/engine/common/gl_q2bsp.c b/engine/common/gl_q2bsp.c index 38f27e70a..203e508d9 100644 --- a/engine/common/gl_q2bsp.c +++ b/engine/common/gl_q2bsp.c @@ -981,6 +981,19 @@ void *Mod_LoadWall(char *name) if (!wal) return NULL; + wal->width = LittleLong(wal->width); + wal->height = LittleLong(wal->height); + { + int i; + + for (i = 0; i < MIPLEVELS; i++) + wal->offsets[i] = LittleLong(wal->offsets[i]); + } + + wal->flags = LittleLong(wal->flags); + wal->contents = LittleLong(wal->contents); + wal->value = LittleLong(wal->value); + //FIXME: Is this needed? oin = in = ReadPCXFile((qbyte *)wal, com_filesize, &width, &height); if (!in) @@ -1100,15 +1113,15 @@ void *Mod_LoadWall(char *name) qbyte *out; tex = Hunk_AllocName(sizeof(texture_t) + wal->width*r_pixbytes*wal->height/64*85, ln); - tex->width = LittleLong(wal->width); - tex->height = LittleLong(wal->height); + tex->width = wal->width; + tex->height = wal->height; tex->pixbytes = r_pixbytes; for (i = 0; i < MIPLEVELS; i++) - tex->offsets[i] = (LittleLong(wal->offsets[i]) - sizeof(*wal))*tex->pixbytes + sizeof(*tex); + tex->offsets[i] = (wal->offsets[i] - sizeof(*wal))*tex->pixbytes + sizeof(*tex); out = (qbyte *)(tex+1); - in = (qbyte *)wal+LittleLong(wal->offsets[0]); + in = (qbyte *)wal+wal->offsets[0]; if (tex->pixbytes == 4) {