mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-31 21:20:39 +00:00
- turned some macros into functions.
This commit is contained in:
parent
64e812bd33
commit
96ebfe808c
2 changed files with 26 additions and 14 deletions
|
@ -217,13 +217,6 @@ inline int32_t FIXED(int32_t msw, int32_t lsw)
|
||||||
#define SET_SP_TAG13(sp,val) (*((short*)&(sp)->xoffset)) = LittleShort((short)val)
|
#define SET_SP_TAG13(sp,val) (*((short*)&(sp)->xoffset)) = LittleShort((short)val)
|
||||||
#define SET_SP_TAG14(sp,val) (*((short*)&(sp)->xrepeat)) = LittleShort((short)val)
|
#define SET_SP_TAG14(sp,val) (*((short*)&(sp)->xrepeat)) = LittleShort((short)val)
|
||||||
|
|
||||||
// OVER and UNDER water macros
|
|
||||||
#define SpriteInDiveArea(sp) (TEST(sector[(sp)->sectnum].extra, SECTFX_DIVE_AREA) ? true : false)
|
|
||||||
#define SpriteInUnderwaterArea(sp) (TEST(sector[(sp)->sectnum].extra, SECTFX_UNDERWATER|SECTFX_UNDERWATER2) ? true : false)
|
|
||||||
|
|
||||||
#define SectorIsDiveArea(sect) (TEST(sector[sect].extra, SECTFX_DIVE_AREA) ? true : false)
|
|
||||||
#define SectorIsUnderwaterArea(sect) (TEST(sector[sect].extra, SECTFX_UNDERWATER|SECTFX_UNDERWATER2) ? true : false)
|
|
||||||
|
|
||||||
#define TRAVERSE_CONNECT(i) for (i = connecthead; i != -1; i = connectpoint2[i])
|
#define TRAVERSE_CONNECT(i) for (i = connecthead; i != -1; i = connectpoint2[i])
|
||||||
|
|
||||||
|
|
||||||
|
@ -2205,6 +2198,27 @@ struct GameInterface : public ::GameInterface
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// OVER and UNDER water macros
|
||||||
|
inline bool SpriteInDiveArea(SPRITEp sp)
|
||||||
|
{
|
||||||
|
return (TEST(sector[(sp)->sectnum].extra, SECTFX_DIVE_AREA) ? true : false);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool SpriteInUnderwaterArea(SPRITEp sp)
|
||||||
|
{
|
||||||
|
return (TEST(sector[(sp)->sectnum].extra, SECTFX_UNDERWATER | SECTFX_UNDERWATER2) ? true : false);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool SectorIsDiveArea(int sect)
|
||||||
|
{
|
||||||
|
return (TEST(sector[sect].extra, SECTFX_DIVE_AREA) ? true : false);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool SectorIsUnderwaterArea(int sect)
|
||||||
|
{
|
||||||
|
return (TEST(sector[sect].extra, SECTFX_UNDERWATER | SECTFX_UNDERWATER2) ? true : false);
|
||||||
|
}
|
||||||
|
|
||||||
END_SW_NS
|
END_SW_NS
|
||||||
|
|
||||||
#include "swactor.h"
|
#include "swactor.h"
|
||||||
|
|
|
@ -19866,12 +19866,10 @@ SpawnSmokePuff(DSWActor* actor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int DoBubble(DSWActor* actor)
|
||||||
DoBubble(DSWActor* actor)
|
|
||||||
{
|
{
|
||||||
USER* u = actor->u();
|
USER* u = actor->u();
|
||||||
int SpriteNum = u->SpriteNum;
|
SPRITEp sp = &actor->s();
|
||||||
SPRITEp sp = &sprite[SpriteNum];
|
|
||||||
|
|
||||||
sp->z -= sp->zvel;
|
sp->z -= sp->zvel;
|
||||||
sp->zvel += 32;
|
sp->zvel += 32;
|
||||||
|
@ -19893,7 +19891,7 @@ DoBubble(DSWActor* actor)
|
||||||
|
|
||||||
if (sp->z < sector[sp->sectnum].ceilingz)
|
if (sp->z < sector[sp->sectnum].ceilingz)
|
||||||
{
|
{
|
||||||
if (SectorIsUnderwaterArea(u->hi_sectp - sector))
|
if (SectorIsUnderwaterArea(int(u->hi_sectp - sector)))
|
||||||
{
|
{
|
||||||
if (!SpriteWarpToSurface(sp))
|
if (!SpriteWarpToSurface(sp))
|
||||||
{
|
{
|
||||||
|
@ -19938,7 +19936,7 @@ DoBubble(DSWActor* actor)
|
||||||
// with the drivables, copy sectors, break sprites, etc
|
// with the drivables, copy sectors, break sprites, etc
|
||||||
void SpriteQueueDelete(DSWActor* actor)
|
void SpriteQueueDelete(DSWActor* actor)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
int SpriteNum = actor->GetSpriteIndex();
|
int SpriteNum = actor->GetSpriteIndex();
|
||||||
|
|
||||||
for (i = 0; i < MAX_STAR_QUEUE; i++)
|
for (i = 0; i < MAX_STAR_QUEUE; i++)
|
||||||
|
@ -19969,7 +19967,7 @@ void SpriteQueueDelete(DSWActor* actor)
|
||||||
|
|
||||||
void QueueReset(void)
|
void QueueReset(void)
|
||||||
{
|
{
|
||||||
short i;
|
size_t i;
|
||||||
StarQueueHead=0;
|
StarQueueHead=0;
|
||||||
HoleQueueHead=0;
|
HoleQueueHead=0;
|
||||||
WallBloodQueueHead=0;
|
WallBloodQueueHead=0;
|
||||||
|
|
Loading…
Reference in a new issue