mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-29 04:50:42 +00:00
- lotsofstuff
This commit is contained in:
parent
c11963b41a
commit
754c8bd9c1
5 changed files with 48 additions and 14 deletions
|
@ -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;
|
spritetype* s;
|
||||||
int movetype;
|
int movetype;
|
||||||
|
@ -745,6 +745,42 @@ short ssp(short i, unsigned int cliptype) //The set sprite function
|
||||||
return (movetype == 0);
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
|
|
|
@ -313,11 +313,11 @@ ACTOR_INLINE int A_CheckEnemyTile(int const tileNum)
|
||||||
return ((g_tile[tileNum].flags & (SFLAG_BADGUY_TILE | SFLAG_BADGUY)) != 0);
|
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)
|
ACTOR_INLINE int A_SetSprite(int const spriteNum, uint32_t cliptype)
|
||||||
{
|
{
|
||||||
vec3_t davect = { (sprite[spriteNum].xvel * (sintable[(sprite[spriteNum].ang + 512) & 2047])) >> 14,
|
return ssp(spriteNum, cliptype);
|
||||||
(sprite[spriteNum].xvel * (sintable[sprite[spriteNum].ang & 2047])) >> 14, sprite[spriteNum].zvel };
|
|
||||||
return (A_MoveSprite(spriteNum, &davect, cliptype) == 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
|
|
@ -187,18 +187,11 @@ void A_DeleteSprite(int spriteNum)
|
||||||
deletesprite(spriteNum);
|
deletesprite(spriteNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void insertspriteq(int i);
|
||||||
|
|
||||||
void A_AddToDeleteQueue(int spriteNum)
|
void A_AddToDeleteQueue(int spriteNum)
|
||||||
{
|
{
|
||||||
if (g_deleteQueueSize == 0)
|
insertspriteq(spriteNum);
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void A_SpawnMultiple(int spriteNum, int tileNum, int spawnCnt)
|
void A_SpawnMultiple(int spriteNum, int tileNum, int spawnCnt)
|
||||||
|
|
|
@ -226,6 +226,7 @@ extern int32_t voting;
|
||||||
int32_t A_CheckInventorySprite(spritetype *s);
|
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,
|
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);
|
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 A_Spawn(int spriteNum,int tileNum);
|
||||||
int G_DoMoveThings(void);
|
int G_DoMoveThings(void);
|
||||||
//int32_t G_EndOfLevel(void);
|
//int32_t G_EndOfLevel(void);
|
||||||
|
|
|
@ -320,6 +320,10 @@ struct psaccess
|
||||||
};
|
};
|
||||||
extern psaccess ps;
|
extern psaccess ps;
|
||||||
|
|
||||||
|
#define spriteqamount g_deleteQueueSize
|
||||||
|
#define spriteq SpriteDeletionQueue
|
||||||
|
#define spriteqloc g_spriteDeleteQueuePos
|
||||||
|
|
||||||
END_DUKE_NS
|
END_DUKE_NS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue