SW: picanm_t

git-svn-id: https://svn.eduke32.com/eduke32@5203 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-05-19 22:01:44 +00:00
parent a97d9c5916
commit 908560f9aa
4 changed files with 29 additions and 35 deletions

View file

@ -662,9 +662,9 @@ precache(void)
SET(gotpic[j>>3], 1<<(j&7)); SET(gotpic[j>>3], 1<<(j&7));
if (TEST(picanm[j],TILE_ANIM_TYPE)) if (TEST(picanm[j].sf, PICANM_ANIMTYPE_MASK) >> PICANM_ANIMTYPE_SHIFT)
{ {
for (i = 1; i <= TEST(picanm[j],TILE_ANIM_NUM); i++) for (i = 1; i <= picanm[j].num; i++)
{ {
SET(gotpic[(j+i)>>3], 1<<((j+i)&7)); SET(gotpic[(j+i)>>3], 1<<((j+i)&7));
} }
@ -674,9 +674,9 @@ precache(void)
SET(gotpic[j>>3], 1<<(j&7)); SET(gotpic[j>>3], 1<<(j&7));
if (TEST(picanm[j],TILE_ANIM_TYPE)) if (TEST(picanm[j].sf, PICANM_ANIMTYPE_MASK) >> PICANM_ANIMTYPE_SHIFT)
{ {
for (i = 1; i <= TEST(picanm[j],TILE_ANIM_NUM); i++) for (i = 1; i <= picanm[j].num; i++)
{ {
SET(gotpic[(j+i)>>3], 1<<((j+i)&7)); SET(gotpic[(j+i)>>3], 1<<((j+i)&7));
} }
@ -690,9 +690,9 @@ precache(void)
SET(gotpic[j>>3], 1<<(j&7)); SET(gotpic[j>>3], 1<<(j&7));
if (TEST(picanm[j],TILE_ANIM_TYPE)) if (TEST(picanm[j].sf, PICANM_ANIMTYPE_MASK) >> PICANM_ANIMTYPE_SHIFT)
{ {
for (i = 1; i <= TEST(picanm[j],TILE_ANIM_NUM); i++) for (i = 1; i <= picanm[j].num; i++)
{ {
SET(gotpic[(j+i)>>3], 1<<((j+i)&7)); SET(gotpic[(j+i)>>3], 1<<((j+i)&7));
} }
@ -703,9 +703,9 @@ precache(void)
j = wp->overpicnum; j = wp->overpicnum;
SET(gotpic[j>>3], 1<<(j&7)); SET(gotpic[j>>3], 1<<(j&7));
if (TEST(picanm[j],TILE_ANIM_TYPE)) if (TEST(picanm[j].sf, PICANM_ANIMTYPE_MASK) >> PICANM_ANIMTYPE_SHIFT)
{ {
for (i = 1; i <= TEST(picanm[j],TILE_ANIM_NUM); i++) for (i = 1; i <= picanm[j].num; i++)
{ {
SET(gotpic[(j+i)>>3], 1<<((j+i)&7)); SET(gotpic[(j+i)>>3], 1<<((j+i)&7));
} }

View file

@ -5719,7 +5719,7 @@ SHOWSPRITE:
x1 = sprx; x1 = sprx;
y1 = spry; y1 = spry;
tilenum = spr->picnum; tilenum = spr->picnum;
xoff = (int)((signed char)((picanm[tilenum] >> 8) & 255)) + ((int) spr->xoffset); xoff = (int)picanm[tilenum].xofs + (int)spr->xoffset;
if ((spr->cstat & 4) > 0) if ((spr->cstat & 4) > 0)
xoff = -xoff; xoff = -xoff;
k = spr->ang; k = spr->ang;
@ -5751,8 +5751,8 @@ SHOWSPRITE:
if (dimensionmode == 5) if (dimensionmode == 5)
{ {
tilenum = spr->picnum; tilenum = spr->picnum;
xoff = (int)((signed char)((picanm[tilenum] >> 8) & 255)) + ((int) spr->xoffset); xoff = (int)picanm[tilenum].xofs + (int)spr->xoffset;
yoff = (int)((signed char)((picanm[tilenum] >> 16) & 255)) + ((int) spr->yoffset); yoff = (int)picanm[tilenum].yofs + (int)spr->yoffset;
if ((spr->cstat & 4) > 0) if ((spr->cstat & 4) > 0)
xoff = -xoff; xoff = -xoff;
if ((spr->cstat & 8) > 0) if ((spr->cstat & 8) > 0)

View file

@ -125,7 +125,7 @@ int krand1(void);
// Map directions/degrees // Map directions/degrees
// //
#if FALSE #if 0
y-- y--
^ 1536 ^ 1536
| |
@ -453,12 +453,12 @@ int StdRandomRange(int range);
// x & y offset of tile // x & y offset of tile
#define TILE_XOFF(picnum) ((int8_t)TEST(picanm[(picnum)] >> 8, 0xFF)) #define TILE_XOFF(picnum) (picanm[(picnum)].xofs)
#define TILE_YOFF(picnum) ((int8_t)TEST(picanm[(picnum)] >> 16, 0xFF)) #define TILE_YOFF(picnum) (picanm[(picnum)].yofs)
// x & y offset of current sprite tile // x & y offset of current sprite tile
#define SPRITEp_XOFF(sp) ((int8_t)TEST(picanm[(sp)->picnum] >> 8, 0xFF)) #define SPRITEp_XOFF(sp) (picanm[(sp)->picnum].xofs)
#define SPRITEp_YOFF(sp) ((int8_t)TEST(picanm[(sp)->picnum] >> 16, 0xFF)) #define SPRITEp_YOFF(sp) (picanm[(sp)->picnum].yofs)
// Z size of top (TOS) and bottom (BOS) part of sprite // Z size of top (TOS) and bottom (BOS) part of sprite
#define SPRITEp_SIZE_TOS(sp) (DIV2(SPRITEp_SIZE_Z(sp)) + Z(SPRITEp_YOFF(sp))) #define SPRITEp_SIZE_TOS(sp) (DIV2(SPRITEp_SIZE_Z(sp)) + Z(SPRITEp_YOFF(sp)))
@ -681,12 +681,6 @@ int StdRandomRange(int range);
) )
// break up of picanm[]
#define TILE_ANIM_NUM (0xF|BIT(4)|BIT(5))
#define TILE_ANIM_TYPE (BIT(6)|BIT(7))
#define TILE_SPEED (0xF << 20)
#define SIZ(array) (sizeof(array)/sizeof(array[0])) #define SIZ(array) (sizeof(array)/sizeof(array[0]))

View file

@ -963,7 +963,7 @@ void
PicAnimOff(short picnum) PicAnimOff(short picnum)
{ {
int i; int i;
short anim_type = TEST(picanm[picnum], TILE_ANIM_TYPE); short anim_type = TEST(picanm[picnum].sf, PICANM_ANIMTYPE_MASK) >> PICANM_ANIMTYPE_SHIFT;
short num; short num;
ASSERT(picnum >= 0 && picnum < MAXTILES); ASSERT(picnum >= 0 && picnum < MAXTILES);
@ -972,16 +972,16 @@ PicAnimOff(short picnum)
return; return;
/* /*
num = TEST(picanm[picnum], TILE_ANIM_NUM); num = picanm[picnum].num;
ASSERT(num < 20); ASSERT(num < 20);
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
RESET(picanm[picnum + i], TILE_ANIM_TYPE); RESET(picanm[picnum + i].sf, PICANM_ANIMTYPE_MASK);
} }
*/ */
RESET(picanm[picnum], TILE_ANIM_TYPE); RESET(picanm[picnum].sf, PICANM_ANIMTYPE_MASK);
} }
SWBOOL SWBOOL
@ -3126,8 +3126,8 @@ KeyMain:
ChangeState(SpriteNum, s_Key[num]); ChangeState(SpriteNum, s_Key[num]);
RESET(picanm[sp->picnum], TILE_ANIM_TYPE); RESET(picanm[sp->picnum].sf, PICANM_ANIMTYPE_MASK);
RESET(picanm[sp->picnum + 1], TILE_ANIM_TYPE); RESET(picanm[sp->picnum + 1].sf, PICANM_ANIMTYPE_MASK);
change_sprite_stat(SpriteNum, STAT_ITEM); change_sprite_stat(SpriteNum, STAT_ITEM);
RESET(sp->cstat, CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN); RESET(sp->cstat, CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
u->Radius = 500; u->Radius = 500;
@ -3161,8 +3161,8 @@ KeyStatueMain:
u->spal = sp->pal; u->spal = sp->pal;
ChangeState(SpriteNum, s_KeyStatue[num]); ChangeState(SpriteNum, s_KeyStatue[num]);
RESET(picanm[sp->picnum], TILE_ANIM_TYPE); RESET(picanm[sp->picnum].sf, PICANM_ANIMTYPE_MASK);
RESET(picanm[sp->picnum + 1], TILE_ANIM_TYPE); RESET(picanm[sp->picnum + 1].sf, PICANM_ANIMTYPE_MASK);
change_sprite_stat(SpriteNum, STAT_ITEM); change_sprite_stat(SpriteNum, STAT_ITEM);
@ -4595,8 +4595,8 @@ int SpawnItemsMatch(short match)
ChangeState(SpriteNum, s_Key[num]); ChangeState(SpriteNum, s_Key[num]);
RESET(picanm[sp->picnum], TILE_ANIM_TYPE); RESET(picanm[sp->picnum].sf, PICANM_ANIMTYPE_MASK);
RESET(picanm[sp->picnum + 1], TILE_ANIM_TYPE); RESET(picanm[sp->picnum + 1].sf, PICANM_ANIMTYPE_MASK);
SetupItemForJump(sip, SpriteNum); SetupItemForJump(sip, SpriteNum);
@ -4640,7 +4640,7 @@ NewStateGroup(short SpriteNum, STATEp StateGroup[])
// turn anims off because people keep setting them in the // turn anims off because people keep setting them in the
// art file // art file
RESET(picanm[sprite[SpriteNum].picnum], TILE_ANIM_TYPE); RESET(picanm[sprite[SpriteNum].picnum].sf, PICANM_ANIMTYPE_MASK);
return 0; return 0;
} }
@ -4759,8 +4759,8 @@ getzrangepoint(int x, int y, int z, short sectnum,
// Calculate and store centering offset information into xoff&yoff // Calculate and store centering offset information into xoff&yoff
tilenum = spr->picnum; tilenum = spr->picnum;
xoff = (int)((signed char)((picanm[tilenum] >> 8) & 255)) + ((int) spr->xoffset); xoff = (int)picanm[tilenum].xofs + (int)spr->xoffset;
yoff = (int)((signed char)((picanm[tilenum] >> 16) & 255)) + ((int) spr->yoffset); yoff = (int)picanm[tilenum].yofs + (int)spr->yoffset;
if (cstat & 4) if (cstat & 4)
xoff = -xoff; xoff = -xoff;
if (cstat & 8) if (cstat & 8)