mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-30 21:31:03 +00:00
- cleanup of the remaining homegrown Blood wrappers.
consoleSysMsg and dassert are gone now, all places now call the system implementation directly.
This commit is contained in:
parent
1579bec714
commit
6acc9db540
48 changed files with 551 additions and 588 deletions
|
@ -2378,7 +2378,7 @@ bool IsUnderwaterSector(int nSector)
|
||||||
|
|
||||||
int actSpriteOwnerToSpriteId(spritetype *pSprite)
|
int actSpriteOwnerToSpriteId(spritetype *pSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite != NULL);
|
assert(pSprite != NULL);
|
||||||
if (pSprite->owner == -1)
|
if (pSprite->owner == -1)
|
||||||
return -1;
|
return -1;
|
||||||
int nSprite = pSprite->owner & (kMaxSprites-1);
|
int nSprite = pSprite->owner & (kMaxSprites-1);
|
||||||
|
@ -2389,7 +2389,7 @@ int actSpriteOwnerToSpriteId(spritetype *pSprite)
|
||||||
|
|
||||||
void actPropagateSpriteOwner(spritetype *pTarget, spritetype *pSource)
|
void actPropagateSpriteOwner(spritetype *pTarget, spritetype *pSource)
|
||||||
{
|
{
|
||||||
dassert(pTarget != NULL && pSource != NULL);
|
assert(pTarget != NULL && pSource != NULL);
|
||||||
if (IsPlayerSprite(pSource))
|
if (IsPlayerSprite(pSource))
|
||||||
pTarget->owner = (pSource->type - kDudePlayer1) | kMaxSprites;
|
pTarget->owner = (pSource->type - kDudePlayer1) | kMaxSprites;
|
||||||
else
|
else
|
||||||
|
@ -2400,7 +2400,7 @@ int actSpriteIdToOwnerId(int nSprite)
|
||||||
{
|
{
|
||||||
if (nSprite == -1)
|
if (nSprite == -1)
|
||||||
return -1;
|
return -1;
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
if (IsPlayerSprite(pSprite))
|
if (IsPlayerSprite(pSprite))
|
||||||
nSprite = (pSprite->type - kDudePlayer1) | kMaxSprites;
|
nSprite = (pSprite->type - kDudePlayer1) | kMaxSprites;
|
||||||
|
@ -2582,12 +2582,12 @@ void actInit(bool bSaveLoad) {
|
||||||
|
|
||||||
void ConcussSprite(int a1, spritetype *pSprite, int x, int y, int z, int a6)
|
void ConcussSprite(int a1, spritetype *pSprite, int x, int y, int z, int a6)
|
||||||
{
|
{
|
||||||
dassert(pSprite != NULL);
|
assert(pSprite != NULL);
|
||||||
int dx = pSprite->x-x;
|
int dx = pSprite->x-x;
|
||||||
int dy = pSprite->y-y;
|
int dy = pSprite->y-y;
|
||||||
int dz = (pSprite->z-z)>>4;
|
int dz = (pSprite->z-z)>>4;
|
||||||
int dist2 = 0x40000+dx*dx+dy*dy+dz*dz;
|
int dist2 = 0x40000+dx*dx+dy*dy+dz*dz;
|
||||||
dassert(dist2 > 0);
|
assert(dist2 > 0);
|
||||||
a6 = scale(0x40000, a6, dist2);
|
a6 = scale(0x40000, a6, dist2);
|
||||||
|
|
||||||
if (pSprite->flags & kPhysMove) {
|
if (pSprite->flags & kPhysMove) {
|
||||||
|
@ -2607,19 +2607,19 @@ void ConcussSprite(int a1, spritetype *pSprite, int x, int y, int z, int a6)
|
||||||
} else if (pSprite->type >= kThingBase && pSprite->type < kThingMax) {
|
} else if (pSprite->type >= kThingBase && pSprite->type < kThingMax) {
|
||||||
mass = thingInfo[pSprite->type - kThingBase].mass;
|
mass = thingInfo[pSprite->type - kThingBase].mass;
|
||||||
} else {
|
} else {
|
||||||
consoleSysMsg("Unexpected type in ConcussSprite(): Sprite: %d Type: %d Stat: %d", (int)pSprite->index, (int)pSprite->type, (int)pSprite->statnum);
|
Printf(PRINT_HIGH, "Unexpected type in ConcussSprite(): Sprite: %d Type: %d Stat: %d", (int)pSprite->index, (int)pSprite->type, (int)pSprite->statnum);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int size = (tilesiz[pSprite->picnum].x*pSprite->xrepeat*tilesiz[pSprite->picnum].y*pSprite->yrepeat)>>1;
|
int size = (tilesiz[pSprite->picnum].x*pSprite->xrepeat*tilesiz[pSprite->picnum].y*pSprite->yrepeat)>>1;
|
||||||
dassert(mass > 0);
|
assert(mass > 0);
|
||||||
|
|
||||||
int t = scale(a6, size, mass);
|
int t = scale(a6, size, mass);
|
||||||
dx = mulscale16(t, dx);
|
dx = mulscale16(t, dx);
|
||||||
dy = mulscale16(t, dy);
|
dy = mulscale16(t, dy);
|
||||||
dz = mulscale16(t, dz);
|
dz = mulscale16(t, dz);
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
xvel[nSprite] += dx;
|
xvel[nSprite] += dx;
|
||||||
yvel[nSprite] += dy;
|
yvel[nSprite] += dy;
|
||||||
zvel[nSprite] += dz;
|
zvel[nSprite] += dz;
|
||||||
|
@ -2889,7 +2889,7 @@ spritetype *actDropObject(spritetype *pSprite, int nType) {
|
||||||
|
|
||||||
bool actHealDude(XSPRITE *pXDude, int a2, int a3)
|
bool actHealDude(XSPRITE *pXDude, int a2, int a3)
|
||||||
{
|
{
|
||||||
dassert(pXDude != NULL);
|
assert(pXDude != NULL);
|
||||||
a2 <<= 4;
|
a2 <<= 4;
|
||||||
a3 <<= 4;
|
a3 <<= 4;
|
||||||
if (pXDude->health < a3)
|
if (pXDude->health < a3)
|
||||||
|
@ -2906,10 +2906,10 @@ bool actHealDude(XSPRITE *pXDude, int a2, int a3)
|
||||||
void actKillDude(int nKillerSprite, spritetype *pSprite, DAMAGE_TYPE damageType, int damage)
|
void actKillDude(int nKillerSprite, spritetype *pSprite, DAMAGE_TYPE damageType, int damage)
|
||||||
{
|
{
|
||||||
spritetype *pKillerSprite = &sprite[nKillerSprite];
|
spritetype *pKillerSprite = &sprite[nKillerSprite];
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
int nType = pSprite->type-kDudeBase;
|
int nType = pSprite->type-kDudeBase;
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0);
|
assert(nXSprite > 0);
|
||||||
XSPRITE *pXSprite = &xsprite[pSprite->extra];
|
XSPRITE *pXSprite = &xsprite[pSprite->extra];
|
||||||
|
|
||||||
switch (pSprite->type) {
|
switch (pSprite->type) {
|
||||||
|
@ -3481,7 +3481,7 @@ void actKillDude(int nKillerSprite, spritetype *pSprite, DAMAGE_TYPE damageType,
|
||||||
}
|
}
|
||||||
|
|
||||||
int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, int damage) {
|
int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, int damage) {
|
||||||
dassert(nSource < kMaxSprites);
|
assert(nSource < kMaxSprites);
|
||||||
|
|
||||||
if (pSprite->flags&32 || pSprite->extra <= 0 || pSprite->extra >= kMaxXSprites || xsprite[pSprite->extra].reference != pSprite->index)
|
if (pSprite->flags&32 || pSprite->extra <= 0 || pSprite->extra >= kMaxXSprites || xsprite[pSprite->extra].reference != pSprite->index)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3500,7 +3500,7 @@ int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, in
|
||||||
switch (pSprite->statnum) {
|
switch (pSprite->statnum) {
|
||||||
case kStatDude: {
|
case kStatDude: {
|
||||||
if (!IsDudeSprite(pSprite)) {
|
if (!IsDudeSprite(pSprite)) {
|
||||||
consoleSysMsg("Bad Dude Failed: initial=%d type=%d %s\n", (int)pSprite->inittype, (int)pSprite->type, (int)(pSprite->flags & kHitagRespawn) ? "RESPAWN" : "NORMAL");
|
Printf(PRINT_HIGH, "Bad Dude Failed: initial=%d type=%d %s\n", (int)pSprite->inittype, (int)pSprite->type, (int)(pSprite->flags & kHitagRespawn) ? "RESPAWN" : "NORMAL");
|
||||||
return damage >> 4;
|
return damage >> 4;
|
||||||
//I_Error("Bad Dude Failed: initial=%d type=%d %s\n", (int)pSprite->inittype, (int)pSprite->type, (int)(pSprite->flags & 16) ? "RESPAWN" : "NORMAL");
|
//I_Error("Bad Dude Failed: initial=%d type=%d %s\n", (int)pSprite->inittype, (int)pSprite->type, (int)(pSprite->flags & 16) ? "RESPAWN" : "NORMAL");
|
||||||
}
|
}
|
||||||
|
@ -3532,7 +3532,7 @@ int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, in
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case kStatThing:
|
case kStatThing:
|
||||||
dassert(pSprite->type >= kThingBase && pSprite->type < kThingMax);
|
assert(pSprite->type >= kThingBase && pSprite->type < kThingMax);
|
||||||
int nType = pSprite->type - kThingBase; int nDamageFactor = thingInfo[nType].dmgControl[damageType];
|
int nType = pSprite->type - kThingBase; int nDamageFactor = thingInfo[nType].dmgControl[damageType];
|
||||||
|
|
||||||
if (!nDamageFactor) return 0;
|
if (!nDamageFactor) return 0;
|
||||||
|
@ -3616,7 +3616,7 @@ int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, in
|
||||||
|
|
||||||
void actHitcodeToData(int a1, HITINFO *pHitInfo, int *a3, spritetype **a4, XSPRITE **a5, int *a6, walltype **a7, XWALL **a8, int *a9, sectortype **a10, XSECTOR **a11)
|
void actHitcodeToData(int a1, HITINFO *pHitInfo, int *a3, spritetype **a4, XSPRITE **a5, int *a6, walltype **a7, XWALL **a8, int *a9, sectortype **a10, XSECTOR **a11)
|
||||||
{
|
{
|
||||||
dassert(pHitInfo != NULL);
|
assert(pHitInfo != NULL);
|
||||||
int nSprite = -1;
|
int nSprite = -1;
|
||||||
spritetype *pSprite = NULL;
|
spritetype *pSprite = NULL;
|
||||||
XSPRITE *pXSprite = NULL;
|
XSPRITE *pXSprite = NULL;
|
||||||
|
@ -3631,7 +3631,7 @@ void actHitcodeToData(int a1, HITINFO *pHitInfo, int *a3, spritetype **a4, XSPRI
|
||||||
case 3:
|
case 3:
|
||||||
case 5:
|
case 5:
|
||||||
nSprite = pHitInfo->hitsprite;
|
nSprite = pHitInfo->hitsprite;
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
pSprite = &sprite[nSprite];
|
pSprite = &sprite[nSprite];
|
||||||
if (pSprite->extra > 0)
|
if (pSprite->extra > 0)
|
||||||
pXSprite = &xsprite[pSprite->extra];
|
pXSprite = &xsprite[pSprite->extra];
|
||||||
|
@ -3639,7 +3639,7 @@ void actHitcodeToData(int a1, HITINFO *pHitInfo, int *a3, spritetype **a4, XSPRI
|
||||||
case 0:
|
case 0:
|
||||||
case 4:
|
case 4:
|
||||||
nWall = pHitInfo->hitwall;
|
nWall = pHitInfo->hitwall;
|
||||||
dassert(nWall >= 0 && nWall < kMaxWalls);
|
assert(nWall >= 0 && nWall < kMaxWalls);
|
||||||
pWall = &wall[nWall];
|
pWall = &wall[nWall];
|
||||||
if (pWall->extra > 0)
|
if (pWall->extra > 0)
|
||||||
pXWall = &xwall[pWall->extra];
|
pXWall = &xwall[pWall->extra];
|
||||||
|
@ -3648,7 +3648,7 @@ void actHitcodeToData(int a1, HITINFO *pHitInfo, int *a3, spritetype **a4, XSPRI
|
||||||
case 2:
|
case 2:
|
||||||
case 6:
|
case 6:
|
||||||
nSector = pHitInfo->hitsect;
|
nSector = pHitInfo->hitsect;
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
pSector = §or[nSector];
|
pSector = §or[nSector];
|
||||||
if (pSector->extra > 0)
|
if (pSector->extra > 0)
|
||||||
pXSector = &xsector[pSector->extra];
|
pXSector = &xsector[pSector->extra];
|
||||||
|
@ -3677,7 +3677,7 @@ void actHitcodeToData(int a1, HITINFO *pHitInfo, int *a3, spritetype **a4, XSPRI
|
||||||
void actImpactMissile(spritetype *pMissile, int hitCode)
|
void actImpactMissile(spritetype *pMissile, int hitCode)
|
||||||
{
|
{
|
||||||
int nXMissile = pMissile->extra;
|
int nXMissile = pMissile->extra;
|
||||||
dassert(nXMissile > 0 && nXMissile < kMaxXSprites);
|
assert(nXMissile > 0 && nXMissile < kMaxXSprites);
|
||||||
XSPRITE *pXMissile = &xsprite[pMissile->extra];
|
XSPRITE *pXMissile = &xsprite[pMissile->extra];
|
||||||
|
|
||||||
int nSpriteHit = -1; int nWallHit = -1; int nSectorHit = -1;
|
int nSpriteHit = -1; int nWallHit = -1; int nSectorHit = -1;
|
||||||
|
@ -3833,7 +3833,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode)
|
||||||
if (hitCode == 3)
|
if (hitCode == 3)
|
||||||
{
|
{
|
||||||
int nObject = gHitInfo.hitsprite;
|
int nObject = gHitInfo.hitsprite;
|
||||||
dassert(nObject >= 0 && nObject < kMaxSprites);
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
||||||
spritetype *pObject = &sprite[nObject];
|
spritetype *pObject = &sprite[nObject];
|
||||||
if (pObject->extra > 0)
|
if (pObject->extra > 0)
|
||||||
{
|
{
|
||||||
|
@ -3851,7 +3851,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode)
|
||||||
if (hitCode == 3)
|
if (hitCode == 3)
|
||||||
{
|
{
|
||||||
int nObject = gHitInfo.hitsprite;
|
int nObject = gHitInfo.hitsprite;
|
||||||
dassert(nObject >= 0 && nObject < kMaxSprites);
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
||||||
spritetype *pObject = &sprite[nObject];
|
spritetype *pObject = &sprite[nObject];
|
||||||
if (pObject->extra > 0)
|
if (pObject->extra > 0)
|
||||||
{
|
{
|
||||||
|
@ -3872,7 +3872,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode)
|
||||||
if (hitCode == 3)
|
if (hitCode == 3)
|
||||||
{
|
{
|
||||||
int nObject = gHitInfo.hitsprite;
|
int nObject = gHitInfo.hitsprite;
|
||||||
dassert(nObject >= 0 && nObject < kMaxSprites);
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
||||||
spritetype *pObject = &sprite[nObject];
|
spritetype *pObject = &sprite[nObject];
|
||||||
if (pObject->extra > 0)
|
if (pObject->extra > 0)
|
||||||
{
|
{
|
||||||
|
@ -3896,7 +3896,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode)
|
||||||
if (hitCode == 3)
|
if (hitCode == 3)
|
||||||
{
|
{
|
||||||
int nObject = gHitInfo.hitsprite;
|
int nObject = gHitInfo.hitsprite;
|
||||||
dassert(nObject >= 0 && nObject < kMaxSprites);
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
||||||
spritetype *pObject = &sprite[nObject];
|
spritetype *pObject = &sprite[nObject];
|
||||||
if (pObject->statnum == kStatDude)
|
if (pObject->statnum == kStatDude)
|
||||||
{
|
{
|
||||||
|
@ -3914,7 +3914,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode)
|
||||||
if (hitCode == 3)
|
if (hitCode == 3)
|
||||||
{
|
{
|
||||||
int nObject = gHitInfo.hitsprite;
|
int nObject = gHitInfo.hitsprite;
|
||||||
dassert(nObject >= 0 && nObject < kMaxSprites);
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
||||||
spritetype *pObject = &sprite[nObject];
|
spritetype *pObject = &sprite[nObject];
|
||||||
if (pObject->statnum == kStatDude)
|
if (pObject->statnum == kStatDude)
|
||||||
{
|
{
|
||||||
|
@ -3939,7 +3939,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode)
|
||||||
if (hitCode == 3)
|
if (hitCode == 3)
|
||||||
{
|
{
|
||||||
int nObject = gHitInfo.hitsprite;
|
int nObject = gHitInfo.hitsprite;
|
||||||
dassert(nObject >= 0 && nObject < kMaxSprites);
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
||||||
spritetype *pObject = &sprite[nObject];
|
spritetype *pObject = &sprite[nObject];
|
||||||
int nOwner = actSpriteOwnerToSpriteId(pMissile);
|
int nOwner = actSpriteOwnerToSpriteId(pMissile);
|
||||||
int nDamage = (15+Random(10))<<4;
|
int nDamage = (15+Random(10))<<4;
|
||||||
|
@ -3952,7 +3952,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode)
|
||||||
if (hitCode == 3)
|
if (hitCode == 3)
|
||||||
{
|
{
|
||||||
int nObject = gHitInfo.hitsprite;
|
int nObject = gHitInfo.hitsprite;
|
||||||
dassert(nObject >= 0 && nObject < kMaxSprites);
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
||||||
spritetype *pObject = &sprite[nObject];
|
spritetype *pObject = &sprite[nObject];
|
||||||
int nOwner = actSpriteOwnerToSpriteId(pMissile);
|
int nOwner = actSpriteOwnerToSpriteId(pMissile);
|
||||||
int nDamage = (10+Random(10))<<4;
|
int nDamage = (10+Random(10))<<4;
|
||||||
|
@ -3981,8 +3981,8 @@ void actKickObject(spritetype *pSprite1, spritetype *pSprite2)
|
||||||
|
|
||||||
void actTouchFloor(spritetype *pSprite, int nSector)
|
void actTouchFloor(spritetype *pSprite, int nSector)
|
||||||
{
|
{
|
||||||
dassert(pSprite != NULL);
|
assert(pSprite != NULL);
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
sectortype * pSector = §or[nSector];
|
sectortype * pSector = §or[nSector];
|
||||||
XSECTOR * pXSector = NULL;
|
XSECTOR * pXSector = NULL;
|
||||||
if (pSector->extra > 0)
|
if (pSector->extra > 0)
|
||||||
|
@ -4321,12 +4321,12 @@ void actAirDrag(spritetype *pSprite, int a2)
|
||||||
int vbp = 0;
|
int vbp = 0;
|
||||||
int v4 = 0;
|
int v4 = 0;
|
||||||
int nSector = pSprite->sectnum;
|
int nSector = pSprite->sectnum;
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
sectortype *pSector = §or[nSector];
|
sectortype *pSector = §or[nSector];
|
||||||
int nXSector = pSector->extra;
|
int nXSector = pSector->extra;
|
||||||
if (nXSector > 0)
|
if (nXSector > 0)
|
||||||
{
|
{
|
||||||
dassert(nXSector < kMaxXSectors);
|
assert(nXSector < kMaxXSectors);
|
||||||
XSECTOR *pXSector = &xsector[nXSector];
|
XSECTOR *pXSector = &xsector[nXSector];
|
||||||
if (pXSector->windVel && (pXSector->windAlways || pXSector->busy))
|
if (pXSector->windVel && (pXSector->windAlways || pXSector->busy))
|
||||||
{
|
{
|
||||||
|
@ -4345,14 +4345,14 @@ void actAirDrag(spritetype *pSprite, int a2)
|
||||||
int MoveThing(spritetype *pSprite)
|
int MoveThing(spritetype *pSprite)
|
||||||
{
|
{
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
int v8 = 0;
|
int v8 = 0;
|
||||||
dassert(pSprite->type >= kThingBase && pSprite->type < kThingMax);
|
assert(pSprite->type >= kThingBase && pSprite->type < kThingMax);
|
||||||
const THINGINFO *pThingInfo = &thingInfo[pSprite->type-kThingBase];
|
const THINGINFO *pThingInfo = &thingInfo[pSprite->type-kThingBase];
|
||||||
int nSector = pSprite->sectnum;
|
int nSector = pSprite->sectnum;
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
int top, bottom;
|
int top, bottom;
|
||||||
GetSpriteExtents(pSprite, &top, &bottom);
|
GetSpriteExtents(pSprite, &top, &bottom);
|
||||||
if (xvel[nSprite] || yvel[nSprite])
|
if (xvel[nSprite] || yvel[nSprite])
|
||||||
|
@ -4361,10 +4361,10 @@ int MoveThing(spritetype *pSprite)
|
||||||
pSprite->cstat &= ~257;
|
pSprite->cstat &= ~257;
|
||||||
v8 = gSpriteHit[nXSprite].hit = ClipMove((int*)&pSprite->x, (int*)&pSprite->y, (int*)&pSprite->z, &nSector, xvel[nSprite]>>12, yvel[nSprite]>>12, pSprite->clipdist<<2, (pSprite->z-top)/4, (bottom-pSprite->z)/4, CLIPMASK0);
|
v8 = gSpriteHit[nXSprite].hit = ClipMove((int*)&pSprite->x, (int*)&pSprite->y, (int*)&pSprite->z, &nSector, xvel[nSprite]>>12, yvel[nSprite]>>12, pSprite->clipdist<<2, (pSprite->z-top)/4, (bottom-pSprite->z)/4, CLIPMASK0);
|
||||||
pSprite->cstat = bakCstat;
|
pSprite->cstat = bakCstat;
|
||||||
dassert(nSector >= 0);
|
assert(nSector >= 0);
|
||||||
if (pSprite->sectnum != nSector)
|
if (pSprite->sectnum != nSector)
|
||||||
{
|
{
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
ChangeSpriteSect(nSprite, nSector);
|
ChangeSpriteSect(nSprite, nSector);
|
||||||
}
|
}
|
||||||
if ((gSpriteHit[nXSprite].hit&0xc000) == 0x8000) {
|
if ((gSpriteHit[nXSprite].hit&0xc000) == 0x8000) {
|
||||||
|
@ -4383,7 +4383,7 @@ int MoveThing(spritetype *pSprite)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
FindSector(pSprite->x, pSprite->y, pSprite->z, &nSector);
|
FindSector(pSprite->x, pSprite->y, pSprite->z, &nSector);
|
||||||
}
|
}
|
||||||
if (zvel[nSprite])
|
if (zvel[nSprite])
|
||||||
|
@ -4529,7 +4529,7 @@ void MoveDude(spritetype *pSprite)
|
||||||
if (IsPlayerSprite(pSprite))
|
if (IsPlayerSprite(pSprite))
|
||||||
pPlayer = &gPlayer[pSprite->type-kDudePlayer1];
|
pPlayer = &gPlayer[pSprite->type-kDudePlayer1];
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -4539,7 +4539,7 @@ void MoveDude(spritetype *pSprite)
|
||||||
int tz = (pSprite->z-top)/4;
|
int tz = (pSprite->z-top)/4;
|
||||||
int wd = pSprite->clipdist<<2;
|
int wd = pSprite->clipdist<<2;
|
||||||
int nSector = pSprite->sectnum;
|
int nSector = pSprite->sectnum;
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
if (xvel[nSprite] || yvel[nSprite])
|
if (xvel[nSprite] || yvel[nSprite])
|
||||||
{
|
{
|
||||||
if (pPlayer && gNoClip)
|
if (pPlayer && gNoClip)
|
||||||
|
@ -4569,7 +4569,7 @@ void MoveDude(spritetype *pSprite)
|
||||||
if (nSector2 != -1)
|
if (nSector2 != -1)
|
||||||
nSector = nSector2;
|
nSector = nSector2;
|
||||||
}
|
}
|
||||||
dassert(nSector >= 0);
|
assert(nSector >= 0);
|
||||||
pSprite->cstat = bakCstat;
|
pSprite->cstat = bakCstat;
|
||||||
}
|
}
|
||||||
switch (gSpriteHit[nXSprite].hit&0xc000)
|
switch (gSpriteHit[nXSprite].hit&0xc000)
|
||||||
|
@ -4633,12 +4633,12 @@ void MoveDude(spritetype *pSprite)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
FindSector(pSprite->x, pSprite->y, pSprite->z, &nSector);
|
FindSector(pSprite->x, pSprite->y, pSprite->z, &nSector);
|
||||||
}
|
}
|
||||||
if (pSprite->sectnum != nSector)
|
if (pSprite->sectnum != nSector)
|
||||||
{
|
{
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
XSECTOR *pXSector;
|
XSECTOR *pXSector;
|
||||||
int nXSector = sector[pSprite->sectnum].extra;
|
int nXSector = sector[pSprite->sectnum].extra;
|
||||||
if (nXSector > 0)
|
if (nXSector > 0)
|
||||||
|
@ -5206,7 +5206,7 @@ int MoveMissile(spritetype *pSprite)
|
||||||
updatesector(x, y, &nSector);
|
updatesector(x, y, &nSector);
|
||||||
if (nSector >= 0 && nSector != pSprite->sectnum)
|
if (nSector >= 0 && nSector != pSprite->sectnum)
|
||||||
{
|
{
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
ChangeSpriteSect(nSprite, nSector);
|
ChangeSpriteSect(nSprite, nSector);
|
||||||
}
|
}
|
||||||
CheckLink(pSprite);
|
CheckLink(pSprite);
|
||||||
|
@ -5517,13 +5517,13 @@ void actProcessSprites(void)
|
||||||
continue;
|
continue;
|
||||||
int nSector = pSprite->sectnum;
|
int nSector = pSprite->sectnum;
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
int nXSector = sector[nSector].extra;
|
int nXSector = sector[nSector].extra;
|
||||||
XSECTOR *pXSector = NULL;
|
XSECTOR *pXSector = NULL;
|
||||||
if (nXSector > 0)
|
if (nXSector > 0)
|
||||||
{
|
{
|
||||||
dassert(nXSector > 0 && nXSector < kMaxXSectors);
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||||
dassert(xsector[nXSector].reference == nSector);
|
assert(xsector[nXSector].reference == nSector);
|
||||||
pXSector = &xsector[nXSector];
|
pXSector = &xsector[nXSector];
|
||||||
}
|
}
|
||||||
if (pXSector && pXSector->panVel && (pXSector->panAlways || pXSector->state || pXSector->busy))
|
if (pXSector && pXSector->panVel && (pXSector->panAlways || pXSector->state || pXSector->busy))
|
||||||
|
@ -5592,7 +5592,7 @@ void actProcessSprites(void)
|
||||||
pSprite->xrepeat = 32;
|
pSprite->xrepeat = 32;
|
||||||
pSprite->yrepeat = 32;
|
pSprite->yrepeat = 32;
|
||||||
int nObject = hit & 0x3fff;
|
int nObject = hit & 0x3fff;
|
||||||
dassert(nObject >= 0 && nObject < kMaxSprites);
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
||||||
spritetype * pObject = &sprite[nObject];
|
spritetype * pObject = &sprite[nObject];
|
||||||
actDamageSprite(actSpriteOwnerToSpriteId(pSprite), pObject, DAMAGE_TYPE_0, pXSprite->data1);
|
actDamageSprite(actSpriteOwnerToSpriteId(pSprite), pObject, DAMAGE_TYPE_0, pXSprite->data1);
|
||||||
}
|
}
|
||||||
|
@ -5603,7 +5603,7 @@ void actProcessSprites(void)
|
||||||
if ((hit&0xc000) == 0xc000)
|
if ((hit&0xc000) == 0xc000)
|
||||||
{
|
{
|
||||||
int nObject = hit & 0x3fff;
|
int nObject = hit & 0x3fff;
|
||||||
dassert(nObject >= 0 && nObject < kMaxSprites);
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
||||||
spritetype *pObject = &sprite[nObject];
|
spritetype *pObject = &sprite[nObject];
|
||||||
actDamageSprite(actSpriteOwnerToSpriteId(pSprite), pObject, DAMAGE_TYPE_0, 12);
|
actDamageSprite(actSpriteOwnerToSpriteId(pSprite), pObject, DAMAGE_TYPE_0, 12);
|
||||||
}
|
}
|
||||||
|
@ -5619,7 +5619,7 @@ void actProcessSprites(void)
|
||||||
int nObject = hit & 0x3fff;
|
int nObject = hit & 0x3fff;
|
||||||
if ((hit&0xc000) != 0xc000 && (nObject < 0 || nObject >= 4096))
|
if ((hit&0xc000) != 0xc000 && (nObject < 0 || nObject >= 4096))
|
||||||
break;
|
break;
|
||||||
dassert(nObject >= 0 && nObject < kMaxSprites);
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
||||||
spritetype *pObject = &sprite[nObject];
|
spritetype *pObject = &sprite[nObject];
|
||||||
actDamageSprite(actSpriteOwnerToSpriteId(pSprite), pObject, DAMAGE_TYPE_0, 12);
|
actDamageSprite(actSpriteOwnerToSpriteId(pSprite), pObject, DAMAGE_TYPE_0, 12);
|
||||||
evPost(pSprite->index, 3, 0, kCallbackFXPodBloodSplat);
|
evPost(pSprite->index, 3, 0, kCallbackFXPodBloodSplat);
|
||||||
|
@ -5630,7 +5630,7 @@ void actProcessSprites(void)
|
||||||
int nObject = hit & 0x3fff;
|
int nObject = hit & 0x3fff;
|
||||||
if ((hit&0xc000) != 0xc000 && (nObject < 0 || nObject >= 4096))
|
if ((hit&0xc000) != 0xc000 && (nObject < 0 || nObject >= 4096))
|
||||||
break;
|
break;
|
||||||
dassert(nObject >= 0 && nObject < kMaxSprites);
|
assert(nObject >= 0 && nObject < kMaxSprites);
|
||||||
actExplodeSprite(pSprite);
|
actExplodeSprite(pSprite);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5660,10 +5660,10 @@ void actProcessSprites(void)
|
||||||
continue;
|
continue;
|
||||||
int nOwner = actSpriteOwnerToSpriteId(pSprite);
|
int nOwner = actSpriteOwnerToSpriteId(pSprite);
|
||||||
int nType = pSprite->type;
|
int nType = pSprite->type;
|
||||||
dassert(nType >= 0 && nType < kExplodeMax);
|
assert(nType >= 0 && nType < kExplodeMax);
|
||||||
const EXPLOSION *pExplodeInfo = &explodeInfo[nType];
|
const EXPLOSION *pExplodeInfo = &explodeInfo[nType];
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
int x = pSprite->x;
|
int x = pSprite->x;
|
||||||
int y = pSprite->y;
|
int y = pSprite->y;
|
||||||
|
@ -5710,7 +5710,7 @@ void actProcessSprites(void)
|
||||||
ConcussSprite(nOwner, pDude, x, y, z, pExplodeInfo->dmgType);
|
ConcussSprite(nOwner, pDude, x, y, z, pExplodeInfo->dmgType);
|
||||||
if (pExplodeInfo->burnTime)
|
if (pExplodeInfo->burnTime)
|
||||||
{
|
{
|
||||||
dassert(pDude->extra > 0 && pDude->extra < kMaxXSprites);
|
assert(pDude->extra > 0 && pDude->extra < kMaxXSprites);
|
||||||
XSPRITE *pXDude = &xsprite[pDude->extra];
|
XSPRITE *pXDude = &xsprite[pDude->extra];
|
||||||
if (!pXDude->burnTime)
|
if (!pXDude->burnTime)
|
||||||
evPost(nSprite2, 3, 0, kCallbackFXFlameLick);
|
evPost(nSprite2, 3, 0, kCallbackFXFlameLick);
|
||||||
|
@ -5737,7 +5737,7 @@ void actProcessSprites(void)
|
||||||
ConcussSprite(nOwner, pThing, x, y, z, pExplodeInfo->dmgType);
|
ConcussSprite(nOwner, pThing, x, y, z, pExplodeInfo->dmgType);
|
||||||
if (pExplodeInfo->burnTime)
|
if (pExplodeInfo->burnTime)
|
||||||
{
|
{
|
||||||
dassert(pThing->extra > 0 && pThing->extra < kMaxXSprites);
|
assert(pThing->extra > 0 && pThing->extra < kMaxXSprites);
|
||||||
XSPRITE *pXThing = &xsprite[pThing->extra];
|
XSPRITE *pXThing = &xsprite[pThing->extra];
|
||||||
if (pThing->type == kThingTNTBarrel && !pXThing->burnTime)
|
if (pThing->type == kThingTNTBarrel && !pXThing->burnTime)
|
||||||
evPost(nSprite2, 3, 0, kCallbackFXFlameLick);
|
evPost(nSprite2, 3, 0, kCallbackFXFlameLick);
|
||||||
|
@ -5815,7 +5815,7 @@ void actProcessSprites(void)
|
||||||
if (pSprite->flags & 32)
|
if (pSprite->flags & 32)
|
||||||
continue;
|
continue;
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
//dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
//assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
if (nXSprite <= 0 || nXSprite >= kMaxXSprites)
|
if (nXSprite <= 0 || nXSprite >= kMaxXSprites)
|
||||||
continue;
|
continue;
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
|
@ -5960,15 +5960,15 @@ void actProcessSprites(void)
|
||||||
if (pSprite->flags & 32)
|
if (pSprite->flags & 32)
|
||||||
continue;
|
continue;
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
int nSector = pSprite->sectnum;
|
int nSector = pSprite->sectnum;
|
||||||
viewBackupSpriteLoc(nSprite, pSprite);
|
viewBackupSpriteLoc(nSprite, pSprite);
|
||||||
int nXSector = sector[nSector].extra;
|
int nXSector = sector[nSector].extra;
|
||||||
XSECTOR *pXSector = NULL;
|
XSECTOR *pXSector = NULL;
|
||||||
if (nXSector > 0)
|
if (nXSector > 0)
|
||||||
{
|
{
|
||||||
dassert(nXSector > 0 && nXSector < kMaxXSectors);
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||||
dassert(xsector[nXSector].reference == nSector);
|
assert(xsector[nXSector].reference == nSector);
|
||||||
pXSector = &xsector[nXSector];
|
pXSector = &xsector[nXSector];
|
||||||
}
|
}
|
||||||
if (pXSector)
|
if (pXSector)
|
||||||
|
@ -6009,12 +6009,12 @@ void actProcessSprites(void)
|
||||||
if (pSprite->flags & 32)
|
if (pSprite->flags & 32)
|
||||||
continue;
|
continue;
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
int nTarget = pXSprite->target;
|
int nTarget = pXSprite->target;
|
||||||
dassert(nTarget >= 0);
|
assert(nTarget >= 0);
|
||||||
viewBackupSpriteLoc(nSprite, pSprite);
|
viewBackupSpriteLoc(nSprite, pSprite);
|
||||||
dassert(nTarget < kMaxSprites);
|
assert(nTarget < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[nTarget];
|
spritetype *pTarget = &sprite[nTarget];
|
||||||
if (pTarget->statnum == kMaxStatus)
|
if (pTarget->statnum == kMaxStatus)
|
||||||
{
|
{
|
||||||
|
@ -6050,8 +6050,8 @@ spritetype * actSpawnSprite(int nSector, int x, int y, int z, int nStat, char a6
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nSprite = headspritestat[kStatPurge];
|
nSprite = headspritestat[kStatPurge];
|
||||||
dassert(nSprite >= 0);
|
assert(nSprite >= 0);
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
ChangeSpriteSect(nSprite, nSector);
|
ChangeSpriteSect(nSprite, nSector);
|
||||||
actPostSprite(nSprite, nStat);
|
actPostSprite(nSprite, nStat);
|
||||||
}
|
}
|
||||||
|
@ -6141,8 +6141,8 @@ spritetype * actSpawnSprite(spritetype *pSource, int nStat)
|
||||||
if (nSprite < 0)
|
if (nSprite < 0)
|
||||||
{
|
{
|
||||||
nSprite = headspritestat[kStatPurge];
|
nSprite = headspritestat[kStatPurge];
|
||||||
dassert(nSprite >= 0);
|
assert(nSprite >= 0);
|
||||||
dassert(pSource->sectnum >= 0 && pSource->sectnum < kMaxSectors);
|
assert(pSource->sectnum >= 0 && pSource->sectnum < kMaxSectors);
|
||||||
ChangeSpriteSect(nSprite, pSource->sectnum);
|
ChangeSpriteSect(nSprite, pSource->sectnum);
|
||||||
actPostSprite(nSprite, nStat);
|
actPostSprite(nSprite, nStat);
|
||||||
}
|
}
|
||||||
|
@ -6164,13 +6164,13 @@ spritetype * actSpawnSprite(spritetype *pSource, int nStat)
|
||||||
|
|
||||||
spritetype * actSpawnThing(int nSector, int x, int y, int z, int nThingType)
|
spritetype * actSpawnThing(int nSector, int x, int y, int z, int nThingType)
|
||||||
{
|
{
|
||||||
dassert(nThingType >= kThingBase && nThingType < kThingMax);
|
assert(nThingType >= kThingBase && nThingType < kThingMax);
|
||||||
spritetype *pSprite = actSpawnSprite(nSector, x, y, z, 4, 1);
|
spritetype *pSprite = actSpawnSprite(nSector, x, y, z, 4, 1);
|
||||||
int nType = nThingType-kThingBase;
|
int nType = nThingType-kThingBase;
|
||||||
int nThing = pSprite->index;
|
int nThing = pSprite->index;
|
||||||
int nXThing = pSprite->extra;
|
int nXThing = pSprite->extra;
|
||||||
pSprite->type = nThingType;
|
pSprite->type = nThingType;
|
||||||
dassert(nXThing > 0 && nXThing < kMaxXSprites);
|
assert(nXThing > 0 && nXThing < kMaxXSprites);
|
||||||
XSPRITE *pXThing = &xsprite[nXThing];
|
XSPRITE *pXThing = &xsprite[nXThing];
|
||||||
const THINGINFO *pThingInfo = &thingInfo[nType];
|
const THINGINFO *pThingInfo = &thingInfo[nType];
|
||||||
pXThing->health = pThingInfo->startHealth<<4;
|
pXThing->health = pThingInfo->startHealth<<4;
|
||||||
|
@ -6249,7 +6249,7 @@ spritetype * actSpawnThing(int nSector, int x, int y, int z, int nThingType)
|
||||||
|
|
||||||
spritetype * actFireThing(spritetype *pSprite, int a2, int a3, int a4, int thingType, int a6)
|
spritetype * actFireThing(spritetype *pSprite, int a2, int a3, int a4, int thingType, int a6)
|
||||||
{
|
{
|
||||||
dassert(thingType >= kThingBase && thingType < kThingMax);
|
assert(thingType >= kThingBase && thingType < kThingMax);
|
||||||
int x = pSprite->x+mulscale30(a2, Cos(pSprite->ang+512));
|
int x = pSprite->x+mulscale30(a2, Cos(pSprite->ang+512));
|
||||||
int y = pSprite->y+mulscale30(a2, Sin(pSprite->ang+512));
|
int y = pSprite->y+mulscale30(a2, Sin(pSprite->ang+512));
|
||||||
int z = pSprite->z+a3;
|
int z = pSprite->z+a3;
|
||||||
|
@ -6275,7 +6275,7 @@ spritetype * actFireThing(spritetype *pSprite, int a2, int a3, int a4, int thing
|
||||||
spritetype* actFireMissile(spritetype *pSprite, int a2, int a3, int a4, int a5, int a6, int nType)
|
spritetype* actFireMissile(spritetype *pSprite, int a2, int a3, int a4, int a5, int a6, int nType)
|
||||||
{
|
{
|
||||||
|
|
||||||
dassert(nType >= kMissileBase && nType < kMissileMax);
|
assert(nType >= kMissileBase && nType < kMissileMax);
|
||||||
char v4 = 0;
|
char v4 = 0;
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
const MissileType *pMissileInfo = &missileInfo[nType-kMissileBase];
|
const MissileType *pMissileInfo = &missileInfo[nType-kMissileBase];
|
||||||
|
@ -6318,7 +6318,7 @@ spritetype* actFireMissile(spritetype *pSprite, int a2, int a3, int a4, int a5,
|
||||||
actPropagateSpriteOwner(pMissile, pSprite);
|
actPropagateSpriteOwner(pMissile, pSprite);
|
||||||
pMissile->cstat |= 1;
|
pMissile->cstat |= 1;
|
||||||
int nXSprite = pMissile->extra;
|
int nXSprite = pMissile->extra;
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
xsprite[nXSprite].target = -1;
|
xsprite[nXSprite].target = -1;
|
||||||
evPost(nMissile, 3, 600, kCallbackRemove);
|
evPost(nMissile, 3, 600, kCallbackRemove);
|
||||||
|
|
||||||
|
@ -6486,7 +6486,7 @@ bool actCheckRespawn(spritetype *pSprite)
|
||||||
|
|
||||||
bool actCanSplatWall(int nWall)
|
bool actCanSplatWall(int nWall)
|
||||||
{
|
{
|
||||||
dassert(nWall >= 0 && nWall < kMaxWalls);
|
assert(nWall >= 0 && nWall < kMaxWalls);
|
||||||
walltype *pWall = &wall[nWall];
|
walltype *pWall = &wall[nWall];
|
||||||
if (pWall->cstat & 16384)
|
if (pWall->cstat & 16384)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -6507,14 +6507,14 @@ bool actCanSplatWall(int nWall)
|
||||||
void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, VECTOR_TYPE vectorType)
|
void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, VECTOR_TYPE vectorType)
|
||||||
{
|
{
|
||||||
int nShooter = pShooter->index;
|
int nShooter = pShooter->index;
|
||||||
dassert(vectorType >= 0 && vectorType < kVectorMax);
|
assert(vectorType >= 0 && vectorType < kVectorMax);
|
||||||
const VECTORDATA *pVectorData = &gVectorData[vectorType];
|
const VECTORDATA *pVectorData = &gVectorData[vectorType];
|
||||||
int nRange = pVectorData->maxDist;
|
int nRange = pVectorData->maxDist;
|
||||||
int hit = VectorScan(pShooter, a2, a3, a4, a5, a6, nRange, 1);
|
int hit = VectorScan(pShooter, a2, a3, a4, a5, a6, nRange, 1);
|
||||||
if (hit == 3)
|
if (hit == 3)
|
||||||
{
|
{
|
||||||
int nSprite = gHitInfo.hitsprite;
|
int nSprite = gHitInfo.hitsprite;
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pShooter, pSprite)) return;
|
if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pShooter, pSprite)) return;
|
||||||
if (IsPlayerSprite(pSprite)) {
|
if (IsPlayerSprite(pSprite)) {
|
||||||
|
@ -6558,7 +6558,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6,
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
int nWall = gHitInfo.hitwall;
|
int nWall = gHitInfo.hitwall;
|
||||||
dassert(nWall >= 0 && nWall < kMaxWalls);
|
assert(nWall >= 0 && nWall < kMaxWalls);
|
||||||
nSurf = surfType[wall[nWall].picnum];
|
nSurf = surfType[wall[nWall].picnum];
|
||||||
if (actCanSplatWall(nWall))
|
if (actCanSplatWall(nWall))
|
||||||
{
|
{
|
||||||
|
@ -6566,7 +6566,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6,
|
||||||
int y = gHitInfo.hity-mulscale(a5, 16, 14);
|
int y = gHitInfo.hity-mulscale(a5, 16, 14);
|
||||||
int z = gHitInfo.hitz-mulscale(a6, 256, 14);
|
int z = gHitInfo.hitz-mulscale(a6, 256, 14);
|
||||||
int nSurf = surfType[wall[nWall].picnum];
|
int nSurf = surfType[wall[nWall].picnum];
|
||||||
dassert(nSurf < kSurfMax);
|
assert(nSurf < kSurfMax);
|
||||||
if (pVectorData->surfHit[nSurf].fx1 >= 0)
|
if (pVectorData->surfHit[nSurf].fx1 >= 0)
|
||||||
{
|
{
|
||||||
spritetype *pFX = gFX.fxSpawn(pVectorData->surfHit[nSurf].fx1, nSector, x, y, z, 0);
|
spritetype *pFX = gFX.fxSpawn(pVectorData->surfHit[nSurf].fx1, nSector, x, y, z, 0);
|
||||||
|
@ -6582,7 +6582,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6,
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
int nWall = gHitInfo.hitwall;
|
int nWall = gHitInfo.hitwall;
|
||||||
dassert(nWall >= 0 && nWall < kMaxWalls);
|
assert(nWall >= 0 && nWall < kMaxWalls);
|
||||||
nSurf = surfType[wall[nWall].overpicnum];
|
nSurf = surfType[wall[nWall].overpicnum];
|
||||||
int nXWall = wall[nWall].extra;
|
int nXWall = wall[nWall].extra;
|
||||||
if (nXWall > 0)
|
if (nXWall > 0)
|
||||||
|
@ -6597,7 +6597,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6,
|
||||||
{
|
{
|
||||||
int nSprite = gHitInfo.hitsprite;
|
int nSprite = gHitInfo.hitsprite;
|
||||||
nSurf = surfType[sprite[nSprite].picnum];
|
nSurf = surfType[sprite[nSprite].picnum];
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
x -= mulscale(a4, 112, 14);
|
x -= mulscale(a4, 112, 14);
|
||||||
y -= mulscale(a5, 112, 14);
|
y -= mulscale(a5, 112, 14);
|
||||||
|
@ -6725,7 +6725,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dassert(nSurf < kSurfMax);
|
assert(nSurf < kSurfMax);
|
||||||
if (pVectorData->surfHit[nSurf].fx2 >= 0)
|
if (pVectorData->surfHit[nSurf].fx2 >= 0)
|
||||||
gFX.fxSpawn(pVectorData->surfHit[nSurf].fx2, nSector, x, y, z, 0);
|
gFX.fxSpawn(pVectorData->surfHit[nSurf].fx2, nSector, x, y, z, 0);
|
||||||
if (pVectorData->surfHit[nSurf].fx3 >= 0)
|
if (pVectorData->surfHit[nSurf].fx3 >= 0)
|
||||||
|
@ -6848,15 +6848,15 @@ void DudeToGibCallback2(int, int nXSprite)
|
||||||
void actPostSprite(int nSprite, int nStatus)
|
void actPostSprite(int nSprite, int nStatus)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
dassert(gPostCount < kMaxSprites);
|
assert(gPostCount < kMaxSprites);
|
||||||
dassert(nSprite < kMaxSprites && sprite[nSprite].statnum < kMaxStatus);
|
assert(nSprite < kMaxSprites && sprite[nSprite].statnum < kMaxStatus);
|
||||||
dassert(nStatus >= 0 && nStatus <= kStatFree);
|
assert(nStatus >= 0 && nStatus <= kStatFree);
|
||||||
if (sprite[nSprite].flags&32)
|
if (sprite[nSprite].flags&32)
|
||||||
{
|
{
|
||||||
for (n = 0; n < gPostCount; n++)
|
for (n = 0; n < gPostCount; n++)
|
||||||
if (gPost[n].TotalKills == nSprite)
|
if (gPost[n].TotalKills == nSprite)
|
||||||
break;
|
break;
|
||||||
dassert(n < gPostCount);
|
assert(n < gPostCount);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -133,7 +133,7 @@ bool CanMove(spritetype *pSprite, int a2, int nAngle, int nRange)
|
||||||
x += mulscale30(nRange, Cos(nAngle));
|
x += mulscale30(nRange, Cos(nAngle));
|
||||||
y += mulscale30(nRange, Sin(nAngle));
|
y += mulscale30(nRange, Sin(nAngle));
|
||||||
int nSector = pSprite->sectnum;
|
int nSector = pSprite->sectnum;
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
if (!FindSector(x, y, z, &nSector))
|
if (!FindSector(x, y, z, &nSector))
|
||||||
return false;
|
return false;
|
||||||
int floorZ = getflorzofslope(nSector, x, y);
|
int floorZ = getflorzofslope(nSector, x, y);
|
||||||
|
@ -231,7 +231,7 @@ bool CanMove(spritetype *pSprite, int a2, int nAngle, int nRange)
|
||||||
void aiChooseDirection(spritetype *pSprite, XSPRITE *pXSprite, int a3)
|
void aiChooseDirection(spritetype *pSprite, XSPRITE *pXSprite, int a3)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
int vc = ((a3+1024-pSprite->ang)&2047)-1024;
|
int vc = ((a3+1024-pSprite->ang)&2047)-1024;
|
||||||
int nCos = Cos(pSprite->ang);
|
int nCos = Cos(pSprite->ang);
|
||||||
int nSin = Sin(pSprite->ang);
|
int nSin = Sin(pSprite->ang);
|
||||||
|
@ -273,7 +273,7 @@ void aiChooseDirection(spritetype *pSprite, XSPRITE *pXSprite, int a3)
|
||||||
void aiMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
void aiMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -286,7 +286,7 @@ void aiMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
void aiMoveTurn(spritetype *pSprite, XSPRITE *pXSprite)
|
void aiMoveTurn(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -296,7 +296,7 @@ void aiMoveTurn(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
void aiMoveDodge(spritetype *pSprite, XSPRITE *pXSprite)
|
void aiMoveDodge(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -321,7 +321,7 @@ void aiMoveDodge(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
void aiActivateDude(spritetype *pSprite, XSPRITE *pXSprite)
|
void aiActivateDude(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!pXSprite->state) {
|
if (!pXSprite->state) {
|
||||||
aiChooseDirection(pSprite, pXSprite, getangle(pXSprite->targetX-pSprite->x, pXSprite->targetY-pSprite->y));
|
aiChooseDirection(pSprite, pXSprite, getangle(pXSprite->targetX-pSprite->x, pXSprite->targetY-pSprite->y));
|
||||||
pXSprite->state = 1;
|
pXSprite->state = 1;
|
||||||
|
@ -872,7 +872,7 @@ void aiSetTarget(XSPRITE *pXSprite, int x, int y, int z)
|
||||||
|
|
||||||
void aiSetTarget(XSPRITE *pXSprite, int nTarget)
|
void aiSetTarget(XSPRITE *pXSprite, int nTarget)
|
||||||
{
|
{
|
||||||
dassert(nTarget >= 0 && nTarget < kMaxSprites);
|
assert(nTarget >= 0 && nTarget < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[nTarget];
|
spritetype *pTarget = &sprite[nTarget];
|
||||||
if (pTarget->type >= kDudeBase && pTarget->type < kDudeMax)
|
if (pTarget->type >= kDudeBase && pTarget->type < kDudeMax)
|
||||||
{
|
{
|
||||||
|
@ -890,7 +890,7 @@ void aiSetTarget(XSPRITE *pXSprite, int nTarget)
|
||||||
|
|
||||||
int aiDamageSprite(spritetype *pSprite, XSPRITE *pXSprite, int nSource, DAMAGE_TYPE nDmgType, int nDamage)
|
int aiDamageSprite(spritetype *pSprite, XSPRITE *pXSprite, int nSource, DAMAGE_TYPE nDmgType, int nDamage)
|
||||||
{
|
{
|
||||||
dassert(nSource < kMaxSprites);
|
assert(nSource < kMaxSprites);
|
||||||
if (!pXSprite->health)
|
if (!pXSprite->health)
|
||||||
return 0;
|
return 0;
|
||||||
pXSprite->health = ClipLow(pXSprite->health - nDamage, 0);
|
pXSprite->health = ClipLow(pXSprite->health - nDamage, 0);
|
||||||
|
@ -1339,7 +1339,7 @@ void RecoilDude(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
void aiThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
void aiThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
if (Chance(pDudeInfo->alertChance))
|
if (Chance(pDudeInfo->alertChance))
|
||||||
{
|
{
|
||||||
|
@ -1378,7 +1378,7 @@ void aiThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
void sub_5F15C(spritetype *pSprite, XSPRITE *pXSprite)
|
void sub_5F15C(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
if (Chance(pDudeInfo->alertChance))
|
if (Chance(pDudeInfo->alertChance))
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,18 +80,18 @@ static void batBiteSeqCallback(int, int nXSprite)
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
int dx = CosScale16(pSprite->ang);
|
int dx = CosScale16(pSprite->ang);
|
||||||
int dy = SinScale16(pSprite->ang);
|
int dy = SinScale16(pSprite->ang);
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
DUDEINFO *pDudeInfoT = getDudeInfo(pTarget->type);
|
DUDEINFO *pDudeInfoT = getDudeInfo(pTarget->type);
|
||||||
int height = (pSprite->yrepeat*pDudeInfo->eyeHeight)<<2;
|
int height = (pSprite->yrepeat*pDudeInfo->eyeHeight)<<2;
|
||||||
int height2 = (pTarget->yrepeat*pDudeInfoT->eyeHeight)<<2;
|
int height2 = (pTarget->yrepeat*pDudeInfoT->eyeHeight)<<2;
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
actFireVector(pSprite, 0, 0, dx, dy, height2-height, VECTOR_TYPE_6);
|
actFireVector(pSprite, 0, 0, dx, dy, height2-height, VECTOR_TYPE_6);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void batThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
static void batThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
DUDEEXTRA_at6_u1 *pDudeExtraE = &gDudeExtra[pSprite->extra].at6.u1;
|
DUDEEXTRA_at6_u1 *pDudeExtraE = &gDudeExtra[pSprite->extra].at6.u1;
|
||||||
if (pDudeExtraE->at8 && pDudeExtraE->Kills < 10)
|
if (pDudeExtraE->at8 && pDudeExtraE->Kills < 10)
|
||||||
|
@ -149,7 +149,7 @@ static void batThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void batThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void batThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
int dy = pXSprite->targetY-pSprite->y;
|
int dy = pXSprite->targetY-pSprite->y;
|
||||||
|
@ -168,9 +168,9 @@ static void batThinkPonder(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &batSearch);
|
aiNewState(pSprite, pXSprite, &batSearch);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
@ -218,7 +218,7 @@ static void batThinkPonder(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void batMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite)
|
static void batMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -242,7 +242,7 @@ static void batMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void batMoveDodgeDown(spritetype *pSprite, XSPRITE *pXSprite)
|
static void batMoveDodgeDown(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -272,9 +272,9 @@ static void batThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &batGoto);
|
aiNewState(pSprite, pXSprite, &batGoto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
@ -328,7 +328,7 @@ static void batThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void batMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
static void batMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -360,7 +360,7 @@ static void batMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void batMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
|
static void batMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -391,7 +391,7 @@ static void batMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void batMoveFly(spritetype *pSprite, XSPRITE *pXSprite)
|
static void batMoveFly(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
|
|
@ -204,7 +204,7 @@ static void beastThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void beastThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void beastThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
XSECTOR *pXSector;
|
XSECTOR *pXSector;
|
||||||
int nXSector = sector[pSprite->sectnum].extra;
|
int nXSector = sector[pSprite->sectnum].extra;
|
||||||
|
@ -243,9 +243,9 @@ static void beastThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &beastSearch);
|
aiNewState(pSprite, pXSprite, &beastSearch);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
@ -391,7 +391,7 @@ static void beastThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void beastThinkSwimGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void beastThinkSwimGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
int dy = pXSprite->targetY-pSprite->y;
|
int dy = pXSprite->targetY-pSprite->y;
|
||||||
|
@ -410,9 +410,9 @@ static void beastThinkSwimChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &beastSwimGoto);
|
aiNewState(pSprite, pXSprite, &beastSwimGoto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
@ -460,7 +460,7 @@ static void beastThinkSwimChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void beastMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
static void beastMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -479,7 +479,7 @@ static void beastMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void sub_628A0(spritetype *pSprite, XSPRITE *pXSprite)
|
static void sub_628A0(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -511,7 +511,7 @@ static void sub_628A0(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void sub_62AE0(spritetype *pSprite, XSPRITE *pXSprite)
|
static void sub_62AE0(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight;
|
int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight;
|
||||||
|
@ -546,7 +546,7 @@ static void sub_62AE0(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void sub_62D7C(spritetype *pSprite, XSPRITE *pXSprite)
|
static void sub_62D7C(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight;
|
int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight;
|
||||||
|
|
|
@ -81,7 +81,7 @@ static void eelBiteSeqCallback(int, int nXSprite)
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
int dx = CosScale16(pSprite->ang);
|
int dx = CosScale16(pSprite->ang);
|
||||||
int dy = SinScale16(pSprite->ang);
|
int dy = SinScale16(pSprite->ang);
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
DUDEINFO *pDudeInfoT = getDudeInfo(pTarget->type);
|
DUDEINFO *pDudeInfoT = getDudeInfo(pTarget->type);
|
||||||
int height = (pSprite->yrepeat*pDudeInfo->eyeHeight)<<2;
|
int height = (pSprite->yrepeat*pDudeInfo->eyeHeight)<<2;
|
||||||
|
@ -98,13 +98,13 @@ static void eelBiteSeqCallback(int, int nXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &eelSearch);
|
aiNewState(pSprite, pXSprite, &eelSearch);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
actFireVector(pSprite, 0, 0, dx, dy, height2-height, VECTOR_TYPE_7);
|
actFireVector(pSprite, 0, 0, dx, dy, height2-height, VECTOR_TYPE_7);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void eelThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
static void eelThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
DUDEEXTRA_at6_u1 *pDudeExtraE = &gDudeExtra[pSprite->extra].at6.u1;
|
DUDEEXTRA_at6_u1 *pDudeExtraE = &gDudeExtra[pSprite->extra].at6.u1;
|
||||||
if (pDudeExtraE->at8 && pDudeExtraE->Kills < 10)
|
if (pDudeExtraE->at8 && pDudeExtraE->Kills < 10)
|
||||||
|
@ -164,7 +164,7 @@ static void eelThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void eelThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void eelThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
int dy = pXSprite->targetY-pSprite->y;
|
int dy = pXSprite->targetY-pSprite->y;
|
||||||
|
@ -183,9 +183,9 @@ static void eelThinkPonder(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &eelSearch);
|
aiNewState(pSprite, pXSprite, &eelSearch);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
@ -233,7 +233,7 @@ static void eelThinkPonder(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void eelMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite)
|
static void eelMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -257,7 +257,7 @@ static void eelMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void eelMoveDodgeDown(spritetype *pSprite, XSPRITE *pXSprite)
|
static void eelMoveDodgeDown(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -287,9 +287,9 @@ static void eelThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &eelGoto);
|
aiNewState(pSprite, pXSprite, &eelGoto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
@ -339,7 +339,7 @@ static void eelThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void eelMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
static void eelMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -371,7 +371,7 @@ static void eelMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void eelMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
|
static void eelMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -399,7 +399,7 @@ static void eelMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void eelMoveAscend(spritetype *pSprite, XSPRITE *pXSprite)
|
static void eelMoveAscend(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
|
|
@ -99,7 +99,7 @@ static void burnThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void burnThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void burnThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
int dy = pXSprite->targetY-pSprite->y;
|
int dy = pXSprite->targetY-pSprite->y;
|
||||||
|
@ -170,9 +170,9 @@ static void burnThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
|
|
@ -105,7 +105,7 @@ static void calebThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void calebThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void calebThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
XSECTOR *pXSector;
|
XSECTOR *pXSector;
|
||||||
int nXSector = sector[pSprite->sectnum].extra;
|
int nXSector = sector[pSprite->sectnum].extra;
|
||||||
|
@ -144,9 +144,9 @@ static void calebThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &tinycalebSearch);
|
aiNewState(pSprite, pXSprite, &tinycalebSearch);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
@ -258,7 +258,7 @@ static void calebThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void calebThinkSwimGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void calebThinkSwimGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
int dy = pXSprite->targetY-pSprite->y;
|
int dy = pXSprite->targetY-pSprite->y;
|
||||||
|
@ -277,9 +277,9 @@ static void calebThinkSwimChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &tinycalebSwimGoto);
|
aiNewState(pSprite, pXSprite, &tinycalebSwimGoto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
@ -322,7 +322,7 @@ static void calebThinkSwimChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void sub_65D04(spritetype *pSprite, XSPRITE *pXSprite)
|
static void sub_65D04(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -354,7 +354,7 @@ static void sub_65D04(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void sub_65F44(spritetype *pSprite, XSPRITE *pXSprite)
|
static void sub_65F44(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight;
|
int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight;
|
||||||
|
@ -389,7 +389,7 @@ static void sub_65F44(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void sub_661E0(spritetype *pSprite, XSPRITE *pXSprite)
|
static void sub_661E0(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight;
|
int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight;
|
||||||
|
|
|
@ -80,14 +80,14 @@ static void cerberusBiteSeqCallback(int, int nXSprite)
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
int dx = CosScale16(pSprite->ang);
|
int dx = CosScale16(pSprite->ang);
|
||||||
int dy = SinScale16(pSprite->ang);
|
int dy = SinScale16(pSprite->ang);
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
///assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
||||||
consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
|
@ -104,9 +104,9 @@ static void cerberusBurnSeqCallback(int, int nXSprite)
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int height = pDudeInfo->eyeHeight*pSprite->yrepeat;
|
int height = pDudeInfo->eyeHeight*pSprite->yrepeat;
|
||||||
///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
///assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
||||||
consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int x = pSprite->x;
|
int x = pSprite->x;
|
||||||
|
@ -183,9 +183,9 @@ static void cerberusBurnSeqCallback2(int, int nXSprite)
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
int nSprite = pXSprite->reference;
|
int nSprite = pXSprite->reference;
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
///assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
||||||
consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -272,9 +272,9 @@ static void cerberusThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void cerberusThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
static void cerberusThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -332,9 +332,9 @@ static void cerberusThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void cerberusThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void cerberusThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -371,17 +371,17 @@ static void cerberusThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
|
||||||
///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
///assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
||||||
consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
|
|
|
@ -166,9 +166,9 @@ static void cultThrowSeqCallback(int, int nXSprite)
|
||||||
nMissile = kThingArmedTNTBundle;
|
nMissile = kThingArmedTNTBundle;
|
||||||
char v4 = Chance(0x6000);
|
char v4 = Chance(0x6000);
|
||||||
sfxPlay3DSound(pSprite, 455, -1, 0);
|
sfxPlay3DSound(pSprite, 455, -1, 0);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
int dx = pTarget->x - pSprite->x;
|
int dx = pTarget->x - pSprite->x;
|
||||||
int dy = pTarget->y - pSprite->y;
|
int dy = pTarget->y - pSprite->y;
|
||||||
int dz = pTarget->z - pSprite->z;
|
int dz = pTarget->z - pSprite->z;
|
||||||
|
@ -205,9 +205,9 @@ static void sub_68230(int, int nXSprite)
|
||||||
if (gGameOptions.nDifficulty > 2)
|
if (gGameOptions.nDifficulty > 2)
|
||||||
nMissile = kThingArmedTNTBundle;
|
nMissile = kThingArmedTNTBundle;
|
||||||
sfxPlay3DSound(pSprite, 455, -1, 0);
|
sfxPlay3DSound(pSprite, 455, -1, 0);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
int dx = pTarget->x - pSprite->x;
|
int dx = pTarget->x - pSprite->x;
|
||||||
int dy = pTarget->y - pSprite->y;
|
int dy = pTarget->y - pSprite->y;
|
||||||
int dz = pTarget->z - pSprite->z;
|
int dz = pTarget->z - pSprite->z;
|
||||||
|
@ -235,7 +235,7 @@ static void cultThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void cultThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void cultThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
int dy = pXSprite->targetY-pSprite->y;
|
int dy = pXSprite->targetY-pSprite->y;
|
||||||
|
@ -274,9 +274,9 @@ static void cultThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
|
|
@ -231,9 +231,9 @@ static void ThrowSSeqCallback(int, int nXSprite)
|
||||||
|
|
||||||
static void gargThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
static void gargThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -294,9 +294,9 @@ static void gargThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void gargThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void gargThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -313,9 +313,9 @@ static void gargThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void gargMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite)
|
static void gargMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -341,9 +341,9 @@ static void gargMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void gargMoveDodgeDown(spritetype *pSprite, XSPRITE *pXSprite)
|
static void gargMoveDodgeDown(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -375,15 +375,15 @@ static void gargThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &gargoyleFGoto);
|
aiNewState(pSprite, pXSprite, &gargoyleFGoto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
///assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
||||||
consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
|
@ -565,9 +565,9 @@ static void entrySStatue(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void gargMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
static void gargMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -601,9 +601,9 @@ static void gargMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void gargMoveSlow(spritetype *pSprite, XSPRITE *pXSprite)
|
static void gargMoveSlow(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -644,9 +644,9 @@ static void gargMoveSlow(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void gargMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
|
static void gargMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -686,9 +686,9 @@ static void gargMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void gargMoveFly(spritetype *pSprite, XSPRITE *pXSprite)
|
static void gargMoveFly(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
|
|
@ -205,9 +205,9 @@ static void ghostBlastSeqCallback(int, int nXSprite)
|
||||||
|
|
||||||
static void ghostThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
static void ghostThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -267,9 +267,9 @@ static void ghostThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void ghostThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void ghostThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -286,9 +286,9 @@ static void ghostThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void ghostMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite)
|
static void ghostMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -314,9 +314,9 @@ static void ghostMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void ghostMoveDodgeDown(spritetype *pSprite, XSPRITE *pXSprite)
|
static void ghostMoveDodgeDown(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -348,15 +348,15 @@ static void ghostThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &ghostGoto);
|
aiNewState(pSprite, pXSprite, &ghostGoto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
///assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
||||||
consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
|
@ -456,9 +456,9 @@ static void ghostThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void ghostMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
static void ghostMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -492,9 +492,9 @@ static void ghostMoveForward(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void ghostMoveSlow(spritetype *pSprite, XSPRITE *pXSprite)
|
static void ghostMoveSlow(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -532,9 +532,9 @@ static void ghostMoveSlow(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void ghostMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
|
static void ghostMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -571,9 +571,9 @@ static void ghostMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void ghostMoveFly(spritetype *pSprite, XSPRITE *pXSprite)
|
static void ghostMoveFly(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
|
|
@ -96,7 +96,7 @@ static void gillThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void gillThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void gillThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
XSECTOR *pXSector;
|
XSECTOR *pXSector;
|
||||||
int nXSector = sector[pSprite->sectnum].extra;
|
int nXSector = sector[pSprite->sectnum].extra;
|
||||||
|
@ -135,9 +135,9 @@ static void gillThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &gillBeastSearch);
|
aiNewState(pSprite, pXSprite, &gillBeastSearch);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
@ -245,7 +245,7 @@ static void gillThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void gillThinkSwimGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void gillThinkSwimGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
int dy = pXSprite->targetY-pSprite->y;
|
int dy = pXSprite->targetY-pSprite->y;
|
||||||
|
@ -264,9 +264,9 @@ static void gillThinkSwimChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &gillBeastSwimSearch);
|
aiNewState(pSprite, pXSprite, &gillBeastSwimSearch);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
@ -314,7 +314,7 @@ static void gillThinkSwimChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void sub_6CB00(spritetype *pSprite, XSPRITE *pXSprite)
|
static void sub_6CB00(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024;
|
||||||
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
int nTurnRange = (pDudeInfo->angSpeed<<2)>>4;
|
||||||
|
@ -346,7 +346,7 @@ static void sub_6CB00(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void sub_6CD74(spritetype *pSprite, XSPRITE *pXSprite)
|
static void sub_6CD74(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight;
|
int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight;
|
||||||
|
@ -381,7 +381,7 @@ static void sub_6CD74(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
static void sub_6D03C(spritetype *pSprite, XSPRITE *pXSprite)
|
static void sub_6D03C(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight;
|
int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight;
|
||||||
|
|
|
@ -82,7 +82,7 @@ static void handThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void handThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void handThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
int dy = pXSprite->targetY-pSprite->y;
|
int dy = pXSprite->targetY-pSprite->y;
|
||||||
|
@ -101,9 +101,9 @@ static void handThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &handGoto);
|
aiNewState(pSprite, pXSprite, &handGoto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
|
|
@ -69,15 +69,15 @@ static void houndBiteSeqCallback(int, int nXSprite)
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
int dx = CosScale16(pSprite->ang);
|
int dx = CosScale16(pSprite->ang);
|
||||||
int dy = SinScale16(pSprite->ang);
|
int dy = SinScale16(pSprite->ang);
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
///assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
||||||
consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
|
@ -106,9 +106,9 @@ static void houndThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void houndThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void houndThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,15 +130,15 @@ static void houndThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &houndGoto);
|
aiNewState(pSprite, pXSprite, &houndGoto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
///assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
||||||
consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
|
|
|
@ -61,7 +61,7 @@ static void innocThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void innocThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void innocThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
int dy = pXSprite->targetY-pSprite->y;
|
int dy = pXSprite->targetY-pSprite->y;
|
||||||
|
@ -80,9 +80,9 @@ static void innocThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &innocentGoto);
|
aiNewState(pSprite, pXSprite, &innocentGoto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
|
|
@ -93,17 +93,17 @@ static void sub_6FFA0(int, int nXSprite)
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
int nSprite = pXSprite->reference;
|
int nSprite = pXSprite->reference;
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
///assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
||||||
consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
|
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -177,9 +177,9 @@ static void sub_7034C(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void sub_70380(spritetype *pSprite, XSPRITE *pXSprite)
|
static void sub_70380(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,15 +219,15 @@ static void sub_704D8(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
///assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
||||||
consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
|
|
|
@ -64,8 +64,8 @@ static void ratBiteSeqCallback(int, int nXSprite)
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
int dx = CosScale16(pSprite->ang);
|
int dx = CosScale16(pSprite->ang);
|
||||||
int dy = SinScale16(pSprite->ang);
|
int dy = SinScale16(pSprite->ang);
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
if (IsPlayerSprite(pTarget))
|
if (IsPlayerSprite(pTarget))
|
||||||
actFireVector(pSprite, 0, 0, dx, dy, pTarget->z-pSprite->z, VECTOR_TYPE_16);
|
actFireVector(pSprite, 0, 0, dx, dy, pTarget->z-pSprite->z, VECTOR_TYPE_16);
|
||||||
|
@ -79,7 +79,7 @@ static void ratThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void ratThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void ratThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
int dy = pXSprite->targetY-pSprite->y;
|
int dy = pXSprite->targetY-pSprite->y;
|
||||||
|
@ -98,9 +98,9 @@ static void ratThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &ratGoto);
|
aiNewState(pSprite, pXSprite, &ratGoto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
|
|
@ -65,7 +65,7 @@ AISTATE spid13A92C = { kAiStateOther, 0, dword_279B50, 60, NULL, NULL, NULL, &sp
|
||||||
|
|
||||||
static char sub_70D30(XSPRITE *pXDude, int a2, int a3)
|
static char sub_70D30(XSPRITE *pXDude, int a2, int a3)
|
||||||
{
|
{
|
||||||
dassert(pXDude != NULL);
|
assert(pXDude != NULL);
|
||||||
int nDude = pXDude->reference;
|
int nDude = pXDude->reference;
|
||||||
spritetype *pDude = &sprite[nDude];
|
spritetype *pDude = &sprite[nDude];
|
||||||
if (IsPlayerSprite(pDude))
|
if (IsPlayerSprite(pDude))
|
||||||
|
@ -95,8 +95,8 @@ static void SpidBiteSeqCallback(int, int nXSprite)
|
||||||
dx += Random2(2000);
|
dx += Random2(2000);
|
||||||
dy += Random2(2000);
|
dy += Random2(2000);
|
||||||
int dz = Random2(2000);
|
int dz = Random2(2000);
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
if (IsPlayerSprite(pTarget)) {
|
if (IsPlayerSprite(pTarget)) {
|
||||||
|
@ -145,8 +145,8 @@ static void SpidJumpSeqCallback(int, int nXSprite)
|
||||||
dx += Random2(200);
|
dx += Random2(200);
|
||||||
dy += Random2(200);
|
dy += Random2(200);
|
||||||
int dz = Random2(200);
|
int dz = Random2(200);
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
if (IsPlayerSprite(pTarget)) {
|
if (IsPlayerSprite(pTarget)) {
|
||||||
dz += pTarget->z-pSprite->z;
|
dz += pTarget->z-pSprite->z;
|
||||||
|
@ -167,9 +167,9 @@ static void sub_71370(int, int nXSprite)
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
int nSprite = pXSprite->reference;
|
int nSprite = pXSprite->reference;
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
DUDEEXTRA_at6_u1 *pDudeExtraE = &gDudeExtra[pSprite->extra].at6.u1;
|
DUDEEXTRA_at6_u1 *pDudeExtraE = &gDudeExtra[pSprite->extra].at6.u1;
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
|
@ -204,7 +204,7 @@ static void spidThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void spidThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void spidThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
int dy = pXSprite->targetY-pSprite->y;
|
int dy = pXSprite->targetY-pSprite->y;
|
||||||
|
@ -223,9 +223,9 @@ static void spidThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &spidGoto);
|
aiNewState(pSprite, pXSprite, &spidGoto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
|
|
@ -88,9 +88,9 @@ static void sub_71BD4(int, int nXSprite)
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int height = pSprite->yrepeat*pDudeInfo->eyeHeight;
|
int height = pSprite->yrepeat*pDudeInfo->eyeHeight;
|
||||||
///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
///assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
||||||
consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int x = pSprite->x;
|
int x = pSprite->x;
|
||||||
|
@ -160,9 +160,9 @@ static void sub_720AC(int, int nXSprite)
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
int nSprite = pXSprite->reference;
|
int nSprite = pXSprite->reference;
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
///assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
||||||
consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -241,9 +241,9 @@ static void sub_72580(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void sub_725A4(spritetype *pSprite, XSPRITE *pXSprite)
|
static void sub_725A4(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -298,9 +298,9 @@ static void sub_725A4(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void sub_72850(spritetype *pSprite, XSPRITE *pXSprite)
|
static void sub_72850(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
|
@ -321,15 +321,15 @@ static void sub_72934(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &tcherno13A9B8);
|
aiNewState(pSprite, pXSprite, &tcherno13A9B8);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
///assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
if (!(pXSprite->target >= 0 && pXSprite->target < kMaxSprites)) {
|
||||||
consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
|
|
|
@ -210,14 +210,14 @@ static void punchCallback(int, int nXIndex) {
|
||||||
|
|
||||||
static void genDudeAttack1(int, int nXIndex) {
|
static void genDudeAttack1(int, int nXIndex) {
|
||||||
if (!(nXIndex >= 0 && nXIndex < kMaxXSprites)) {
|
if (!(nXIndex >= 0 && nXIndex < kMaxXSprites)) {
|
||||||
consoleSysMsg("nXIndex >= 0 && nXIndex < kMaxXSprites");
|
Printf(PRINT_HIGH, "nXIndex >= 0 && nXIndex < kMaxXSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
XSPRITE* pXSprite = &xsprite[nXIndex]; int nSprite = pXSprite->reference;
|
XSPRITE* pXSprite = &xsprite[nXIndex]; int nSprite = pXSprite->reference;
|
||||||
if (pXSprite->target < 0) return;
|
if (pXSprite->target < 0) return;
|
||||||
else if (!(nSprite >= 0 && nSprite < kMaxSprites)) {
|
else if (!(nSprite >= 0 && nSprite < kMaxSprites)) {
|
||||||
consoleSysMsg("nIndex >= 0 && nIndex < kMaxSprites");
|
Printf(PRINT_HIGH, "nIndex >= 0 && nIndex < kMaxSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ static void unicultThinkSearch( spritetype* pSprite, XSPRITE* pXSprite ) {
|
||||||
static void unicultThinkGoto(spritetype* pSprite, XSPRITE* pXSprite) {
|
static void unicultThinkGoto(spritetype* pSprite, XSPRITE* pXSprite) {
|
||||||
|
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1025,7 +1025,7 @@ void aiGenDudeMoveForward(spritetype* pSprite, XSPRITE* pXSprite ) {
|
||||||
|
|
||||||
void aiGenDudeChooseDirection(spritetype* pSprite, XSPRITE* pXSprite, int a3, int xvel, int yvel) {
|
void aiGenDudeChooseDirection(spritetype* pSprite, XSPRITE* pXSprite, int a3, int xvel, int yvel) {
|
||||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||||
consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1061,7 +1061,7 @@ void aiGenDudeChooseDirection(spritetype* pSprite, XSPRITE* pXSprite, int a3, in
|
||||||
|
|
||||||
void aiGenDudeNewState(spritetype* pSprite, AISTATE* pAIState) {
|
void aiGenDudeNewState(spritetype* pSprite, AISTATE* pAIState) {
|
||||||
if (!xspriRangeIsFine(pSprite->extra)) {
|
if (!xspriRangeIsFine(pSprite->extra)) {
|
||||||
consoleSysMsg("!xspriRangeIsFine(pSprite->extra)");
|
Printf(PRINT_HIGH, "!xspriRangeIsFine(pSprite->extra)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1693,7 +1693,7 @@ spritetype* genDudeSpawn(spritetype* pSprite, int nDist) {
|
||||||
void genDudeTransform(spritetype* pSprite) {
|
void genDudeTransform(spritetype* pSprite) {
|
||||||
|
|
||||||
if (!(pSprite->extra >= 0 && pSprite->extra < kMaxXSprites)) {
|
if (!(pSprite->extra >= 0 && pSprite->extra < kMaxXSprites)) {
|
||||||
consoleSysMsg("pSprite->extra >= 0 && pSprite->extra < kMaxXSprites");
|
Printf(PRINT_HIGH, "pSprite->extra >= 0 && pSprite->extra < kMaxXSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1810,7 +1810,7 @@ void genDudeTransform(spritetype* pSprite) {
|
||||||
|
|
||||||
void updateTargetOfLeech(spritetype* pSprite) {
|
void updateTargetOfLeech(spritetype* pSprite) {
|
||||||
if (!(pSprite->extra >= 0 && pSprite->extra < kMaxXSprites)) {
|
if (!(pSprite->extra >= 0 && pSprite->extra < kMaxXSprites)) {
|
||||||
consoleSysMsg("pSprite->extra >= 0 && pSprite->extra < kMaxXSprites");
|
Printf(PRINT_HIGH, "pSprite->extra >= 0 && pSprite->extra < kMaxXSprites");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1831,7 +1831,7 @@ void updateTargetOfLeech(spritetype* pSprite) {
|
||||||
|
|
||||||
void updateTargetOfSlaves(spritetype* pSprite) {
|
void updateTargetOfSlaves(spritetype* pSprite) {
|
||||||
if (!xspriRangeIsFine(pSprite->extra)) {
|
if (!xspriRangeIsFine(pSprite->extra)) {
|
||||||
consoleSysMsg("!xspriRangeIsFine(pSprite->extra)");
|
Printf(PRINT_HIGH, "!xspriRangeIsFine(pSprite->extra)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1938,13 +1938,13 @@ int genDudeSeqStartId(XSPRITE* pXSprite) {
|
||||||
|
|
||||||
bool genDudePrepare(spritetype* pSprite, int propId) {
|
bool genDudePrepare(spritetype* pSprite, int propId) {
|
||||||
if (!spriRangeIsFine(pSprite->index)) {
|
if (!spriRangeIsFine(pSprite->index)) {
|
||||||
consoleSysMsg("!spriRangeIsFine(pSprite->index)");
|
Printf(PRINT_HIGH, "!spriRangeIsFine(pSprite->index)");
|
||||||
return false;
|
return false;
|
||||||
} else if (!xspriRangeIsFine(pSprite->extra)) {
|
} else if (!xspriRangeIsFine(pSprite->extra)) {
|
||||||
consoleSysMsg("!xspriRangeIsFine(pSprite->extra)");
|
Printf(PRINT_HIGH, "!xspriRangeIsFine(pSprite->extra)");
|
||||||
return false;
|
return false;
|
||||||
} else if (pSprite->type != kDudeModernCustom) {
|
} else if (pSprite->type != kDudeModernCustom) {
|
||||||
consoleSysMsg("pSprite->type != kDudeModernCustom");
|
Printf(PRINT_HIGH, "pSprite->type != kDudeModernCustom");
|
||||||
return false;
|
return false;
|
||||||
} else if (propId < kGenDudePropertyAll || propId >= kGenDudePropertyMax) {
|
} else if (propId < kGenDudePropertyAll || propId >= kGenDudePropertyMax) {
|
||||||
viewSetSystemMessage("Unknown custom dude #%d property (%d)", pSprite->index, propId);
|
viewSetSystemMessage("Unknown custom dude #%d property (%d)", pSprite->index, propId);
|
||||||
|
|
|
@ -111,7 +111,7 @@ static void zombaThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void zombaThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void zombaThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
int dy = pXSprite->targetY-pSprite->y;
|
int dy = pXSprite->targetY-pSprite->y;
|
||||||
|
@ -130,9 +130,9 @@ static void zombaThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &zombieASearch);
|
aiNewState(pSprite, pXSprite, &zombieASearch);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
@ -180,9 +180,9 @@ static void zombaThinkPonder(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &zombieASearch);
|
aiNewState(pSprite, pXSprite, &zombieASearch);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
@ -226,7 +226,7 @@ static void zombaThinkPonder(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void myThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
static void myThinkTarget(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
||||||
{
|
{
|
||||||
|
|
|
@ -118,7 +118,7 @@ static void zombfThinkSearch(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
|
|
||||||
static void zombfThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
static void zombfThinkGoto(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
{
|
{
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
int dx = pXSprite->targetX-pSprite->x;
|
int dx = pXSprite->targetX-pSprite->x;
|
||||||
int dy = pXSprite->targetY-pSprite->y;
|
int dy = pXSprite->targetY-pSprite->y;
|
||||||
|
@ -137,9 +137,9 @@ static void zombfThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
|
||||||
aiNewState(pSprite, pXSprite, &zombieFGoto);
|
aiNewState(pSprite, pXSprite, &zombieFGoto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||||
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
|
||||||
spritetype *pTarget = &sprite[pXSprite->target];
|
spritetype *pTarget = &sprite[pXSprite->target];
|
||||||
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
XSPRITE *pXTarget = &xsprite[pTarget->extra];
|
||||||
int dx = pTarget->x-pSprite->x;
|
int dx = pTarget->x-pSprite->x;
|
||||||
|
|
|
@ -133,7 +133,7 @@ static const WEAPONICON gWeaponIcon[] = {
|
||||||
|
|
||||||
static tspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect)
|
static tspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect)
|
||||||
{
|
{
|
||||||
dassert(nViewEffect >= 0 && nViewEffect < kViewEffectMax);
|
assert(nViewEffect >= 0 && nViewEffect < kViewEffectMax);
|
||||||
auto pTSprite = &tsprite[nTSprite];
|
auto pTSprite = &tsprite[nTSprite];
|
||||||
if (gDetail < effectDetail[nViewEffect] || nTSprite >= maxspritesonscreen) return NULL;
|
if (gDetail < effectDetail[nViewEffect] || nTSprite >= maxspritesonscreen) return NULL;
|
||||||
switch (nViewEffect)
|
switch (nViewEffect)
|
||||||
|
@ -239,7 +239,7 @@ static tspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect)
|
||||||
int y = mulscale30(nLen, Sin(nAng));
|
int y = mulscale30(nLen, Sin(nAng));
|
||||||
pNSprite->y = pTSprite->y + y;
|
pNSprite->y = pTSprite->y + y;
|
||||||
pNSprite->z = pTSprite->z;
|
pNSprite->z = pTSprite->z;
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
FindSector(pNSprite->x, pNSprite->y, pNSprite->z, &nSector);
|
FindSector(pNSprite->x, pNSprite->y, pNSprite->z, &nSector);
|
||||||
pNSprite->sectnum = nSector;
|
pNSprite->sectnum = nSector;
|
||||||
pNSprite->owner = pTSprite->owner;
|
pNSprite->owner = pTSprite->owner;
|
||||||
|
@ -395,7 +395,7 @@ static tspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect)
|
||||||
}
|
}
|
||||||
case VIEW_EFFECT_12:
|
case VIEW_EFFECT_12:
|
||||||
{
|
{
|
||||||
dassert(pTSprite->type >= kDudePlayer1 && pTSprite->type <= kDudePlayer8);
|
assert(pTSprite->type >= kDudePlayer1 && pTSprite->type <= kDudePlayer8);
|
||||||
PLAYER *pPlayer = &gPlayer[pTSprite->type-kDudePlayer1];
|
PLAYER *pPlayer = &gPlayer[pTSprite->type-kDudePlayer1];
|
||||||
WEAPONICON weaponIcon = gWeaponIcon[pPlayer->curWeapon];
|
WEAPONICON weaponIcon = gWeaponIcon[pPlayer->curWeapon];
|
||||||
const int nTile = weaponIcon.nTile;
|
const int nTile = weaponIcon.nTile;
|
||||||
|
@ -444,7 +444,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
|
||||||
{
|
{
|
||||||
// shift before interpolating to increase precision.
|
// shift before interpolating to increase precision.
|
||||||
int myclock = (gFrameClock<<3) + mulscale16(4<<3, smoothratio);
|
int myclock = (gFrameClock<<3) + mulscale16(4<<3, smoothratio);
|
||||||
dassert(spritesortcnt <= maxspritesonscreen);
|
assert(spritesortcnt <= maxspritesonscreen);
|
||||||
gCameraAng = cA;
|
gCameraAng = cA;
|
||||||
int nViewSprites = spritesortcnt;
|
int nViewSprites = spritesortcnt;
|
||||||
for (int nTSprite = spritesortcnt-1; nTSprite >= 0; nTSprite--)
|
for (int nTSprite = spritesortcnt-1; nTSprite >= 0; nTSprite--)
|
||||||
|
@ -481,7 +481,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
|
||||||
int nAnim = 0;
|
int nAnim = 0;
|
||||||
switch (picanm[nTile].extra & 7) {
|
switch (picanm[nTile].extra & 7) {
|
||||||
case 0:
|
case 0:
|
||||||
//dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
//assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
if (nXSprite <= 0 || nXSprite >= kMaxXSprites) break;
|
if (nXSprite <= 0 || nXSprite >= kMaxXSprites) break;
|
||||||
switch (pTSprite->type) {
|
switch (pTSprite->type) {
|
||||||
case kSwitchToggle:
|
case kSwitchToggle:
|
||||||
|
@ -632,7 +632,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
|
||||||
pTSprite->shade = ClipRange(nShade, -128, 127);
|
pTSprite->shade = ClipRange(nShade, -128, 127);
|
||||||
if ((pTSprite->flags&kHitagRespawn) && sprite[pTSprite->owner].owner == 3)
|
if ((pTSprite->flags&kHitagRespawn) && sprite[pTSprite->owner].owner == 3)
|
||||||
{
|
{
|
||||||
dassert(pTXSprite != NULL);
|
assert(pTXSprite != NULL);
|
||||||
pTSprite->xrepeat = 48;
|
pTSprite->xrepeat = 48;
|
||||||
pTSprite->yrepeat = 48;
|
pTSprite->yrepeat = 48;
|
||||||
pTSprite->shade = -128;
|
pTSprite->shade = -128;
|
||||||
|
@ -736,7 +736,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
|
||||||
case kMissileFlareRegular:
|
case kMissileFlareRegular:
|
||||||
case kMissileFlareAlt:
|
case kMissileFlareAlt:
|
||||||
if (pTSprite->statnum == kStatFlare) {
|
if (pTSprite->statnum == kStatFlare) {
|
||||||
dassert(pTXSprite != NULL);
|
assert(pTXSprite != NULL);
|
||||||
if (pTXSprite->target == gView->nSprite) {
|
if (pTXSprite->target == gView->nSprite) {
|
||||||
pTSprite->xrepeat = 0;
|
pTSprite->xrepeat = 0;
|
||||||
break;
|
break;
|
||||||
|
@ -765,7 +765,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
|
||||||
if (pTSprite->type == kDudeHand && pTXSprite->aiState == &hand13A3B4)
|
if (pTSprite->type == kDudeHand && pTXSprite->aiState == &hand13A3B4)
|
||||||
{
|
{
|
||||||
spritetype *pTTarget = &sprite[pTXSprite->target];
|
spritetype *pTTarget = &sprite[pTXSprite->target];
|
||||||
dassert(pTXSprite != NULL && pTTarget != NULL);
|
assert(pTXSprite != NULL && pTTarget != NULL);
|
||||||
if (IsPlayerSprite(pTTarget))
|
if (IsPlayerSprite(pTTarget))
|
||||||
{
|
{
|
||||||
pTSprite->xrepeat = 0;
|
pTSprite->xrepeat = 0;
|
||||||
|
|
|
@ -131,7 +131,7 @@ void SortTags()
|
||||||
|
|
||||||
void AddCmdDefine(char *text, int value)
|
void AddCmdDefine(char *text, int value)
|
||||||
{
|
{
|
||||||
dassert(nCmdDefines < kMaxCmdLineDefines);
|
assert(nCmdDefines < kMaxCmdLineDefines);
|
||||||
|
|
||||||
gCmdDefines[nCmdDefines]._text = text;
|
gCmdDefines[nCmdDefines]._text = text;
|
||||||
gCmdDefines[nCmdDefines]._value = value;
|
gCmdDefines[nCmdDefines]._value = value;
|
||||||
|
@ -696,7 +696,7 @@ void ParseScript(int lumpnum)
|
||||||
|
|
||||||
// loc_11FC3:
|
// loc_11FC3:
|
||||||
gParseLevel++;
|
gParseLevel++;
|
||||||
dassert(gParseLevel < kMaxParseLevels);
|
assert(gParseLevel < kMaxParseLevels);
|
||||||
|
|
||||||
if (bGotDefine) {
|
if (bGotDefine) {
|
||||||
dword_44CE0[gParseLevel] = dword_44CE0[gParseLevel - 1];
|
dword_44CE0[gParseLevel] = dword_44CE0[gParseLevel - 1];
|
||||||
|
|
|
@ -88,7 +88,7 @@ void Remove(int nSprite) // 1
|
||||||
|
|
||||||
void FlareBurst(int nSprite) // 2
|
void FlareBurst(int nSprite) // 2
|
||||||
{
|
{
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
int nAngle = getangle(xvel[nSprite], yvel[nSprite]);
|
int nAngle = getangle(xvel[nSprite], yvel[nSprite]);
|
||||||
int nRadius = 0x55555;
|
int nRadius = 0x55555;
|
||||||
|
@ -147,10 +147,10 @@ void fxFlareSparkLite(int nSprite) // 4
|
||||||
|
|
||||||
void fxZombieBloodSpurt(int nSprite) // 5
|
void fxZombieBloodSpurt(int nSprite) // 5
|
||||||
{
|
{
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
int top, bottom;
|
int top, bottom;
|
||||||
GetSpriteExtents(pSprite, &top, &bottom);
|
GetSpriteExtents(pSprite, &top, &bottom);
|
||||||
|
@ -226,7 +226,7 @@ void fxDynPuff(int nSprite) // 8
|
||||||
void Respawn(int nSprite) // 9
|
void Respawn(int nSprite) // 9
|
||||||
{
|
{
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
dassert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites);
|
assert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites);
|
||||||
XSPRITE *pXSprite = &xsprite[pSprite->extra];
|
XSPRITE *pXSprite = &xsprite[pSprite->extra];
|
||||||
|
|
||||||
if (pSprite->statnum != kStatRespawn && pSprite->statnum != kStatThing) {
|
if (pSprite->statnum != kStatRespawn && pSprite->statnum != kStatThing) {
|
||||||
|
@ -251,8 +251,8 @@ void Respawn(int nSprite) // 9
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3: {
|
case 3: {
|
||||||
dassert(pSprite->owner != kStatRespawn);
|
assert(pSprite->owner != kStatRespawn);
|
||||||
dassert(pSprite->owner >= 0 && pSprite->owner < kMaxStatus);
|
assert(pSprite->owner >= 0 && pSprite->owner < kMaxStatus);
|
||||||
ChangeSpriteStat(nSprite, pSprite->owner);
|
ChangeSpriteStat(nSprite, pSprite->owner);
|
||||||
pSprite->type = pSprite->inittype;
|
pSprite->type = pSprite->inittype;
|
||||||
pSprite->owner = -1;
|
pSprite->owner = -1;
|
||||||
|
@ -306,7 +306,7 @@ void PlayerBubble(int nSprite) // 10
|
||||||
if (IsPlayerSprite(pSprite))
|
if (IsPlayerSprite(pSprite))
|
||||||
{
|
{
|
||||||
PLAYER *pPlayer = &gPlayer[pSprite->type-kDudePlayer1];
|
PLAYER *pPlayer = &gPlayer[pSprite->type-kDudePlayer1];
|
||||||
dassert(pPlayer != NULL);
|
assert(pPlayer != NULL);
|
||||||
if (!pPlayer->bubbleTime)
|
if (!pPlayer->bubbleTime)
|
||||||
return;
|
return;
|
||||||
int top, bottom;
|
int top, bottom;
|
||||||
|
@ -355,7 +355,7 @@ void EnemyBubble(int nSprite) // 11
|
||||||
|
|
||||||
void CounterCheck(int nSector) // 12
|
void CounterCheck(int nSector) // 12
|
||||||
{
|
{
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
if (sector[nSector].type != kSectorCounter) return;
|
if (sector[nSector].type != kSectorCounter) return;
|
||||||
if (sector[nSector].extra <= 0) return;
|
if (sector[nSector].extra <= 0) return;
|
||||||
|
|
||||||
|
@ -403,7 +403,7 @@ void fxBloodBits(int nSprite) // 14
|
||||||
if (pSprite->ang == 1024)
|
if (pSprite->ang == 1024)
|
||||||
{
|
{
|
||||||
int nChannel = 28+(pSprite->index&2);
|
int nChannel = 28+(pSprite->index&2);
|
||||||
dassert(nChannel < 32);
|
assert(nChannel < 32);
|
||||||
sfxPlay3DSound(pSprite, 385, nChannel, 1);
|
sfxPlay3DSound(pSprite, 385, nChannel, 1);
|
||||||
}
|
}
|
||||||
if (Chance(0x5000))
|
if (Chance(0x5000))
|
||||||
|
@ -452,7 +452,7 @@ void fxBouncingSleeve(int nSprite) // 16
|
||||||
}
|
}
|
||||||
|
|
||||||
int nChannel = 28 + (pSprite->index & 2);
|
int nChannel = 28 + (pSprite->index & 2);
|
||||||
dassert(nChannel < 32);
|
assert(nChannel < 32);
|
||||||
|
|
||||||
// tommy sleeve
|
// tommy sleeve
|
||||||
if (pSprite->type >= 37 && pSprite->type <= 39) {
|
if (pSprite->type >= 37 && pSprite->type <= 39) {
|
||||||
|
@ -549,7 +549,7 @@ void fxPodBloodSplat(int nSprite) // 19
|
||||||
if (pSprite->ang == 1024)
|
if (pSprite->ang == 1024)
|
||||||
{
|
{
|
||||||
int nChannel = 28+(pSprite->index&2);
|
int nChannel = 28+(pSprite->index&2);
|
||||||
dassert(nChannel < 32);
|
assert(nChannel < 32);
|
||||||
sfxPlay3DSound(pSprite, 385, nChannel, 1);
|
sfxPlay3DSound(pSprite, 385, nChannel, 1);
|
||||||
}
|
}
|
||||||
spritetype *pFX = NULL;
|
spritetype *pFX = NULL;
|
||||||
|
|
|
@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "pragmas.h"
|
#include "pragmas.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
@ -30,17 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
BEGIN_BLD_NS
|
BEGIN_BLD_NS
|
||||||
|
|
||||||
#define BLOODWIDESCREENDEF "blood_widescreen.def"
|
|
||||||
|
|
||||||
#define BYTEVERSION 103
|
|
||||||
#define EXEVERSION 101
|
|
||||||
|
|
||||||
void _SetErrorLoc(const char *pzFile, int nLine);
|
|
||||||
void __dassert(const char *pzExpr, const char *pzFile, int nLine);
|
|
||||||
void QuitGame(void);
|
void QuitGame(void);
|
||||||
void consoleSysMsg(const char* pMessage, ...);
|
|
||||||
|
|
||||||
#define dassert(x) assert(x)
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -462,8 +453,6 @@ enum searchpathtypes_t {
|
||||||
SEARCHPATH_REMOVE = 1<<0,
|
SEARCHPATH_REMOVE = 1<<0,
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void G_ExtInit(void);
|
|
||||||
|
|
||||||
extern void G_SetupGlobalPsky(void);
|
extern void G_SetupGlobalPsky(void);
|
||||||
|
|
||||||
|
|
||||||
|
@ -758,14 +747,14 @@ public:
|
||||||
unsigned int readUnsigned(int nBits)
|
unsigned int readUnsigned(int nBits)
|
||||||
{
|
{
|
||||||
unsigned int n = 0;
|
unsigned int n = 0;
|
||||||
dassert(nBits <= 32);
|
assert(nBits <= 32);
|
||||||
for (int i = 0; i < nBits; i++)
|
for (int i = 0; i < nBits; i++)
|
||||||
n += readBit()<<i;
|
n += readBit()<<i;
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
int readSigned(int nBits)
|
int readSigned(int nBits)
|
||||||
{
|
{
|
||||||
dassert(nBits <= 32);
|
assert(nBits <= 32);
|
||||||
int n = (int)readUnsigned(nBits);
|
int n = (int)readUnsigned(nBits);
|
||||||
n <<= 32-nBits;
|
n <<= 32-nBits;
|
||||||
n >>= 32-nBits;
|
n >>= 32-nBits;
|
||||||
|
|
|
@ -66,8 +66,8 @@ void dbCrypt(char *pPtr, int nLength, int nKey)
|
||||||
|
|
||||||
void InsertSpriteSect(int nSprite, int nSector)
|
void InsertSpriteSect(int nSprite, int nSector)
|
||||||
{
|
{
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
int nOther = headspritesect[nSector];
|
int nOther = headspritesect[nSector];
|
||||||
if (nOther >= 0)
|
if (nOther >= 0)
|
||||||
{
|
{
|
||||||
|
@ -87,9 +87,9 @@ void InsertSpriteSect(int nSprite, int nSector)
|
||||||
|
|
||||||
void RemoveSpriteSect(int nSprite)
|
void RemoveSpriteSect(int nSprite)
|
||||||
{
|
{
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
int nSector = sprite[nSprite].sectnum;
|
int nSector = sprite[nSprite].sectnum;
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
int nOther = nextspritesect[nSprite];
|
int nOther = nextspritesect[nSprite];
|
||||||
if (nOther < 0)
|
if (nOther < 0)
|
||||||
{
|
{
|
||||||
|
@ -109,8 +109,8 @@ void RemoveSpriteSect(int nSprite)
|
||||||
|
|
||||||
void InsertSpriteStat(int nSprite, int nStat)
|
void InsertSpriteStat(int nSprite, int nStat)
|
||||||
{
|
{
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
dassert(nStat >= 0 && nStat <= kMaxStatus);
|
assert(nStat >= 0 && nStat <= kMaxStatus);
|
||||||
int nOther = headspritestat[nStat];
|
int nOther = headspritestat[nStat];
|
||||||
if (nOther >= 0)
|
if (nOther >= 0)
|
||||||
{
|
{
|
||||||
|
@ -131,9 +131,9 @@ void InsertSpriteStat(int nSprite, int nStat)
|
||||||
|
|
||||||
void RemoveSpriteStat(int nSprite)
|
void RemoveSpriteStat(int nSprite)
|
||||||
{
|
{
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
int nStat = sprite[nSprite].statnum;
|
int nStat = sprite[nSprite].statnum;
|
||||||
dassert(nStat >= 0 && nStat <= kMaxStatus);
|
assert(nStat >= 0 && nStat <= kMaxStatus);
|
||||||
int nOther = nextspritestat[nSprite];
|
int nOther = nextspritestat[nSprite];
|
||||||
if (nOther < 0)
|
if (nOther < 0)
|
||||||
{
|
{
|
||||||
|
@ -176,7 +176,7 @@ void qinitspritelists(void) // Replace
|
||||||
int InsertSprite(int nSector, int nStat)
|
int InsertSprite(int nSector, int nStat)
|
||||||
{
|
{
|
||||||
int nSprite = headspritestat[kMaxStatus];
|
int nSprite = headspritestat[kMaxStatus];
|
||||||
dassert(nSprite < kMaxSprites);
|
assert(nSprite < kMaxSprites);
|
||||||
if (nSprite < 0)
|
if (nSprite < 0)
|
||||||
{
|
{
|
||||||
return nSprite;
|
return nSprite;
|
||||||
|
@ -210,9 +210,9 @@ int DeleteSprite(int nSprite)
|
||||||
{
|
{
|
||||||
dbDeleteXSprite(sprite[nSprite].extra);
|
dbDeleteXSprite(sprite[nSprite].extra);
|
||||||
}
|
}
|
||||||
dassert(sprite[nSprite].statnum >= 0 && sprite[nSprite].statnum < kMaxStatus);
|
assert(sprite[nSprite].statnum >= 0 && sprite[nSprite].statnum < kMaxStatus);
|
||||||
RemoveSpriteStat(nSprite);
|
RemoveSpriteStat(nSprite);
|
||||||
dassert(sprite[nSprite].sectnum >= 0 && sprite[nSprite].sectnum < kMaxSectors);
|
assert(sprite[nSprite].sectnum >= 0 && sprite[nSprite].sectnum < kMaxSectors);
|
||||||
RemoveSpriteSect(nSprite);
|
RemoveSpriteSect(nSprite);
|
||||||
InsertSpriteStat(nSprite, kMaxStatus);
|
InsertSpriteStat(nSprite, kMaxStatus);
|
||||||
|
|
||||||
|
@ -228,9 +228,9 @@ int qdeletesprite(short nSprite) // Replace
|
||||||
|
|
||||||
int ChangeSpriteSect(int nSprite, int nSector)
|
int ChangeSpriteSect(int nSprite, int nSector)
|
||||||
{
|
{
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
dassert(sprite[nSprite].sectnum >= 0 && sprite[nSprite].sectnum < kMaxSectors);
|
assert(sprite[nSprite].sectnum >= 0 && sprite[nSprite].sectnum < kMaxSectors);
|
||||||
RemoveSpriteSect(nSprite);
|
RemoveSpriteSect(nSprite);
|
||||||
InsertSpriteSect(nSprite, nSector);
|
InsertSpriteSect(nSprite, nSector);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -243,10 +243,10 @@ int qchangespritesect(short nSprite, short nSector)
|
||||||
|
|
||||||
int ChangeSpriteStat(int nSprite, int nStatus)
|
int ChangeSpriteStat(int nSprite, int nStatus)
|
||||||
{
|
{
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
dassert(nStatus >= 0 && nStatus < kMaxStatus);
|
assert(nStatus >= 0 && nStatus < kMaxStatus);
|
||||||
dassert(sprite[nSprite].statnum >= 0 && sprite[nSprite].statnum < kMaxStatus);
|
assert(sprite[nSprite].statnum >= 0 && sprite[nSprite].statnum < kMaxStatus);
|
||||||
dassert(sprite[nSprite].sectnum >= 0 && sprite[nSprite].sectnum < kMaxSectors);
|
assert(sprite[nSprite].sectnum >= 0 && sprite[nSprite].sectnum < kMaxSectors);
|
||||||
RemoveSpriteStat(nSprite);
|
RemoveSpriteStat(nSprite);
|
||||||
InsertSpriteStat(nSprite, nStatus);
|
InsertSpriteStat(nSprite, nStatus);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -293,8 +293,8 @@ unsigned short dbInsertXSprite(int nSprite)
|
||||||
|
|
||||||
void dbDeleteXSprite(int nXSprite)
|
void dbDeleteXSprite(int nXSprite)
|
||||||
{
|
{
|
||||||
dassert(xsprite[nXSprite].reference >= 0);
|
assert(xsprite[nXSprite].reference >= 0);
|
||||||
dassert(sprite[xsprite[nXSprite].reference].extra == nXSprite);
|
assert(sprite[xsprite[nXSprite].reference].extra == nXSprite);
|
||||||
InsertFree(nextXSprite, nXSprite);
|
InsertFree(nextXSprite, nXSprite);
|
||||||
sprite[xsprite[nXSprite].reference].extra = -1;
|
sprite[xsprite[nXSprite].reference].extra = -1;
|
||||||
xsprite[nXSprite].reference = -1;
|
xsprite[nXSprite].reference = -1;
|
||||||
|
@ -316,7 +316,7 @@ unsigned short dbInsertXWall(int nWall)
|
||||||
|
|
||||||
void dbDeleteXWall(int nXWall)
|
void dbDeleteXWall(int nXWall)
|
||||||
{
|
{
|
||||||
dassert(xwall[nXWall].reference >= 0);
|
assert(xwall[nXWall].reference >= 0);
|
||||||
InsertFree(nextXWall, nXWall);
|
InsertFree(nextXWall, nXWall);
|
||||||
wall[xwall[nXWall].reference].extra = -1;
|
wall[xwall[nXWall].reference].extra = -1;
|
||||||
xwall[nXWall].reference = -1;
|
xwall[nXWall].reference = -1;
|
||||||
|
@ -338,7 +338,7 @@ unsigned short dbInsertXSector(int nSector)
|
||||||
|
|
||||||
void dbDeleteXSector(int nXSector)
|
void dbDeleteXSector(int nXSector)
|
||||||
{
|
{
|
||||||
dassert(xsector[nXSector].reference >= 0);
|
assert(xsector[nXSector].reference >= 0);
|
||||||
InsertFree(nextXSector, nXSector);
|
InsertFree(nextXSector, nXSector);
|
||||||
sector[xsector[nXSector].reference].extra = -1;
|
sector[xsector[nXSector].reference].extra = -1;
|
||||||
xsector[nXSector].reference = -1;
|
xsector[nXSector].reference = -1;
|
||||||
|
@ -355,7 +355,7 @@ void dbXSpriteClean(void)
|
||||||
}
|
}
|
||||||
if (sprite[i].statnum < kMaxStatus && nXSprite > 0)
|
if (sprite[i].statnum < kMaxStatus && nXSprite > 0)
|
||||||
{
|
{
|
||||||
dassert(nXSprite < kMaxXSprites);
|
assert(nXSprite < kMaxXSprites);
|
||||||
if (xsprite[nXSprite].reference != i)
|
if (xsprite[nXSprite].reference != i)
|
||||||
{
|
{
|
||||||
int nXSprite2 = dbInsertXSprite(i);
|
int nXSprite2 = dbInsertXSprite(i);
|
||||||
|
@ -369,7 +369,7 @@ void dbXSpriteClean(void)
|
||||||
int nSprite = xsprite[i].reference;
|
int nSprite = xsprite[i].reference;
|
||||||
if (nSprite >= 0)
|
if (nSprite >= 0)
|
||||||
{
|
{
|
||||||
dassert(nSprite < kMaxSprites);
|
assert(nSprite < kMaxSprites);
|
||||||
if (sprite[nSprite].statnum >= kMaxStatus || sprite[nSprite].extra != i)
|
if (sprite[nSprite].statnum >= kMaxStatus || sprite[nSprite].extra != i)
|
||||||
{
|
{
|
||||||
InsertFree(nextXSprite, i);
|
InsertFree(nextXSprite, i);
|
||||||
|
@ -390,7 +390,7 @@ void dbXWallClean(void)
|
||||||
}
|
}
|
||||||
if (nXWall > 0)
|
if (nXWall > 0)
|
||||||
{
|
{
|
||||||
dassert(nXWall < kMaxXWalls);
|
assert(nXWall < kMaxXWalls);
|
||||||
if (xwall[nXWall].reference == -1)
|
if (xwall[nXWall].reference == -1)
|
||||||
{
|
{
|
||||||
wall[i].extra = -1;
|
wall[i].extra = -1;
|
||||||
|
@ -406,7 +406,7 @@ void dbXWallClean(void)
|
||||||
int nXWall = wall[i].extra;
|
int nXWall = wall[i].extra;
|
||||||
if (nXWall > 0)
|
if (nXWall > 0)
|
||||||
{
|
{
|
||||||
dassert(nXWall < kMaxXWalls);
|
assert(nXWall < kMaxXWalls);
|
||||||
if (xwall[nXWall].reference != i)
|
if (xwall[nXWall].reference != i)
|
||||||
{
|
{
|
||||||
int nXWall2 = dbInsertXWall(i);
|
int nXWall2 = dbInsertXWall(i);
|
||||||
|
@ -420,7 +420,7 @@ void dbXWallClean(void)
|
||||||
int nWall = xwall[i].reference;
|
int nWall = xwall[i].reference;
|
||||||
if (nWall >= 0)
|
if (nWall >= 0)
|
||||||
{
|
{
|
||||||
dassert(nWall < kMaxWalls);
|
assert(nWall < kMaxWalls);
|
||||||
if (nWall >= numwalls || wall[nWall].extra != i)
|
if (nWall >= numwalls || wall[nWall].extra != i)
|
||||||
{
|
{
|
||||||
InsertFree(nextXWall, i);
|
InsertFree(nextXWall, i);
|
||||||
|
@ -443,7 +443,7 @@ void dbXSectorClean(void)
|
||||||
}
|
}
|
||||||
if (nXSector > 0)
|
if (nXSector > 0)
|
||||||
{
|
{
|
||||||
dassert(nXSector < kMaxXSectors);
|
assert(nXSector < kMaxXSectors);
|
||||||
if (xsector[nXSector].reference == -1)
|
if (xsector[nXSector].reference == -1)
|
||||||
{
|
{
|
||||||
sector[i].extra = -1;
|
sector[i].extra = -1;
|
||||||
|
@ -459,7 +459,7 @@ void dbXSectorClean(void)
|
||||||
int nXSector = sector[i].extra;
|
int nXSector = sector[i].extra;
|
||||||
if (nXSector > 0)
|
if (nXSector > 0)
|
||||||
{
|
{
|
||||||
dassert(nXSector < kMaxXSectors);
|
assert(nXSector < kMaxXSectors);
|
||||||
if (xsector[nXSector].reference != i)
|
if (xsector[nXSector].reference != i)
|
||||||
{
|
{
|
||||||
int nXSector2 = dbInsertXSector(i);
|
int nXSector2 = dbInsertXSector(i);
|
||||||
|
@ -473,7 +473,7 @@ void dbXSectorClean(void)
|
||||||
int nSector = xsector[i].reference;
|
int nSector = xsector[i].reference;
|
||||||
if (nSector >= 0)
|
if (nSector >= 0)
|
||||||
{
|
{
|
||||||
dassert(nSector < kMaxSectors);
|
assert(nSector < kMaxSectors);
|
||||||
if (nSector >= numsectors || sector[nSector].extra != i)
|
if (nSector >= numsectors || sector[nSector].extra != i)
|
||||||
{
|
{
|
||||||
InsertFree(nextXSector, i);
|
InsertFree(nextXSector, i);
|
||||||
|
@ -778,7 +778,7 @@ int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short
|
||||||
{
|
{
|
||||||
nCount = byte_19AE44.at48;
|
nCount = byte_19AE44.at48;
|
||||||
}
|
}
|
||||||
dassert(nCount <= nXSectorSize);
|
assert(nCount <= nXSectorSize);
|
||||||
fr.Read(pBuffer, nCount);
|
fr.Read(pBuffer, nCount);
|
||||||
BitReader bitReader(pBuffer, nCount);
|
BitReader bitReader(pBuffer, nCount);
|
||||||
pXSector->reference = bitReader.readSigned(14);
|
pXSector->reference = bitReader.readSigned(14);
|
||||||
|
@ -897,7 +897,7 @@ int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short
|
||||||
{
|
{
|
||||||
nCount = byte_19AE44.at44;
|
nCount = byte_19AE44.at44;
|
||||||
}
|
}
|
||||||
dassert(nCount <= nXWallSize);
|
assert(nCount <= nXWallSize);
|
||||||
fr.Read(pBuffer, nCount);
|
fr.Read(pBuffer, nCount);
|
||||||
BitReader bitReader(pBuffer, nCount);
|
BitReader bitReader(pBuffer, nCount);
|
||||||
pXWall->reference = bitReader.readSigned(14);
|
pXWall->reference = bitReader.readSigned(14);
|
||||||
|
@ -991,7 +991,7 @@ int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short
|
||||||
{
|
{
|
||||||
nCount = byte_19AE44.at40;
|
nCount = byte_19AE44.at40;
|
||||||
}
|
}
|
||||||
dassert(nCount <= nXSpriteSize);
|
assert(nCount <= nXSpriteSize);
|
||||||
fr.Read(pBuffer, nCount);
|
fr.Read(pBuffer, nCount);
|
||||||
BitReader bitReader(pBuffer, nCount);
|
BitReader bitReader(pBuffer, nCount);
|
||||||
pXSprite->reference = bitReader.readSigned(14);
|
pXSprite->reference = bitReader.readSigned(14);
|
||||||
|
|
|
@ -86,19 +86,19 @@ int GetBucketChannel(const RXBUCKET *pRX)
|
||||||
case 6: {
|
case 6: {
|
||||||
int nIndex = pRX->index;
|
int nIndex = pRX->index;
|
||||||
int nXIndex = sector[nIndex].extra;
|
int nXIndex = sector[nIndex].extra;
|
||||||
dassert(nXIndex > 0);
|
assert(nXIndex > 0);
|
||||||
return xsector[nXIndex].rxID;
|
return xsector[nXIndex].rxID;
|
||||||
}
|
}
|
||||||
case 0: {
|
case 0: {
|
||||||
int nIndex = pRX->index;
|
int nIndex = pRX->index;
|
||||||
int nXIndex = wall[nIndex].extra;
|
int nXIndex = wall[nIndex].extra;
|
||||||
dassert(nXIndex > 0);
|
assert(nXIndex > 0);
|
||||||
return xwall[nXIndex].rxID;
|
return xwall[nXIndex].rxID;
|
||||||
}
|
}
|
||||||
case 3: {
|
case 3: {
|
||||||
int nIndex = pRX->index;
|
int nIndex = pRX->index;
|
||||||
int nXIndex = sprite[nIndex].extra;
|
int nXIndex = sprite[nIndex].extra;
|
||||||
dassert(nXIndex > 0);
|
assert(nXIndex > 0);
|
||||||
return xsprite[nXIndex].rxID;
|
return xsprite[nXIndex].rxID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -280,7 +280,7 @@ void evInit(void)
|
||||||
I_Error("Invalid xsector reference in sector %d", i);
|
I_Error("Invalid xsector reference in sector %d", i);
|
||||||
if (nXSector > 0 && xsector[nXSector].rxID > 0)
|
if (nXSector > 0 && xsector[nXSector].rxID > 0)
|
||||||
{
|
{
|
||||||
dassert(nCount < kChannelMax);
|
assert(nCount < kChannelMax);
|
||||||
rxBucket[nCount].type = 6;
|
rxBucket[nCount].type = 6;
|
||||||
rxBucket[nCount].index = i;
|
rxBucket[nCount].index = i;
|
||||||
nCount++;
|
nCount++;
|
||||||
|
@ -293,7 +293,7 @@ void evInit(void)
|
||||||
I_Error("Invalid xwall reference in wall %d", i);
|
I_Error("Invalid xwall reference in wall %d", i);
|
||||||
if (nXWall > 0 && xwall[nXWall].rxID > 0)
|
if (nXWall > 0 && xwall[nXWall].rxID > 0)
|
||||||
{
|
{
|
||||||
dassert(nCount < kChannelMax);
|
assert(nCount < kChannelMax);
|
||||||
rxBucket[nCount].type = 0;
|
rxBucket[nCount].type = 0;
|
||||||
rxBucket[nCount].index = i;
|
rxBucket[nCount].index = i;
|
||||||
nCount++;
|
nCount++;
|
||||||
|
@ -308,7 +308,7 @@ void evInit(void)
|
||||||
I_Error("Invalid xsprite reference in sprite %d", i);
|
I_Error("Invalid xsprite reference in sprite %d", i);
|
||||||
if (nXSprite > 0 && xsprite[nXSprite].rxID > 0)
|
if (nXSprite > 0 && xsprite[nXSprite].rxID > 0)
|
||||||
{
|
{
|
||||||
dassert(nCount < kChannelMax);
|
assert(nCount < kChannelMax);
|
||||||
rxBucket[nCount].type = 3;
|
rxBucket[nCount].type = 3;
|
||||||
rxBucket[nCount].index = i;
|
rxBucket[nCount].index = i;
|
||||||
nCount++;
|
nCount++;
|
||||||
|
@ -333,19 +333,19 @@ char evGetSourceState(int nType, int nIndex)
|
||||||
case 6:
|
case 6:
|
||||||
{
|
{
|
||||||
int nXIndex = sector[nIndex].extra;
|
int nXIndex = sector[nIndex].extra;
|
||||||
dassert(nXIndex > 0 && nXIndex < kMaxXSectors);
|
assert(nXIndex > 0 && nXIndex < kMaxXSectors);
|
||||||
return xsector[nXIndex].state;
|
return xsector[nXIndex].state;
|
||||||
}
|
}
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
int nXIndex = wall[nIndex].extra;
|
int nXIndex = wall[nIndex].extra;
|
||||||
dassert(nXIndex > 0 && nXIndex < kMaxXWalls);
|
assert(nXIndex > 0 && nXIndex < kMaxXWalls);
|
||||||
return xwall[nXIndex].state;
|
return xwall[nXIndex].state;
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
int nXIndex = sprite[nIndex].extra;
|
int nXIndex = sprite[nIndex].extra;
|
||||||
dassert(nXIndex > 0 && nXIndex < kMaxXSprites);
|
assert(nXIndex > 0 && nXIndex < kMaxXSprites);
|
||||||
return xsprite[nXIndex].state;
|
return xsprite[nXIndex].state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -486,7 +486,7 @@ void evSend(int nIndex, int nType, int rxId, COMMAND_ID command)
|
||||||
}
|
}
|
||||||
|
|
||||||
void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command) {
|
void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command) {
|
||||||
dassert(command != kCmdCallback);
|
assert(command != kCmdCallback);
|
||||||
if (command == kCmdState) command = evGetSourceState(nType, nIndex) ? kCmdOn : kCmdOff;
|
if (command == kCmdState) command = evGetSourceState(nType, nIndex) ? kCmdOn : kCmdOff;
|
||||||
else if (command == kCmdNotState) command = evGetSourceState(nType, nIndex) ? kCmdOff : kCmdOn;
|
else if (command == kCmdNotState) command = evGetSourceState(nType, nIndex) ? kCmdOff : kCmdOn;
|
||||||
EVENT evn = {};
|
EVENT evn = {};
|
||||||
|
@ -524,8 +524,8 @@ void evProcess(unsigned int nTime)
|
||||||
EVENT event = eventQ.ERemove();
|
EVENT event = eventQ.ERemove();
|
||||||
if (event.cmd == kCmdCallback)
|
if (event.cmd == kCmdCallback)
|
||||||
{
|
{
|
||||||
dassert(event.funcID < kCallbackMax);
|
assert(event.funcID < kCallbackMax);
|
||||||
dassert(gCallback[event.funcID] != NULL);
|
assert(gCallback[event.funcID] != NULL);
|
||||||
gCallback[event.funcID](event.index);
|
gCallback[event.funcID](event.index);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -600,7 +600,7 @@ void EventQLoadSave::Save()
|
||||||
Write(&eventstime[i], sizeof(eventstime[i]));
|
Write(&eventstime[i], sizeof(eventstime[i]));
|
||||||
Write(&events[i], sizeof(events[i]));
|
Write(&events[i], sizeof(events[i]));
|
||||||
}
|
}
|
||||||
dassert(eventQ.PQueue->Size() == 0);
|
assert(eventQ.PQueue->Size() == 0);
|
||||||
for (int i = 0; i < nEvents; i++)
|
for (int i = 0; i < nEvents; i++)
|
||||||
{
|
{
|
||||||
eventQ.PQueue->Insert(eventstime[i], events[i]);
|
eventQ.PQueue->Insert(eventstime[i], events[i]);
|
||||||
|
|
|
@ -209,8 +209,8 @@ void CFX::fxProcess(void)
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
viewBackupSpriteLoc(nSprite, pSprite);
|
viewBackupSpriteLoc(nSprite, pSprite);
|
||||||
short nSector = pSprite->sectnum;
|
short nSector = pSprite->sectnum;
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
dassert(pSprite->type < kFXMax);
|
assert(pSprite->type < kFXMax);
|
||||||
FXDATA *pFXData = &gFXData[pSprite->type];
|
FXDATA *pFXData = &gFXData[pSprite->type];
|
||||||
actAirDrag(pSprite, pFXData->ata);
|
actAirDrag(pSprite, pFXData->ata);
|
||||||
if (xvel[nSprite])
|
if (xvel[nSprite])
|
||||||
|
@ -235,13 +235,13 @@ void CFX::fxProcess(void)
|
||||||
sub_73FFC(nSprite);
|
sub_73FFC(nSprite);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
dassert(gCallback[pFXData->funcID] != NULL);
|
assert(gCallback[pFXData->funcID] != NULL);
|
||||||
gCallback[pFXData->funcID](nSprite);
|
gCallback[pFXData->funcID](nSprite);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (nSector != pSprite->sectnum)
|
if (nSector != pSprite->sectnum)
|
||||||
{
|
{
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
ChangeSpriteSect(nSprite, nSector);
|
ChangeSpriteSect(nSprite, nSector);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ void CFX::fxProcess(void)
|
||||||
sub_73FFC(nSprite);
|
sub_73FFC(nSprite);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
dassert(gCallback[pFXData->funcID] != NULL);
|
assert(gCallback[pFXData->funcID] != NULL);
|
||||||
gCallback[pFXData->funcID](nSprite);
|
gCallback[pFXData->funcID](nSprite);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,8 +49,8 @@ HITINFO gHitInfo;
|
||||||
|
|
||||||
bool AreSectorsNeighbors(int sect1, int sect2)
|
bool AreSectorsNeighbors(int sect1, int sect2)
|
||||||
{
|
{
|
||||||
dassert(sect1 >= 0 && sect1 < kMaxSectors);
|
assert(sect1 >= 0 && sect1 < kMaxSectors);
|
||||||
dassert(sect2 >= 0 && sect2 < kMaxSectors);
|
assert(sect2 >= 0 && sect2 < kMaxSectors);
|
||||||
if (sector[sect1].wallnum < sector[sect2].wallnum)
|
if (sector[sect1].wallnum < sector[sect2].wallnum)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < sector[sect1].wallnum; i++)
|
for (int i = 0; i < sector[sect1].wallnum; i++)
|
||||||
|
@ -77,7 +77,7 @@ bool AreSectorsNeighbors(int sect1, int sect2)
|
||||||
bool FindSector(int nX, int nY, int nZ, int *nSector)
|
bool FindSector(int nX, int nY, int nZ, int *nSector)
|
||||||
{
|
{
|
||||||
int32_t nZFloor, nZCeil;
|
int32_t nZFloor, nZCeil;
|
||||||
dassert(*nSector >= 0 && *nSector < kMaxSectors);
|
assert(*nSector >= 0 && *nSector < kMaxSectors);
|
||||||
if (inside(nX, nY, *nSector))
|
if (inside(nX, nY, *nSector))
|
||||||
{
|
{
|
||||||
getzsofslope(*nSector, nX, nY, &nZCeil, &nZFloor);
|
getzsofslope(*nSector, nX, nY, &nZCeil, &nZFloor);
|
||||||
|
@ -117,7 +117,7 @@ bool FindSector(int nX, int nY, int nZ, int *nSector)
|
||||||
|
|
||||||
bool FindSector(int nX, int nY, int *nSector)
|
bool FindSector(int nX, int nY, int *nSector)
|
||||||
{
|
{
|
||||||
dassert(*nSector >= 0 && *nSector < kMaxSectors);
|
assert(*nSector >= 0 && *nSector < kMaxSectors);
|
||||||
if (inside(nX, nY, *nSector))
|
if (inside(nX, nY, *nSector))
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -145,7 +145,7 @@ bool FindSector(int nX, int nY, int *nSector)
|
||||||
|
|
||||||
bool CheckProximity(spritetype *pSprite, int nX, int nY, int nZ, int nSector, int nDist)
|
bool CheckProximity(spritetype *pSprite, int nX, int nY, int nZ, int nSector, int nDist)
|
||||||
{
|
{
|
||||||
dassert(pSprite != NULL);
|
assert(pSprite != NULL);
|
||||||
int oX = klabs(nX-pSprite->x)>>4;
|
int oX = klabs(nX-pSprite->x)>>4;
|
||||||
if (oX >= nDist) return 0;
|
if (oX >= nDist) return 0;
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ int GetWallAngle(int nWall)
|
||||||
|
|
||||||
void GetWallNormal(int nWall, int *pX, int *pY)
|
void GetWallNormal(int nWall, int *pX, int *pY)
|
||||||
{
|
{
|
||||||
dassert(nWall >= 0 && nWall < kMaxWalls);
|
assert(nWall >= 0 && nWall < kMaxWalls);
|
||||||
int nWall2 = wall[nWall].point2;
|
int nWall2 = wall[nWall].point2;
|
||||||
int dX = -(wall[nWall2].y - wall[nWall].y);
|
int dX = -(wall[nWall2].y - wall[nWall].y);
|
||||||
dX >>= 4;
|
dX >>= 4;
|
||||||
|
@ -375,8 +375,8 @@ bool IntersectRay(int wx, int wy, int wdx, int wdy, int x1, int y1, int z1, int
|
||||||
|
|
||||||
int HitScan(spritetype *pSprite, int z, int dx, int dy, int dz, unsigned int nMask, int nRange)
|
int HitScan(spritetype *pSprite, int z, int dx, int dy, int dz, unsigned int nMask, int nRange)
|
||||||
{
|
{
|
||||||
dassert(pSprite != NULL);
|
assert(pSprite != NULL);
|
||||||
dassert(dx != 0 || dy != 0);
|
assert(dx != 0 || dy != 0);
|
||||||
gHitInfo.hitsect = -1;
|
gHitInfo.hitsect = -1;
|
||||||
gHitInfo.hitwall = -1;
|
gHitInfo.hitwall = -1;
|
||||||
gHitInfo.hitsprite = -1;
|
gHitInfo.hitsprite = -1;
|
||||||
|
@ -428,7 +428,7 @@ int HitScan(spritetype *pSprite, int z, int dx, int dy, int dz, unsigned int nMa
|
||||||
int VectorScan(spritetype *pSprite, int nOffset, int nZOffset, int dx, int dy, int dz, int nRange, int ac)
|
int VectorScan(spritetype *pSprite, int nOffset, int nZOffset, int dx, int dy, int dz, int nRange, int ac)
|
||||||
{
|
{
|
||||||
int nNum = 256;
|
int nNum = 256;
|
||||||
dassert(pSprite != NULL);
|
assert(pSprite != NULL);
|
||||||
gHitInfo.hitsect = -1;
|
gHitInfo.hitsect = -1;
|
||||||
gHitInfo.hitwall = -1;
|
gHitInfo.hitwall = -1;
|
||||||
gHitInfo.hitsprite = -1;
|
gHitInfo.hitsprite = -1;
|
||||||
|
@ -482,7 +482,7 @@ int VectorScan(spritetype *pSprite, int nOffset, int nZOffset, int dx, int dy, i
|
||||||
int nOffset = tileTopOffset(nPicnum);
|
int nOffset = tileTopOffset(nPicnum);
|
||||||
if (nOffset)
|
if (nOffset)
|
||||||
otherZ -= (nOffset*pOther->yrepeat)<<2;
|
otherZ -= (nOffset*pOther->yrepeat)<<2;
|
||||||
dassert(height > 0);
|
assert(height > 0);
|
||||||
int height2 = scale(otherZ-gHitInfo.hitz, tileHeight(nPicnum), height);
|
int height2 = scale(otherZ-gHitInfo.hitz, tileHeight(nPicnum), height);
|
||||||
if (!(pOther->cstat & 8))
|
if (!(pOther->cstat & 8))
|
||||||
height2 = tileHeight(nPicnum)-height2;
|
height2 = tileHeight(nPicnum)-height2;
|
||||||
|
@ -491,7 +491,7 @@ int VectorScan(spritetype *pSprite, int nOffset, int nZOffset, int dx, int dy, i
|
||||||
int width = (tileWidth(nPicnum)*pOther->xrepeat)>>2;
|
int width = (tileWidth(nPicnum)*pOther->xrepeat)>>2;
|
||||||
width = (width*3)/4;
|
width = (width*3)/4;
|
||||||
int check1 = ((y1 - pOther->y)*dx - (x1 - pOther->x)*dy) / ksqrt(dx*dx+dy*dy);
|
int check1 = ((y1 - pOther->y)*dx - (x1 - pOther->x)*dy) / ksqrt(dx*dx+dy*dy);
|
||||||
dassert(width > 0);
|
assert(width > 0);
|
||||||
int width2 = scale(check1, tileWidth(nPicnum), width);
|
int width2 = scale(check1, tileWidth(nPicnum), width);
|
||||||
int nOffset = tileLeftOffset(nPicnum);
|
int nOffset = tileLeftOffset(nPicnum);
|
||||||
width2 += nOffset + tileWidth(nPicnum) / 2;
|
width2 += nOffset + tileWidth(nPicnum) / 2;
|
||||||
|
@ -657,7 +657,7 @@ int VectorScan(spritetype *pSprite, int nOffset, int nZOffset, int dx, int dy, i
|
||||||
|
|
||||||
void GetZRange(spritetype *pSprite, int *ceilZ, int *ceilHit, int *floorZ, int *floorHit, int nDist, unsigned int nMask, unsigned int nClipParallax)
|
void GetZRange(spritetype *pSprite, int *ceilZ, int *ceilHit, int *floorZ, int *floorHit, int nDist, unsigned int nMask, unsigned int nClipParallax)
|
||||||
{
|
{
|
||||||
dassert(pSprite != NULL);
|
assert(pSprite != NULL);
|
||||||
int bakCstat = pSprite->cstat;
|
int bakCstat = pSprite->cstat;
|
||||||
int32_t nTemp1, nTemp2;
|
int32_t nTemp1, nTemp2;
|
||||||
pSprite->cstat &= ~257;
|
pSprite->cstat &= ~257;
|
||||||
|
@ -789,7 +789,7 @@ unsigned int ClipMove(int *x, int *y, int *z, int *nSector, int xv, int yv, int
|
||||||
int GetClosestSectors(int nSector, int x, int y, int nDist, short *pSectors, char *pSectBit)
|
int GetClosestSectors(int nSector, int x, int y, int nDist, short *pSectors, char *pSectBit)
|
||||||
{
|
{
|
||||||
char sectbits[(kMaxSectors+7)>>3];
|
char sectbits[(kMaxSectors+7)>>3];
|
||||||
dassert(pSectors != NULL);
|
assert(pSectors != NULL);
|
||||||
memset(sectbits, 0, sizeof(sectbits));
|
memset(sectbits, 0, sizeof(sectbits));
|
||||||
pSectors[0] = nSector;
|
pSectors[0] = nSector;
|
||||||
SetBitString(sectbits, nSector);
|
SetBitString(sectbits, nSector);
|
||||||
|
@ -835,7 +835,7 @@ int GetClosestSectors(int nSector, int x, int y, int nDist, short *pSectors, cha
|
||||||
int GetClosestSpriteSectors(int nSector, int x, int y, int nDist, short *pSectors, char *pSectBit, short *a8)
|
int GetClosestSpriteSectors(int nSector, int x, int y, int nDist, short *pSectors, char *pSectBit, short *a8)
|
||||||
{
|
{
|
||||||
char sectbits[(kMaxSectors+7)>>3];
|
char sectbits[(kMaxSectors+7)>>3];
|
||||||
dassert(pSectors != NULL);
|
assert(pSectors != NULL);
|
||||||
memset(sectbits, 0, sizeof(sectbits));
|
memset(sectbits, 0, sizeof(sectbits));
|
||||||
pSectors[0] = nSector;
|
pSectors[0] = nSector;
|
||||||
SetBitString(sectbits, nSector);
|
SetBitString(sectbits, nSector);
|
||||||
|
|
|
@ -392,7 +392,7 @@ void GibThing(spritetype *pSprite, GIBTHING *pGThing, CGibPosition *pPos, CGibVe
|
||||||
int dz1 = floorZ-z;
|
int dz1 = floorZ-z;
|
||||||
int dz2 = z-ceilZ;
|
int dz2 = z-ceilZ;
|
||||||
spritetype *pGib = actSpawnThing(nSector, x, y, z, pGThing->TotalKills);
|
spritetype *pGib = actSpawnThing(nSector, x, y, z, pGThing->TotalKills);
|
||||||
dassert(pGib != NULL);
|
assert(pGib != NULL);
|
||||||
if (pGThing->Kills > -1)
|
if (pGThing->Kills > -1)
|
||||||
pGib->picnum = pGThing->Kills;
|
pGib->picnum = pGThing->Kills;
|
||||||
if (pVel)
|
if (pVel)
|
||||||
|
@ -431,28 +431,28 @@ void GibThing(spritetype *pSprite, GIBTHING *pGThing, CGibPosition *pPos, CGibVe
|
||||||
|
|
||||||
void GibSprite(spritetype *pSprite, GIBTYPE nGibType, CGibPosition *pPos, CGibVelocity *pVel)
|
void GibSprite(spritetype *pSprite, GIBTYPE nGibType, CGibPosition *pPos, CGibVelocity *pVel)
|
||||||
{
|
{
|
||||||
dassert(pSprite != NULL);
|
assert(pSprite != NULL);
|
||||||
dassert(nGibType >= 0 && nGibType < kGibMax);
|
assert(nGibType >= 0 && nGibType < kGibMax);
|
||||||
if (pSprite->sectnum < 0 || pSprite->sectnum >= numsectors)
|
if (pSprite->sectnum < 0 || pSprite->sectnum >= numsectors)
|
||||||
return;
|
return;
|
||||||
GIBLIST *pGib = &gibList[nGibType];
|
GIBLIST *pGib = &gibList[nGibType];
|
||||||
for (int i = 0; i < pGib->Kills; i++)
|
for (int i = 0; i < pGib->Kills; i++)
|
||||||
{
|
{
|
||||||
GIBFX *pGibFX = &pGib->TotalKills[i];
|
GIBFX *pGibFX = &pGib->TotalKills[i];
|
||||||
dassert(pGibFX->chance > 0);
|
assert(pGibFX->chance > 0);
|
||||||
GibFX(pSprite, pGibFX, pPos, pVel);
|
GibFX(pSprite, pGibFX, pPos, pVel);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < pGib->atc; i++)
|
for (int i = 0; i < pGib->atc; i++)
|
||||||
{
|
{
|
||||||
GIBTHING *pGibThing = &pGib->at8[i];
|
GIBTHING *pGibThing = &pGib->at8[i];
|
||||||
dassert(pGibThing->chance > 0);
|
assert(pGibThing->chance > 0);
|
||||||
GibThing(pSprite, pGibThing, pPos, pVel);
|
GibThing(pSprite, pGibThing, pPos, pVel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GibFX(int nWall, GIBFX * pGFX, int a3, int a4, int a5, int a6, CGibVelocity * pVel)
|
void GibFX(int nWall, GIBFX * pGFX, int a3, int a4, int a5, int a6, CGibVelocity * pVel)
|
||||||
{
|
{
|
||||||
dassert(nWall >= 0 && nWall < numwalls);
|
assert(nWall >= 0 && nWall < numwalls);
|
||||||
walltype *pWall = &wall[nWall];
|
walltype *pWall = &wall[nWall];
|
||||||
int nCount = ChanceToCount(pGFX->chance, pGFX->at9);
|
int nCount = ChanceToCount(pGFX->chance, pGFX->at9);
|
||||||
int nSector = sectorofwall(nWall);
|
int nSector = sectorofwall(nWall);
|
||||||
|
@ -484,8 +484,8 @@ void GibFX(int nWall, GIBFX * pGFX, int a3, int a4, int a5, int a6, CGibVelocity
|
||||||
|
|
||||||
void GibWall(int nWall, GIBTYPE nGibType, CGibVelocity *pVel)
|
void GibWall(int nWall, GIBTYPE nGibType, CGibVelocity *pVel)
|
||||||
{
|
{
|
||||||
dassert(nWall >= 0 && nWall < numwalls);
|
assert(nWall >= 0 && nWall < numwalls);
|
||||||
dassert(nGibType >= 0 && nGibType < kGibMax);
|
assert(nGibType >= 0 && nGibType < kGibMax);
|
||||||
int cx, cy, cz, wx, wy, wz;
|
int cx, cy, cz, wx, wy, wz;
|
||||||
walltype *pWall = &wall[nWall];
|
walltype *pWall = &wall[nWall];
|
||||||
cx = (pWall->x+wall[pWall->point2].x)>>1;
|
cx = (pWall->x+wall[pWall->point2].x)>>1;
|
||||||
|
@ -506,7 +506,7 @@ void GibWall(int nWall, GIBTYPE nGibType, CGibVelocity *pVel)
|
||||||
for (int i = 0; i < pGib->Kills; i++)
|
for (int i = 0; i < pGib->Kills; i++)
|
||||||
{
|
{
|
||||||
GIBFX *pGibFX = &pGib->TotalKills[i];
|
GIBFX *pGibFX = &pGib->TotalKills[i];
|
||||||
dassert(pGibFX->chance > 0);
|
assert(pGibFX->chance > 0);
|
||||||
GibFX(nWall, pGibFX, ceilZ, wx, wy, wz, pVel);
|
GibFX(nWall, pGibFX, ceilZ, wx, wy, wz, pVel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,9 +35,6 @@ BEGIN_BLD_NS
|
||||||
int gFrameClock;
|
int gFrameClock;
|
||||||
int gFrameCount;
|
int gFrameCount;
|
||||||
|
|
||||||
static const char *_module;
|
|
||||||
static int _line;
|
|
||||||
|
|
||||||
int32_t gDetail = 4;
|
int32_t gDetail = 4;
|
||||||
bool gNoClip;
|
bool gNoClip;
|
||||||
bool gInfiniteAmmo;
|
bool gInfiniteAmmo;
|
||||||
|
@ -48,19 +45,4 @@ bool gFogMode = false;
|
||||||
int gWeaponsV10x;
|
int gWeaponsV10x;
|
||||||
/////////
|
/////////
|
||||||
|
|
||||||
|
|
||||||
void _SetErrorLoc(const char *pzFile, int nLine)
|
|
||||||
{
|
|
||||||
_module = pzFile;
|
|
||||||
_line = nLine;
|
|
||||||
}
|
|
||||||
|
|
||||||
// by NoOne: show warning msgs in game instead of throwing errors (in some cases)
|
|
||||||
void consoleSysMsg(const char* pzFormat, ...) {
|
|
||||||
|
|
||||||
va_list args;
|
|
||||||
va_start(args, pzFormat);
|
|
||||||
VPrintf(PRINT_LOW, TEXTCOLOR_RED "%s\n", args);
|
|
||||||
}
|
|
||||||
|
|
||||||
END_BLD_NS
|
END_BLD_NS
|
||||||
|
|
|
@ -122,7 +122,7 @@ void IniFile::LoadRes(void *res)
|
||||||
}
|
}
|
||||||
|
|
||||||
curNode->next = (FNODE*)malloc(strlen(pBuffer) + sizeof(FNODE));
|
curNode->next = (FNODE*)malloc(strlen(pBuffer) + sizeof(FNODE));
|
||||||
dassert(curNode->next != NULL);
|
assert(curNode->next != NULL);
|
||||||
|
|
||||||
anotherNode = curNode;
|
anotherNode = curNode;
|
||||||
curNode = curNode->next;
|
curNode = curNode->next;
|
||||||
|
@ -184,7 +184,7 @@ void IniFile::Save(void)
|
||||||
{
|
{
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
FILE *hFile = fopen(fileName, "w");
|
FILE *hFile = fopen(fileName, "w");
|
||||||
dassert(hFile != NULL);
|
assert(hFile != NULL);
|
||||||
curNode = head.next;
|
curNode = head.next;
|
||||||
while (curNode != &head)
|
while (curNode != &head)
|
||||||
{
|
{
|
||||||
|
@ -238,7 +238,7 @@ bool IniFile::FindKey(const char *key)
|
||||||
|
|
||||||
char *pEqual = strchr(curNode->name, '=');
|
char *pEqual = strchr(curNode->name, '=');
|
||||||
char *pEqualStart = pEqual;
|
char *pEqualStart = pEqual;
|
||||||
dassert(pEqual != NULL);
|
assert(pEqual != NULL);
|
||||||
|
|
||||||
// remove whitespace
|
// remove whitespace
|
||||||
while (isspace(*(pEqual - 1))) {
|
while (isspace(*(pEqual - 1))) {
|
||||||
|
@ -274,7 +274,7 @@ void IniFile::AddSection(const char *section)
|
||||||
if (anotherNode != &head)
|
if (anotherNode != &head)
|
||||||
{
|
{
|
||||||
FNODE *newNode = (FNODE*)malloc(sizeof(FNODE));
|
FNODE *newNode = (FNODE*)malloc(sizeof(FNODE));
|
||||||
dassert(newNode != NULL);
|
assert(newNode != NULL);
|
||||||
|
|
||||||
newNode->name[0] = 0;
|
newNode->name[0] = 0;
|
||||||
newNode->next = anotherNode->next;
|
newNode->next = anotherNode->next;
|
||||||
|
@ -284,7 +284,7 @@ void IniFile::AddSection(const char *section)
|
||||||
|
|
||||||
sprintf(buffer, "[%s]", section);
|
sprintf(buffer, "[%s]", section);
|
||||||
FNODE *newNode = (FNODE*)malloc(strlen(buffer) + sizeof(FNODE));
|
FNODE *newNode = (FNODE*)malloc(strlen(buffer) + sizeof(FNODE));
|
||||||
dassert(newNode != NULL);
|
assert(newNode != NULL);
|
||||||
|
|
||||||
strcpy(newNode->name, buffer);
|
strcpy(newNode->name, buffer);
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ void IniFile::AddKeyString(const char *key, const char *value)
|
||||||
sprintf(buffer, "%s=%s", key, value);
|
sprintf(buffer, "%s=%s", key, value);
|
||||||
|
|
||||||
FNODE *newNode = (FNODE*)malloc(strlen(buffer) + sizeof(FNODE));
|
FNODE *newNode = (FNODE*)malloc(strlen(buffer) + sizeof(FNODE));
|
||||||
dassert(newNode != NULL);
|
assert(newNode != NULL);
|
||||||
|
|
||||||
strcpy(newNode->name, buffer);
|
strcpy(newNode->name, buffer);
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ void IniFile::ChangeKeyString(const char *key, const char *value)
|
||||||
sprintf(buffer, "%s=%s", key, value);
|
sprintf(buffer, "%s=%s", key, value);
|
||||||
|
|
||||||
FNODE *newNode = (FNODE*)realloc(curNode, strlen(buffer) + sizeof(FNODE));
|
FNODE *newNode = (FNODE*)realloc(curNode, strlen(buffer) + sizeof(FNODE));
|
||||||
dassert(newNode != NULL);
|
assert(newNode != NULL);
|
||||||
|
|
||||||
strcpy(newNode->name, buffer);
|
strcpy(newNode->name, buffer);
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ void CheckSectionAbend(const char *pzSection)
|
||||||
|
|
||||||
void CheckKeyAbend(const char *pzSection, const char *pzKey)
|
void CheckKeyAbend(const char *pzSection, const char *pzKey)
|
||||||
{
|
{
|
||||||
dassert(pzSection != NULL);
|
assert(pzSection != NULL);
|
||||||
|
|
||||||
if (!pzKey || !BloodINI->KeyExists(pzSection, pzKey))
|
if (!pzKey || !BloodINI->KeyExists(pzSection, pzKey))
|
||||||
I_Error("Key %s expected in section [%s] of BLOOD.INI", pzKey, pzSection);
|
I_Error("Key %s expected in section [%s] of BLOOD.INI", pzKey, pzSection);
|
||||||
|
@ -183,7 +183,7 @@ void levelLoadDefaults(void)
|
||||||
|
|
||||||
void levelGetNextLevels(int *pnEndingA, int *pnEndingB)
|
void levelGetNextLevels(int *pnEndingA, int *pnEndingB)
|
||||||
{
|
{
|
||||||
dassert(pnEndingA != NULL && pnEndingB != NULL);
|
assert(pnEndingA != NULL && pnEndingB != NULL);
|
||||||
int nEndingA = currentLevel->nextLevel;
|
int nEndingA = currentLevel->nextLevel;
|
||||||
if (nEndingA >= 0)
|
if (nEndingA >= 0)
|
||||||
nEndingA--;
|
nEndingA--;
|
||||||
|
|
|
@ -460,7 +460,7 @@ void LoadSave::Load(void)
|
||||||
void LoadSave::Read(void *pData, int nSize)
|
void LoadSave::Read(void *pData, int nSize)
|
||||||
{
|
{
|
||||||
dword_27AA38 += nSize;
|
dword_27AA38 += nSize;
|
||||||
dassert(hLFile.isOpen());
|
assert(hLFile.isOpen());
|
||||||
if (hLFile.Read(pData, nSize) != nSize)
|
if (hLFile.Read(pData, nSize) != nSize)
|
||||||
I_Error("Error reading save file.");
|
I_Error("Error reading save file.");
|
||||||
}
|
}
|
||||||
|
@ -469,7 +469,7 @@ void LoadSave::Write(void *pData, int nSize)
|
||||||
{
|
{
|
||||||
dword_27AA38 += nSize;
|
dword_27AA38 += nSize;
|
||||||
dword_27AA3C += nSize;
|
dword_27AA3C += nSize;
|
||||||
dassert(hSFile != NULL);
|
assert(hSFile != NULL);
|
||||||
if (hSFile->Write(pData, nSize) != (size_t)nSize)
|
if (hSFile->Write(pData, nSize) != (size_t)nSize)
|
||||||
I_Error("File error #%d writing save file.", errno);
|
I_Error("File error #%d writing save file.", errno);
|
||||||
}
|
}
|
||||||
|
@ -573,12 +573,6 @@ void MyLoadSave::Load(void)
|
||||||
psky_t *pSky = tileSetupSky(DEFAULTPSKY);
|
psky_t *pSky = tileSetupSky(DEFAULTPSKY);
|
||||||
int id;
|
int id;
|
||||||
Read(&id, sizeof(id));
|
Read(&id, sizeof(id));
|
||||||
if (id != 0x5653424e/*'VSBN'*/)
|
|
||||||
I_Error("Old saved game found");
|
|
||||||
short version;
|
|
||||||
Read(&version, sizeof(version));
|
|
||||||
if (version != BYTEVERSION)
|
|
||||||
I_Error("Incompatible version of saved game found!");
|
|
||||||
Read(&gGameOptions, sizeof(gGameOptions));
|
Read(&gGameOptions, sizeof(gGameOptions));
|
||||||
|
|
||||||
int nNumSprites;
|
int nNumSprites;
|
||||||
|
@ -659,8 +653,6 @@ void MyLoadSave::Save(void)
|
||||||
int nNumSprites = 0;
|
int nNumSprites = 0;
|
||||||
int id = 0x5653424e/*'VSBN'*/;
|
int id = 0x5653424e/*'VSBN'*/;
|
||||||
Write(&id, sizeof(id));
|
Write(&id, sizeof(id));
|
||||||
short version = BYTEVERSION;
|
|
||||||
Write(&version, sizeof(version));
|
|
||||||
for (int nSprite = 0; nSprite < kMaxSprites; nSprite++)
|
for (int nSprite = 0; nSprite < kMaxSprites; nSprite++)
|
||||||
{
|
{
|
||||||
if (sprite[nSprite].statnum < kMaxStatus && nSprite > nNumSprites)
|
if (sprite[nSprite].statnum < kMaxStatus && nSprite > nNumSprites)
|
||||||
|
|
|
@ -293,7 +293,7 @@ void nnExtInitModernStuff(bool bSaveLoad) {
|
||||||
if (bSaveLoad) break;
|
if (bSaveLoad) break;
|
||||||
else if (!pXSprite->rxID) condError(pXSprite,"\nThe condition must have RX ID!\nSPRITE #%d", pSprite->index);
|
else if (!pXSprite->rxID) condError(pXSprite,"\nThe condition must have RX ID!\nSPRITE #%d", pSprite->index);
|
||||||
else if (!pXSprite->txID && !pSprite->hitag) {
|
else if (!pXSprite->txID && !pSprite->hitag) {
|
||||||
consoleSysMsg("The condition must have TX ID or hitag to be set: RX ID %d, SPRITE #%d", pXSprite->rxID, pSprite->index);
|
Printf(PRINT_HIGH, "The condition must have TX ID or hitag to be set: RX ID %d, SPRITE #%d", pXSprite->rxID, pSprite->index);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -440,7 +440,7 @@ void nnExtInitModernStuff(bool bSaveLoad) {
|
||||||
|
|
||||||
if (pXSprite->waitTime > 0) {
|
if (pXSprite->waitTime > 0) {
|
||||||
pXSprite->busyTime += ClipHigh(((pXSprite->waitTime * 120) / 10), 4095); pXSprite->waitTime = 0;
|
pXSprite->busyTime += ClipHigh(((pXSprite->waitTime * 120) / 10), 4095); pXSprite->waitTime = 0;
|
||||||
consoleSysMsg("Summing busyTime and waitTime for tracking condition #%d, RX ID %d. Result = %d ticks", pSprite->index, pXSprite->rxID, pXSprite->busyTime);
|
Printf(PRINT_HIGH, "Summing busyTime and waitTime for tracking condition #%d, RX ID %d. Result = %d ticks", pSprite->index, pXSprite->rxID, pXSprite->busyTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
pXSprite->busy = pXSprite->busyTime;
|
pXSprite->busy = pXSprite->busyTime;
|
||||||
|
@ -633,7 +633,7 @@ void nnExtInitModernStuff(bool bSaveLoad) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
consoleSysMsg("No objects to track found for condition #%d, rx id: %d!", pSprite->index, pXSprite->rxID);
|
Printf(PRINT_HIGH, "No objects to track found for condition #%d, rx id: %d!", pSprite->index, pXSprite->rxID);
|
||||||
|
|
||||||
pCond->length = count;
|
pCond->length = count;
|
||||||
pCond->xindex = pSprite->extra;
|
pCond->xindex = pSprite->extra;
|
||||||
|
@ -653,7 +653,7 @@ int nnExtRandom(int a, int b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetDataVal(spritetype* pSprite, int data) {
|
int GetDataVal(spritetype* pSprite, int data) {
|
||||||
dassert(xspriRangeIsFine(pSprite->extra));
|
assert(xspriRangeIsFine(pSprite->extra));
|
||||||
|
|
||||||
switch (data) {
|
switch (data) {
|
||||||
case 0: return xsprite[pSprite->extra].data1;
|
case 0: return xsprite[pSprite->extra].data1;
|
||||||
|
@ -1095,10 +1095,10 @@ void debrisMove(int listIndex) {
|
||||||
|
|
||||||
pSprite->cstat = oldcstat;
|
pSprite->cstat = oldcstat;
|
||||||
|
|
||||||
dassert(nSector >= 0);
|
assert(nSector >= 0);
|
||||||
|
|
||||||
if (pSprite->sectnum != nSector) {
|
if (pSprite->sectnum != nSector) {
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
ChangeSpriteSect(nSprite, nSector);
|
ChangeSpriteSect(nSprite, nSector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1108,7 +1108,7 @@ void debrisMove(int listIndex) {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
FindSector(pSprite->x, pSprite->y, pSprite->z, &nSector);
|
FindSector(pSprite->x, pSprite->y, pSprite->z, &nSector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1553,10 +1553,10 @@ void trPlayerCtrlGiveStuff(XSPRITE* pXSource, PLAYER* pPlayer, TRPLAYERCTRL* pCt
|
||||||
case 1: // give N weapon and default ammo for it
|
case 1: // give N weapon and default ammo for it
|
||||||
case 2: // give just N ammo for selected weapon
|
case 2: // give just N ammo for selected weapon
|
||||||
if (weapon <= 0 || weapon > 13) {
|
if (weapon <= 0 || weapon > 13) {
|
||||||
consoleSysMsg("Weapon #%d is out of a weapons range!");
|
Printf(PRINT_HIGH, "Weapon #%d is out of a weapons range!");
|
||||||
break;
|
break;
|
||||||
} else if (pXSource->data2 == 2 && pXSource->data4 == 0) {
|
} else if (pXSource->data2 == 2 && pXSource->data4 == 0) {
|
||||||
consoleSysMsg("Zero ammo for weapon #%d is specified!");
|
Printf(PRINT_HIGH, "Zero ammo for weapon #%d is specified!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (weapon) {
|
switch (weapon) {
|
||||||
|
@ -2299,7 +2299,7 @@ void useSpriteDamager(XSPRITE* pXSource, spritetype* pSprite) {
|
||||||
if (dmgType >= kDmgFall) {
|
if (dmgType >= kDmgFall) {
|
||||||
if (dmg < pXSprite->health << 4) {
|
if (dmg < pXSprite->health << 4) {
|
||||||
if (nnExtIsImmune(pSprite, dmgType, 0)) {
|
if (nnExtIsImmune(pSprite, dmgType, 0)) {
|
||||||
consoleSysMsg("Dude type %d is immune to damage type %d!", pSprite->type, dmgType);
|
Printf(PRINT_HIGH, "Dude type %d is immune to damage type %d!", pSprite->type, dmgType);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2329,7 +2329,7 @@ void useSpriteDamager(XSPRITE* pXSource, spritetype* pSprite) {
|
||||||
void useSeqSpawnerGen(XSPRITE* pXSource, int objType, int index) {
|
void useSeqSpawnerGen(XSPRITE* pXSource, int objType, int index) {
|
||||||
|
|
||||||
if (pXSource->data2 > 0 && !getSequence(pXSource->data2)) {
|
if (pXSource->data2 > 0 && !getSequence(pXSource->data2)) {
|
||||||
consoleSysMsg("Missing sequence #%d", pXSource->data2);
|
Printf(PRINT_HIGH, "Missing sequence #%d", pXSource->data2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4330,7 +4330,7 @@ void useIncDecGen(XSPRITE* pXSource, short objType, int objIndex) {
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
dataIndex = (buffer[i] - 52) + 4;
|
dataIndex = (buffer[i] - 52) + 4;
|
||||||
if ((data = getDataFieldOfObject(objType, objIndex, dataIndex)) == -65535) {
|
if ((data = getDataFieldOfObject(objType, objIndex, dataIndex)) == -65535) {
|
||||||
consoleSysMsg("\nWrong index of data (%c) for IncDec Gen #%d! Only 1, 2, 3 and 4 indexes allowed!\n", buffer[i], objIndex);
|
Printf(PRINT_HIGH, "\nWrong index of data (%c) for IncDec Gen #%d! Only 1, 2, 3 and 4 indexes allowed!\n", buffer[i], objIndex);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
spritetype* pSource = &sprite[pXSource->reference];
|
spritetype* pSource = &sprite[pXSource->reference];
|
||||||
|
@ -5187,7 +5187,7 @@ void levelEndLevelCustom(int nLevel) {
|
||||||
|
|
||||||
void callbackUniMissileBurst(int nSprite) // 22
|
void callbackUniMissileBurst(int nSprite) // 22
|
||||||
{
|
{
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
if (sprite[nSprite].statnum != kStatProjectile) return;
|
if (sprite[nSprite].statnum != kStatProjectile) return;
|
||||||
spritetype* pSprite = &sprite[nSprite];
|
spritetype* pSprite = &sprite[nSprite];
|
||||||
int nAngle = getangle(xvel[nSprite], yvel[nSprite]);
|
int nAngle = getangle(xvel[nSprite], yvel[nSprite]);
|
||||||
|
@ -5238,7 +5238,7 @@ void callbackUniMissileBurst(int nSprite) // 22
|
||||||
|
|
||||||
void callbackMakeMissileBlocking(int nSprite) // 23
|
void callbackMakeMissileBlocking(int nSprite) // 23
|
||||||
{
|
{
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
if (sprite[nSprite].statnum != kStatProjectile) return;
|
if (sprite[nSprite].statnum != kStatProjectile) return;
|
||||||
sprite[nSprite].cstat |= CSTAT_SPRITE_BLOCK;
|
sprite[nSprite].cstat |= CSTAT_SPRITE_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,8 +250,8 @@ DAMAGEINFO damageInfo[7] = {
|
||||||
|
|
||||||
int powerupCheck(PLAYER *pPlayer, int nPowerUp)
|
int powerupCheck(PLAYER *pPlayer, int nPowerUp)
|
||||||
{
|
{
|
||||||
dassert(pPlayer != NULL);
|
assert(pPlayer != NULL);
|
||||||
dassert(nPowerUp >= 0 && nPowerUp < kMaxPowerUps);
|
assert(nPowerUp >= 0 && nPowerUp < kMaxPowerUps);
|
||||||
int nPack = powerupToPackItem(nPowerUp);
|
int nPack = powerupToPackItem(nPowerUp);
|
||||||
if (nPack >= 0 && !packItemActive(pPlayer, nPack))
|
if (nPack >= 0 && !packItemActive(pPlayer, nPack))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -598,7 +598,7 @@ char playerSeqPlaying(PLAYER * pPlayer, int nSeq)
|
||||||
|
|
||||||
void playerSetRace(PLAYER *pPlayer, int nLifeMode)
|
void playerSetRace(PLAYER *pPlayer, int nLifeMode)
|
||||||
{
|
{
|
||||||
dassert(nLifeMode >= kModeHuman && nLifeMode <= kModeHumanGrown);
|
assert(nLifeMode >= kModeHuman && nLifeMode <= kModeHumanGrown);
|
||||||
DUDEINFO *pDudeInfo = pPlayer->pDudeInfo;
|
DUDEINFO *pDudeInfo = pPlayer->pDudeInfo;
|
||||||
*pDudeInfo = gPlayerTemplate[nLifeMode];
|
*pDudeInfo = gPlayerTemplate[nLifeMode];
|
||||||
pPlayer->lifeMode = nLifeMode;
|
pPlayer->lifeMode = nLifeMode;
|
||||||
|
@ -695,7 +695,7 @@ void playerStart(int nPlayer, int bNewLevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
spritetype *pSprite = actSpawnSprite(pStartZone->sectnum, pStartZone->x, pStartZone->y, pStartZone->z, 6, 1);
|
spritetype *pSprite = actSpawnSprite(pStartZone->sectnum, pStartZone->x, pStartZone->y, pStartZone->z, 6, 1);
|
||||||
dassert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites);
|
assert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites);
|
||||||
XSPRITE *pXSprite = &xsprite[pSprite->extra];
|
XSPRITE *pXSprite = &xsprite[pSprite->extra];
|
||||||
pPlayer->pSprite = pSprite;
|
pPlayer->pSprite = pSprite;
|
||||||
pPlayer->pXSprite = pXSprite;
|
pPlayer->pXSprite = pXSprite;
|
||||||
|
@ -821,7 +821,7 @@ void playerReset(PLAYER *pPlayer)
|
||||||
static int dword_136438[] = {
|
static int dword_136438[] = {
|
||||||
3, 4, 2, 8, 9, 10, 7, 1, 1, 1, 1, 1, 1, 1
|
3, 4, 2, 8, 9, 10, 7, 1, 1, 1, 1, 1, 1, 1
|
||||||
};
|
};
|
||||||
dassert(pPlayer != NULL);
|
assert(pPlayer != NULL);
|
||||||
for (int i = 0; i < 14; i++)
|
for (int i = 0; i < 14; i++)
|
||||||
{
|
{
|
||||||
pPlayer->hasWeapon[i] = gInfiniteAmmo;
|
pPlayer->hasWeapon[i] = gInfiniteAmmo;
|
||||||
|
@ -1665,7 +1665,7 @@ void playerProcess(PLAYER *pPlayer)
|
||||||
nSector = pSprite->sectnum;
|
nSector = pSprite->sectnum;
|
||||||
actDamageSprite(nSprite, pSprite, DAMAGE_TYPE_0, 500<<4);
|
actDamageSprite(nSprite, pSprite, DAMAGE_TYPE_0, 500<<4);
|
||||||
}
|
}
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
ChangeSpriteSect(nSprite, nSector);
|
ChangeSpriteSect(nSprite, nSector);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1773,20 +1773,20 @@ spritetype *playerFireMissile(PLAYER *pPlayer, int a2, int a3, int a4, int a5, i
|
||||||
|
|
||||||
spritetype * playerFireThing(PLAYER *pPlayer, int a2, int a3, int thingType, int a5)
|
spritetype * playerFireThing(PLAYER *pPlayer, int a2, int a3, int thingType, int a5)
|
||||||
{
|
{
|
||||||
dassert(thingType >= kThingBase && thingType < kThingMax);
|
assert(thingType >= kThingBase && thingType < kThingMax);
|
||||||
return actFireThing(pPlayer->pSprite, a2, pPlayer->zWeapon-pPlayer->pSprite->z, pPlayer->slope+a3, thingType, a5);
|
return actFireThing(pPlayer->pSprite, a2, pPlayer->zWeapon-pPlayer->pSprite->z, pPlayer->slope+a3, thingType, a5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void playerFrag(PLAYER *pKiller, PLAYER *pVictim)
|
void playerFrag(PLAYER *pKiller, PLAYER *pVictim)
|
||||||
{
|
{
|
||||||
dassert(pKiller != NULL);
|
assert(pKiller != NULL);
|
||||||
dassert(pVictim != NULL);
|
assert(pVictim != NULL);
|
||||||
|
|
||||||
char buffer[128] = "";
|
char buffer[128] = "";
|
||||||
int nKiller = pKiller->pSprite->type-kDudePlayer1;
|
int nKiller = pKiller->pSprite->type-kDudePlayer1;
|
||||||
dassert(nKiller >= 0 && nKiller < kMaxPlayers);
|
assert(nKiller >= 0 && nKiller < kMaxPlayers);
|
||||||
int nVictim = pVictim->pSprite->type-kDudePlayer1;
|
int nVictim = pVictim->pSprite->type-kDudePlayer1;
|
||||||
dassert(nVictim >= 0 && nVictim < kMaxPlayers);
|
assert(nVictim >= 0 && nVictim < kMaxPlayers);
|
||||||
if (nKiller == nVictim)
|
if (nKiller == nVictim)
|
||||||
{
|
{
|
||||||
pVictim->fraggerId = -1;
|
pVictim->fraggerId = -1;
|
||||||
|
@ -1918,8 +1918,8 @@ spritetype *sub_40A94(PLAYER *pPlayer, int a2)
|
||||||
|
|
||||||
int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, int nDamage)
|
int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, int nDamage)
|
||||||
{
|
{
|
||||||
dassert(nSource < kMaxSprites);
|
assert(nSource < kMaxSprites);
|
||||||
dassert(pPlayer != NULL);
|
assert(pPlayer != NULL);
|
||||||
if (pPlayer->damageControl[nDamageType])
|
if (pPlayer->damageControl[nDamageType])
|
||||||
return 0;
|
return 0;
|
||||||
nDamage = playerDamageArmor(pPlayer, nDamageType, nDamage);
|
nDamage = playerDamageArmor(pPlayer, nDamageType, nDamage);
|
||||||
|
@ -2052,7 +2052,7 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in
|
||||||
FragPlayer(pPlayer, nSource);
|
FragPlayer(pPlayer, nSource);
|
||||||
trTriggerSprite(nSprite, pXSprite, kCmdOff);
|
trTriggerSprite(nSprite, pXSprite, kCmdOff);
|
||||||
}
|
}
|
||||||
dassert(getSequence(pDudeInfo->seqStartID + nDeathSeqID) != NULL);
|
assert(getSequence(pDudeInfo->seqStartID + nDeathSeqID) != NULL);
|
||||||
seqSpawn(pDudeInfo->seqStartID+nDeathSeqID, 3, nXSprite, nKneelingPlayer);
|
seqSpawn(pDudeInfo->seqStartID+nDeathSeqID, 3, nXSprite, nKneelingPlayer);
|
||||||
return nDamage;
|
return nDamage;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,13 +112,13 @@ public:
|
||||||
}
|
}
|
||||||
void Delete(uint32_t k)
|
void Delete(uint32_t k)
|
||||||
{
|
{
|
||||||
dassert(k <= fNodeCount);
|
assert(k <= fNodeCount);
|
||||||
queueItems[k] = queueItems[fNodeCount--];
|
queueItems[k] = queueItems[fNodeCount--];
|
||||||
Downheap(k);
|
Downheap(k);
|
||||||
}
|
}
|
||||||
void Insert(uint32_t a1, T a2)
|
void Insert(uint32_t a1, T a2)
|
||||||
{
|
{
|
||||||
dassert(fNodeCount < kPQueueSize);
|
assert(fNodeCount < kPQueueSize);
|
||||||
fNodeCount++;
|
fNodeCount++;
|
||||||
queueItems[fNodeCount].TotalKills = a1;
|
queueItems[fNodeCount].TotalKills = a1;
|
||||||
queueItems[fNodeCount].Kills = a2;
|
queueItems[fNodeCount].Kills = a2;
|
||||||
|
@ -133,7 +133,7 @@ public:
|
||||||
}
|
}
|
||||||
uint32_t LowestPriority(void)
|
uint32_t LowestPriority(void)
|
||||||
{
|
{
|
||||||
dassert(fNodeCount > 0);
|
assert(fNodeCount > 0);
|
||||||
return queueItems[1].TotalKills;
|
return queueItems[1].TotalKills;
|
||||||
}
|
}
|
||||||
void Kill(std::function<bool(T)> pMatch)
|
void Kill(std::function<bool(T)> pMatch)
|
||||||
|
@ -167,7 +167,7 @@ public:
|
||||||
}
|
}
|
||||||
T Remove(void)
|
T Remove(void)
|
||||||
{
|
{
|
||||||
dassert(stdQueue.size() > 0);
|
assert(stdQueue.size() > 0);
|
||||||
T data = stdQueue.begin()->Kills;
|
T data = stdQueue.begin()->Kills;
|
||||||
stdQueue.erase(stdQueue.begin());
|
stdQueue.erase(stdQueue.begin());
|
||||||
return data;
|
return data;
|
||||||
|
|
|
@ -367,7 +367,7 @@ static void fakeMoveDude(spritetype *pSprite)
|
||||||
int bottom, top;
|
int bottom, top;
|
||||||
if (IsPlayerSprite(pSprite))
|
if (IsPlayerSprite(pSprite))
|
||||||
pPlayer = &gPlayer[pSprite->type-kDudePlayer1];
|
pPlayer = &gPlayer[pSprite->type-kDudePlayer1];
|
||||||
dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||||
GetSpriteExtents(pSprite, &top, &bottom);
|
GetSpriteExtents(pSprite, &top, &bottom);
|
||||||
top += predict.at58 - pSprite->z;
|
top += predict.at58 - pSprite->z;
|
||||||
bottom += predict.at58 - pSprite->z;
|
bottom += predict.at58 - pSprite->z;
|
||||||
|
@ -375,7 +375,7 @@ static void fakeMoveDude(spritetype *pSprite)
|
||||||
int tz = (predict.at58-top)/4;
|
int tz = (predict.at58-top)/4;
|
||||||
int wd = pSprite->clipdist*4;
|
int wd = pSprite->clipdist*4;
|
||||||
int nSector = predict.at68;
|
int nSector = predict.at68;
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
if (predict.at5c || predict.at60)
|
if (predict.at5c || predict.at60)
|
||||||
{
|
{
|
||||||
if (pPlayer && gNoClip)
|
if (pPlayer && gNoClip)
|
||||||
|
@ -401,7 +401,7 @@ static void fakeMoveDude(spritetype *pSprite)
|
||||||
nSector = nSector2;
|
nSector = nSector2;
|
||||||
}
|
}
|
||||||
|
|
||||||
dassert(nSector >= 0);
|
assert(nSector >= 0);
|
||||||
|
|
||||||
pSprite->cstat = bakCstat;
|
pSprite->cstat = bakCstat;
|
||||||
}
|
}
|
||||||
|
@ -426,7 +426,7 @@ static void fakeMoveDude(spritetype *pSprite)
|
||||||
}
|
}
|
||||||
if (predict.at68 != nSector)
|
if (predict.at68 != nSector)
|
||||||
{
|
{
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
predict.at68 = nSector;
|
predict.at68 = nSector;
|
||||||
}
|
}
|
||||||
char bUnderwater = 0;
|
char bUnderwater = 0;
|
||||||
|
@ -578,12 +578,12 @@ static void fakeActAirDrag(spritetype *, int num)
|
||||||
int xvec = 0;
|
int xvec = 0;
|
||||||
int yvec = 0;
|
int yvec = 0;
|
||||||
int nSector = predict.at68;
|
int nSector = predict.at68;
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
sectortype *pSector = §or[nSector];
|
sectortype *pSector = §or[nSector];
|
||||||
int nXSector = pSector->extra;
|
int nXSector = pSector->extra;
|
||||||
if (nXSector > 0)
|
if (nXSector > 0)
|
||||||
{
|
{
|
||||||
dassert(nXSector < kMaxXSectors);
|
assert(nXSector < kMaxXSectors);
|
||||||
XSECTOR *pXSector = &xsector[nXSector];
|
XSECTOR *pXSector = &xsector[nXSector];
|
||||||
if (pXSector->windVel && (pXSector->windAlways || pXSector->busy))
|
if (pXSector->windVel && (pXSector->windAlways || pXSector->busy))
|
||||||
{
|
{
|
||||||
|
@ -605,14 +605,14 @@ void fakeActProcessSprites(void)
|
||||||
if (pSprite->statnum == kStatDude)
|
if (pSprite->statnum == kStatDude)
|
||||||
{
|
{
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
int nSector = predict.at68;
|
int nSector = predict.at68;
|
||||||
int nXSector = sector[nSector].extra;
|
int nXSector = sector[nSector].extra;
|
||||||
XSECTOR *pXSector = NULL;
|
XSECTOR *pXSector = NULL;
|
||||||
if (nXSector > 0)
|
if (nXSector > 0)
|
||||||
{
|
{
|
||||||
dassert(nXSector > 0 && nXSector < kMaxXSectors);
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||||
dassert(xsector[nXSector].reference == nSector);
|
assert(xsector[nXSector].reference == nSector);
|
||||||
pXSector = &xsector[nXSector];
|
pXSector = &xsector[nXSector];
|
||||||
}
|
}
|
||||||
if (pXSector)
|
if (pXSector)
|
||||||
|
|
|
@ -40,7 +40,7 @@ static int nQavClients;
|
||||||
|
|
||||||
int qavRegisterClient(void(*pClient)(int, void *))
|
int qavRegisterClient(void(*pClient)(int, void *))
|
||||||
{
|
{
|
||||||
dassert(nQavClients < kMaxQavClients);
|
assert(nQavClients < kMaxQavClients);
|
||||||
qavClientCallback[nQavClients] = pClient;
|
qavClientCallback[nQavClients] = pClient;
|
||||||
|
|
||||||
return nQavClients++;
|
return nQavClients++;
|
||||||
|
@ -88,9 +88,9 @@ void DrawFrame(double x, double y, TILE_FRAME *pTile, int stat, int shade, int p
|
||||||
|
|
||||||
void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, bool to3dview)
|
void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, bool to3dview)
|
||||||
{
|
{
|
||||||
dassert(ticksPerFrame > 0);
|
assert(ticksPerFrame > 0);
|
||||||
int nFrame = ticks / ticksPerFrame;
|
int nFrame = ticks / ticksPerFrame;
|
||||||
dassert(nFrame >= 0 && nFrame < nFrames);
|
assert(nFrame >= 0 && nFrame < nFrames);
|
||||||
FRAMEINFO *pFrame = &frames[nFrame];
|
FRAMEINFO *pFrame = &frames[nFrame];
|
||||||
for (int i = 0; i < 8; i++)
|
for (int i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
|
@ -107,7 +107,7 @@ void QAV::Draw(int ticks, int stat, int shade, int palnum, bool to3dview)
|
||||||
|
|
||||||
void QAV::Play(int start, int end, int nCallback, void *pData)
|
void QAV::Play(int start, int end, int nCallback, void *pData)
|
||||||
{
|
{
|
||||||
dassert(ticksPerFrame > 0);
|
assert(ticksPerFrame > 0);
|
||||||
int frame;
|
int frame;
|
||||||
int ticks;
|
int ticks;
|
||||||
if (start < 0)
|
if (start < 0)
|
||||||
|
|
|
@ -509,7 +509,7 @@ private:
|
||||||
|
|
||||||
void flashTeamScore(int team, bool show)
|
void flashTeamScore(int team, bool show)
|
||||||
{
|
{
|
||||||
dassert(0 == team || 1 == team); // 0: blue, 1: red
|
assert(0 == team || 1 == team); // 0: blue, 1: red
|
||||||
|
|
||||||
if (dword_21EFD0[team] == 0 || (gFrameClock & 8))
|
if (dword_21EFD0[team] == 0 || (gFrameClock & 8))
|
||||||
{
|
{
|
||||||
|
|
|
@ -121,7 +121,7 @@ void DoSectorLighting(void)
|
||||||
int nXSector = shadeList[i];
|
int nXSector = shadeList[i];
|
||||||
XSECTOR *pXSector = &xsector[nXSector];
|
XSECTOR *pXSector = &xsector[nXSector];
|
||||||
int nSector = pXSector->reference;
|
int nSector = pXSector->reference;
|
||||||
dassert(sector[nSector].extra == nXSector);
|
assert(sector[nSector].extra == nXSector);
|
||||||
if (pXSector->shade)
|
if (pXSector->shade)
|
||||||
{
|
{
|
||||||
int v4 = pXSector->shade;
|
int v4 = pXSector->shade;
|
||||||
|
@ -267,9 +267,9 @@ void DoSectorPanning(void)
|
||||||
int nXSector = panList[i];
|
int nXSector = panList[i];
|
||||||
XSECTOR *pXSector = &xsector[nXSector];
|
XSECTOR *pXSector = &xsector[nXSector];
|
||||||
int nSector = pXSector->reference;
|
int nSector = pXSector->reference;
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
sectortype *pSector = §or[nSector];
|
sectortype *pSector = §or[nSector];
|
||||||
dassert(pSector->extra == nXSector);
|
assert(pSector->extra == nXSector);
|
||||||
if (pXSector->panAlways || pXSector->busy)
|
if (pXSector->panAlways || pXSector->busy)
|
||||||
{
|
{
|
||||||
int angle = pXSector->panAngle+1024;
|
int angle = pXSector->panAngle+1024;
|
||||||
|
@ -316,7 +316,7 @@ void DoSectorPanning(void)
|
||||||
int nXWall = wallPanList[i];
|
int nXWall = wallPanList[i];
|
||||||
XWALL *pXWall = &xwall[nXWall];
|
XWALL *pXWall = &xwall[nXWall];
|
||||||
int nWall = pXWall->reference;
|
int nWall = pXWall->reference;
|
||||||
dassert(wall[nWall].extra == nXWall);
|
assert(wall[nWall].extra == nXWall);
|
||||||
if (pXWall->panAlways || pXWall->busy)
|
if (pXWall->panAlways || pXWall->busy)
|
||||||
{
|
{
|
||||||
int psx = pXWall->panXVel<<10;
|
int psx = pXWall->panXVel<<10;
|
||||||
|
|
|
@ -54,7 +54,7 @@ static void(*seqClientCallback[kMaxSeqClients])(int, int);
|
||||||
|
|
||||||
int seqRegisterClient(void(*pClient)(int, int))
|
int seqRegisterClient(void(*pClient)(int, int))
|
||||||
{
|
{
|
||||||
dassert(nSeqClients < kMaxSeqClients);
|
assert(nSeqClients < kMaxSeqClients);
|
||||||
seqClientCallback[nSeqClients] = pClient;
|
seqClientCallback[nSeqClients] = pClient;
|
||||||
return nSeqClients++;
|
return nSeqClients++;
|
||||||
}
|
}
|
||||||
|
@ -93,11 +93,11 @@ SEQINST siMasked[kMaxXWalls];
|
||||||
|
|
||||||
void UpdateSprite(int nXSprite, SEQFRAME *pFrame)
|
void UpdateSprite(int nXSprite, SEQFRAME *pFrame)
|
||||||
{
|
{
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
int nSprite = xsprite[nXSprite].reference;
|
int nSprite = xsprite[nXSprite].reference;
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
dassert(pSprite->extra == nXSprite);
|
assert(pSprite->extra == nXSprite);
|
||||||
if (pSprite->flags & 2)
|
if (pSprite->flags & 2)
|
||||||
{
|
{
|
||||||
if (tilesiz[pSprite->picnum].y != tilesiz[seqGetTile(pFrame)].y || tileTopOffset(pSprite->picnum) != tileTopOffset(seqGetTile(pFrame))
|
if (tilesiz[pSprite->picnum].y != tilesiz[seqGetTile(pFrame)].y || tileTopOffset(pSprite->picnum) != tileTopOffset(seqGetTile(pFrame))
|
||||||
|
@ -164,11 +164,11 @@ void UpdateSprite(int nXSprite, SEQFRAME *pFrame)
|
||||||
|
|
||||||
void UpdateWall(int nXWall, SEQFRAME *pFrame)
|
void UpdateWall(int nXWall, SEQFRAME *pFrame)
|
||||||
{
|
{
|
||||||
dassert(nXWall > 0 && nXWall < kMaxXWalls);
|
assert(nXWall > 0 && nXWall < kMaxXWalls);
|
||||||
int nWall = xwall[nXWall].reference;
|
int nWall = xwall[nXWall].reference;
|
||||||
dassert(nWall >= 0 && nWall < kMaxWalls);
|
assert(nWall >= 0 && nWall < kMaxWalls);
|
||||||
walltype *pWall = &wall[nWall];
|
walltype *pWall = &wall[nWall];
|
||||||
dassert(pWall->extra == nXWall);
|
assert(pWall->extra == nXWall);
|
||||||
pWall->picnum = seqGetTile(pFrame);
|
pWall->picnum = seqGetTile(pFrame);
|
||||||
if (pFrame->at5_0)
|
if (pFrame->at5_0)
|
||||||
pWall->pal = pFrame->at5_0;
|
pWall->pal = pFrame->at5_0;
|
||||||
|
@ -192,12 +192,12 @@ void UpdateWall(int nXWall, SEQFRAME *pFrame)
|
||||||
|
|
||||||
void UpdateMasked(int nXWall, SEQFRAME *pFrame)
|
void UpdateMasked(int nXWall, SEQFRAME *pFrame)
|
||||||
{
|
{
|
||||||
dassert(nXWall > 0 && nXWall < kMaxXWalls);
|
assert(nXWall > 0 && nXWall < kMaxXWalls);
|
||||||
int nWall = xwall[nXWall].reference;
|
int nWall = xwall[nXWall].reference;
|
||||||
dassert(nWall >= 0 && nWall < kMaxWalls);
|
assert(nWall >= 0 && nWall < kMaxWalls);
|
||||||
walltype *pWall = &wall[nWall];
|
walltype *pWall = &wall[nWall];
|
||||||
dassert(pWall->extra == nXWall);
|
assert(pWall->extra == nXWall);
|
||||||
dassert(pWall->nextwall >= 0);
|
assert(pWall->nextwall >= 0);
|
||||||
walltype *pWallNext = &wall[pWall->nextwall];
|
walltype *pWallNext = &wall[pWall->nextwall];
|
||||||
pWall->overpicnum = pWallNext->overpicnum = seqGetTile(pFrame);
|
pWall->overpicnum = pWallNext->overpicnum = seqGetTile(pFrame);
|
||||||
if (pFrame->at5_0)
|
if (pFrame->at5_0)
|
||||||
|
@ -246,11 +246,11 @@ void UpdateMasked(int nXWall, SEQFRAME *pFrame)
|
||||||
|
|
||||||
void UpdateFloor(int nXSector, SEQFRAME *pFrame)
|
void UpdateFloor(int nXSector, SEQFRAME *pFrame)
|
||||||
{
|
{
|
||||||
dassert(nXSector > 0 && nXSector < kMaxXSectors);
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||||
int nSector = xsector[nXSector].reference;
|
int nSector = xsector[nXSector].reference;
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
sectortype *pSector = §or[nSector];
|
sectortype *pSector = §or[nSector];
|
||||||
dassert(pSector->extra == nXSector);
|
assert(pSector->extra == nXSector);
|
||||||
pSector->floorpicnum = seqGetTile(pFrame);
|
pSector->floorpicnum = seqGetTile(pFrame);
|
||||||
pSector->floorshade = pFrame->at4_0;
|
pSector->floorshade = pFrame->at4_0;
|
||||||
if (pFrame->at5_0)
|
if (pFrame->at5_0)
|
||||||
|
@ -259,11 +259,11 @@ void UpdateFloor(int nXSector, SEQFRAME *pFrame)
|
||||||
|
|
||||||
void UpdateCeiling(int nXSector, SEQFRAME *pFrame)
|
void UpdateCeiling(int nXSector, SEQFRAME *pFrame)
|
||||||
{
|
{
|
||||||
dassert(nXSector > 0 && nXSector < kMaxXSectors);
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||||
int nSector = xsector[nXSector].reference;
|
int nSector = xsector[nXSector].reference;
|
||||||
dassert(nSector >= 0 && nSector < kMaxSectors);
|
assert(nSector >= 0 && nSector < kMaxSectors);
|
||||||
sectortype *pSector = §or[nSector];
|
sectortype *pSector = §or[nSector];
|
||||||
dassert(pSector->extra == nXSector);
|
assert(pSector->extra == nXSector);
|
||||||
pSector->ceilingpicnum = seqGetTile(pFrame);
|
pSector->ceilingpicnum = seqGetTile(pFrame);
|
||||||
pSector->ceilingshade = pFrame->at4_0;
|
pSector->ceilingshade = pFrame->at4_0;
|
||||||
if (pFrame->at5_0)
|
if (pFrame->at5_0)
|
||||||
|
@ -272,7 +272,7 @@ void UpdateCeiling(int nXSector, SEQFRAME *pFrame)
|
||||||
|
|
||||||
void SEQINST::Update(ACTIVE *pActive)
|
void SEQINST::Update(ACTIVE *pActive)
|
||||||
{
|
{
|
||||||
dassert(frameIndex < pSequence->nFrames);
|
assert(frameIndex < pSequence->nFrames);
|
||||||
switch (pActive->type)
|
switch (pActive->type)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -369,8 +369,8 @@ SEQINST * GetInstance(int a1, int a2)
|
||||||
|
|
||||||
void UnlockInstance(SEQINST *pInst)
|
void UnlockInstance(SEQINST *pInst)
|
||||||
{
|
{
|
||||||
dassert(pInst != NULL);
|
assert(pInst != NULL);
|
||||||
dassert(pInst->pSequence != NULL);
|
assert(pInst->pSequence != NULL);
|
||||||
pInst->pSequence = NULL;
|
pInst->pSequence = NULL;
|
||||||
pInst->at13 = 0;
|
pInst->at13 = 0;
|
||||||
}
|
}
|
||||||
|
@ -395,7 +395,7 @@ void seqSpawn(int a1, int a2, int a3, int a4)
|
||||||
if (activeList[i].type == a2 && activeList[i].xindex == a3)
|
if (activeList[i].type == a2 && activeList[i].xindex == a3)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dassert(i < seqActiveCount);
|
assert(i < seqActiveCount);
|
||||||
}
|
}
|
||||||
if (memcmp(pSeq->signature, "SEQ\x1a", 4) != 0)
|
if (memcmp(pSeq->signature, "SEQ\x1a", 4) != 0)
|
||||||
I_Error("Invalid sequence %d", a1);
|
I_Error("Invalid sequence %d", a1);
|
||||||
|
@ -414,7 +414,7 @@ void seqSpawn(int a1, int a2, int a3, int a4)
|
||||||
pInst->frameIndex = 0;
|
pInst->frameIndex = 0;
|
||||||
if (i == seqActiveCount)
|
if (i == seqActiveCount)
|
||||||
{
|
{
|
||||||
dassert(seqActiveCount < kMaxSequences);
|
assert(seqActiveCount < kMaxSequences);
|
||||||
activeList[seqActiveCount].type = a2;
|
activeList[seqActiveCount].type = a2;
|
||||||
activeList[seqActiveCount].xindex = a3;
|
activeList[seqActiveCount].xindex = a3;
|
||||||
seqActiveCount++;
|
seqActiveCount++;
|
||||||
|
@ -433,7 +433,7 @@ void seqKill(int a1, int a2)
|
||||||
if (activeList[i].type == a1 && activeList[i].xindex == a2)
|
if (activeList[i].type == a1 && activeList[i].xindex == a2)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dassert(i < seqActiveCount);
|
assert(i < seqActiveCount);
|
||||||
seqActiveCount--;
|
seqActiveCount--;
|
||||||
activeList[i] = activeList[seqActiveCount];
|
activeList[i] = activeList[seqActiveCount];
|
||||||
pInst->at13 = 0;
|
pInst->at13 = 0;
|
||||||
|
@ -486,7 +486,7 @@ void seqProcess(int a1)
|
||||||
{
|
{
|
||||||
SEQINST *pInst = GetInstance(activeList[i].type, activeList[i].xindex);
|
SEQINST *pInst = GetInstance(activeList[i].type, activeList[i].xindex);
|
||||||
Seq *pSeq = pInst->pSequence;
|
Seq *pSeq = pInst->pSequence;
|
||||||
dassert(pInst->frameIndex < pSeq->nFrames);
|
assert(pInst->frameIndex < pSeq->nFrames);
|
||||||
pInst->at10 -= a1;
|
pInst->at10 -= a1;
|
||||||
while (pInst->at10 < 0)
|
while (pInst->at10 < 0)
|
||||||
{
|
{
|
||||||
|
@ -507,7 +507,7 @@ void seqProcess(int a1)
|
||||||
{
|
{
|
||||||
int nXSprite = activeList[i].xindex;
|
int nXSprite = activeList[i].xindex;
|
||||||
int nSprite = xsprite[nXSprite].reference;
|
int nSprite = xsprite[nXSprite].reference;
|
||||||
dassert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
evKill(nSprite, 3);
|
evKill(nSprite, 3);
|
||||||
if ((sprite[nSprite].flags & kHitagRespawn) && sprite[nSprite].inittype >= kDudeBase && sprite[nSprite].inittype < kDudeMax)
|
if ((sprite[nSprite].flags & kHitagRespawn) && sprite[nSprite].inittype >= kDudeBase && sprite[nSprite].inittype < kDudeMax)
|
||||||
evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, kCallbackRespawn);
|
evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, kCallbackRespawn);
|
||||||
|
@ -519,7 +519,7 @@ void seqProcess(int a1)
|
||||||
{
|
{
|
||||||
int nXWall = activeList[i].xindex;
|
int nXWall = activeList[i].xindex;
|
||||||
int nWall = xwall[nXWall].reference;
|
int nWall = xwall[nXWall].reference;
|
||||||
dassert(nWall >= 0 && nWall < kMaxWalls);
|
assert(nWall >= 0 && nWall < kMaxWalls);
|
||||||
wall[nWall].cstat &= ~(8 + 16 + 32);
|
wall[nWall].cstat &= ~(8 + 16 + 32);
|
||||||
if (wall[nWall].nextwall != -1)
|
if (wall[nWall].nextwall != -1)
|
||||||
wall[wall[nWall].nextwall].cstat &= ~(8 + 16 + 32);
|
wall[wall[nWall].nextwall].cstat &= ~(8 + 16 + 32);
|
||||||
|
|
|
@ -150,7 +150,7 @@ void sndStartSample(const char *pzSound, int nVolume, int nChannel)
|
||||||
return;
|
return;
|
||||||
if (!strlen(pzSound))
|
if (!strlen(pzSound))
|
||||||
return;
|
return;
|
||||||
dassert(nChannel >= -1 && nChannel < kChannelMax);
|
assert(nChannel >= -1 && nChannel < kChannelMax);
|
||||||
auto snd = soundEngine->FindSound(pzSound);
|
auto snd = soundEngine->FindSound(pzSound);
|
||||||
if (snd > 0)
|
if (snd > 0)
|
||||||
{
|
{
|
||||||
|
@ -162,7 +162,7 @@ void sndStartSample(unsigned int nSound, int nVolume, int nChannel, bool bLoop,
|
||||||
{
|
{
|
||||||
if (!SoundEnabled())
|
if (!SoundEnabled())
|
||||||
return;
|
return;
|
||||||
dassert(nChannel >= -1 && nChannel < kChannelMax);
|
assert(nChannel >= -1 && nChannel < kChannelMax);
|
||||||
if (nChannel >= 7) nChannel = -1;
|
if (nChannel >= 7) nChannel = -1;
|
||||||
auto snd = soundEngine->FindSoundByResID(nSound);
|
auto snd = soundEngine->FindSoundByResID(nSound);
|
||||||
if (snd > 0)
|
if (snd > 0)
|
||||||
|
|
|
@ -186,7 +186,7 @@ BUSY gBusy[128];
|
||||||
|
|
||||||
void AddBusy(int a1, BUSYID a2, int nDelta)
|
void AddBusy(int a1, BUSYID a2, int nDelta)
|
||||||
{
|
{
|
||||||
dassert(nDelta != 0);
|
assert(nDelta != 0);
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < gBusyCount; i++)
|
for (i = 0; i < gBusyCount; i++)
|
||||||
{
|
{
|
||||||
|
@ -226,19 +226,19 @@ unsigned int GetSourceBusy(EVENT a1)
|
||||||
case 6:
|
case 6:
|
||||||
{
|
{
|
||||||
int nXIndex = sector[nIndex].extra;
|
int nXIndex = sector[nIndex].extra;
|
||||||
dassert(nXIndex > 0 && nXIndex < kMaxXSectors);
|
assert(nXIndex > 0 && nXIndex < kMaxXSectors);
|
||||||
return xsector[nXIndex].busy;
|
return xsector[nXIndex].busy;
|
||||||
}
|
}
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
int nXIndex = wall[nIndex].extra;
|
int nXIndex = wall[nIndex].extra;
|
||||||
dassert(nXIndex > 0 && nXIndex < kMaxXWalls);
|
assert(nXIndex > 0 && nXIndex < kMaxXWalls);
|
||||||
return xwall[nXIndex].busy;
|
return xwall[nXIndex].busy;
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
int nXIndex = sprite[nIndex].extra;
|
int nXIndex = sprite[nIndex].extra;
|
||||||
dassert(nXIndex > 0 && nXIndex < kMaxXSprites);
|
assert(nXIndex > 0 && nXIndex < kMaxXSprites);
|
||||||
return xsprite[nXIndex].busy;
|
return xsprite[nXIndex].busy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -766,7 +766,7 @@ void SectorStartSound(int nSector, int nState)
|
||||||
if (pSprite->statnum == kStatDecoration && pSprite->type == kSoundSector)
|
if (pSprite->statnum == kStatDecoration && pSprite->type == kSoundSector)
|
||||||
{
|
{
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
if (nState)
|
if (nState)
|
||||||
{
|
{
|
||||||
|
@ -790,7 +790,7 @@ void SectorEndSound(int nSector, int nState)
|
||||||
if (pSprite->statnum == kStatDecoration && pSprite->type == kSoundSector)
|
if (pSprite->statnum == kStatDecoration && pSprite->type == kSoundSector)
|
||||||
{
|
{
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
if (nState)
|
if (nState)
|
||||||
{
|
{
|
||||||
|
@ -1047,8 +1047,8 @@ int GetHighestSprite(int nSector, int nStatus, int *a3)
|
||||||
|
|
||||||
int GetCrushedSpriteExtents(unsigned int nSector, int *pzTop, int *pzBot)
|
int GetCrushedSpriteExtents(unsigned int nSector, int *pzTop, int *pzBot)
|
||||||
{
|
{
|
||||||
dassert(pzTop != NULL && pzBot != NULL);
|
assert(pzTop != NULL && pzBot != NULL);
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
int vc = -1;
|
int vc = -1;
|
||||||
sectortype *pSector = §or[nSector];
|
sectortype *pSector = §or[nSector];
|
||||||
int vbp = pSector->ceilingz;
|
int vbp = pSector->ceilingz;
|
||||||
|
@ -1073,9 +1073,9 @@ int GetCrushedSpriteExtents(unsigned int nSector, int *pzTop, int *pzBot)
|
||||||
|
|
||||||
int VCrushBusy(unsigned int nSector, unsigned int a2)
|
int VCrushBusy(unsigned int nSector, unsigned int a2)
|
||||||
{
|
{
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
int nXSector = sector[nSector].extra;
|
int nXSector = sector[nSector].extra;
|
||||||
dassert(nXSector > 0 && nXSector < kMaxXSectors);
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||||
XSECTOR *pXSector = &xsector[nXSector];
|
XSECTOR *pXSector = &xsector[nXSector];
|
||||||
int nWave;
|
int nWave;
|
||||||
if (pXSector->busy < a2)
|
if (pXSector->busy < a2)
|
||||||
|
@ -1112,9 +1112,9 @@ int VCrushBusy(unsigned int nSector, unsigned int a2)
|
||||||
|
|
||||||
int VSpriteBusy(unsigned int nSector, unsigned int a2)
|
int VSpriteBusy(unsigned int nSector, unsigned int a2)
|
||||||
{
|
{
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
int nXSector = sector[nSector].extra;
|
int nXSector = sector[nSector].extra;
|
||||||
dassert(nXSector > 0 && nXSector < kMaxXSectors);
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||||
XSECTOR *pXSector = &xsector[nXSector];
|
XSECTOR *pXSector = &xsector[nXSector];
|
||||||
int nWave;
|
int nWave;
|
||||||
if (pXSector->busy < a2)
|
if (pXSector->busy < a2)
|
||||||
|
@ -1161,9 +1161,9 @@ int VSpriteBusy(unsigned int nSector, unsigned int a2)
|
||||||
|
|
||||||
int VDoorBusy(unsigned int nSector, unsigned int a2)
|
int VDoorBusy(unsigned int nSector, unsigned int a2)
|
||||||
{
|
{
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
int nXSector = sector[nSector].extra;
|
int nXSector = sector[nSector].extra;
|
||||||
dassert(nXSector > 0 && nXSector < kMaxXSectors);
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||||
XSECTOR *pXSector = &xsector[nXSector];
|
XSECTOR *pXSector = &xsector[nXSector];
|
||||||
int vbp;
|
int vbp;
|
||||||
if (pXSector->state)
|
if (pXSector->state)
|
||||||
|
@ -1175,7 +1175,7 @@ int VDoorBusy(unsigned int nSector, unsigned int a2)
|
||||||
if (nSprite >= 0 && a2 > pXSector->busy)
|
if (nSprite >= 0 && a2 > pXSector->busy)
|
||||||
{
|
{
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
dassert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites);
|
assert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites);
|
||||||
XSPRITE *pXSprite = &xsprite[pSprite->extra];
|
XSPRITE *pXSprite = &xsprite[pSprite->extra];
|
||||||
if (pXSector->onCeilZ > pXSector->offCeilZ || pXSector->onFloorZ < pXSector->offFloorZ)
|
if (pXSector->onCeilZ > pXSector->offCeilZ || pXSector->onFloorZ < pXSector->offFloorZ)
|
||||||
{
|
{
|
||||||
|
@ -1209,7 +1209,7 @@ int VDoorBusy(unsigned int nSector, unsigned int a2)
|
||||||
else if (nSprite >= 0 && a2 < pXSector->busy)
|
else if (nSprite >= 0 && a2 < pXSector->busy)
|
||||||
{
|
{
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
dassert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites);
|
assert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites);
|
||||||
XSPRITE *pXSprite = &xsprite[pSprite->extra];
|
XSPRITE *pXSprite = &xsprite[pSprite->extra];
|
||||||
if (pXSector->offCeilZ > pXSector->onCeilZ || pXSector->offFloorZ < pXSector->onFloorZ)
|
if (pXSector->offCeilZ > pXSector->onCeilZ || pXSector->offFloorZ < pXSector->onFloorZ)
|
||||||
{
|
{
|
||||||
|
@ -1260,10 +1260,10 @@ int VDoorBusy(unsigned int nSector, unsigned int a2)
|
||||||
|
|
||||||
int HDoorBusy(unsigned int nSector, unsigned int a2)
|
int HDoorBusy(unsigned int nSector, unsigned int a2)
|
||||||
{
|
{
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
sectortype *pSector = §or[nSector];
|
sectortype *pSector = §or[nSector];
|
||||||
int nXSector = pSector->extra;
|
int nXSector = pSector->extra;
|
||||||
dassert(nXSector > 0 && nXSector < kMaxXSectors);
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||||
XSECTOR *pXSector = &xsector[nXSector];
|
XSECTOR *pXSector = &xsector[nXSector];
|
||||||
int nWave;
|
int nWave;
|
||||||
if (pXSector->busy < a2)
|
if (pXSector->busy < a2)
|
||||||
|
@ -1288,10 +1288,10 @@ int HDoorBusy(unsigned int nSector, unsigned int a2)
|
||||||
|
|
||||||
int RDoorBusy(unsigned int nSector, unsigned int a2)
|
int RDoorBusy(unsigned int nSector, unsigned int a2)
|
||||||
{
|
{
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
sectortype *pSector = §or[nSector];
|
sectortype *pSector = §or[nSector];
|
||||||
int nXSector = pSector->extra;
|
int nXSector = pSector->extra;
|
||||||
dassert(nXSector > 0 && nXSector < kMaxXSectors);
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||||
XSECTOR *pXSector = &xsector[nXSector];
|
XSECTOR *pXSector = &xsector[nXSector];
|
||||||
int nWave;
|
int nWave;
|
||||||
if (pXSector->busy < a2)
|
if (pXSector->busy < a2)
|
||||||
|
@ -1315,10 +1315,10 @@ int RDoorBusy(unsigned int nSector, unsigned int a2)
|
||||||
|
|
||||||
int StepRotateBusy(unsigned int nSector, unsigned int a2)
|
int StepRotateBusy(unsigned int nSector, unsigned int a2)
|
||||||
{
|
{
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
sectortype *pSector = §or[nSector];
|
sectortype *pSector = §or[nSector];
|
||||||
int nXSector = pSector->extra;
|
int nXSector = pSector->extra;
|
||||||
dassert(nXSector > 0 && nXSector < kMaxXSectors);
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||||
XSECTOR *pXSector = &xsector[nXSector];
|
XSECTOR *pXSector = &xsector[nXSector];
|
||||||
spritetype *pSprite = &sprite[pXSector->marker0];
|
spritetype *pSprite = &sprite[pXSector->marker0];
|
||||||
int vbp;
|
int vbp;
|
||||||
|
@ -1349,10 +1349,10 @@ int StepRotateBusy(unsigned int nSector, unsigned int a2)
|
||||||
|
|
||||||
int GenSectorBusy(unsigned int nSector, unsigned int a2)
|
int GenSectorBusy(unsigned int nSector, unsigned int a2)
|
||||||
{
|
{
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
sectortype *pSector = §or[nSector];
|
sectortype *pSector = §or[nSector];
|
||||||
int nXSector = pSector->extra;
|
int nXSector = pSector->extra;
|
||||||
dassert(nXSector > 0 && nXSector < kMaxXSectors);
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||||
XSECTOR *pXSector = &xsector[nXSector];
|
XSECTOR *pXSector = &xsector[nXSector];
|
||||||
pXSector->busy = a2;
|
pXSector->busy = a2;
|
||||||
if (pXSector->command == kCmdLink && pXSector->txID)
|
if (pXSector->command == kCmdLink && pXSector->txID)
|
||||||
|
@ -1368,10 +1368,10 @@ int GenSectorBusy(unsigned int nSector, unsigned int a2)
|
||||||
|
|
||||||
int PathBusy(unsigned int nSector, unsigned int a2)
|
int PathBusy(unsigned int nSector, unsigned int a2)
|
||||||
{
|
{
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
sectortype *pSector = §or[nSector];
|
sectortype *pSector = §or[nSector];
|
||||||
int nXSector = pSector->extra;
|
int nXSector = pSector->extra;
|
||||||
dassert(nXSector > 0 && nXSector < kMaxXSectors);
|
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||||
XSECTOR *pXSector = &xsector[nXSector];
|
XSECTOR *pXSector = &xsector[nXSector];
|
||||||
spritetype *pSprite = &sprite[basePath[nSector]];
|
spritetype *pSprite = &sprite[basePath[nSector]];
|
||||||
spritetype *pSprite1 = &sprite[pXSector->marker0];
|
spritetype *pSprite1 = &sprite[pXSector->marker0];
|
||||||
|
@ -1452,13 +1452,13 @@ void TeleFrag(int nKiller, int nSector)
|
||||||
|
|
||||||
void OperateTeleport(unsigned int nSector, XSECTOR *pXSector)
|
void OperateTeleport(unsigned int nSector, XSECTOR *pXSector)
|
||||||
{
|
{
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
int nDest = pXSector->marker0;
|
int nDest = pXSector->marker0;
|
||||||
dassert(nDest < kMaxSprites);
|
assert(nDest < kMaxSprites);
|
||||||
spritetype *pDest = &sprite[nDest];
|
spritetype *pDest = &sprite[nDest];
|
||||||
dassert(pDest->statnum == kStatMarker);
|
assert(pDest->statnum == kStatMarker);
|
||||||
dassert(pDest->type == kMarkerWarpDest);
|
assert(pDest->type == kMarkerWarpDest);
|
||||||
dassert(pDest->sectnum >= 0 && pDest->sectnum < kMaxSectors);
|
assert(pDest->sectnum >= 0 && pDest->sectnum < kMaxSectors);
|
||||||
for (int nSprite = headspritesect[nSector]; nSprite >= 0; nSprite = nextspritesect[nSprite])
|
for (int nSprite = headspritesect[nSector]; nSprite >= 0; nSprite = nextspritesect[nSprite])
|
||||||
{
|
{
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
|
@ -1498,7 +1498,7 @@ void OperatePath(unsigned int nSector, XSECTOR *pXSector, EVENT event)
|
||||||
int nSprite;
|
int nSprite;
|
||||||
spritetype *pSprite = NULL;
|
spritetype *pSprite = NULL;
|
||||||
XSPRITE *pXSprite;
|
XSPRITE *pXSprite;
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
spritetype *pSprite2 = &sprite[pXSector->marker0];
|
spritetype *pSprite2 = &sprite[pXSector->marker0];
|
||||||
XSPRITE *pXSprite2 = &xsprite[pSprite2->extra];
|
XSPRITE *pXSprite2 = &xsprite[pSprite2->extra];
|
||||||
int nId = pXSprite2->data2;
|
int nId = pXSprite2->data2;
|
||||||
|
@ -1541,7 +1541,7 @@ void OperatePath(unsigned int nSector, XSECTOR *pXSector, EVENT event)
|
||||||
|
|
||||||
void OperateSector(unsigned int nSector, XSECTOR *pXSector, EVENT event)
|
void OperateSector(unsigned int nSector, XSECTOR *pXSector, EVENT event)
|
||||||
{
|
{
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
sectortype *pSector = §or[nSector];
|
sectortype *pSector = §or[nSector];
|
||||||
|
|
||||||
#ifdef NOONE_EXTENSIONS
|
#ifdef NOONE_EXTENSIONS
|
||||||
|
@ -1653,7 +1653,7 @@ void InitPath(unsigned int nSector, XSECTOR *pXSector)
|
||||||
int nSprite;
|
int nSprite;
|
||||||
spritetype *pSprite;
|
spritetype *pSprite;
|
||||||
XSPRITE *pXSprite;
|
XSPRITE *pXSprite;
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
int nId = pXSector->data;
|
int nId = pXSector->data;
|
||||||
for (nSprite = headspritestat[kStatPathMarker]; nSprite >= 0; nSprite = nextspritestat[nSprite])
|
for (nSprite = headspritestat[kStatPathMarker]; nSprite >= 0; nSprite = nextspritestat[nSprite])
|
||||||
{
|
{
|
||||||
|
@ -1717,7 +1717,7 @@ void LinkSprite(int nSprite, XSPRITE *pXSprite, EVENT event) {
|
||||||
{
|
{
|
||||||
int nSprite2 = event.index;
|
int nSprite2 = event.index;
|
||||||
int nXSprite2 = sprite[nSprite2].extra;
|
int nXSprite2 = sprite[nSprite2].extra;
|
||||||
dassert(nXSprite2 > 0 && nXSprite2 < kMaxXSprites);
|
assert(nXSprite2 > 0 && nXSprite2 < kMaxXSprites);
|
||||||
pXSprite->data1 = xsprite[nXSprite2].data1;
|
pXSprite->data1 = xsprite[nXSprite2].data1;
|
||||||
if (pXSprite->data1 == pXSprite->data2)
|
if (pXSprite->data1 == pXSprite->data2)
|
||||||
SetSpriteState(nSprite, pXSprite, 1);
|
SetSpriteState(nSprite, pXSprite, 1);
|
||||||
|
@ -1745,7 +1745,7 @@ void LinkWall(int nWall, XWALL *pXWall, EVENT event)
|
||||||
}
|
}
|
||||||
|
|
||||||
void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int command) {
|
void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int command) {
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
if (!pXSector->locked && !pXSector->isTriggered) {
|
if (!pXSector->locked && !pXSector->isTriggered) {
|
||||||
|
|
||||||
if (pXSector->triggerOnce)
|
if (pXSector->triggerOnce)
|
||||||
|
@ -1764,7 +1764,7 @@ void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int command) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void trTriggerWall(unsigned int nWall, XWALL *pXWall, int command) {
|
void trTriggerWall(unsigned int nWall, XWALL *pXWall, int command) {
|
||||||
dassert(nWall < (unsigned int)numwalls);
|
assert(nWall < (unsigned int)numwalls);
|
||||||
if (!pXWall->locked && !pXWall->isTriggered) {
|
if (!pXWall->locked && !pXWall->isTriggered) {
|
||||||
|
|
||||||
if (pXWall->triggerOnce)
|
if (pXWall->triggerOnce)
|
||||||
|
@ -1802,8 +1802,8 @@ void trTriggerSprite(unsigned int nSprite, XSPRITE *pXSprite, int command) {
|
||||||
|
|
||||||
|
|
||||||
void trMessageSector(unsigned int nSector, EVENT event) {
|
void trMessageSector(unsigned int nSector, EVENT event) {
|
||||||
dassert(nSector < (unsigned int)numsectors);
|
assert(nSector < (unsigned int)numsectors);
|
||||||
dassert(sector[nSector].extra > 0 && sector[nSector].extra < kMaxXSectors);
|
assert(sector[nSector].extra > 0 && sector[nSector].extra < kMaxXSectors);
|
||||||
XSECTOR *pXSector = &xsector[sector[nSector].extra];
|
XSECTOR *pXSector = &xsector[sector[nSector].extra];
|
||||||
if (!pXSector->locked || event.cmd == kCmdUnlock || event.cmd == kCmdToggleLock) {
|
if (!pXSector->locked || event.cmd == kCmdUnlock || event.cmd == kCmdToggleLock) {
|
||||||
switch (event.cmd) {
|
switch (event.cmd) {
|
||||||
|
@ -1823,8 +1823,8 @@ void trMessageSector(unsigned int nSector, EVENT event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void trMessageWall(unsigned int nWall, EVENT event) {
|
void trMessageWall(unsigned int nWall, EVENT event) {
|
||||||
dassert(nWall < (unsigned int)numwalls);
|
assert(nWall < (unsigned int)numwalls);
|
||||||
dassert(wall[nWall].extra > 0 && wall[nWall].extra < kMaxXWalls);
|
assert(wall[nWall].extra > 0 && wall[nWall].extra < kMaxXWalls);
|
||||||
|
|
||||||
XWALL *pXWall = &xwall[wall[nWall].extra];
|
XWALL *pXWall = &xwall[wall[nWall].extra];
|
||||||
if (!pXWall->locked || event.cmd == kCmdUnlock || event.cmd == kCmdToggleLock) {
|
if (!pXWall->locked || event.cmd == kCmdUnlock || event.cmd == kCmdToggleLock) {
|
||||||
|
@ -2025,7 +2025,7 @@ void trInit(void)
|
||||||
for (int i = 0; i < numwalls; i++)
|
for (int i = 0; i < numwalls; i++)
|
||||||
{
|
{
|
||||||
int nXWall = wall[i].extra;
|
int nXWall = wall[i].extra;
|
||||||
dassert(nXWall < kMaxXWalls);
|
assert(nXWall < kMaxXWalls);
|
||||||
if (nXWall > 0)
|
if (nXWall > 0)
|
||||||
{
|
{
|
||||||
XWALL *pXWall = &xwall[nXWall];
|
XWALL *pXWall = &xwall[nXWall];
|
||||||
|
@ -2033,7 +2033,7 @@ void trInit(void)
|
||||||
pXWall->busy = 65536;
|
pXWall->busy = 65536;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dassert((numsectors >= 0) && (numsectors < kMaxSectors));
|
assert((numsectors >= 0) && (numsectors < kMaxSectors));
|
||||||
for (int i = 0; i < numsectors; i++)
|
for (int i = 0; i < numsectors; i++)
|
||||||
{
|
{
|
||||||
sectortype *pSector = §or[i];
|
sectortype *pSector = §or[i];
|
||||||
|
@ -2042,7 +2042,7 @@ void trInit(void)
|
||||||
int nXSector = pSector->extra;
|
int nXSector = pSector->extra;
|
||||||
if (nXSector > 0)
|
if (nXSector > 0)
|
||||||
{
|
{
|
||||||
dassert(nXSector < kMaxXSectors);
|
assert(nXSector < kMaxXSectors);
|
||||||
XSECTOR *pXSector = &xsector[nXSector];
|
XSECTOR *pXSector = &xsector[nXSector];
|
||||||
if (pXSector->state)
|
if (pXSector->state)
|
||||||
pXSector->busy = 65536;
|
pXSector->busy = 65536;
|
||||||
|
@ -2115,7 +2115,7 @@ void trInit(void)
|
||||||
int nXSprite = sprite[i].extra;
|
int nXSprite = sprite[i].extra;
|
||||||
if (sprite[i].statnum < kStatFree && nXSprite > 0)
|
if (sprite[i].statnum < kStatFree && nXSprite > 0)
|
||||||
{
|
{
|
||||||
dassert(nXSprite < kMaxXSprites);
|
assert(nXSprite < kMaxXSprites);
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
if (pXSprite->state)
|
if (pXSprite->state)
|
||||||
pXSprite->busy = 65536;
|
pXSprite->busy = 65536;
|
||||||
|
@ -2190,11 +2190,11 @@ void trTextOver(int nId)
|
||||||
|
|
||||||
void InitGenerator(int nSprite)
|
void InitGenerator(int nSprite)
|
||||||
{
|
{
|
||||||
dassert(nSprite < kMaxSprites);
|
assert(nSprite < kMaxSprites);
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
dassert(pSprite->statnum != kMaxStatus);
|
assert(pSprite->statnum != kMaxStatus);
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0);
|
assert(nXSprite > 0);
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
switch (sprite[nSprite].type) {
|
switch (sprite[nSprite].type) {
|
||||||
case kGenTrigger:
|
case kGenTrigger:
|
||||||
|
@ -2208,11 +2208,11 @@ void InitGenerator(int nSprite)
|
||||||
|
|
||||||
void ActivateGenerator(int nSprite)
|
void ActivateGenerator(int nSprite)
|
||||||
{
|
{
|
||||||
dassert(nSprite < kMaxSprites);
|
assert(nSprite < kMaxSprites);
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
dassert(pSprite->statnum != kMaxStatus);
|
assert(pSprite->statnum != kMaxStatus);
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0);
|
assert(nXSprite > 0);
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
switch (pSprite->type) {
|
switch (pSprite->type) {
|
||||||
case kGenDripWater:
|
case kGenDripWater:
|
||||||
|
|
|
@ -264,7 +264,7 @@ void viewInit(void)
|
||||||
FontSet(4, 4480, 0);
|
FontSet(4, 4480, 0);
|
||||||
|
|
||||||
lensdata = fileSystem.LoadFile("lens.dat");
|
lensdata = fileSystem.LoadFile("lens.dat");
|
||||||
dassert(lensdata.Size() == kLensSize * kLensSize * sizeof(int));
|
assert(lensdata.Size() == kLensSize * kLensSize * sizeof(int));
|
||||||
|
|
||||||
lensTable = (int*)lensdata.Data();
|
lensTable = (int*)lensdata.Data();
|
||||||
#if B_BIG_ENDIAN == 1
|
#if B_BIG_ENDIAN == 1
|
||||||
|
@ -295,7 +295,7 @@ void CalcOtherPosition(spritetype *pSprite, int *pX, int *pY, int *pZ, int *vsec
|
||||||
int vZ = FixedToInt(mulscale(zm - IntToFixed(100), 1280, 3))-(16<<8);
|
int vZ = FixedToInt(mulscale(zm - IntToFixed(100), 1280, 3))-(16<<8);
|
||||||
int bakCstat = pSprite->cstat;
|
int bakCstat = pSprite->cstat;
|
||||||
pSprite->cstat &= ~256;
|
pSprite->cstat &= ~256;
|
||||||
dassert(*vsectnum >= 0 && *vsectnum < kMaxSectors);
|
assert(*vsectnum >= 0 && *vsectnum < kMaxSectors);
|
||||||
FindSector(*pX, *pY, *pZ, vsectnum);
|
FindSector(*pX, *pY, *pZ, vsectnum);
|
||||||
short nHSector;
|
short nHSector;
|
||||||
int hX, hY;
|
int hX, hY;
|
||||||
|
@ -329,7 +329,7 @@ void CalcOtherPosition(spritetype *pSprite, int *pX, int *pY, int *pZ, int *vsec
|
||||||
int myclock = gFrameClock + mulscale16(4, smoothratio);
|
int myclock = gFrameClock + mulscale16(4, smoothratio);
|
||||||
othercameradist = ClipHigh(othercameradist+((myclock-othercameraclock)<<10), 65536);
|
othercameradist = ClipHigh(othercameradist+((myclock-othercameraclock)<<10), 65536);
|
||||||
othercameraclock = myclock;
|
othercameraclock = myclock;
|
||||||
dassert(*vsectnum >= 0 && *vsectnum < kMaxSectors);
|
assert(*vsectnum >= 0 && *vsectnum < kMaxSectors);
|
||||||
FindSector(*pX, *pY, *pZ, vsectnum);
|
FindSector(*pX, *pY, *pZ, vsectnum);
|
||||||
pSprite->cstat = bakCstat;
|
pSprite->cstat = bakCstat;
|
||||||
}
|
}
|
||||||
|
@ -341,7 +341,7 @@ void CalcPosition(spritetype *pSprite, int *pX, int *pY, int *pZ, int *vsectnum,
|
||||||
int vZ = FixedToInt(mulscale(zm - IntToFixed(100), 1280, 3))-(16<<8);
|
int vZ = FixedToInt(mulscale(zm - IntToFixed(100), 1280, 3))-(16<<8);
|
||||||
int bakCstat = pSprite->cstat;
|
int bakCstat = pSprite->cstat;
|
||||||
pSprite->cstat &= ~256;
|
pSprite->cstat &= ~256;
|
||||||
dassert(*vsectnum >= 0 && *vsectnum < kMaxSectors);
|
assert(*vsectnum >= 0 && *vsectnum < kMaxSectors);
|
||||||
FindSector(*pX, *pY, *pZ, vsectnum);
|
FindSector(*pX, *pY, *pZ, vsectnum);
|
||||||
short nHSector;
|
short nHSector;
|
||||||
int hX, hY;
|
int hX, hY;
|
||||||
|
@ -376,7 +376,7 @@ void CalcPosition(spritetype *pSprite, int *pX, int *pY, int *pZ, int *vsectnum,
|
||||||
int myclock = gFrameClock + mulscale16(4, smoothratio);
|
int myclock = gFrameClock + mulscale16(4, smoothratio);
|
||||||
cameradist = ClipHigh(cameradist+((myclock-cameraclock)<<10), 65536);
|
cameradist = ClipHigh(cameradist+((myclock-cameraclock)<<10), 65536);
|
||||||
cameraclock = myclock;
|
cameraclock = myclock;
|
||||||
dassert(*vsectnum >= 0 && *vsectnum < kMaxSectors);
|
assert(*vsectnum >= 0 && *vsectnum < kMaxSectors);
|
||||||
FindSector(*pX, *pY, *pZ, vsectnum);
|
FindSector(*pX, *pY, *pZ, vsectnum);
|
||||||
pSprite->cstat = bakCstat;
|
pSprite->cstat = bakCstat;
|
||||||
}
|
}
|
||||||
|
@ -404,9 +404,9 @@ void DoLensEffect(void)
|
||||||
{
|
{
|
||||||
// To investigate whether this can be implemented as a shader effect.
|
// To investigate whether this can be implemented as a shader effect.
|
||||||
auto d = tileData(4077);
|
auto d = tileData(4077);
|
||||||
dassert(d != NULL);
|
assert(d != NULL);
|
||||||
auto s = tilePtr(4079);
|
auto s = tilePtr(4079);
|
||||||
dassert(s != NULL);
|
assert(s != NULL);
|
||||||
for (int i = 0; i < kLensSize*kLensSize; i++, d++)
|
for (int i = 0; i < kLensSize*kLensSize; i++, d++)
|
||||||
if (lensTable[i] >= 0)
|
if (lensTable[i] >= 0)
|
||||||
*d = s[lensTable[i]];
|
*d = s[lensTable[i]];
|
||||||
|
@ -847,7 +847,7 @@ void viewDrawScreen(bool sceneonly)
|
||||||
{
|
{
|
||||||
spritetype* pSprite = &sprite[nSprite];
|
spritetype* pSprite = &sprite[nSprite];
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
XSPRITE* pXSprite = &xsprite[nXSprite];
|
XSPRITE* pXSprite = &xsprite[nXSprite];
|
||||||
if (TestBitString(gotsector, pSprite->sectnum))
|
if (TestBitString(gotsector, pSprite->sectnum))
|
||||||
{
|
{
|
||||||
|
|
|
@ -158,7 +158,7 @@ void warpInit(void)
|
||||||
{
|
{
|
||||||
spritetype *pSprite = &sprite[nSprite];
|
spritetype *pSprite = &sprite[nSprite];
|
||||||
int nXSprite = pSprite->extra;
|
int nXSprite = pSprite->extra;
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
XSPRITE *pXSprite = &xsprite[nXSprite];
|
XSPRITE *pXSprite = &xsprite[nXSprite];
|
||||||
int nLink = pXSprite->data1;
|
int nLink = pXSprite->data1;
|
||||||
for (int j = 0; j < kMaxSectors; j++)
|
for (int j = 0; j < kMaxSectors; j++)
|
||||||
|
@ -168,7 +168,7 @@ void warpInit(void)
|
||||||
{
|
{
|
||||||
spritetype *pSprite2 = &sprite[nSprite2];
|
spritetype *pSprite2 = &sprite[nSprite2];
|
||||||
int nXSprite = pSprite2->extra;
|
int nXSprite = pSprite2->extra;
|
||||||
dassert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
XSPRITE *pXSprite2 = &xsprite[nXSprite];
|
XSPRITE *pXSprite2 = &xsprite[nXSprite];
|
||||||
if (pXSprite2->data1 == nLink)
|
if (pXSprite2->data1 == nLink)
|
||||||
{
|
{
|
||||||
|
@ -197,9 +197,9 @@ int CheckLink(spritetype *pSprite)
|
||||||
if (z <= pSprite->z)
|
if (z <= pSprite->z)
|
||||||
{
|
{
|
||||||
nLower = pUpper->owner;
|
nLower = pUpper->owner;
|
||||||
dassert(nLower >= 0 && nLower < kMaxSprites);
|
assert(nLower >= 0 && nLower < kMaxSprites);
|
||||||
spritetype *pLower = &sprite[nLower];
|
spritetype *pLower = &sprite[nLower];
|
||||||
dassert(pLower->sectnum >= 0 && pLower->sectnum < kMaxSectors);
|
assert(pLower->sectnum >= 0 && pLower->sectnum < kMaxSectors);
|
||||||
ChangeSpriteSect(pSprite->index, pLower->sectnum);
|
ChangeSpriteSect(pSprite->index, pLower->sectnum);
|
||||||
pSprite->x += pLower->x-pUpper->x;
|
pSprite->x += pLower->x-pUpper->x;
|
||||||
pSprite->y += pLower->y-pUpper->y;
|
pSprite->y += pLower->y-pUpper->y;
|
||||||
|
@ -224,9 +224,9 @@ int CheckLink(spritetype *pSprite)
|
||||||
if (z >= pSprite->z)
|
if (z >= pSprite->z)
|
||||||
{
|
{
|
||||||
nUpper = pLower->owner;
|
nUpper = pLower->owner;
|
||||||
dassert(nUpper >= 0 && nUpper < kMaxSprites);
|
assert(nUpper >= 0 && nUpper < kMaxSprites);
|
||||||
spritetype *pUpper = &sprite[nUpper];
|
spritetype *pUpper = &sprite[nUpper];
|
||||||
dassert(pUpper->sectnum >= 0 && pUpper->sectnum < kMaxSectors);
|
assert(pUpper->sectnum >= 0 && pUpper->sectnum < kMaxSectors);
|
||||||
ChangeSpriteSect(pSprite->index, pUpper->sectnum);
|
ChangeSpriteSect(pSprite->index, pUpper->sectnum);
|
||||||
pSprite->x += pUpper->x-pLower->x;
|
pSprite->x += pUpper->x-pLower->x;
|
||||||
pSprite->y += pUpper->y-pLower->y;
|
pSprite->y += pUpper->y-pLower->y;
|
||||||
|
@ -258,9 +258,9 @@ int CheckLink(int *x, int *y, int *z, int *nSector)
|
||||||
if (z1 <= *z)
|
if (z1 <= *z)
|
||||||
{
|
{
|
||||||
nLower = pUpper->owner;
|
nLower = pUpper->owner;
|
||||||
dassert(nLower >= 0 && nLower < kMaxSprites);
|
assert(nLower >= 0 && nLower < kMaxSprites);
|
||||||
spritetype *pLower = &sprite[nLower];
|
spritetype *pLower = &sprite[nLower];
|
||||||
dassert(pLower->sectnum >= 0 && pLower->sectnum < kMaxSectors);
|
assert(pLower->sectnum >= 0 && pLower->sectnum < kMaxSectors);
|
||||||
*nSector = pLower->sectnum;
|
*nSector = pLower->sectnum;
|
||||||
*x += pLower->x-pUpper->x;
|
*x += pLower->x-pUpper->x;
|
||||||
*y += pLower->y-pUpper->y;
|
*y += pLower->y-pUpper->y;
|
||||||
|
@ -284,9 +284,9 @@ int CheckLink(int *x, int *y, int *z, int *nSector)
|
||||||
if (z1 >= *z)
|
if (z1 >= *z)
|
||||||
{
|
{
|
||||||
nUpper = pLower->owner;
|
nUpper = pLower->owner;
|
||||||
dassert(nUpper >= 0 && nUpper < kMaxSprites);
|
assert(nUpper >= 0 && nUpper < kMaxSprites);
|
||||||
spritetype *pUpper = &sprite[nUpper];
|
spritetype *pUpper = &sprite[nUpper];
|
||||||
dassert(pUpper->sectnum >= 0 && pUpper->sectnum < kMaxSectors);
|
assert(pUpper->sectnum >= 0 && pUpper->sectnum < kMaxSectors);
|
||||||
*nSector = pUpper->sectnum;
|
*nSector = pUpper->sectnum;
|
||||||
*x += pUpper->x-pLower->x;
|
*x += pUpper->x-pLower->x;
|
||||||
*y += pUpper->y-pLower->y;
|
*y += pUpper->y-pLower->y;
|
||||||
|
|
|
@ -234,7 +234,7 @@ void WeaponPrecache(HitList &hits)
|
||||||
|
|
||||||
void WeaponDraw(PLAYER *pPlayer, int a2, double a3, double a4, int a5, int smoothratio)
|
void WeaponDraw(PLAYER *pPlayer, int a2, double a3, double a4, int a5, int smoothratio)
|
||||||
{
|
{
|
||||||
dassert(pPlayer != NULL);
|
assert(pPlayer != NULL);
|
||||||
if (pPlayer->weaponQav == -1)
|
if (pPlayer->weaponQav == -1)
|
||||||
return;
|
return;
|
||||||
QAV * pQAV = weaponQAV[pPlayer->weaponQav];
|
QAV * pQAV = weaponQAV[pPlayer->weaponQav];
|
||||||
|
@ -257,7 +257,7 @@ void WeaponDraw(PLAYER *pPlayer, int a2, double a3, double a4, int a5, int smoot
|
||||||
|
|
||||||
void WeaponPlay(PLAYER *pPlayer)
|
void WeaponPlay(PLAYER *pPlayer)
|
||||||
{
|
{
|
||||||
dassert(pPlayer != NULL);
|
assert(pPlayer != NULL);
|
||||||
if (pPlayer->weaponQav == -1)
|
if (pPlayer->weaponQav == -1)
|
||||||
return;
|
return;
|
||||||
QAV *pQAV = weaponQAV[pPlayer->weaponQav];
|
QAV *pQAV = weaponQAV[pPlayer->weaponQav];
|
||||||
|
@ -268,7 +268,7 @@ void WeaponPlay(PLAYER *pPlayer)
|
||||||
|
|
||||||
void StartQAV(PLAYER *pPlayer, int nWeaponQAV, int a3, char a4)
|
void StartQAV(PLAYER *pPlayer, int nWeaponQAV, int a3, char a4)
|
||||||
{
|
{
|
||||||
dassert(nWeaponQAV < kQAVEnd);
|
assert(nWeaponQAV < kQAVEnd);
|
||||||
pPlayer->weaponQav = nWeaponQAV;
|
pPlayer->weaponQav = nWeaponQAV;
|
||||||
pPlayer->weaponTimer = weaponQAV[nWeaponQAV]->at10;
|
pPlayer->weaponTimer = weaponQAV[nWeaponQAV]->at10;
|
||||||
pPlayer->qavCallback = a3;
|
pPlayer->qavCallback = a3;
|
||||||
|
@ -309,7 +309,7 @@ void UpdateAimVector(PLAYER * pPlayer)
|
||||||
{
|
{
|
||||||
short nSprite;
|
short nSprite;
|
||||||
spritetype *pSprite;
|
spritetype *pSprite;
|
||||||
dassert(pPlayer != NULL);
|
assert(pPlayer != NULL);
|
||||||
spritetype *pPSprite = pPlayer->pSprite;
|
spritetype *pPSprite = pPlayer->pSprite;
|
||||||
int x = pPSprite->x;
|
int x = pPSprite->x;
|
||||||
int y = pPSprite->y;
|
int y = pPSprite->y;
|
||||||
|
@ -467,7 +467,7 @@ t_WeaponModes weaponModes[] = {
|
||||||
|
|
||||||
void WeaponRaise(PLAYER *pPlayer)
|
void WeaponRaise(PLAYER *pPlayer)
|
||||||
{
|
{
|
||||||
dassert(pPlayer != NULL);
|
assert(pPlayer != NULL);
|
||||||
int prevWeapon = pPlayer->curWeapon;
|
int prevWeapon = pPlayer->curWeapon;
|
||||||
pPlayer->curWeapon = pPlayer->newWeapon;
|
pPlayer->curWeapon = pPlayer->newWeapon;
|
||||||
pPlayer->newWeapon = 0;
|
pPlayer->newWeapon = 0;
|
||||||
|
@ -617,7 +617,7 @@ void WeaponRaise(PLAYER *pPlayer)
|
||||||
|
|
||||||
void WeaponLower(PLAYER *pPlayer)
|
void WeaponLower(PLAYER *pPlayer)
|
||||||
{
|
{
|
||||||
dassert(pPlayer != NULL);
|
assert(pPlayer != NULL);
|
||||||
if (sub_4B1A4(pPlayer))
|
if (sub_4B1A4(pPlayer))
|
||||||
return;
|
return;
|
||||||
pPlayer->throwPower = 0;
|
pPlayer->throwPower = 0;
|
||||||
|
@ -1113,7 +1113,7 @@ enum { kMaxShotgunBarrels = 4 };
|
||||||
|
|
||||||
void FireShotgun(int nTrigger, PLAYER *pPlayer)
|
void FireShotgun(int nTrigger, PLAYER *pPlayer)
|
||||||
{
|
{
|
||||||
dassert(nTrigger > 0 && nTrigger <= kMaxShotgunBarrels);
|
assert(nTrigger > 0 && nTrigger <= kMaxShotgunBarrels);
|
||||||
if (nTrigger == 1)
|
if (nTrigger == 1)
|
||||||
{
|
{
|
||||||
sfxPlay3DSound(pPlayer->pSprite, 411, 2, 0);
|
sfxPlay3DSound(pPlayer->pSprite, 411, 2, 0);
|
||||||
|
@ -1197,7 +1197,7 @@ enum { kMaxSpread = 14 };
|
||||||
|
|
||||||
void FireSpread(int nTrigger, PLAYER *pPlayer)
|
void FireSpread(int nTrigger, PLAYER *pPlayer)
|
||||||
{
|
{
|
||||||
dassert(nTrigger > 0 && nTrigger <= kMaxSpread);
|
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
|
||||||
Aim *aim = &pPlayer->aim;
|
Aim *aim = &pPlayer->aim;
|
||||||
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
|
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
|
||||||
int dx = CosScale16(angle);
|
int dx = CosScale16(angle);
|
||||||
|
@ -1218,7 +1218,7 @@ void FireSpread(int nTrigger, PLAYER *pPlayer)
|
||||||
|
|
||||||
void AltFireSpread(int nTrigger, PLAYER *pPlayer)
|
void AltFireSpread(int nTrigger, PLAYER *pPlayer)
|
||||||
{
|
{
|
||||||
dassert(nTrigger > 0 && nTrigger <= kMaxSpread);
|
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
|
||||||
Aim *aim = &pPlayer->aim;
|
Aim *aim = &pPlayer->aim;
|
||||||
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
|
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
|
||||||
int dx = CosScale16(angle);
|
int dx = CosScale16(angle);
|
||||||
|
@ -1247,7 +1247,7 @@ void AltFireSpread(int nTrigger, PLAYER *pPlayer)
|
||||||
|
|
||||||
void AltFireSpread2(int nTrigger, PLAYER *pPlayer)
|
void AltFireSpread2(int nTrigger, PLAYER *pPlayer)
|
||||||
{
|
{
|
||||||
dassert(nTrigger > 0 && nTrigger <= kMaxSpread);
|
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
|
||||||
Aim *aim = &pPlayer->aim;
|
Aim *aim = &pPlayer->aim;
|
||||||
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
|
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
|
||||||
int dx = CosScale16(angle);
|
int dx = CosScale16(angle);
|
||||||
|
@ -1346,7 +1346,7 @@ void FireVoodoo(int nTrigger, PLAYER *pPlayer)
|
||||||
actDamageSprite(nSprite, pSprite, DAMAGE_TYPE_2, 1<<4);
|
actDamageSprite(nSprite, pSprite, DAMAGE_TYPE_2, 1<<4);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dassert(pPlayer->voodooTarget >= 0);
|
assert(pPlayer->voodooTarget >= 0);
|
||||||
spritetype *pTarget = &sprite[pPlayer->voodooTarget];
|
spritetype *pTarget = &sprite[pPlayer->voodooTarget];
|
||||||
if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pPlayer, pTarget))
|
if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pPlayer, pTarget))
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue