- lotsofstuff

This commit is contained in:
Christoph Oelckers 2020-05-06 09:56:13 +02:00
parent c11963b41a
commit 754c8bd9c1
5 changed files with 48 additions and 14 deletions

View file

@ -730,7 +730,7 @@ int movesprite(short spritenum, int xchange, int ychange, int zchange, unsigned
//
//---------------------------------------------------------------------------
short ssp(short i, unsigned int cliptype) //The set sprite function
int ssp(short i, unsigned int cliptype) //The set sprite function
{
spritetype* s;
int movetype;
@ -745,6 +745,42 @@ short ssp(short i, unsigned int cliptype) //The set sprite function
return (movetype == 0);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void insertspriteq(int i)
{
if (spriteqamount > 0)
{
if (spriteq[spriteqloc] >= 0)
sprite[spriteq[spriteqloc]].xrepeat = 0;
spriteq[spriteqloc] = i;
spriteqloc = (spriteqloc + 1) % spriteqamount;
}
else sprite[i].xrepeat = sprite[i].yrepeat = 0;
}
//---------------------------------------------------------------------------
//
// consolidation of several nearly identical functions
// lotsofmoney -> MONEY
// lotsofmail -> MAIL
// lotsofpaper -> PAPER
//
//---------------------------------------------------------------------------
void lotsofstuff(spritetype* s, short n, int spawntype)
{
short i, j;
for (i = n; i > 0; i--)
{
j = EGS(s->sectnum, s->x, s->y, s->z - (krand() % (47 << 8)), spawntype, -32, 8, 8, krand() & 2047, 0, 0, 0, 5);
sprite[j].cstat = krand() & 12;
}
}
//---------------------------------------------------------------------------
//

View file

@ -313,11 +313,11 @@ ACTOR_INLINE int A_CheckEnemyTile(int const tileNum)
return ((g_tile[tileNum].flags & (SFLAG_BADGUY_TILE | SFLAG_BADGUY)) != 0);
}
int ssp(short i, unsigned int cliptype); //The set sprite function
ACTOR_INLINE int A_SetSprite(int const spriteNum, uint32_t cliptype)
{
vec3_t davect = { (sprite[spriteNum].xvel * (sintable[(sprite[spriteNum].ang + 512) & 2047])) >> 14,
(sprite[spriteNum].xvel * (sintable[sprite[spriteNum].ang & 2047])) >> 14, sprite[spriteNum].zvel };
return (A_MoveSprite(spriteNum, &davect, cliptype) == 0);
return ssp(spriteNum, cliptype);
}
# endif

View file

@ -187,18 +187,11 @@ void A_DeleteSprite(int spriteNum)
deletesprite(spriteNum);
}
void insertspriteq(int i);
void A_AddToDeleteQueue(int spriteNum)
{
if (g_deleteQueueSize == 0)
{
A_DeleteSprite(spriteNum);
return;
}
if (SpriteDeletionQueue[g_spriteDeleteQueuePos] >= 0)
sprite[SpriteDeletionQueue[g_spriteDeleteQueuePos]].xrepeat = 0;
SpriteDeletionQueue[g_spriteDeleteQueuePos] = spriteNum;
g_spriteDeleteQueuePos = (g_spriteDeleteQueuePos+1)%g_deleteQueueSize;
insertspriteq(spriteNum);
}
void A_SpawnMultiple(int spriteNum, int tileNum, int spawnCnt)

View file

@ -226,6 +226,7 @@ extern int32_t voting;
int32_t A_CheckInventorySprite(spritetype *s);
int32_t A_InsertSprite(int16_t whatsect, int32_t s_x, int32_t s_y, int32_t s_z, int16_t s_pn, int8_t s_s, uint8_t s_xr,
uint8_t s_yr, int16_t s_a, int16_t s_ve, int16_t s_zv, int16_t s_ow, int16_t s_ss);
#define EGS A_InsertSprite
int A_Spawn(int spriteNum,int tileNum);
int G_DoMoveThings(void);
//int32_t G_EndOfLevel(void);

View file

@ -320,6 +320,10 @@ struct psaccess
};
extern psaccess ps;
#define spriteqamount g_deleteQueueSize
#define spriteq SpriteDeletionQueue
#define spriteqloc g_spriteDeleteQueuePos
END_DUKE_NS
#endif