mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-23 04:11:53 +00:00
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
This commit is contained in:
parent
d38f681655
commit
0fc98d5021
1 changed files with 17 additions and 4 deletions
|
@ -981,6 +981,19 @@ void *Mod_LoadWall(char *name)
|
||||||
if (!wal)
|
if (!wal)
|
||||||
return NULL;
|
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?
|
//FIXME: Is this needed?
|
||||||
oin = in = ReadPCXFile((qbyte *)wal, com_filesize, &width, &height);
|
oin = in = ReadPCXFile((qbyte *)wal, com_filesize, &width, &height);
|
||||||
if (!in)
|
if (!in)
|
||||||
|
@ -1100,15 +1113,15 @@ void *Mod_LoadWall(char *name)
|
||||||
qbyte *out;
|
qbyte *out;
|
||||||
|
|
||||||
tex = Hunk_AllocName(sizeof(texture_t) + wal->width*r_pixbytes*wal->height/64*85, ln);
|
tex = Hunk_AllocName(sizeof(texture_t) + wal->width*r_pixbytes*wal->height/64*85, ln);
|
||||||
tex->width = LittleLong(wal->width);
|
tex->width = wal->width;
|
||||||
tex->height = LittleLong(wal->height);
|
tex->height = wal->height;
|
||||||
|
|
||||||
tex->pixbytes = r_pixbytes;
|
tex->pixbytes = r_pixbytes;
|
||||||
for (i = 0; i < MIPLEVELS; i++)
|
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);
|
out = (qbyte *)(tex+1);
|
||||||
in = (qbyte *)wal+LittleLong(wal->offsets[0]);
|
in = (qbyte *)wal+wal->offsets[0];
|
||||||
|
|
||||||
if (tex->pixbytes == 4)
|
if (tex->pixbytes == 4)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue