Skip to content

Commit

Permalink
Don't modify offsets if ANY sprites were merged
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Dec 29, 2014
1 parent 0a0b0d1 commit 5ed8dd0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
2 changes: 2 additions & 0 deletions src/doomstat.c
Expand Up @@ -47,6 +47,8 @@ char *gamedescription;
boolean nerve = false;
boolean bfgedition = false;

boolean mergedsprites = false;

boolean chex = false;
boolean chexdeh = false;
boolean hacx = false;
Expand Down
2 changes: 2 additions & 0 deletions src/doomstat.h
Expand Up @@ -90,6 +90,8 @@ extern int gamemap;
extern boolean nerve;
extern boolean bfgedition;

extern boolean mergedsprites;

extern boolean chex;
extern boolean chexdeh;
extern boolean hacx;
Expand Down
6 changes: 3 additions & 3 deletions src/r_data.c
Expand Up @@ -807,18 +807,18 @@ void R_InitSpriteLumps(void)
{
int j = 0;

while (sproffsets[j].name[0])
if (!mergedsprites || BTSX)
{
if (sproffsets[j].canmodify || BTSX)
while (sproffsets[j].name[0])
{
if (i == W_CheckNumForName(sproffsets[j].name) - firstspritelump)
{
spriteoffset[i] = SHORT(sproffsets[j].x) << FRACBITS;
spritetopoffset[i] = SHORT(sproffsets[j].y) << FRACBITS;
break;
}
j++;
}
j++;
}
}
}
Expand Down
13 changes: 2 additions & 11 deletions src/w_merge.c
Expand Up @@ -314,17 +314,8 @@ static void GenerateSpriteList(void)
}

AddSpriteLump(lump);
if (i < iwad_sprites.numlumps && lump->size != iwad_sprites.lumps[i].size)
{
int j = 0;

while (sproffsets[j].name[0])
{
if (!strcasecmp(sproffsets[j].name, lump->name))
sproffsets[j].canmodify = false;
j++;
}
}

mergedsprites = true;
}
}

Expand Down

0 comments on commit 5ed8dd0

Please sign in to comment.