Split r3159..r3161, part 4: Tweaks of tiledata_t's "cacherange" member.

REM: This will need a savegame version bump.

git-svn-id: https://svn.eduke32.com/eduke32@3169 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-11-15 14:28:00 +00:00
parent 9dd3748b03
commit f7eb5adb40
3 changed files with 10 additions and 14 deletions

View file

@ -172,7 +172,7 @@ typedef struct {
uint32_t flags; // formerly SpriteFlags, ActorType uint32_t flags; // formerly SpriteFlags, ActorType
int16_t cacherange[2]; // formerly SpriteCache int16_t cacherange; // formerly SpriteCache
// todo: make this a pointer and allocate at runtime // todo: make this a pointer and allocate at runtime
projectile_t defproj; projectile_t defproj;

View file

@ -4147,7 +4147,6 @@ static int32_t C_ParseCommand(int32_t loop)
g_tile[*g_scriptPtr].flags |= SPRITE_NOPAL; g_tile[*g_scriptPtr].flags |= SPRITE_NOPAL;
break; break;
case CON_PRECACHE: case CON_PRECACHE:
g_tile[*g_scriptPtr].flags |= SPRITE_CACHE;
C_GetNextValue(LABEL_DEFINE); C_GetNextValue(LABEL_DEFINE);
g_scriptPtr--; g_scriptPtr--;
i = *g_scriptPtr; i = *g_scriptPtr;
@ -4156,16 +4155,13 @@ static int32_t C_ParseCommand(int32_t loop)
C_ReportError(ERROR_EXCEEDSMAXTILES); C_ReportError(ERROR_EXCEEDSMAXTILES);
g_numCompilerErrors++; g_numCompilerErrors++;
} }
g_tile[j].cacherange[0] = i; g_tile[j].cacherange = i;
C_GetNextValue(LABEL_DEFINE); C_GetNextValue(LABEL_DEFINE);
g_scriptPtr--; g_scriptPtr--;
i = *g_scriptPtr; if (*g_scriptPtr)
if ((unsigned)i >= MAXTILES) g_tile[j].flags |= SPRITE_CACHE;
{
C_ReportError(ERROR_EXCEEDSMAXTILES);
g_numCompilerErrors++;
}
g_tile[j].cacherange[1] = i;
break; break;
} }
continue; continue;

View file

@ -88,8 +88,8 @@ static void G_CacheSpriteNum(int32_t i)
maxc = 1; maxc = 1;
if (A_CheckSpriteTileFlags(PN, SPRITE_CACHE) && g_tile[PN].cacherange[1]) if (g_tile[PN].cacherange >= PN)
for (j = g_tile[PN].cacherange[0]; j <= g_tile[PN].cacherange[1]; j++) for (j = PN; j <= g_tile[PN].cacherange; j++)
tloadtile(j,1); tloadtile(j,1);
switch (DYNAMICTILEMAP(PN)) switch (DYNAMICTILEMAP(PN))
@ -227,8 +227,8 @@ static void G_PrecacheSprites(void)
if (g_tile[i].flags & SPRITE_PROJECTILE) if (g_tile[i].flags & SPRITE_PROJECTILE)
tloadtile(i,1); tloadtile(i,1);
if (A_CheckSpriteTileFlags(i, SPRITE_CACHE) && g_tile[i].cacherange[1]) if (A_CheckSpriteTileFlags(i, SPRITE_CACHE))
for (j = g_tile[i].cacherange[0]; j <= g_tile[i].cacherange[1]; j++) for (j = i; j <= g_tile[i].cacherange; j++)
tloadtile(j,1); tloadtile(j,1);
} }
tloadtile(BOTTOMSTATUSBAR,1); tloadtile(BOTTOMSTATUSBAR,1);