mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-31 21:20:39 +00:00
- tabified more Blood files.
This commit is contained in:
parent
c25641c631
commit
b7d095b943
17 changed files with 4730 additions and 4510 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -35,7 +35,7 @@ enum
|
|||
kAttrRespawn = 0x0010,
|
||||
kAttrFree = 0x0020,
|
||||
kAttrSmoke = 0x0100, // receives tsprite smoke/steam
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
@ -44,63 +44,63 @@ struct AISTATE;
|
|||
|
||||
|
||||
struct MAPSIGNATURE {
|
||||
char signature[4];
|
||||
int16_t version;
|
||||
char signature[4];
|
||||
int16_t version;
|
||||
};
|
||||
|
||||
struct MAPHEADER {
|
||||
int32_t x; // x
|
||||
int32_t y; // y
|
||||
int32_t z; // z
|
||||
int16_t ang; // ang
|
||||
int16_t sect; // sect
|
||||
int16_t pskybits; // pskybits
|
||||
int32_t visibility; // visibility
|
||||
int32_t mattid; // song id, Matt
|
||||
uint8_t parallax; // parallaxtype
|
||||
int32_t revision; // map revision
|
||||
int16_t numsectors; // numsectors
|
||||
int16_t numwalls; // numwalls
|
||||
int16_t numsprites; // numsprites
|
||||
struct MAPHEADER {
|
||||
int32_t x; // x
|
||||
int32_t y; // y
|
||||
int32_t z; // z
|
||||
int16_t ang; // ang
|
||||
int16_t sect; // sect
|
||||
int16_t pskybits; // pskybits
|
||||
int32_t visibility; // visibility
|
||||
int32_t mattid; // song id, Matt
|
||||
uint8_t parallax; // parallaxtype
|
||||
int32_t revision; // map revision
|
||||
int16_t numsectors; // numsectors
|
||||
int16_t numwalls; // numwalls
|
||||
int16_t numsprites; // numsprites
|
||||
};
|
||||
|
||||
struct MAPHEADER2 {
|
||||
char name[64];
|
||||
int numxsprites; // xsprite size
|
||||
int numxwalls; // xwall size
|
||||
int numxsectors; // xsector size
|
||||
uint8_t pad[52];
|
||||
char name[64];
|
||||
int numxsprites; // xsprite size
|
||||
int numxwalls; // xwall size
|
||||
int numxsectors; // xsector size
|
||||
uint8_t pad[52];
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
extern int gVisibility;
|
||||
extern const char *gItemText[];
|
||||
extern const char *gAmmoText[];
|
||||
extern const char *gWeaponText[];
|
||||
extern const char* gItemText[];
|
||||
extern const char* gAmmoText[];
|
||||
extern const char* gWeaponText[];
|
||||
extern int gSkyCount;
|
||||
|
||||
void GetSpriteExtents(spritetypebase const * const pSprite, int *top, int *bottom)
|
||||
void GetSpriteExtents(spritetypebase const* const pSprite, int* top, int* bottom)
|
||||
{
|
||||
*top = *bottom = pSprite->pos.Z;
|
||||
if ((pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_FLOOR)
|
||||
{
|
||||
int height = tileHeight(pSprite->picnum);
|
||||
int center = height / 2 + tileTopOffset(pSprite->picnum);
|
||||
*top -= (pSprite->yrepeat << 2)*center;
|
||||
*bottom += (pSprite->yrepeat << 2)*(height - center);
|
||||
}
|
||||
*top = *bottom = pSprite->pos.Z;
|
||||
if ((pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_FLOOR)
|
||||
{
|
||||
int height = tileHeight(pSprite->picnum);
|
||||
int center = height / 2 + tileTopOffset(pSprite->picnum);
|
||||
*top -= (pSprite->yrepeat << 2) * center;
|
||||
*bottom += (pSprite->yrepeat << 2) * (height - center);
|
||||
}
|
||||
}
|
||||
|
||||
struct BloodSpawnSpriteDef : public SpawnSpriteDef
|
||||
{
|
||||
TArray<XSPRITE> xspr;
|
||||
TArray<XSPRITE> xspr;
|
||||
};
|
||||
|
||||
DBloodActor* InsertSprite(sectortype* pSector, int nStat);
|
||||
int DeleteSprite(DBloodActor* actor);
|
||||
|
||||
unsigned int dbReadMapCRC(const char *pPath);
|
||||
unsigned int dbReadMapCRC(const char* pPath);
|
||||
void dbLoadMap(const char* pPath, int* pX, int* pY, int* pZ, short* pAngle, sectortype** pSector, unsigned int* pCRC, BloodSpawnSpriteDef& sprites);
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -26,43 +26,43 @@ BEGIN_BLD_NS
|
|||
|
||||
// By NoOne: renamed dude struct
|
||||
struct DUDEINFO {
|
||||
int16_t seqStartID; // seq
|
||||
int16_t startHealth; // health
|
||||
uint16_t mass; // mass
|
||||
int at6; // unused?
|
||||
uint8_t clipdist; // clipdist
|
||||
int eyeHeight;
|
||||
int aimHeight; // used by just Cerberus
|
||||
int hearDist; // hear radius
|
||||
int seeDist; // sight radius
|
||||
int periphery; // periphery
|
||||
int meleeDist; // unused?
|
||||
int fleeHealth; // at which hp level enemy will turn in burning dude
|
||||
int hinderDamage; // recoil damage
|
||||
int changeTarget; // chance to change target when attacked someone else
|
||||
int changeTargetKin; // chance to change target when attacked by same type
|
||||
int alertChance;
|
||||
uint8_t lockOut; // indicates if this dude can trigger something via trigger flags
|
||||
int frontSpeed; // acceleration
|
||||
int sideSpeed; // dodge
|
||||
int backSpeed; // backward speed (unused)
|
||||
int angSpeed; // turn speed
|
||||
int nGibType[3]; // which gib used when explode dude
|
||||
int startDamage[7]; // start damage shift
|
||||
int damageVal[7]; // real damage? Hmm?
|
||||
int at8c; // unused ?
|
||||
int at90; // unused ?
|
||||
int16_t seqStartID; // seq
|
||||
int16_t startHealth; // health
|
||||
uint16_t mass; // mass
|
||||
int at6; // unused?
|
||||
uint8_t clipdist; // clipdist
|
||||
int eyeHeight;
|
||||
int aimHeight; // used by just Cerberus
|
||||
int hearDist; // hear radius
|
||||
int seeDist; // sight radius
|
||||
int periphery; // periphery
|
||||
int meleeDist; // unused?
|
||||
int fleeHealth; // at which hp level enemy will turn in burning dude
|
||||
int hinderDamage; // recoil damage
|
||||
int changeTarget; // chance to change target when attacked someone else
|
||||
int changeTargetKin; // chance to change target when attacked by same type
|
||||
int alertChance;
|
||||
uint8_t lockOut; // indicates if this dude can trigger something via trigger flags
|
||||
int frontSpeed; // acceleration
|
||||
int sideSpeed; // dodge
|
||||
int backSpeed; // backward speed (unused)
|
||||
int angSpeed; // turn speed
|
||||
int nGibType[3]; // which gib used when explode dude
|
||||
int startDamage[7]; // start damage shift
|
||||
int damageVal[7]; // real damage? Hmm?
|
||||
int at8c; // unused ?
|
||||
int at90; // unused ?
|
||||
};
|
||||
|
||||
extern DUDEINFO dudeInfo[kDudeMax-kDudeBase];
|
||||
extern DUDEINFO dudeInfo[kDudeMax - kDudeBase];
|
||||
extern DUDEINFO gPlayerTemplate[4];
|
||||
extern DUDEINFO fakeDudeInfo;
|
||||
|
||||
inline DUDEINFO *getDudeInfo(int const nType)
|
||||
inline DUDEINFO* getDudeInfo(int const nType)
|
||||
{
|
||||
if (nType >= kDudeBase && nType < kDudeMax)
|
||||
return &dudeInfo[nType - kDudeBase];
|
||||
return &fakeDudeInfo;
|
||||
if (nType >= kDudeBase && nType < kDudeMax)
|
||||
return &dudeInfo[nType - kDudeBase];
|
||||
return &fakeDudeInfo;
|
||||
}
|
||||
|
||||
END_BLD_NS
|
||||
|
|
|
@ -36,7 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
BEGIN_BLD_NS
|
||||
|
||||
|
||||
void GameInterface::LevelCompleted(MapRecord *map, int skill)
|
||||
void GameInterface::LevelCompleted(MapRecord* map, int skill)
|
||||
{
|
||||
// Save the player state before taking down anything.
|
||||
for (int i = connecthead; i >= 0; i = connectpoint2[i])
|
||||
|
@ -63,7 +63,7 @@ void GameInterface::LevelCompleted(MapRecord *map, int skill)
|
|||
ShowIntermission(currentLevel, map, &info, [=](bool)
|
||||
{
|
||||
soundEngine->StopAllChannels();
|
||||
gameaction = map? ga_nextlevel : ga_creditsmenu;
|
||||
gameaction = map ? ga_nextlevel : ga_creditsmenu;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -28,20 +28,20 @@ BEGIN_BLD_NS
|
|||
|
||||
class CKillMgr {
|
||||
public:
|
||||
int TotalKills, Kills;
|
||||
void SetCount(int);
|
||||
void AddNewKill(int);
|
||||
void AddKill(DBloodActor *actor);
|
||||
void CountTotalKills(void);
|
||||
void Clear(void);
|
||||
int TotalKills, Kills;
|
||||
void SetCount(int);
|
||||
void AddNewKill(int);
|
||||
void AddKill(DBloodActor* actor);
|
||||
void CountTotalKills(void);
|
||||
void Clear(void);
|
||||
};
|
||||
|
||||
class CSecretMgr {
|
||||
public:
|
||||
int Total, Founds, Super;
|
||||
void SetCount(int);
|
||||
void Found(int);
|
||||
void Clear(void);
|
||||
int Total, Founds, Super;
|
||||
void SetCount(int);
|
||||
void Found(int);
|
||||
void Clear(void);
|
||||
};
|
||||
|
||||
extern CSecretMgr gSecretMgr;
|
||||
|
|
|
@ -72,7 +72,7 @@ static int GetBucketChannel(EventObject* pBucket)
|
|||
if (pBucket->isActor())
|
||||
{
|
||||
auto pActor = pBucket->actor();
|
||||
return pActor? pActor->xspr.rxID : 0;
|
||||
return pActor ? pActor->xspr.rxID : 0;
|
||||
}
|
||||
|
||||
Printf(PRINT_HIGH, "Unexpected rxBucket %s", pBucket->description().GetChars());
|
||||
|
@ -157,7 +157,7 @@ static void SortRXBucket(int nCount)
|
|||
}
|
||||
break;
|
||||
}
|
||||
EventObject * middle = pArray + nCount / 2;
|
||||
EventObject* middle = pArray + nCount / 2;
|
||||
if (nCount > 29)
|
||||
{
|
||||
EventObject* first = pArray;
|
||||
|
@ -280,7 +280,7 @@ void evInit(TArray<DBloodActor*>& actors)
|
|||
memset(rxBucket, 0, sizeof(rxBucket));
|
||||
|
||||
// add all the tags to the bucket array
|
||||
for(auto& sect: sector)
|
||||
for (auto& sect : sector)
|
||||
{
|
||||
if (sect.hasX() && sect.xs().rxID > 0)
|
||||
{
|
||||
|
@ -290,7 +290,7 @@ void evInit(TArray<DBloodActor*>& actors)
|
|||
}
|
||||
}
|
||||
|
||||
for(auto& wal: wall)
|
||||
for (auto& wal : wall)
|
||||
{
|
||||
if (wal.hasX() && wal.xw().rxID > 0)
|
||||
{
|
||||
|
@ -389,7 +389,7 @@ void evSend(EventObject& eob, int rxId, COMMAND_ID command)
|
|||
else viewSetSystemMessage("Invalid Total-Secrets command by %s", eob.description().GetChars());
|
||||
break;
|
||||
case kChannelSecretFound:
|
||||
{
|
||||
{
|
||||
int nIndex = -1;
|
||||
if (eob.isActor() && eob.actor()) nIndex = eob.actor()->GetIndex() + 3 * 65536; // the hint system needs the sprite index.
|
||||
else if (eob.isSector()) nIndex = eob.rawindex() + 6 * 65536;
|
||||
|
@ -451,28 +451,28 @@ void evSend(EventObject& eob, int rxId, COMMAND_ID command)
|
|||
}
|
||||
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
if (gModernMap)
|
||||
if (gModernMap)
|
||||
{
|
||||
// allow to send commands on player sprites
|
||||
PLAYER* pPlayer = NULL;
|
||||
if (playerRXRngIsFine(rxId))
|
||||
if (playerRXRngIsFine(rxId))
|
||||
{
|
||||
if ((pPlayer = getPlayerById((rxId - kChannelPlayer7) + kMaxPlayers)) != nullptr)
|
||||
trMessageSprite(pPlayer->actor, event);
|
||||
}
|
||||
else if (rxId == kChannelAllPlayers)
|
||||
else if (rxId == kChannelAllPlayers)
|
||||
{
|
||||
for (int i = 0; i < kMaxPlayers; i++)
|
||||
for (int i = 0; i < kMaxPlayers; i++)
|
||||
{
|
||||
if ((pPlayer = getPlayerById(i)) != nullptr)
|
||||
trMessageSprite(pPlayer->actor, event);
|
||||
}
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
for (int i = bucketHead[rxId]; i < bucketHead[rxId + 1]; i++)
|
||||
for (int i = bucketHead[rxId]; i < bucketHead[rxId + 1]; i++)
|
||||
{
|
||||
auto eo = rxBucket[i];
|
||||
if (!event.event_isObject(eo))
|
||||
|
@ -510,13 +510,13 @@ void evPost_(EventObject& eob, unsigned int nDelta, COMMAND_ID command)
|
|||
assert(command != kCmdCallback);
|
||||
if (command == kCmdState) command = evGetSourceState(eob) ? kCmdOn : kCmdOff;
|
||||
else if (command == kCmdNotState) command = evGetSourceState(eob) ? kCmdOff : kCmdOn;
|
||||
EVENT evn = {eob, (int8_t)command, 0, PlayClock + (int)nDelta };
|
||||
EVENT evn = { eob, (int8_t)command, 0, PlayClock + (int)nDelta };
|
||||
queue.insert(evn);
|
||||
}
|
||||
|
||||
void evPost_(const EventObject& eob, unsigned int nDelta, CALLBACK_ID callback)
|
||||
{
|
||||
EVENT evn = {eob, kCmdCallback, (int16_t)callback, PlayClock + (int)nDelta };
|
||||
EVENT evn = { eob, kCmdCallback, (int16_t)callback, PlayClock + (int)nDelta };
|
||||
queue.insert(evn);
|
||||
}
|
||||
|
||||
|
@ -649,8 +649,8 @@ void evProcess(unsigned int time)
|
|||
if (event.target.isActor()) trMessageSprite(event.target.actor(), event);
|
||||
else if (event.target.isSector()) trMessageSector(event.target.sector(), event);
|
||||
else if (event.target.isWall()) trMessageWall(event.target.wall(), event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -669,21 +669,21 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, EventObject& w, Ev
|
|||
{
|
||||
case 0:
|
||||
{
|
||||
DBloodActor* a = arc.isWriting()? w.actor() : nullptr;
|
||||
DBloodActor* a = arc.isWriting() ? w.actor() : nullptr;
|
||||
arc("actor", a);
|
||||
if (arc.isReading()) w = EventObject(a);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
auto s = arc.isWriting()? w.sector() : nullptr;
|
||||
auto s = arc.isWriting() ? w.sector() : nullptr;
|
||||
arc("sector", s);
|
||||
if (arc.isReading()) w = EventObject(s);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
auto s = arc.isWriting()? w.wall() : nullptr;
|
||||
auto s = arc.isWriting() ? w.wall() : nullptr;
|
||||
arc("wall", s);
|
||||
if (arc.isReading()) w = EventObject(s);
|
||||
break;
|
||||
|
|
|
@ -39,18 +39,18 @@ class EventObject
|
|||
DBloodActor* ActorP;
|
||||
uint64_t index;
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
EventObject() = default;
|
||||
explicit EventObject(std::nullptr_t) { index = -1; }
|
||||
explicit EventObject(DBloodActor* actor_) { ActorP = actor_; assert(isActor()); }
|
||||
explicit EventObject(sectortype *sect) { index = (sectnum(sect) << 8) | Sector; }
|
||||
explicit EventObject(sectortype* sect) { index = (sectnum(sect) << 8) | Sector; }
|
||||
explicit EventObject(walltype* wall) { index = (wallnum(wall) << 8) | Wall; }
|
||||
|
||||
bool isActor() const { return (index&7) == Actor; }
|
||||
bool isSector() const { return (index&7) == Sector; }
|
||||
bool isWall() const { return (index&7) == Wall; }
|
||||
|
||||
bool isActor() const { return (index & 7) == Actor; }
|
||||
bool isSector() const { return (index & 7) == Sector; }
|
||||
bool isWall() const { return (index & 7) == Wall; }
|
||||
|
||||
DBloodActor* actor() { assert(isActor()); return GC::ReadBarrier(ActorP); }
|
||||
sectortype* sector() { assert(isSector()); return &::sector[index >> 8]; }
|
||||
walltype* wall() { assert(isWall()); return &::wall[index >> 8]; }
|
||||
|
@ -117,50 +117,50 @@ extern EventObject rxBucket[];
|
|||
extern unsigned short bucketHead[];
|
||||
|
||||
enum COMMAND_ID {
|
||||
kCmdOff = 0,
|
||||
kCmdOn = 1,
|
||||
kCmdState = 2,
|
||||
kCmdToggle = 3,
|
||||
kCmdNotState = 4,
|
||||
kCmdLink = 5,
|
||||
kCmdLock = 6,
|
||||
kCmdUnlock = 7,
|
||||
kCmdToggleLock = 8,
|
||||
kCmdStopOff = 9,
|
||||
kCmdStopOn = 10,
|
||||
kCmdStopNext = 11,
|
||||
kCmdCounterSector = 12,
|
||||
kCmdCallback = 20,
|
||||
kCmdRepeat = 21,
|
||||
kCmdOff = 0,
|
||||
kCmdOn = 1,
|
||||
kCmdState = 2,
|
||||
kCmdToggle = 3,
|
||||
kCmdNotState = 4,
|
||||
kCmdLink = 5,
|
||||
kCmdLock = 6,
|
||||
kCmdUnlock = 7,
|
||||
kCmdToggleLock = 8,
|
||||
kCmdStopOff = 9,
|
||||
kCmdStopOn = 10,
|
||||
kCmdStopNext = 11,
|
||||
kCmdCounterSector = 12,
|
||||
kCmdCallback = 20,
|
||||
kCmdRepeat = 21,
|
||||
|
||||
|
||||
kCmdSpritePush = 30,
|
||||
kCmdSpriteImpact = 31,
|
||||
kCmdSpritePickup = 32,
|
||||
kCmdSpriteTouch = 33,
|
||||
kCmdSpriteSight = 34,
|
||||
kCmdSpriteProximity = 35,
|
||||
kCmdSpriteExplode = 36,
|
||||
kCmdSpritePush = 30,
|
||||
kCmdSpriteImpact = 31,
|
||||
kCmdSpritePickup = 32,
|
||||
kCmdSpriteTouch = 33,
|
||||
kCmdSpriteSight = 34,
|
||||
kCmdSpriteProximity = 35,
|
||||
kCmdSpriteExplode = 36,
|
||||
|
||||
kCmdSectorPush = 40,
|
||||
kCmdSectorImpact = 41,
|
||||
kCmdSectorEnter = 42,
|
||||
kCmdSectorExit = 43,
|
||||
kCmdSectorPush = 40,
|
||||
kCmdSectorImpact = 41,
|
||||
kCmdSectorEnter = 42,
|
||||
kCmdSectorExit = 43,
|
||||
|
||||
kCmdWallPush = 50,
|
||||
kCmdWallImpact = 51,
|
||||
kCmdWallTouch = 52,
|
||||
kCmdWallPush = 50,
|
||||
kCmdWallImpact = 51,
|
||||
kCmdWallTouch = 52,
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
kCmdSectorMotionPause = 13, // stops motion of the sector
|
||||
kCmdSectorMotionContinue = 14, // continues motion of the sector
|
||||
kCmdDudeFlagsSet = 15, // copy dudeFlags from sprite to dude
|
||||
kCmdModernUse = 53, // used by most of modern types
|
||||
kCmdSectorMotionPause = 13, // stops motion of the sector
|
||||
kCmdSectorMotionContinue = 14, // continues motion of the sector
|
||||
kCmdDudeFlagsSet = 15, // copy dudeFlags from sprite to dude
|
||||
kCmdModernUse = 53, // used by most of modern types
|
||||
#endif
|
||||
|
||||
kCmdNumberic = 64, // 64: 0, 65: 1 and so on up to 255
|
||||
kCmdModernFeaturesEnable = 100, // must be in object with kChannelMapModernize RX / TX
|
||||
kCmdModernFeaturesDisable = 200, // must be in object with kChannelMapModernize RX / TX
|
||||
kCmdNumbericMax = 255,
|
||||
kCmdNumberic = 64, // 64: 0, 65: 1 and so on up to 255
|
||||
kCmdModernFeaturesEnable = 100, // must be in object with kChannelMapModernize RX / TX
|
||||
kCmdModernFeaturesDisable = 200, // must be in object with kChannelMapModernize RX / TX
|
||||
kCmdNumbericMax = 255,
|
||||
};
|
||||
|
||||
enum SSType
|
||||
|
@ -175,11 +175,11 @@ enum SSType
|
|||
};
|
||||
|
||||
inline bool playerRXRngIsFine(int rx) {
|
||||
return (rx >= kChannelPlayer0 && rx < kChannelPlayer7);
|
||||
return (rx >= kChannelPlayer0 && rx < kChannelPlayer7);
|
||||
}
|
||||
|
||||
inline bool channelRangeIsFine(int channel) {
|
||||
return (channel >= kChannelUser && channel < kChannelUserMax);
|
||||
return (channel >= kChannelUser && channel < kChannelUserMax);
|
||||
}
|
||||
|
||||
struct EVENT
|
||||
|
@ -214,19 +214,19 @@ struct EVENT
|
|||
return target.isWall();
|
||||
}
|
||||
|
||||
DBloodActor* getActor()
|
||||
DBloodActor* getActor()
|
||||
{
|
||||
assert(isActor());
|
||||
return target.actor();
|
||||
}
|
||||
|
||||
sectortype* getSector()
|
||||
sectortype* getSector()
|
||||
{
|
||||
assert(isSector());
|
||||
return target.sector();
|
||||
}
|
||||
|
||||
walltype* getWall()
|
||||
walltype* getWall()
|
||||
{
|
||||
assert(isWall());
|
||||
return target.wall();
|
||||
|
|
|
@ -36,93 +36,123 @@ int gDamping = 6;
|
|||
|
||||
uint8_t CoolTable[1024];
|
||||
|
||||
void CellularFrame(uint8_t *pFrame, int sizeX, int sizeY);
|
||||
void CellularFrame(uint8_t* pFrame, int sizeX, int sizeY);
|
||||
|
||||
static uint8_t FrameBuffer[17280];
|
||||
static uint8_t SeedBuffer[16][128];
|
||||
static TArray<uint8_t> gCLU;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void InitSeedBuffers(void)
|
||||
{
|
||||
for (int i = 0; i < 16; i++)
|
||||
for (int j = 0; j < fireSize; j += 2)
|
||||
SeedBuffer[i][j] = SeedBuffer[i][j+1] = wrand();
|
||||
for (int i = 0; i < 16; i++)
|
||||
for (int j = 0; j < fireSize; j += 2)
|
||||
SeedBuffer[i][j] = SeedBuffer[i][j + 1] = wrand();
|
||||
}
|
||||
|
||||
void BuildCoolTable(void)
|
||||
{
|
||||
for (int i = 0; i < 1024; i++)
|
||||
CoolTable[i] = ClipLow((i-gDamping) / 4, 0);
|
||||
for (int i = 0; i < 1024; i++)
|
||||
CoolTable[i] = ClipLow((i - gDamping) / 4, 0);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void DoFireFrame(void)
|
||||
{
|
||||
int nRand = qrand()&15;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
memcpy(FrameBuffer+16896+i*128, SeedBuffer[nRand], 128);
|
||||
}
|
||||
CellularFrame(FrameBuffer, 128, 132);
|
||||
int nRand = qrand() & 15;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
memcpy(FrameBuffer + 16896 + i * 128, SeedBuffer[nRand], 128);
|
||||
}
|
||||
CellularFrame(FrameBuffer, 128, 132);
|
||||
auto pData = TileFiles.tileMakeWritable(2342);
|
||||
uint8_t *pSource = FrameBuffer;
|
||||
int x = fireSize;
|
||||
do
|
||||
{
|
||||
int y = fireSize;
|
||||
auto pDataBak = pData;
|
||||
do
|
||||
{
|
||||
*pData = gCLU[*pSource];
|
||||
pSource++;
|
||||
pData += fireSize;
|
||||
} while (--y);
|
||||
pData = pDataBak + 1;
|
||||
} while (--x);
|
||||
uint8_t* pSource = FrameBuffer;
|
||||
int x = fireSize;
|
||||
do
|
||||
{
|
||||
int y = fireSize;
|
||||
auto pDataBak = pData;
|
||||
do
|
||||
{
|
||||
*pData = gCLU[*pSource];
|
||||
pSource++;
|
||||
pData += fireSize;
|
||||
} while (--y);
|
||||
pData = pDataBak + 1;
|
||||
} while (--x);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void FireInit(void)
|
||||
{
|
||||
memset(FrameBuffer, 0, sizeof(FrameBuffer));
|
||||
BuildCoolTable();
|
||||
InitSeedBuffers();
|
||||
auto fr = fileSystem.OpenFileReader("rfire.clu");
|
||||
if (!fr.isOpen())
|
||||
I_Error("RFIRE.CLU not found");
|
||||
gCLU = fr.Read();
|
||||
for (int i = 0; i < 100; i++)
|
||||
DoFireFrame();
|
||||
memset(FrameBuffer, 0, sizeof(FrameBuffer));
|
||||
BuildCoolTable();
|
||||
InitSeedBuffers();
|
||||
auto fr = fileSystem.OpenFileReader("rfire.clu");
|
||||
if (!fr.isOpen())
|
||||
I_Error("RFIRE.CLU not found");
|
||||
gCLU = fr.Read();
|
||||
for (int i = 0; i < 100; i++)
|
||||
DoFireFrame();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void FireProcess(void)
|
||||
{
|
||||
// This assumes a smooth high frame rate. Ugh...
|
||||
static int lastUpdate;
|
||||
int clock = I_GetBuildTime()/ 2;
|
||||
if (clock < lastUpdate || lastUpdate + 2 < clock)
|
||||
{
|
||||
DoFireFrame();
|
||||
lastUpdate = clock;
|
||||
TileFiles.InvalidateTile(2342);
|
||||
}
|
||||
static int lastUpdate;
|
||||
int clock = I_GetBuildTime() / 2;
|
||||
if (clock < lastUpdate || lastUpdate + 2 < clock)
|
||||
{
|
||||
DoFireFrame();
|
||||
lastUpdate = clock;
|
||||
TileFiles.InvalidateTile(2342);
|
||||
}
|
||||
}
|
||||
|
||||
void CellularFrame(uint8_t *pFrame, int sizeX, int sizeY)
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void CellularFrame(uint8_t* pFrame, int sizeX, int sizeY)
|
||||
{
|
||||
int nSquare = sizeX * sizeY;
|
||||
uint8_t *pPtr1 = (uint8_t*)pFrame;
|
||||
while (nSquare--)
|
||||
{
|
||||
uint8_t *pPtr2 = pPtr1+sizeX;
|
||||
int sum = *(pPtr2-1) + *pPtr2 + *(pPtr2+1) + *(pPtr2+sizeX);
|
||||
if (*(pPtr2+sizeX) > 96)
|
||||
{
|
||||
pPtr2 += sizeX;
|
||||
sum += *(pPtr2-1) + *pPtr2 + *(pPtr2+1) + *(pPtr2+sizeX);
|
||||
sum >>= 1;
|
||||
}
|
||||
*pPtr1 = CoolTable[sum];
|
||||
pPtr1++;
|
||||
}
|
||||
int nSquare = sizeX * sizeY;
|
||||
uint8_t* pPtr1 = (uint8_t*)pFrame;
|
||||
while (nSquare--)
|
||||
{
|
||||
uint8_t* pPtr2 = pPtr1 + sizeX;
|
||||
int sum = *(pPtr2 - 1) + *pPtr2 + *(pPtr2 + 1) + *(pPtr2 + sizeX);
|
||||
if (*(pPtr2 + sizeX) > 96)
|
||||
{
|
||||
pPtr2 += sizeX;
|
||||
sum += *(pPtr2 - 1) + *pPtr2 + *(pPtr2 + 1) + *(pPtr2 + sizeX);
|
||||
sum >>= 1;
|
||||
}
|
||||
*pPtr1 = CoolTable[sum];
|
||||
pPtr1++;
|
||||
}
|
||||
}
|
||||
|
||||
END_BLD_NS
|
||||
|
|
|
@ -32,306 +32,354 @@ BEGIN_BLD_NS
|
|||
CFX gFX;
|
||||
|
||||
struct FXDATA {
|
||||
CALLBACK_ID funcID; // callback
|
||||
uint8_t detail; // detail
|
||||
int16_t seq; // seq
|
||||
int16_t flags; // flags
|
||||
int32_t gravity; // gravity
|
||||
int32_t drag; // air drag
|
||||
int32_t ate;
|
||||
int16_t picnum; // picnum
|
||||
uint8_t xrepeat; // xrepeat
|
||||
uint8_t yrepeat; // yrepeat
|
||||
ESpriteFlags cstat; // cstat
|
||||
int8_t shade; // shade
|
||||
uint8_t pal; // pal
|
||||
CALLBACK_ID funcID; // callback
|
||||
uint8_t detail; // detail
|
||||
int16_t seq; // seq
|
||||
int16_t flags; // flags
|
||||
int32_t gravity; // gravity
|
||||
int32_t drag; // air drag
|
||||
int32_t ate;
|
||||
int16_t picnum; // picnum
|
||||
uint8_t xrepeat; // xrepeat
|
||||
uint8_t yrepeat; // yrepeat
|
||||
ESpriteFlags cstat; // cstat
|
||||
int8_t shade; // shade
|
||||
uint8_t pal; // pal
|
||||
};
|
||||
|
||||
FXDATA gFXData[] = {
|
||||
{ kCallbackNone, 0, 49, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 50, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 51, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 52, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 44, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 45, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 46, 1, -128, 8192, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 42, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 43, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 48, 3, -256, 8192, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 60, 3, -256, 8192, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackFXBloodBits, 2, 0, 1, 46603, 2048, 480, 2154, 40, 40, 0, -12, 0 },
|
||||
{ kCallbackNone, 2, 0, 3, 46603, 5120, 480, 2269, 24, 24, 0, -128, 0 },
|
||||
{ kCallbackNone, 2, 0, 3, 46603, 5120, 480, 1720, 24, 24, 0, -128, 0 },
|
||||
{ kCallbackNone, 1, 0, 1, 58254, 3072, 480, 2280, 48, 48, 0, -128, 0 },
|
||||
{ kCallbackNone, 1, 0, 1, 58254, 3072, 480, 3135, 48, 48, 0, -128, 0 },
|
||||
{ kCallbackNone, 0, 0, 3, 58254, 1024, 480, 3261, 32, 32, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 58254, 1024, 480, 3265, 32, 32, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 58254, 1024, 480, 3269, 32, 32, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 58254, 1024, 480, 3273, 32, 32, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 58254, 1024, 480, 3277, 32, 32, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 0, 1, -27962, 8192, 600, 1128, 16, 16, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP, -16, 0 }, // bubble 1
|
||||
{ kCallbackNone, 2, 0, 1, -18641, 8192, 600, 1128, 12, 12, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP, -16, 0 }, // bubble 2
|
||||
{ kCallbackNone, 2, 0, 1, -9320, 8192, 600, 1128, 8, 8, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP, -16, 0 }, // bubble 3
|
||||
{ kCallbackNone, 2, 0, 1, -18641, 8192, 600, 1131, 32, 32, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP, -16, 0 },
|
||||
{ kCallbackFXBloodBits, 2, 0, 3, 27962, 4096, 480, 733, 32, 32, 0, -16, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 18641, 4096, 120, 2261, 12, 12, 0, -128, 0 },
|
||||
{ kCallbackNone, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 58254, 3328, 480, 2185, 48, 48, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 0, 3, 58254, 1024, 480, 2620, 48, 48, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 55, 1, -13981, 5120, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 56, 1, -13981, 5120, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 57, 1, 0, 2048, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 58, 1, 0, 2048, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 0, 0, 0, 0, 960, 956, 32, 32, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_FLOOR, 0, 0 },
|
||||
{ kCallbackFXBouncingSleeve, 2, 62, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackFXBouncingSleeve, 2, 63, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackFXBouncingSleeve, 2, 64, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackFXBouncingSleeve, 2, 65, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackFXBouncingSleeve, 2, 66, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackFXBouncingSleeve, 2, 67, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 0, 0, 0, 838, 16, 16, CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_WALL, -8, 0 },
|
||||
{ kCallbackNone, 0, 0, 3, 34952, 8192, 0, 2078, 64, 64, 0, -8, 0 },
|
||||
{ kCallbackNone, 0, 0, 3, 34952, 8192, 0, 1106, 64, 64, 0, -8, 0 },
|
||||
{ kCallbackNone, 0, 0, 3, 58254, 3328, 480, 2406, 48, 48, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 46603, 4096, 480, 3511, 64, 64, 0, -128, 0 },
|
||||
{ kCallbackNone, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 11, 3, -256, 8192, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 11, 3, 0, 8192, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 30, 3, 0, 0, 0, 0, 40, 40, CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_WALL, -8, 0 },
|
||||
{ kCallbackFXPodBloodSplat, 2, 0, 3, 27962, 4096, 480, 4023, 32, 32, 0, -16, 0 },
|
||||
{ kCallbackFXPodBloodSplat, 2, 0, 3, 27962, 4096, 480, 4028, 32, 32, 0, -16, 0 },
|
||||
{ kCallbackNone, 2, 0, 0, 0, 0, 480, 926, 32, 32, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_FLOOR, -12, 0 },
|
||||
{ kCallbackNone, 1, 70, 1, -13981, 5120, 0, 0, 0, 0, 0, 0, 0 }
|
||||
{ kCallbackNone, 0, 49, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 50, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 51, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 52, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 44, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 45, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 46, 1, -128, 8192, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 42, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 43, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 48, 3, -256, 8192, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 60, 3, -256, 8192, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackFXBloodBits, 2, 0, 1, 46603, 2048, 480, 2154, 40, 40, 0, -12, 0 },
|
||||
{ kCallbackNone, 2, 0, 3, 46603, 5120, 480, 2269, 24, 24, 0, -128, 0 },
|
||||
{ kCallbackNone, 2, 0, 3, 46603, 5120, 480, 1720, 24, 24, 0, -128, 0 },
|
||||
{ kCallbackNone, 1, 0, 1, 58254, 3072, 480, 2280, 48, 48, 0, -128, 0 },
|
||||
{ kCallbackNone, 1, 0, 1, 58254, 3072, 480, 3135, 48, 48, 0, -128, 0 },
|
||||
{ kCallbackNone, 0, 0, 3, 58254, 1024, 480, 3261, 32, 32, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 58254, 1024, 480, 3265, 32, 32, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 58254, 1024, 480, 3269, 32, 32, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 58254, 1024, 480, 3273, 32, 32, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 58254, 1024, 480, 3277, 32, 32, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 0, 1, -27962, 8192, 600, 1128, 16, 16, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP, -16, 0 }, // bubble 1
|
||||
{ kCallbackNone, 2, 0, 1, -18641, 8192, 600, 1128, 12, 12, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP, -16, 0 }, // bubble 2
|
||||
{ kCallbackNone, 2, 0, 1, -9320, 8192, 600, 1128, 8, 8, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP, -16, 0 }, // bubble 3
|
||||
{ kCallbackNone, 2, 0, 1, -18641, 8192, 600, 1131, 32, 32, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP, -16, 0 },
|
||||
{ kCallbackFXBloodBits, 2, 0, 3, 27962, 4096, 480, 733, 32, 32, 0, -16, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 18641, 4096, 120, 2261, 12, 12, 0, -128, 0 },
|
||||
{ kCallbackNone, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 58254, 3328, 480, 2185, 48, 48, 0, 0, 0 },
|
||||
{ kCallbackNone, 0, 0, 3, 58254, 1024, 480, 2620, 48, 48, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 55, 1, -13981, 5120, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 56, 1, -13981, 5120, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 57, 1, 0, 2048, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 58, 1, 0, 2048, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 0, 0, 0, 0, 960, 956, 32, 32, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_FLOOR, 0, 0 },
|
||||
{ kCallbackFXBouncingSleeve, 2, 62, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackFXBouncingSleeve, 2, 63, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackFXBouncingSleeve, 2, 64, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackFXBouncingSleeve, 2, 65, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackFXBouncingSleeve, 2, 66, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackFXBouncingSleeve, 2, 67, 0, 46603, 1024, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 0, 0, 0, 838, 16, 16, CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_WALL, -8, 0 },
|
||||
{ kCallbackNone, 0, 0, 3, 34952, 8192, 0, 2078, 64, 64, 0, -8, 0 },
|
||||
{ kCallbackNone, 0, 0, 3, 34952, 8192, 0, 1106, 64, 64, 0, -8, 0 },
|
||||
{ kCallbackNone, 0, 0, 3, 58254, 3328, 480, 2406, 48, 48, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 3, 46603, 4096, 480, 3511, 64, 64, 0, -128, 0 },
|
||||
{ kCallbackNone, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 11, 3, -256, 8192, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 2, 11, 3, 0, 8192, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ kCallbackNone, 1, 30, 3, 0, 0, 0, 0, 40, 40, CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_WALL, -8, 0 },
|
||||
{ kCallbackFXPodBloodSplat, 2, 0, 3, 27962, 4096, 480, 4023, 32, 32, 0, -16, 0 },
|
||||
{ kCallbackFXPodBloodSplat, 2, 0, 3, 27962, 4096, 480, 4028, 32, 32, 0, -16, 0 },
|
||||
{ kCallbackNone, 2, 0, 0, 0, 0, 480, 926, 32, 32, CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_FLOOR, -12, 0 },
|
||||
{ kCallbackNone, 1, 70, 1, -13981, 5120, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void CFX::destroy(DBloodActor* actor)
|
||||
{
|
||||
if (!actor) return;
|
||||
evKillActor(actor);
|
||||
if (actor->hasX()) seqKill(actor);
|
||||
DeleteSprite(actor);
|
||||
if (!actor) return;
|
||||
evKillActor(actor);
|
||||
if (actor->hasX()) seqKill(actor);
|
||||
DeleteSprite(actor);
|
||||
}
|
||||
|
||||
void CFX::remove(DBloodActor* actor)
|
||||
{
|
||||
if (!actor) return;
|
||||
if (actor->hasX()) seqKill(actor);
|
||||
if (actor->spr.statnum != kStatFree)
|
||||
actPostSprite(actor, kStatFree);
|
||||
if (!actor) return;
|
||||
if (actor->hasX()) seqKill(actor);
|
||||
if (actor->spr.statnum != kStatFree)
|
||||
actPostSprite(actor, kStatFree);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
DBloodActor* CFX::fxSpawnActor(FX_ID nFx, sectortype* pSector, int x, int y, int z, unsigned int a6)
|
||||
{
|
||||
if (pSector == nullptr)
|
||||
return nullptr;
|
||||
auto pSector2 = pSector;
|
||||
if (!FindSector(x, y, z, &pSector2))
|
||||
return nullptr;
|
||||
if (adult_lockout && gGameOptions.nGameType <= 0)
|
||||
{
|
||||
switch (nFx)
|
||||
{
|
||||
case FX_0:
|
||||
case FX_1:
|
||||
case FX_2:
|
||||
case FX_3:
|
||||
case FX_13:
|
||||
case FX_34:
|
||||
case FX_35:
|
||||
case FX_36:
|
||||
return nullptr;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (nFx < 0 || nFx >= kFXMax)
|
||||
return nullptr;
|
||||
FXDATA *pFX = &gFXData[nFx];
|
||||
if (pSector == nullptr)
|
||||
return nullptr;
|
||||
auto pSector2 = pSector;
|
||||
if (!FindSector(x, y, z, &pSector2))
|
||||
return nullptr;
|
||||
if (adult_lockout && gGameOptions.nGameType <= 0)
|
||||
{
|
||||
switch (nFx)
|
||||
{
|
||||
case FX_0:
|
||||
case FX_1:
|
||||
case FX_2:
|
||||
case FX_3:
|
||||
case FX_13:
|
||||
case FX_34:
|
||||
case FX_35:
|
||||
case FX_36:
|
||||
return nullptr;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (nFx < 0 || nFx >= kFXMax)
|
||||
return nullptr;
|
||||
FXDATA* pFX = &gFXData[nFx];
|
||||
|
||||
auto actor = actSpawnSprite(pSector, x, y, z, 1, 0);
|
||||
auto actor = actSpawnSprite(pSector, x, y, z, 1, 0);
|
||||
|
||||
actor->spr.type = nFx;
|
||||
actor->spr.picnum = pFX->picnum;
|
||||
actor->spr.cstat |= pFX->cstat;
|
||||
actor->spr.shade = pFX->shade;
|
||||
actor->spr.pal = pFX->pal;
|
||||
actor->spr.detail = pFX->detail;
|
||||
if (pFX->xrepeat > 0)
|
||||
actor->spr.xrepeat = pFX->xrepeat;
|
||||
if (pFX->yrepeat > 0)
|
||||
actor->spr.yrepeat = pFX->yrepeat;
|
||||
if ((pFX->flags & 1) && Chance(0x8000))
|
||||
actor->spr.cstat |= CSTAT_SPRITE_XFLIP;
|
||||
if ((pFX->flags & 2) && Chance(0x8000))
|
||||
actor->spr.cstat |= CSTAT_SPRITE_YFLIP;
|
||||
if (pFX->seq)
|
||||
{
|
||||
actor->addX();
|
||||
seqSpawn(pFX->seq, actor, -1);
|
||||
}
|
||||
if (a6 == 0)
|
||||
a6 = pFX->ate;
|
||||
if (a6)
|
||||
evPostActor(actor, a6+Random2(a6>>1), kCallbackRemove);
|
||||
return actor;
|
||||
actor->spr.type = nFx;
|
||||
actor->spr.picnum = pFX->picnum;
|
||||
actor->spr.cstat |= pFX->cstat;
|
||||
actor->spr.shade = pFX->shade;
|
||||
actor->spr.pal = pFX->pal;
|
||||
actor->spr.detail = pFX->detail;
|
||||
if (pFX->xrepeat > 0)
|
||||
actor->spr.xrepeat = pFX->xrepeat;
|
||||
if (pFX->yrepeat > 0)
|
||||
actor->spr.yrepeat = pFX->yrepeat;
|
||||
if ((pFX->flags & 1) && Chance(0x8000))
|
||||
actor->spr.cstat |= CSTAT_SPRITE_XFLIP;
|
||||
if ((pFX->flags & 2) && Chance(0x8000))
|
||||
actor->spr.cstat |= CSTAT_SPRITE_YFLIP;
|
||||
if (pFX->seq)
|
||||
{
|
||||
actor->addX();
|
||||
seqSpawn(pFX->seq, actor, -1);
|
||||
}
|
||||
if (a6 == 0)
|
||||
a6 = pFX->ate;
|
||||
if (a6)
|
||||
evPostActor(actor, a6 + Random2(a6 >> 1), kCallbackRemove);
|
||||
return actor;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void CFX::fxProcess(void)
|
||||
{
|
||||
BloodStatIterator it(kStatFX);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
viewBackupSpriteLoc(actor);
|
||||
auto pSector = actor->spr.sector();
|
||||
assert(pSector);
|
||||
assert(actor->spr.type < kFXMax);
|
||||
FXDATA *pFXData = &gFXData[actor->spr.type];
|
||||
actAirDrag(actor, pFXData->drag);
|
||||
actor->spr.pos.X += actor->xvel>>12;
|
||||
actor->spr.pos.Y += actor->yvel>>12;
|
||||
actor->spr.pos.Z += actor->zvel>>8;
|
||||
// Weird...
|
||||
if (actor->xvel || (actor->yvel && actor->spr.pos.Z >= actor->spr.sector()->floorz))
|
||||
{
|
||||
updatesector(actor->spr.pos.X, actor->spr.pos.Y, &pSector);
|
||||
if (pSector == nullptr)
|
||||
{
|
||||
remove(actor);
|
||||
continue;
|
||||
}
|
||||
if (getflorzofslopeptr(actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y) <= actor->spr.pos.Z)
|
||||
{
|
||||
if (pFXData->funcID < 0 || pFXData->funcID >= kCallbackMax)
|
||||
{
|
||||
remove(actor);
|
||||
continue;
|
||||
}
|
||||
gCallback[pFXData->funcID](actor, nullptr);
|
||||
continue;
|
||||
}
|
||||
if (pSector != actor->spr.sector())
|
||||
{
|
||||
assert(pSector);
|
||||
ChangeActorSect(actor, pSector);
|
||||
}
|
||||
}
|
||||
if (actor->xvel || actor->yvel || actor->zvel)
|
||||
{
|
||||
int32_t floorZ, ceilZ;
|
||||
getzsofslopeptr(pSector, actor->spr.pos.X, actor->spr.pos.Y, &ceilZ, &floorZ);
|
||||
if (ceilZ > actor->spr.pos.Z && !(pSector->ceilingstat & CSTAT_SECTOR_SKY))
|
||||
{
|
||||
remove(actor);
|
||||
continue;
|
||||
}
|
||||
if (floorZ < actor->spr.pos.Z)
|
||||
{
|
||||
if (pFXData->funcID < 0 || pFXData->funcID >= kCallbackMax)
|
||||
{
|
||||
remove(actor);
|
||||
continue;
|
||||
}
|
||||
gCallback[pFXData->funcID](actor, nullptr);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
actor->zvel += pFXData->gravity;
|
||||
}
|
||||
BloodStatIterator it(kStatFX);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
viewBackupSpriteLoc(actor);
|
||||
auto pSector = actor->spr.sector();
|
||||
assert(pSector);
|
||||
assert(actor->spr.type < kFXMax);
|
||||
FXDATA* pFXData = &gFXData[actor->spr.type];
|
||||
actAirDrag(actor, pFXData->drag);
|
||||
actor->spr.pos.X += actor->xvel >> 12;
|
||||
actor->spr.pos.Y += actor->yvel >> 12;
|
||||
actor->spr.pos.Z += actor->zvel >> 8;
|
||||
// Weird...
|
||||
if (actor->xvel || (actor->yvel && actor->spr.pos.Z >= actor->spr.sector()->floorz))
|
||||
{
|
||||
updatesector(actor->spr.pos.X, actor->spr.pos.Y, &pSector);
|
||||
if (pSector == nullptr)
|
||||
{
|
||||
remove(actor);
|
||||
continue;
|
||||
}
|
||||
if (getflorzofslopeptr(actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y) <= actor->spr.pos.Z)
|
||||
{
|
||||
if (pFXData->funcID < 0 || pFXData->funcID >= kCallbackMax)
|
||||
{
|
||||
remove(actor);
|
||||
continue;
|
||||
}
|
||||
gCallback[pFXData->funcID](actor, nullptr);
|
||||
continue;
|
||||
}
|
||||
if (pSector != actor->spr.sector())
|
||||
{
|
||||
assert(pSector);
|
||||
ChangeActorSect(actor, pSector);
|
||||
}
|
||||
}
|
||||
if (actor->xvel || actor->yvel || actor->zvel)
|
||||
{
|
||||
int32_t floorZ, ceilZ;
|
||||
getzsofslopeptr(pSector, actor->spr.pos.X, actor->spr.pos.Y, &ceilZ, &floorZ);
|
||||
if (ceilZ > actor->spr.pos.Z && !(pSector->ceilingstat & CSTAT_SECTOR_SKY))
|
||||
{
|
||||
remove(actor);
|
||||
continue;
|
||||
}
|
||||
if (floorZ < actor->spr.pos.Z)
|
||||
{
|
||||
if (pFXData->funcID < 0 || pFXData->funcID >= kCallbackMax)
|
||||
{
|
||||
remove(actor);
|
||||
continue;
|
||||
}
|
||||
gCallback[pFXData->funcID](actor, nullptr);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
actor->zvel += pFXData->gravity;
|
||||
}
|
||||
}
|
||||
|
||||
void fxSpawnBlood(DBloodActor *actor, int )
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void fxSpawnBlood(DBloodActor* actor, int)
|
||||
{
|
||||
if (!actor->spr.insector())
|
||||
return;
|
||||
auto pSector = actor->spr.sector();
|
||||
if (!FindSector(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, &pSector))
|
||||
return;
|
||||
if (adult_lockout && gGameOptions.nGameType <= 0)
|
||||
return;
|
||||
auto bloodactor = gFX.fxSpawnActor(FX_27, actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 0);
|
||||
if (bloodactor)
|
||||
{
|
||||
bloodactor->spr.ang = 1024;
|
||||
bloodactor->xvel = Random2(0x6aaaa);
|
||||
bloodactor->yvel = Random2(0x6aaaa);
|
||||
bloodactor->zvel = -(int)Random(0x10aaaa)-100;
|
||||
evPostActor(bloodactor, 8, kCallbackFXBloodSpurt);
|
||||
}
|
||||
if (!actor->spr.insector())
|
||||
return;
|
||||
auto pSector = actor->spr.sector();
|
||||
if (!FindSector(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, &pSector))
|
||||
return;
|
||||
if (adult_lockout && gGameOptions.nGameType <= 0)
|
||||
return;
|
||||
auto bloodactor = gFX.fxSpawnActor(FX_27, actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 0);
|
||||
if (bloodactor)
|
||||
{
|
||||
bloodactor->spr.ang = 1024;
|
||||
bloodactor->xvel = Random2(0x6aaaa);
|
||||
bloodactor->yvel = Random2(0x6aaaa);
|
||||
bloodactor->zvel = -(int)Random(0x10aaaa) - 100;
|
||||
evPostActor(bloodactor, 8, kCallbackFXBloodSpurt);
|
||||
}
|
||||
}
|
||||
|
||||
void fxSpawnPodStuff(DBloodActor* actor, int )
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void fxSpawnPodStuff(DBloodActor* actor, int)
|
||||
{
|
||||
if (!actor->spr.insector())
|
||||
return;
|
||||
auto pSector = actor->spr.sector();
|
||||
if (!FindSector(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, &pSector))
|
||||
return;
|
||||
if (adult_lockout && gGameOptions.nGameType <= 0)
|
||||
return;
|
||||
DBloodActor *spawnactor;
|
||||
if (actor->spr.type == kDudePodGreen)
|
||||
spawnactor = gFX.fxSpawnActor(FX_53, actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 0);
|
||||
else
|
||||
spawnactor = gFX.fxSpawnActor(FX_54, actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 0);
|
||||
if (spawnactor)
|
||||
{
|
||||
spawnactor->spr.ang = 1024;
|
||||
spawnactor->xvel = Random2(0x6aaaa);
|
||||
spawnactor->yvel = Random2(0x6aaaa);
|
||||
spawnactor->zvel = -(int)Random(0x10aaaa)-100;
|
||||
evPostActor(spawnactor, 8, kCallbackFXPodBloodSpray);
|
||||
}
|
||||
if (!actor->spr.insector())
|
||||
return;
|
||||
auto pSector = actor->spr.sector();
|
||||
if (!FindSector(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, &pSector))
|
||||
return;
|
||||
if (adult_lockout && gGameOptions.nGameType <= 0)
|
||||
return;
|
||||
DBloodActor* spawnactor;
|
||||
if (actor->spr.type == kDudePodGreen)
|
||||
spawnactor = gFX.fxSpawnActor(FX_53, actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 0);
|
||||
else
|
||||
spawnactor = gFX.fxSpawnActor(FX_54, actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, 0);
|
||||
if (spawnactor)
|
||||
{
|
||||
spawnactor->spr.ang = 1024;
|
||||
spawnactor->xvel = Random2(0x6aaaa);
|
||||
spawnactor->yvel = Random2(0x6aaaa);
|
||||
spawnactor->zvel = -(int)Random(0x10aaaa) - 100;
|
||||
evPostActor(spawnactor, 8, kCallbackFXPodBloodSpray);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void fxSpawnEjectingBrass(DBloodActor* actor, int z, int a3, int a4)
|
||||
{
|
||||
int x = actor->spr.pos.X + MulScale(actor->spr.clipdist - 4, Cos(actor->spr.ang), 28);
|
||||
int y = actor->spr.pos.Y + MulScale(actor->spr.clipdist - 4, Sin(actor->spr.ang), 28);
|
||||
x += MulScale(a3, Cos(actor->spr.ang + 512), 30);
|
||||
y += MulScale(a3, Sin(actor->spr.ang + 512), 30);
|
||||
auto pBrass = gFX.fxSpawnActor((FX_ID)(FX_37 + Random(3)), actor->spr.sector(), x, y, z, 0);
|
||||
if (pBrass)
|
||||
{
|
||||
if (!VanillaMode())
|
||||
pBrass->spr.ang = Random(2047);
|
||||
int nDist = (a4 << 18) / 120 + Random2(((a4 / 4) << 18) / 120);
|
||||
int nAngle = actor->spr.ang + Random2(56) + 512;
|
||||
pBrass->xvel = MulScale(nDist, Cos(nAngle), 30);
|
||||
pBrass->yvel = MulScale(nDist, Sin(nAngle), 30);
|
||||
pBrass->zvel = actor->zvel - (0x20000 + (Random2(40) << 18) / 120);
|
||||
}
|
||||
int x = actor->spr.pos.X + MulScale(actor->spr.clipdist - 4, Cos(actor->spr.ang), 28);
|
||||
int y = actor->spr.pos.Y + MulScale(actor->spr.clipdist - 4, Sin(actor->spr.ang), 28);
|
||||
x += MulScale(a3, Cos(actor->spr.ang + 512), 30);
|
||||
y += MulScale(a3, Sin(actor->spr.ang + 512), 30);
|
||||
auto pBrass = gFX.fxSpawnActor((FX_ID)(FX_37 + Random(3)), actor->spr.sector(), x, y, z, 0);
|
||||
if (pBrass)
|
||||
{
|
||||
if (!VanillaMode())
|
||||
pBrass->spr.ang = Random(2047);
|
||||
int nDist = (a4 << 18) / 120 + Random2(((a4 / 4) << 18) / 120);
|
||||
int nAngle = actor->spr.ang + Random2(56) + 512;
|
||||
pBrass->xvel = MulScale(nDist, Cos(nAngle), 30);
|
||||
pBrass->yvel = MulScale(nDist, Sin(nAngle), 30);
|
||||
pBrass->zvel = actor->zvel - (0x20000 + (Random2(40) << 18) / 120);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void fxSpawnEjectingShell(DBloodActor* actor, int z, int a3, int a4)
|
||||
{
|
||||
int x = actor->spr.pos.X + MulScale(actor->spr.clipdist - 4, Cos(actor->spr.ang), 28);
|
||||
int y = actor->spr.pos.Y + MulScale(actor->spr.clipdist - 4, Sin(actor->spr.ang), 28);
|
||||
x += MulScale(a3, Cos(actor->spr.ang + 512), 30);
|
||||
y += MulScale(a3, Sin(actor->spr.ang + 512), 30);
|
||||
auto pShell = gFX.fxSpawnActor((FX_ID)(FX_40 + Random(3)), actor->spr.sector(), x, y, z, 0);
|
||||
if (pShell)
|
||||
{
|
||||
if (!VanillaMode())
|
||||
pShell->spr.ang = Random(2047);
|
||||
int nDist = (a4 << 18) / 120 + Random2(((a4 / 4) << 18) / 120);
|
||||
int nAngle = actor->spr.ang + Random2(56) + 512;
|
||||
pShell->xvel = MulScale(nDist, Cos(nAngle), 30);
|
||||
pShell->yvel = MulScale(nDist, Sin(nAngle), 30);
|
||||
pShell->zvel = actor->zvel - (0x20000 + (Random2(20) << 18) / 120);
|
||||
}
|
||||
int x = actor->spr.pos.X + MulScale(actor->spr.clipdist - 4, Cos(actor->spr.ang), 28);
|
||||
int y = actor->spr.pos.Y + MulScale(actor->spr.clipdist - 4, Sin(actor->spr.ang), 28);
|
||||
x += MulScale(a3, Cos(actor->spr.ang + 512), 30);
|
||||
y += MulScale(a3, Sin(actor->spr.ang + 512), 30);
|
||||
auto pShell = gFX.fxSpawnActor((FX_ID)(FX_40 + Random(3)), actor->spr.sector(), x, y, z, 0);
|
||||
if (pShell)
|
||||
{
|
||||
if (!VanillaMode())
|
||||
pShell->spr.ang = Random(2047);
|
||||
int nDist = (a4 << 18) / 120 + Random2(((a4 / 4) << 18) / 120);
|
||||
int nAngle = actor->spr.ang + Random2(56) + 512;
|
||||
pShell->xvel = MulScale(nDist, Cos(nAngle), 30);
|
||||
pShell->yvel = MulScale(nDist, Sin(nAngle), 30);
|
||||
pShell->zvel = actor->zvel - (0x20000 + (Random2(20) << 18) / 120);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void fxPrecache()
|
||||
{
|
||||
for (int i = 0; i < kFXMax; i++)
|
||||
{
|
||||
tilePrecacheTile(gFXData[i].picnum, 0, 0);
|
||||
if (gFXData[i].seq)
|
||||
seqPrecacheId(gFXData[i].seq, 0);
|
||||
}
|
||||
for (int i = 0; i < kFXMax; i++)
|
||||
{
|
||||
tilePrecacheTile(gFXData[i].picnum, 0, 0);
|
||||
if (gFXData[i].seq)
|
||||
seqPrecacheId(gFXData[i].seq, 0);
|
||||
}
|
||||
}
|
||||
|
||||
END_BLD_NS
|
||||
|
|
|
@ -28,79 +28,79 @@ BEGIN_BLD_NS
|
|||
|
||||
|
||||
enum FX_ID {
|
||||
FX_NONE = -1,
|
||||
FX_0 = 0,
|
||||
FX_1,
|
||||
FX_2,
|
||||
FX_3,
|
||||
FX_4,
|
||||
FX_5,
|
||||
FX_6,
|
||||
FX_7,
|
||||
FX_8,
|
||||
FX_9,
|
||||
FX_10,
|
||||
FX_11,
|
||||
FX_12,
|
||||
FX_13,
|
||||
FX_14,
|
||||
FX_15,
|
||||
FX_16,
|
||||
FX_17,
|
||||
FX_18,
|
||||
FX_19,
|
||||
FX_20,
|
||||
FX_21,
|
||||
FX_22,
|
||||
FX_23,
|
||||
FX_24,
|
||||
FX_25,
|
||||
FX_26,
|
||||
FX_27,
|
||||
FX_28,
|
||||
FX_29,
|
||||
FX_30,
|
||||
FX_31,
|
||||
FX_32,
|
||||
FX_33,
|
||||
FX_34,
|
||||
FX_35,
|
||||
FX_36,
|
||||
FX_37,
|
||||
FX_38,
|
||||
FX_39,
|
||||
FX_40,
|
||||
FX_41,
|
||||
FX_42,
|
||||
FX_43,
|
||||
FX_44,
|
||||
FX_45,
|
||||
FX_46,
|
||||
FX_47,
|
||||
FX_48,
|
||||
FX_49,
|
||||
FX_50,
|
||||
FX_51,
|
||||
FX_52,
|
||||
FX_53,
|
||||
FX_54,
|
||||
FX_55,
|
||||
FX_56,
|
||||
kFXMax
|
||||
FX_NONE = -1,
|
||||
FX_0 = 0,
|
||||
FX_1,
|
||||
FX_2,
|
||||
FX_3,
|
||||
FX_4,
|
||||
FX_5,
|
||||
FX_6,
|
||||
FX_7,
|
||||
FX_8,
|
||||
FX_9,
|
||||
FX_10,
|
||||
FX_11,
|
||||
FX_12,
|
||||
FX_13,
|
||||
FX_14,
|
||||
FX_15,
|
||||
FX_16,
|
||||
FX_17,
|
||||
FX_18,
|
||||
FX_19,
|
||||
FX_20,
|
||||
FX_21,
|
||||
FX_22,
|
||||
FX_23,
|
||||
FX_24,
|
||||
FX_25,
|
||||
FX_26,
|
||||
FX_27,
|
||||
FX_28,
|
||||
FX_29,
|
||||
FX_30,
|
||||
FX_31,
|
||||
FX_32,
|
||||
FX_33,
|
||||
FX_34,
|
||||
FX_35,
|
||||
FX_36,
|
||||
FX_37,
|
||||
FX_38,
|
||||
FX_39,
|
||||
FX_40,
|
||||
FX_41,
|
||||
FX_42,
|
||||
FX_43,
|
||||
FX_44,
|
||||
FX_45,
|
||||
FX_46,
|
||||
FX_47,
|
||||
FX_48,
|
||||
FX_49,
|
||||
FX_50,
|
||||
FX_51,
|
||||
FX_52,
|
||||
FX_53,
|
||||
FX_54,
|
||||
FX_55,
|
||||
FX_56,
|
||||
kFXMax
|
||||
};
|
||||
|
||||
class CFX {
|
||||
public:
|
||||
void destroy(DBloodActor*);
|
||||
void remove(DBloodActor*);
|
||||
DBloodActor* fxSpawnActor(FX_ID a, sectortype* b, int c, int d, int e, unsigned int f);
|
||||
void fxProcess(void);
|
||||
void destroy(DBloodActor*);
|
||||
void remove(DBloodActor*);
|
||||
DBloodActor* fxSpawnActor(FX_ID a, sectortype* b, int c, int d, int e, unsigned int f);
|
||||
void fxProcess(void);
|
||||
};
|
||||
|
||||
void fxSpawnBlood(DBloodActor* pSprite, int a2);
|
||||
void fxSpawnPodStuff(DBloodActor *pSprite, int a2);
|
||||
void fxSpawnEjectingBrass(DBloodActor*pSprite, int z, int a3, int a4);
|
||||
void fxSpawnEjectingShell(DBloodActor*pSprite, int z, int a3, int a4);
|
||||
void fxSpawnPodStuff(DBloodActor* pSprite, int a2);
|
||||
void fxSpawnEjectingBrass(DBloodActor* pSprite, int z, int a3, int a4);
|
||||
void fxSpawnEjectingShell(DBloodActor* pSprite, int z, int a3, int a4);
|
||||
|
||||
extern CFX gFX;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -27,24 +27,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
BEGIN_BLD_NS
|
||||
|
||||
enum {
|
||||
PARALLAXCLIP_CEILING = 1,
|
||||
PARALLAXCLIP_FLOOR = 2,
|
||||
PARALLAXCLIP_CEILING = 1,
|
||||
PARALLAXCLIP_FLOOR = 2,
|
||||
};
|
||||
|
||||
|
||||
bool FindSector(int nX, int nY, int nZ, sectortype** ppSector);
|
||||
bool FindSector(int nX, int nY, sectortype** ppSector);
|
||||
|
||||
bool CheckProximity(DBloodActor *pSprite, int nX, int nY, int nZ, sectortype* pSector, int nDist);
|
||||
bool CheckProximity(DBloodActor* pSprite, int nX, int nY, int nZ, sectortype* pSector, int nDist);
|
||||
bool CheckProximityPoint(int nX1, int nY1, int nZ1, int nX2, int nY2, int nZ2, int nDist);
|
||||
bool CheckProximityWall(walltype* pWall, int x, int y, int nDist);
|
||||
int GetWallAngle(walltype* pWall);
|
||||
void GetWallNormal(walltype* pWall, int *pX, int *pY);
|
||||
bool IntersectRay(int wx, int wy, int wdx, int wdy, int x1, int y1, int z1, int x2, int y2, int z2, int *ix, int *iy, int *iz);
|
||||
int HitScan(DBloodActor *pSprite, int z, int dx, int dy, int dz, unsigned int nMask, int a8);
|
||||
int VectorScan(DBloodActor *pSprite, int nOffset, int nZOffset, int dx, int dy, int dz, int nRange, int ac);
|
||||
void GetZRange(DBloodActor *pSprite, int *ceilZ, Collision *ceilHit, int *floorZ, Collision *floorHit, int nDist, unsigned int nMask, unsigned int nClipParallax = 0);
|
||||
void GetZRangeAtXYZ(int x, int y, int z, sectortype* pSector, int *ceilZ, Collision *ceilHit, int *floorZ, Collision *floorHit, int nDist, unsigned int nMask, unsigned int nClipParallax = 0);
|
||||
void GetWallNormal(walltype* pWall, int* pX, int* pY);
|
||||
bool IntersectRay(int wx, int wy, int wdx, int wdy, int x1, int y1, int z1, int x2, int y2, int z2, int* ix, int* iy, int* iz);
|
||||
int HitScan(DBloodActor* pSprite, int z, int dx, int dy, int dz, unsigned int nMask, int a8);
|
||||
int VectorScan(DBloodActor* pSprite, int nOffset, int nZOffset, int dx, int dy, int dz, int nRange, int ac);
|
||||
void GetZRange(DBloodActor* pSprite, int* ceilZ, Collision* ceilHit, int* floorZ, Collision* floorHit, int nDist, unsigned int nMask, unsigned int nClipParallax = 0);
|
||||
void GetZRangeAtXYZ(int x, int y, int z, sectortype* pSector, int* ceilZ, Collision* ceilHit, int* floorZ, Collision* floorHit, int nDist, unsigned int nMask, unsigned int nClipParallax = 0);
|
||||
int GetDistToLine(int x1, int y1, int x2, int y2, int x3, int y3);
|
||||
void ClipMove(vec3_t& pos, sectortype** pSector, int xv, int yv, int wd, int cd, int fd, unsigned int nMask, CollisionBase& hit, int tracecount = 3);
|
||||
BitArray GetClosestSpriteSectors(sectortype* pSector, int x, int y, int nDist, TArray<walltype*>* pWalls, bool newSectCheckMethod = false);
|
||||
|
|
|
@ -32,472 +32,508 @@ BEGIN_BLD_NS
|
|||
|
||||
struct GIBFX
|
||||
{
|
||||
FX_ID fxId;
|
||||
int at1;
|
||||
int chance;
|
||||
int at9;
|
||||
int atd;
|
||||
int at11;
|
||||
FX_ID fxId;
|
||||
int at1;
|
||||
int chance;
|
||||
int at9;
|
||||
int atd;
|
||||
int at11;
|
||||
};
|
||||
|
||||
|
||||
struct GIBTHING
|
||||
{
|
||||
int type;
|
||||
int Kills;
|
||||
int chance;
|
||||
int atc;
|
||||
int at10;
|
||||
int type;
|
||||
int Kills;
|
||||
int chance;
|
||||
int atc;
|
||||
int at10;
|
||||
};
|
||||
|
||||
struct GIBLIST
|
||||
{
|
||||
GIBFX *gibFX;
|
||||
int Kills;
|
||||
GIBTHING *at8;
|
||||
int atc;
|
||||
int at10;
|
||||
GIBFX* gibFX;
|
||||
int Kills;
|
||||
GIBTHING* at8;
|
||||
int atc;
|
||||
int at10;
|
||||
};
|
||||
|
||||
GIBFX gibFxGlassT[] = {
|
||||
{ FX_18, 0, 65536, 3, 200, 400 },
|
||||
{ FX_31, 0, 32768, 5, 200, 400 }
|
||||
{ FX_18, 0, 65536, 3, 200, 400 },
|
||||
{ FX_31, 0, 32768, 5, 200, 400 }
|
||||
};
|
||||
|
||||
GIBFX gibFxGlassS[] = {
|
||||
{ FX_18, 0, 65536, 8, 200, 400 }
|
||||
{ FX_18, 0, 65536, 8, 200, 400 }
|
||||
};
|
||||
|
||||
GIBFX gibFxBurnShard[] = {
|
||||
{ FX_16, 0, 65536, 12, 500, 1000 }
|
||||
{ FX_16, 0, 65536, 12, 500, 1000 }
|
||||
};
|
||||
|
||||
GIBFX gibFxWoodShard[] = {
|
||||
{ FX_17, 0, 65536, 12, 500, 1000 }
|
||||
{ FX_17, 0, 65536, 12, 500, 1000 }
|
||||
};
|
||||
|
||||
GIBFX gibFxMetalShard[] = {
|
||||
{ FX_30, 0, 65536, 12, 500, 1000 }
|
||||
{ FX_30, 0, 65536, 12, 500, 1000 }
|
||||
};
|
||||
|
||||
GIBFX gibFxFireSpark[] = {
|
||||
{ FX_14, 0, 65536, 8, 500, 1000 }
|
||||
{ FX_14, 0, 65536, 8, 500, 1000 }
|
||||
};
|
||||
|
||||
GIBFX gibFxShockSpark[] = {
|
||||
{ FX_15, 0, 65536, 8, 500, 1000 }
|
||||
{ FX_15, 0, 65536, 8, 500, 1000 }
|
||||
};
|
||||
|
||||
GIBFX gibFxBloodChunks[] = {
|
||||
{ FX_13, 0, 65536, 8, 90, 600 }
|
||||
{ FX_13, 0, 65536, 8, 90, 600 }
|
||||
};
|
||||
|
||||
GIBFX gibFxBubblesS[] = {
|
||||
{ FX_25, 0, 65536, 8, 200, 400 }
|
||||
{ FX_25, 0, 65536, 8, 200, 400 }
|
||||
};
|
||||
|
||||
GIBFX gibFxBubblesM[] = {
|
||||
{ FX_24, 0, 65536, 8, 200, 400 }
|
||||
{ FX_24, 0, 65536, 8, 200, 400 }
|
||||
};
|
||||
|
||||
GIBFX gibFxBubblesL[] = {
|
||||
{ FX_23, 0, 65536, 8, 200, 400 }
|
||||
{ FX_23, 0, 65536, 8, 200, 400 }
|
||||
};
|
||||
|
||||
GIBFX gibFxIcicles[] = {
|
||||
{ FX_31, 0, 65536, 15, 200, 400 }
|
||||
{ FX_31, 0, 65536, 15, 200, 400 }
|
||||
};
|
||||
|
||||
GIBFX gibFxGlassCombo1[] = {
|
||||
{ FX_18, 0, 65536, 15, 200, 400 },
|
||||
{ FX_31, 0, 65536, 10, 200, 400 }
|
||||
{ FX_18, 0, 65536, 15, 200, 400 },
|
||||
{ FX_31, 0, 65536, 10, 200, 400 }
|
||||
};
|
||||
|
||||
GIBFX gibFxGlassCombo2[] = {
|
||||
{ FX_18, 0, 65536, 5, 200, 400 },
|
||||
{ FX_20, 0, 53248, 5, 200, 400 },
|
||||
{ FX_21, 0, 53248, 5, 200, 400 },
|
||||
{ FX_19, 0, 53248, 5, 200, 400 },
|
||||
{ FX_22, 0, 53248, 5, 200, 400 }
|
||||
{ FX_18, 0, 65536, 5, 200, 400 },
|
||||
{ FX_20, 0, 53248, 5, 200, 400 },
|
||||
{ FX_21, 0, 53248, 5, 200, 400 },
|
||||
{ FX_19, 0, 53248, 5, 200, 400 },
|
||||
{ FX_22, 0, 53248, 5, 200, 400 }
|
||||
};
|
||||
|
||||
GIBFX gibFxWoodCombo[] = {
|
||||
{ FX_16, 0, 65536, 8, 500, 1000 },
|
||||
{ FX_17, 0, 65536, 8, 500, 1000 },
|
||||
{ FX_14, 0, 65536, 8, 500, 1000 }
|
||||
{ FX_16, 0, 65536, 8, 500, 1000 },
|
||||
{ FX_17, 0, 65536, 8, 500, 1000 },
|
||||
{ FX_14, 0, 65536, 8, 500, 1000 }
|
||||
};
|
||||
|
||||
GIBFX gibFxMedicCombo[] = {
|
||||
{ FX_18, 0, 32768, 7, 200, 400 },
|
||||
{ FX_30, 0, 65536, 7, 500, 1000 },
|
||||
{ FX_13, 0, 65536, 10, 90, 600 },
|
||||
{ FX_14, 0, 32768, 7, 500, 1000 }
|
||||
{ FX_18, 0, 32768, 7, 200, 400 },
|
||||
{ FX_30, 0, 65536, 7, 500, 1000 },
|
||||
{ FX_13, 0, 65536, 10, 90, 600 },
|
||||
{ FX_14, 0, 32768, 7, 500, 1000 }
|
||||
};
|
||||
|
||||
GIBFX gibFxFlareSpark[] = {
|
||||
{ FX_28, 0, 32768, 15, 128, -128 }
|
||||
{ FX_28, 0, 32768, 15, 128, -128 }
|
||||
};
|
||||
|
||||
GIBFX gibFxBloodBits[] = {
|
||||
{ FX_13, 0, 45056, 8, 90, 600 }
|
||||
{ FX_13, 0, 45056, 8, 90, 600 }
|
||||
};
|
||||
|
||||
GIBFX gibFxRockShards[] = {
|
||||
{ FX_46, 0, 65536, 10, 300, 800 },
|
||||
{ FX_31, 0, 32768, 10, 200, 1000 }
|
||||
{ FX_46, 0, 65536, 10, 300, 800 },
|
||||
{ FX_31, 0, 32768, 10, 200, 1000 }
|
||||
};
|
||||
|
||||
GIBFX gibFxPaperCombo1[] = {
|
||||
{ FX_47, 0, 65536, 12, 300, 600 },
|
||||
{ FX_14, 0, 65536, 8, 500, 1000 }
|
||||
{ FX_47, 0, 65536, 12, 300, 600 },
|
||||
{ FX_14, 0, 65536, 8, 500, 1000 }
|
||||
};
|
||||
|
||||
GIBFX gibFxPlantCombo1[] = {
|
||||
{ FX_44, 0, 45056, 8, 400, 800 },
|
||||
{ FX_45, 0, 45056, 8, 300, 800 },
|
||||
{ FX_14, 0, 45056, 6, 500, 1000 }
|
||||
{ FX_44, 0, 45056, 8, 400, 800 },
|
||||
{ FX_45, 0, 45056, 8, 300, 800 },
|
||||
{ FX_14, 0, 45056, 6, 500, 1000 }
|
||||
};
|
||||
|
||||
GIBFX gibFx13BBA8[] = {
|
||||
{ FX_49, 0, 65536, 4, 80, 300 }
|
||||
{ FX_49, 0, 65536, 4, 80, 300 }
|
||||
};
|
||||
|
||||
GIBFX gibFx13BBC0[] = {
|
||||
{ FX_50, 0, 65536, 4, 80, 0 }
|
||||
{ FX_50, 0, 65536, 4, 80, 0 }
|
||||
};
|
||||
|
||||
GIBFX gibFx13BBD8[] = {
|
||||
{ FX_50, 0, 65536, 20, 800, -40 },
|
||||
{ FX_15, 0, 65536, 15, 400, 10 }
|
||||
{ FX_50, 0, 65536, 20, 800, -40 },
|
||||
{ FX_15, 0, 65536, 15, 400, 10 }
|
||||
};
|
||||
|
||||
GIBFX gibFx13BC04[] = {
|
||||
{ FX_32, 0, 65536, 8, 100, 0 }
|
||||
{ FX_32, 0, 65536, 8, 100, 0 }
|
||||
};
|
||||
|
||||
GIBFX gibFx13BC1C[] = {
|
||||
{ FX_56, 0, 65536, 8, 100, 0 }
|
||||
{ FX_56, 0, 65536, 8, 100, 0 }
|
||||
};
|
||||
|
||||
GIBTHING gibHuman[] = {
|
||||
{ 425, 1454, 917504, 300, 900 },
|
||||
{ 425, 1454, 917504, 300, 900 },
|
||||
{ 425, 1267, 917504, 300, 900 },
|
||||
{ 425, 1267, 917504, 300, 900 },
|
||||
{ 425, 1268, 917504, 300, 900 },
|
||||
{ 425, 1269, 917504, 300, 900 },
|
||||
{ 425, 1456, 917504, 300, 900 }
|
||||
{ 425, 1454, 917504, 300, 900 },
|
||||
{ 425, 1454, 917504, 300, 900 },
|
||||
{ 425, 1267, 917504, 300, 900 },
|
||||
{ 425, 1267, 917504, 300, 900 },
|
||||
{ 425, 1268, 917504, 300, 900 },
|
||||
{ 425, 1269, 917504, 300, 900 },
|
||||
{ 425, 1456, 917504, 300, 900 }
|
||||
};
|
||||
|
||||
GIBTHING gibMime[] = {
|
||||
{ 425, 2405, 917504, 300, 900 },
|
||||
{ 425, 2405, 917504, 300, 900 },
|
||||
{ 425, 2404, 917504, 300, 900 },
|
||||
{ 425, 1268, 32768, 300, 900 },
|
||||
{ 425, 1269, 32768, 300, 900 },
|
||||
{ 425, 1456, 32768, 300, 900 },
|
||||
{ 425, 2405, 917504, 300, 900 },
|
||||
{ 425, 2405, 917504, 300, 900 },
|
||||
{ 425, 2404, 917504, 300, 900 },
|
||||
{ 425, 1268, 32768, 300, 900 },
|
||||
{ 425, 1269, 32768, 300, 900 },
|
||||
{ 425, 1456, 32768, 300, 900 },
|
||||
};
|
||||
|
||||
GIBTHING gibHound[] = {
|
||||
{ 425, 1326, 917504, 300, 900 },
|
||||
{ 425, 1268, 32768, 300, 900 },
|
||||
{ 425, 1269, 32768, 300, 900 },
|
||||
{ 425, 1456, 32768, 300, 900 }
|
||||
{ 425, 1326, 917504, 300, 900 },
|
||||
{ 425, 1268, 32768, 300, 900 },
|
||||
{ 425, 1269, 32768, 300, 900 },
|
||||
{ 425, 1456, 32768, 300, 900 }
|
||||
};
|
||||
|
||||
GIBTHING gibFleshGargoyle[] = {
|
||||
{ 425, 1369, 917504, 300, 900 },
|
||||
{ 425, 1361, 917504, 300, 900 },
|
||||
{ 425, 1268, 32768, 300, 900 },
|
||||
{ 425, 1269, 32768, 300, 900 },
|
||||
{ 425, 1456, 32768, 300, 900 }
|
||||
{ 425, 1369, 917504, 300, 900 },
|
||||
{ 425, 1361, 917504, 300, 900 },
|
||||
{ 425, 1268, 32768, 300, 900 },
|
||||
{ 425, 1269, 32768, 300, 900 },
|
||||
{ 425, 1456, 32768, 300, 900 }
|
||||
};
|
||||
|
||||
GIBTHING gibAxeZombieHead[] = {
|
||||
{ 427, 3405, 917504, 0, 0 }
|
||||
{ 427, 3405, 917504, 0, 0 }
|
||||
};
|
||||
|
||||
GIBLIST gibList[] = {
|
||||
{ gibFxGlassT, 2, NULL, 0, 300 },
|
||||
{ gibFxGlassS, 1, NULL, 0, 300 },
|
||||
{ gibFxBurnShard, 1, NULL, 0, 0 },
|
||||
{ gibFxWoodShard, 1, NULL, 0, 0 },
|
||||
{ gibFxMetalShard, 1, NULL, 0, 0 },
|
||||
{ gibFxFireSpark, 1, NULL, 0, 0 },
|
||||
{ gibFxShockSpark, 1, NULL, 0, 0 },
|
||||
{ gibFxBloodChunks, 1, NULL, 0, 0 },
|
||||
{ gibFxBubblesS, 1, NULL, 0, 0 },
|
||||
{ gibFxBubblesM, 1, NULL, 0, 0 },
|
||||
{ gibFxBubblesL, 1, NULL, 0, 0 },
|
||||
{ gibFxIcicles, 1, NULL, 0, 0 },
|
||||
{ gibFxGlassCombo1, 2, NULL, 0, 300 },
|
||||
{ gibFxGlassCombo2, 5, NULL, 0, 300 },
|
||||
{ gibFxWoodCombo, 3, NULL, 0, 0 },
|
||||
{ NULL, 0, gibHuman, 7, 0 },
|
||||
{ gibFxMedicCombo, 4, NULL, 0, 0 },
|
||||
{ gibFxFlareSpark, 1, NULL, 0, 0 },
|
||||
{ gibFxBloodBits, 1, NULL, 0, 0 },
|
||||
{ gibFxRockShards, 2, NULL, 0, 0 },
|
||||
{ gibFxPaperCombo1, 2, NULL, 0, 0 },
|
||||
{ gibFxPlantCombo1, 3, NULL, 0, 0 },
|
||||
{ gibFx13BBA8, 1, NULL, 0, 0 },
|
||||
{ gibFx13BBC0, 1, NULL, 0, 0 },
|
||||
{ gibFx13BBD8, 2, NULL, 0, 0 },
|
||||
{ gibFx13BC04, 1, NULL, 0, 0 },
|
||||
{ gibFx13BC1C, 1, NULL, 0, 0 },
|
||||
{ NULL, 0, gibAxeZombieHead, 1, 0 },
|
||||
{ NULL, 0, gibMime, 6, 0 },
|
||||
{ NULL, 0, gibHound, 4, 0 },
|
||||
{ NULL, 0, gibFleshGargoyle, 5, 0 },
|
||||
{ gibFxGlassT, 2, NULL, 0, 300 },
|
||||
{ gibFxGlassS, 1, NULL, 0, 300 },
|
||||
{ gibFxBurnShard, 1, NULL, 0, 0 },
|
||||
{ gibFxWoodShard, 1, NULL, 0, 0 },
|
||||
{ gibFxMetalShard, 1, NULL, 0, 0 },
|
||||
{ gibFxFireSpark, 1, NULL, 0, 0 },
|
||||
{ gibFxShockSpark, 1, NULL, 0, 0 },
|
||||
{ gibFxBloodChunks, 1, NULL, 0, 0 },
|
||||
{ gibFxBubblesS, 1, NULL, 0, 0 },
|
||||
{ gibFxBubblesM, 1, NULL, 0, 0 },
|
||||
{ gibFxBubblesL, 1, NULL, 0, 0 },
|
||||
{ gibFxIcicles, 1, NULL, 0, 0 },
|
||||
{ gibFxGlassCombo1, 2, NULL, 0, 300 },
|
||||
{ gibFxGlassCombo2, 5, NULL, 0, 300 },
|
||||
{ gibFxWoodCombo, 3, NULL, 0, 0 },
|
||||
{ NULL, 0, gibHuman, 7, 0 },
|
||||
{ gibFxMedicCombo, 4, NULL, 0, 0 },
|
||||
{ gibFxFlareSpark, 1, NULL, 0, 0 },
|
||||
{ gibFxBloodBits, 1, NULL, 0, 0 },
|
||||
{ gibFxRockShards, 2, NULL, 0, 0 },
|
||||
{ gibFxPaperCombo1, 2, NULL, 0, 0 },
|
||||
{ gibFxPlantCombo1, 3, NULL, 0, 0 },
|
||||
{ gibFx13BBA8, 1, NULL, 0, 0 },
|
||||
{ gibFx13BBC0, 1, NULL, 0, 0 },
|
||||
{ gibFx13BBD8, 2, NULL, 0, 0 },
|
||||
{ gibFx13BC04, 1, NULL, 0, 0 },
|
||||
{ gibFx13BC1C, 1, NULL, 0, 0 },
|
||||
{ NULL, 0, gibAxeZombieHead, 1, 0 },
|
||||
{ NULL, 0, gibMime, 6, 0 },
|
||||
{ NULL, 0, gibHound, 4, 0 },
|
||||
{ NULL, 0, gibFleshGargoyle, 5, 0 },
|
||||
};
|
||||
|
||||
int ChanceToCount(int a1, int a2)
|
||||
{
|
||||
int vb = a2;
|
||||
if (a1 < 0x10000)
|
||||
{
|
||||
for (int i = 0; i < a2; i++)
|
||||
if (!Chance(a1))
|
||||
vb--;
|
||||
}
|
||||
return vb;
|
||||
int vb = a2;
|
||||
if (a1 < 0x10000)
|
||||
{
|
||||
for (int i = 0; i < a2; i++)
|
||||
if (!Chance(a1))
|
||||
vb--;
|
||||
}
|
||||
return vb;
|
||||
}
|
||||
|
||||
void GibFX(DBloodActor* actor, GIBFX *pGFX, CGibPosition *pPos, CGibVelocity *pVel)
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void GibFX(DBloodActor* actor, GIBFX* pGFX, CGibPosition* pPos, CGibVelocity* pVel)
|
||||
{
|
||||
auto pSector = actor->spr.sector();
|
||||
if (adult_lockout && gGameOptions.nGameType == 0 && pGFX->fxId == FX_13)
|
||||
return;
|
||||
CGibPosition gPos(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z);
|
||||
if (pPos)
|
||||
gPos = *pPos;
|
||||
int32_t ceilZ, floorZ;
|
||||
getzsofslopeptr(pSector, gPos.x, gPos.y, &ceilZ, &floorZ);
|
||||
int nCount = ChanceToCount(pGFX->chance, pGFX->at9);
|
||||
int dz1 = floorZ-gPos.z;
|
||||
int dz2 = gPos.z-ceilZ;
|
||||
int top, bottom;
|
||||
GetActorExtents(actor, &top, &bottom);
|
||||
for (int i = 0; i < nCount; i++)
|
||||
{
|
||||
if (!pPos && (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0)
|
||||
{
|
||||
int nAngle = Random(2048);
|
||||
gPos.x = actor->spr.pos.X+MulScale(actor->spr.clipdist<<2, Cos(nAngle), 30);
|
||||
gPos.y = actor->spr.pos.Y+MulScale(actor->spr.clipdist<<2, Sin(nAngle), 30);
|
||||
gPos.z = bottom-Random(bottom-top);
|
||||
}
|
||||
auto pFX = gFX.fxSpawnActor(pGFX->fxId, pSector, gPos.x, gPos.y, gPos.z, 0);
|
||||
if (pFX)
|
||||
{
|
||||
if (pGFX->at1 < 0)
|
||||
pFX->spr.pal = actor->spr.pal;
|
||||
if (pVel)
|
||||
{
|
||||
pFX->xvel = pVel->vx+Random2(pGFX->atd);
|
||||
pFX->yvel = pVel->vy+Random2(pGFX->atd);
|
||||
pFX->zvel = pVel->vz-Random(pGFX->at11);
|
||||
}
|
||||
else
|
||||
{
|
||||
pFX->xvel = Random2((pGFX->atd<<18)/120);
|
||||
pFX->yvel = Random2((pGFX->atd<<18)/120);
|
||||
switch(actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
|
||||
{
|
||||
case 16:
|
||||
pFX->zvel = Random2((pGFX->at11<<18)/120);
|
||||
break;
|
||||
default:
|
||||
if (dz2 < dz1 && dz2 < 0x4000)
|
||||
{
|
||||
pFX->zvel = 0;
|
||||
}
|
||||
else if (dz2 > dz1 && dz1 < 0x4000)
|
||||
{
|
||||
pFX->zvel = -(int)Random((abs(pGFX->at11)<<18)/120);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((pGFX->at11<<18)/120 < 0)
|
||||
pFX->zvel = -(int)Random((abs(pGFX->at11)<<18)/120);
|
||||
else
|
||||
pFX->zvel = Random2((pGFX->at11<<18)/120);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
auto pSector = actor->spr.sector();
|
||||
if (adult_lockout && gGameOptions.nGameType == 0 && pGFX->fxId == FX_13)
|
||||
return;
|
||||
CGibPosition gPos(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z);
|
||||
if (pPos)
|
||||
gPos = *pPos;
|
||||
int32_t ceilZ, floorZ;
|
||||
getzsofslopeptr(pSector, gPos.x, gPos.y, &ceilZ, &floorZ);
|
||||
int nCount = ChanceToCount(pGFX->chance, pGFX->at9);
|
||||
int dz1 = floorZ - gPos.z;
|
||||
int dz2 = gPos.z - ceilZ;
|
||||
int top, bottom;
|
||||
GetActorExtents(actor, &top, &bottom);
|
||||
for (int i = 0; i < nCount; i++)
|
||||
{
|
||||
if (!pPos && (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0)
|
||||
{
|
||||
int nAngle = Random(2048);
|
||||
gPos.x = actor->spr.pos.X + MulScale(actor->spr.clipdist << 2, Cos(nAngle), 30);
|
||||
gPos.y = actor->spr.pos.Y + MulScale(actor->spr.clipdist << 2, Sin(nAngle), 30);
|
||||
gPos.z = bottom - Random(bottom - top);
|
||||
}
|
||||
auto pFX = gFX.fxSpawnActor(pGFX->fxId, pSector, gPos.x, gPos.y, gPos.z, 0);
|
||||
if (pFX)
|
||||
{
|
||||
if (pGFX->at1 < 0)
|
||||
pFX->spr.pal = actor->spr.pal;
|
||||
if (pVel)
|
||||
{
|
||||
pFX->xvel = pVel->vx + Random2(pGFX->atd);
|
||||
pFX->yvel = pVel->vy + Random2(pGFX->atd);
|
||||
pFX->zvel = pVel->vz - Random(pGFX->at11);
|
||||
}
|
||||
else
|
||||
{
|
||||
pFX->xvel = Random2((pGFX->atd << 18) / 120);
|
||||
pFX->yvel = Random2((pGFX->atd << 18) / 120);
|
||||
switch (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
|
||||
{
|
||||
case 16:
|
||||
pFX->zvel = Random2((pGFX->at11 << 18) / 120);
|
||||
break;
|
||||
default:
|
||||
if (dz2 < dz1 && dz2 < 0x4000)
|
||||
{
|
||||
pFX->zvel = 0;
|
||||
}
|
||||
else if (dz2 > dz1 && dz1 < 0x4000)
|
||||
{
|
||||
pFX->zvel = -(int)Random((abs(pGFX->at11) << 18) / 120);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((pGFX->at11 << 18) / 120 < 0)
|
||||
pFX->zvel = -(int)Random((abs(pGFX->at11) << 18) / 120);
|
||||
else
|
||||
pFX->zvel = Random2((pGFX->at11 << 18) / 120);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GibThing(DBloodActor* actor, GIBTHING *pGThing, CGibPosition *pPos, CGibVelocity *pVel)
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void GibThing(DBloodActor* actor, GIBTHING* pGThing, CGibPosition* pPos, CGibVelocity* pVel)
|
||||
{
|
||||
if (adult_lockout && gGameOptions.nGameType <= 0)
|
||||
switch (pGThing->type) {
|
||||
case kThingBloodBits:
|
||||
case kThingZombieHead:
|
||||
return;
|
||||
}
|
||||
if (adult_lockout && gGameOptions.nGameType <= 0)
|
||||
switch (pGThing->type) {
|
||||
case kThingBloodBits:
|
||||
case kThingZombieHead:
|
||||
return;
|
||||
}
|
||||
|
||||
if (pGThing->chance == 65536 || Chance(pGThing->chance))
|
||||
{
|
||||
auto pSector = actor->spr.sector();
|
||||
int top, bottom;
|
||||
GetActorExtents(actor, &top, &bottom);
|
||||
int x, y, z;
|
||||
if (!pPos)
|
||||
{
|
||||
int nAngle = Random(2048);
|
||||
x = actor->spr.pos.X+MulScale(actor->spr.clipdist<<2, Cos(nAngle), 30);
|
||||
y = actor->spr.pos.Y+MulScale(actor->spr.clipdist<<2, Sin(nAngle), 30);
|
||||
z = bottom-Random(bottom-top);
|
||||
}
|
||||
else
|
||||
{
|
||||
x = pPos->x;
|
||||
y = pPos->y;
|
||||
z = pPos->z;
|
||||
}
|
||||
int32_t ceilZ, floorZ;
|
||||
getzsofslopeptr(pSector, x, y, &ceilZ, &floorZ);
|
||||
int dz1 = floorZ-z;
|
||||
int dz2 = z-ceilZ;
|
||||
auto gibactor = actSpawnThing(pSector, x, y, z, pGThing->type);
|
||||
if (!gibactor) return;
|
||||
if (pGThing->chance == 65536 || Chance(pGThing->chance))
|
||||
{
|
||||
auto pSector = actor->spr.sector();
|
||||
int top, bottom;
|
||||
GetActorExtents(actor, &top, &bottom);
|
||||
int x, y, z;
|
||||
if (!pPos)
|
||||
{
|
||||
int nAngle = Random(2048);
|
||||
x = actor->spr.pos.X + MulScale(actor->spr.clipdist << 2, Cos(nAngle), 30);
|
||||
y = actor->spr.pos.Y + MulScale(actor->spr.clipdist << 2, Sin(nAngle), 30);
|
||||
z = bottom - Random(bottom - top);
|
||||
}
|
||||
else
|
||||
{
|
||||
x = pPos->x;
|
||||
y = pPos->y;
|
||||
z = pPos->z;
|
||||
}
|
||||
int32_t ceilZ, floorZ;
|
||||
getzsofslopeptr(pSector, x, y, &ceilZ, &floorZ);
|
||||
int dz1 = floorZ - z;
|
||||
int dz2 = z - ceilZ;
|
||||
auto gibactor = actSpawnThing(pSector, x, y, z, pGThing->type);
|
||||
if (!gibactor) return;
|
||||
|
||||
if (pGThing->Kills > -1)
|
||||
gibactor->spr.picnum = pGThing->Kills;
|
||||
if (pVel)
|
||||
{
|
||||
gibactor->xvel = pVel->vx+Random2(pGThing->atc);
|
||||
gibactor->yvel = pVel->vy+Random2(pGThing->atc);
|
||||
gibactor->zvel = pVel->vz-Random(pGThing->at10);
|
||||
}
|
||||
else
|
||||
{
|
||||
gibactor->xvel = Random2((pGThing->atc<<18)/120);
|
||||
gibactor->yvel = Random2((pGThing->atc<<18)/120);
|
||||
switch (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
|
||||
{
|
||||
case 16:
|
||||
gibactor->zvel = Random2((pGThing->at10<<18)/120);
|
||||
break;
|
||||
default:
|
||||
if (dz2 < dz1 && dz2 < 0x4000)
|
||||
{
|
||||
gibactor->zvel = 0;
|
||||
}
|
||||
else if (dz2 > dz1 && dz1 < 0x4000)
|
||||
{
|
||||
gibactor->zvel = -(int)Random((pGThing->at10<<18)/120);
|
||||
}
|
||||
else
|
||||
{
|
||||
gibactor->zvel = Random2((pGThing->at10<<18)/120);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pGThing->Kills > -1)
|
||||
gibactor->spr.picnum = pGThing->Kills;
|
||||
if (pVel)
|
||||
{
|
||||
gibactor->xvel = pVel->vx + Random2(pGThing->atc);
|
||||
gibactor->yvel = pVel->vy + Random2(pGThing->atc);
|
||||
gibactor->zvel = pVel->vz - Random(pGThing->at10);
|
||||
}
|
||||
else
|
||||
{
|
||||
gibactor->xvel = Random2((pGThing->atc << 18) / 120);
|
||||
gibactor->yvel = Random2((pGThing->atc << 18) / 120);
|
||||
switch (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
|
||||
{
|
||||
case 16:
|
||||
gibactor->zvel = Random2((pGThing->at10 << 18) / 120);
|
||||
break;
|
||||
default:
|
||||
if (dz2 < dz1 && dz2 < 0x4000)
|
||||
{
|
||||
gibactor->zvel = 0;
|
||||
}
|
||||
else if (dz2 > dz1 && dz1 < 0x4000)
|
||||
{
|
||||
gibactor->zvel = -(int)Random((pGThing->at10 << 18) / 120);
|
||||
}
|
||||
else
|
||||
{
|
||||
gibactor->zvel = Random2((pGThing->at10 << 18) / 120);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GibSprite(DBloodActor* actor, GIBTYPE nGibType, CGibPosition *pPos, CGibVelocity *pVel)
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void GibSprite(DBloodActor* actor, GIBTYPE nGibType, CGibPosition* pPos, CGibVelocity* pVel)
|
||||
{
|
||||
assert(actor != NULL);
|
||||
assert(nGibType >= 0 && nGibType < kGibMax);
|
||||
assert(actor != NULL);
|
||||
assert(nGibType >= 0 && nGibType < kGibMax);
|
||||
|
||||
if (!actor->spr.insector())
|
||||
return;
|
||||
GIBLIST *pGib = &gibList[nGibType];
|
||||
for (int i = 0; i < pGib->Kills; i++)
|
||||
{
|
||||
GIBFX *pGibFX = &pGib->gibFX[i];
|
||||
assert(pGibFX->chance > 0);
|
||||
GibFX(actor, pGibFX, pPos, pVel);
|
||||
}
|
||||
for (int i = 0; i < pGib->atc; i++)
|
||||
{
|
||||
GIBTHING *pGibThing = &pGib->at8[i];
|
||||
assert(pGibThing->chance > 0);
|
||||
GibThing(actor, pGibThing, pPos, pVel);
|
||||
}
|
||||
if (!actor->spr.insector())
|
||||
return;
|
||||
GIBLIST* pGib = &gibList[nGibType];
|
||||
for (int i = 0; i < pGib->Kills; i++)
|
||||
{
|
||||
GIBFX* pGibFX = &pGib->gibFX[i];
|
||||
assert(pGibFX->chance > 0);
|
||||
GibFX(actor, pGibFX, pPos, pVel);
|
||||
}
|
||||
for (int i = 0; i < pGib->atc; i++)
|
||||
{
|
||||
GIBTHING* pGibThing = &pGib->at8[i];
|
||||
assert(pGibThing->chance > 0);
|
||||
GibThing(actor, pGibThing, pPos, pVel);
|
||||
}
|
||||
}
|
||||
|
||||
void GibFX(walltype* pWall, GIBFX * pGFX, int a3, int a4, int a5, int a6, CGibVelocity * pVel)
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void GibFX(walltype* pWall, GIBFX* pGFX, int a3, int a4, int a5, int a6, CGibVelocity* pVel)
|
||||
{
|
||||
assert(pWall);
|
||||
int nCount = ChanceToCount(pGFX->chance, pGFX->at9);
|
||||
auto pSector = pWall->sectorp();
|
||||
for (int i = 0; i < nCount; i++)
|
||||
{
|
||||
int r1 = Random(a6);
|
||||
int r2 = Random(a5);
|
||||
int r3 = Random(a4);
|
||||
auto pGib = gFX.fxSpawnActor(pGFX->fxId, pSector, pWall->pos.X+r3, pWall->pos.Y+r2, a3+r1, 0);
|
||||
if (pGib)
|
||||
{
|
||||
if (pGFX->at1 < 0)
|
||||
pGib->spr.pal = pWall->pal;
|
||||
if (!pVel)
|
||||
{
|
||||
pGib->xvel = Random2((pGFX->atd<<18)/120);
|
||||
pGib->yvel = Random2((pGFX->atd<<18)/120);
|
||||
pGib->zvel = -(int)Random((pGFX->at11<<18)/120);
|
||||
}
|
||||
else
|
||||
{
|
||||
pGib->xvel = Random2((pVel->vx << 18) / 120);
|
||||
pGib->yvel = Random2((pVel->vy << 18) / 120);
|
||||
pGib->zvel = -(int)Random((pVel->vz<<18)/120);
|
||||
}
|
||||
}
|
||||
}
|
||||
assert(pWall);
|
||||
int nCount = ChanceToCount(pGFX->chance, pGFX->at9);
|
||||
auto pSector = pWall->sectorp();
|
||||
for (int i = 0; i < nCount; i++)
|
||||
{
|
||||
int r1 = Random(a6);
|
||||
int r2 = Random(a5);
|
||||
int r3 = Random(a4);
|
||||
auto pGib = gFX.fxSpawnActor(pGFX->fxId, pSector, pWall->pos.X + r3, pWall->pos.Y + r2, a3 + r1, 0);
|
||||
if (pGib)
|
||||
{
|
||||
if (pGFX->at1 < 0)
|
||||
pGib->spr.pal = pWall->pal;
|
||||
if (!pVel)
|
||||
{
|
||||
pGib->xvel = Random2((pGFX->atd << 18) / 120);
|
||||
pGib->yvel = Random2((pGFX->atd << 18) / 120);
|
||||
pGib->zvel = -(int)Random((pGFX->at11 << 18) / 120);
|
||||
}
|
||||
else
|
||||
{
|
||||
pGib->xvel = Random2((pVel->vx << 18) / 120);
|
||||
pGib->yvel = Random2((pVel->vy << 18) / 120);
|
||||
pGib->zvel = -(int)Random((pVel->vz << 18) / 120);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GibWall(walltype* pWall, GIBTYPE nGibType, CGibVelocity *pVel)
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void GibWall(walltype* pWall, GIBTYPE nGibType, CGibVelocity* pVel)
|
||||
{
|
||||
assert(pWall);
|
||||
assert(nGibType >= 0 && nGibType < kGibMax);
|
||||
int cx, cy, cz, wx, wy, wz;
|
||||
assert(pWall);
|
||||
assert(nGibType >= 0 && nGibType < kGibMax);
|
||||
int cx, cy, cz, wx, wy, wz;
|
||||
|
||||
cx = (pWall->pos.X+pWall->point2Wall()->pos.X)>>1;
|
||||
cy = (pWall->pos.Y+pWall->point2Wall()->pos.Y)>>1;
|
||||
auto pSector = pWall->sectorp();
|
||||
int32_t ceilZ, floorZ;
|
||||
getzsofslopeptr(pSector, cx, cy, &ceilZ, &floorZ);
|
||||
int32_t ceilZ2, floorZ2;
|
||||
getzsofslopeptr(pWall->nextSector(), cx, cy, &ceilZ2, &floorZ2);
|
||||
cx = (pWall->pos.X + pWall->point2Wall()->pos.X) >> 1;
|
||||
cy = (pWall->pos.Y + pWall->point2Wall()->pos.Y) >> 1;
|
||||
auto pSector = pWall->sectorp();
|
||||
int32_t ceilZ, floorZ;
|
||||
getzsofslopeptr(pSector, cx, cy, &ceilZ, &floorZ);
|
||||
int32_t ceilZ2, floorZ2;
|
||||
getzsofslopeptr(pWall->nextSector(), cx, cy, &ceilZ2, &floorZ2);
|
||||
|
||||
ceilZ = ClipLow(ceilZ, ceilZ2);
|
||||
floorZ = ClipHigh(floorZ, floorZ2);
|
||||
wz = floorZ-ceilZ;
|
||||
wx = pWall->point2Wall()->pos.X-pWall->pos.X;
|
||||
wy = pWall->point2Wall()->pos.Y-pWall->pos.Y;
|
||||
cz = (ceilZ+floorZ)>>1;
|
||||
ceilZ = ClipLow(ceilZ, ceilZ2);
|
||||
floorZ = ClipHigh(floorZ, floorZ2);
|
||||
wz = floorZ - ceilZ;
|
||||
wx = pWall->point2Wall()->pos.X - pWall->pos.X;
|
||||
wy = pWall->point2Wall()->pos.Y - pWall->pos.Y;
|
||||
cz = (ceilZ + floorZ) >> 1;
|
||||
|
||||
GIBLIST *pGib = &gibList[nGibType];
|
||||
sfxPlay3DSound(cx, cy, cz, pGib->at10, pSector);
|
||||
for (int i = 0; i < pGib->Kills; i++)
|
||||
{
|
||||
GIBFX *pGibFX = &pGib->gibFX[i];
|
||||
assert(pGibFX->chance > 0);
|
||||
GibFX(pWall, pGibFX, ceilZ, wx, wy, wz, pVel);
|
||||
}
|
||||
GIBLIST* pGib = &gibList[nGibType];
|
||||
sfxPlay3DSound(cx, cy, cz, pGib->at10, pSector);
|
||||
for (int i = 0; i < pGib->Kills; i++)
|
||||
{
|
||||
GIBFX* pGibFX = &pGib->gibFX[i];
|
||||
assert(pGibFX->chance > 0);
|
||||
GibFX(pWall, pGibFX, ceilZ, wx, wy, wz, pVel);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void gibPrecache()
|
||||
{
|
||||
for (int i = 0; i < kGibMax; i++)
|
||||
{
|
||||
auto const pThing = gibList[i].at8;
|
||||
if (pThing)
|
||||
{
|
||||
for (int j = 0; j < gibList[i].atc; j++)
|
||||
{
|
||||
if (pThing[j].Kills >= 0)
|
||||
tilePrecacheTile(pThing[j].Kills, -1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < kGibMax; i++)
|
||||
{
|
||||
auto const pThing = gibList[i].at8;
|
||||
if (pThing)
|
||||
{
|
||||
for (int j = 0; j < gibList[i].atc; j++)
|
||||
{
|
||||
if (pThing[j].Kills >= 0)
|
||||
tilePrecacheTile(pThing[j].Kills, -1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
END_BLD_NS
|
||||
|
|
|
@ -25,52 +25,52 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
BEGIN_BLD_NS
|
||||
|
||||
enum GIBTYPE {
|
||||
GIBTYPE_0 = 0,
|
||||
GIBTYPE_1,
|
||||
GIBTYPE_2,
|
||||
GIBTYPE_3,
|
||||
GIBTYPE_4,
|
||||
GIBTYPE_5,
|
||||
GIBTYPE_6,
|
||||
GIBTYPE_7,
|
||||
GIBTYPE_8,
|
||||
GIBTYPE_9,
|
||||
GIBTYPE_10,
|
||||
GIBTYPE_11,
|
||||
GIBTYPE_12,
|
||||
GIBTYPE_13,
|
||||
GIBTYPE_14,
|
||||
GIBTYPE_15,
|
||||
GIBTYPE_16,
|
||||
GIBTYPE_17,
|
||||
GIBTYPE_18,
|
||||
GIBTYPE_19,
|
||||
GIBTYPE_20,
|
||||
GIBTYPE_21,
|
||||
GIBTYPE_22,
|
||||
GIBTYPE_23,
|
||||
GIBTYPE_24,
|
||||
GIBTYPE_25,
|
||||
GIBTYPE_26,
|
||||
GIBTYPE_27,
|
||||
GIBTYPE_28,
|
||||
GIBTYPE_29,
|
||||
GIBTYPE_30,
|
||||
kGibMax
|
||||
GIBTYPE_0 = 0,
|
||||
GIBTYPE_1,
|
||||
GIBTYPE_2,
|
||||
GIBTYPE_3,
|
||||
GIBTYPE_4,
|
||||
GIBTYPE_5,
|
||||
GIBTYPE_6,
|
||||
GIBTYPE_7,
|
||||
GIBTYPE_8,
|
||||
GIBTYPE_9,
|
||||
GIBTYPE_10,
|
||||
GIBTYPE_11,
|
||||
GIBTYPE_12,
|
||||
GIBTYPE_13,
|
||||
GIBTYPE_14,
|
||||
GIBTYPE_15,
|
||||
GIBTYPE_16,
|
||||
GIBTYPE_17,
|
||||
GIBTYPE_18,
|
||||
GIBTYPE_19,
|
||||
GIBTYPE_20,
|
||||
GIBTYPE_21,
|
||||
GIBTYPE_22,
|
||||
GIBTYPE_23,
|
||||
GIBTYPE_24,
|
||||
GIBTYPE_25,
|
||||
GIBTYPE_26,
|
||||
GIBTYPE_27,
|
||||
GIBTYPE_28,
|
||||
GIBTYPE_29,
|
||||
GIBTYPE_30,
|
||||
kGibMax
|
||||
};
|
||||
|
||||
class CGibPosition {
|
||||
public:
|
||||
int x, y, z;
|
||||
CGibPosition(int _x, int _y, int _z) : x(_x), y(_y), z(_z) {}
|
||||
int x, y, z;
|
||||
CGibPosition(int _x, int _y, int _z) : x(_x), y(_y), z(_z) {}
|
||||
};
|
||||
|
||||
class CGibVelocity {
|
||||
public:
|
||||
int vx, vy, vz;
|
||||
CGibVelocity(int _vx, int _vy, int _vz) : vx(_vx), vy(_vy), vz(_vz) {}
|
||||
int vx, vy, vz;
|
||||
CGibVelocity(int _vx, int _vy, int _vz) : vx(_vx), vy(_vy), vz(_vz) {}
|
||||
};
|
||||
|
||||
void GibSprite(DBloodActor *pSprite, GIBTYPE nGibType, CGibPosition *pPos, CGibVelocity *pVel);
|
||||
void GibWall(walltype* pWall, GIBTYPE nGibType, CGibVelocity *pVel);
|
||||
void GibSprite(DBloodActor* pSprite, GIBTYPE nGibType, CGibPosition* pPos, CGibVelocity* pVel);
|
||||
void GibWall(walltype* pWall, GIBTYPE nGibType, CGibVelocity* pVel);
|
||||
END_BLD_NS
|
||||
|
|
|
@ -59,6 +59,12 @@ static struct {
|
|||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
static void drawElement(int x, int y, int tile, double scale = 1, int flipx = 0, int flipy = 0, int pin = 0, int basepal = 0, double alpha = 1)
|
||||
{
|
||||
int flags = RS_TOPLEFT;
|
||||
|
@ -66,10 +72,16 @@ static void drawElement(int x, int y, int tile, double scale = 1, int flipx = 0,
|
|||
if (flipy) flags |= RS_YFLIPHUD;
|
||||
if (pin == -1) flags |= RS_ALIGN_L;
|
||||
else if (pin == 1) flags |= RS_ALIGN_R;
|
||||
hud_drawsprite(x, y, int(scale*65536), 0, tile, 0, basepal, flags, alpha);
|
||||
hud_drawsprite(x, y, int(scale * 65536), 0, tile, 0, basepal, flags, alpha);
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
static void viewBurnTime(int gScale)
|
||||
{
|
||||
if (!gScale) return;
|
||||
|
@ -86,8 +98,13 @@ static void viewBurnTime(int gScale)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void hudDraw(PLAYER *gView, sectortype* pSector, double bobx, double boby, double zDelta, int basepal, double smoothratio)
|
||||
void hudDraw(PLAYER* gView, sectortype* pSector, double bobx, double boby, double zDelta, int basepal, double smoothratio)
|
||||
{
|
||||
double look_anghalf = gView->angle.look_anghalf(smoothratio);
|
||||
|
||||
|
@ -116,7 +133,7 @@ void hudDraw(PLAYER *gView, sectortype* pSector, double bobx, double boby, doubl
|
|||
{
|
||||
cY += (-2048. / 128.);
|
||||
}
|
||||
int nShade = pSector->floorshade;
|
||||
int nShade = pSector->floorshade;
|
||||
int nPalette = 0;
|
||||
if (gView->actor->spr.sector()->hasX()) {
|
||||
sectortype* pViewSect = gView->actor->spr.sector();
|
||||
|
|
Loading…
Reference in a new issue