From 6acc9db540bd0231085170d1c27a2d6db55f704b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 11 Oct 2020 12:38:17 +0200 Subject: [PATCH] - cleanup of the remaining homegrown Blood wrappers. consoleSysMsg and dassert are gone now, all places now call the system implementation directly. --- source/blood/src/actor.cpp | 162 ++++++++++++++--------------- source/blood/src/ai.cpp | 20 ++-- source/blood/src/aibat.cpp | 26 ++--- source/blood/src/aibeast.cpp | 20 ++-- source/blood/src/aiboneel.cpp | 26 ++--- source/blood/src/aiburn.cpp | 6 +- source/blood/src/aicaleb.cpp | 18 ++-- source/blood/src/aicerber.cpp | 32 +++--- source/blood/src/aicult.cpp | 14 +-- source/blood/src/aigarg.cpp | 40 +++---- source/blood/src/aighost.cpp | 40 +++---- source/blood/src/aigilbst.cpp | 18 ++-- source/blood/src/aihand.cpp | 6 +- source/blood/src/aihound.cpp | 20 ++-- source/blood/src/aiinnoc.cpp | 6 +- source/blood/src/aipod.cpp | 20 ++-- source/blood/src/airat.cpp | 10 +- source/blood/src/aispid.cpp | 20 ++-- source/blood/src/aitchern.cpp | 24 ++--- source/blood/src/aiunicult.cpp | 22 ++-- source/blood/src/aizomba.cpp | 12 +-- source/blood/src/aizombf.cpp | 6 +- source/blood/src/animatesprite.cpp | 16 +-- source/blood/src/barf.cpp | 4 +- source/blood/src/callback.cpp | 22 ++-- source/blood/src/common_game.h | 17 +-- source/blood/src/db.cpp | 66 ++++++------ source/blood/src/eventq.cpp | 26 ++--- source/blood/src/fx.cpp | 10 +- source/blood/src/gameutil.cpp | 28 ++--- source/blood/src/gib.cpp | 18 ++-- source/blood/src/globals.cpp | 18 ---- source/blood/src/inifile.cpp | 14 +-- source/blood/src/levels.cpp | 4 +- source/blood/src/loadsave.cpp | 12 +-- source/blood/src/nnexts.cpp | 28 ++--- source/blood/src/player.cpp | 28 ++--- source/blood/src/pqueue.h | 8 +- source/blood/src/prediction.cpp | 18 ++-- source/blood/src/qav.cpp | 8 +- source/blood/src/sbar.cpp | 2 +- source/blood/src/sectorfx.cpp | 8 +- source/blood/src/seq.cpp | 52 ++++----- source/blood/src/sound.cpp | 4 +- source/blood/src/triggers.cpp | 102 +++++++++--------- source/blood/src/view.cpp | 16 +-- source/blood/src/warp.cpp | 20 ++-- source/blood/src/weapon.cpp | 22 ++-- 48 files changed, 551 insertions(+), 588 deletions(-) diff --git a/source/blood/src/actor.cpp b/source/blood/src/actor.cpp index 6b97890e2..9e9d3025f 100644 --- a/source/blood/src/actor.cpp +++ b/source/blood/src/actor.cpp @@ -2378,7 +2378,7 @@ bool IsUnderwaterSector(int nSector) int actSpriteOwnerToSpriteId(spritetype *pSprite) { - dassert(pSprite != NULL); + assert(pSprite != NULL); if (pSprite->owner == -1) return -1; int nSprite = pSprite->owner & (kMaxSprites-1); @@ -2389,7 +2389,7 @@ int actSpriteOwnerToSpriteId(spritetype *pSprite) void actPropagateSpriteOwner(spritetype *pTarget, spritetype *pSource) { - dassert(pTarget != NULL && pSource != NULL); + assert(pTarget != NULL && pSource != NULL); if (IsPlayerSprite(pSource)) pTarget->owner = (pSource->type - kDudePlayer1) | kMaxSprites; else @@ -2400,7 +2400,7 @@ int actSpriteIdToOwnerId(int nSprite) { if (nSprite == -1) return -1; - dassert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSprite >= 0 && nSprite < kMaxSprites); spritetype *pSprite = &sprite[nSprite]; if (IsPlayerSprite(pSprite)) 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) { - dassert(pSprite != NULL); + assert(pSprite != NULL); int dx = pSprite->x-x; int dy = pSprite->y-y; int dz = (pSprite->z-z)>>4; int dist2 = 0x40000+dx*dx+dy*dy+dz*dz; - dassert(dist2 > 0); + assert(dist2 > 0); a6 = scale(0x40000, a6, dist2); 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) { mass = thingInfo[pSprite->type - kThingBase].mass; } 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; } 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); dx = mulscale16(t, dx); dy = mulscale16(t, dy); dz = mulscale16(t, dz); int nSprite = pSprite->index; - dassert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSprite >= 0 && nSprite < kMaxSprites); xvel[nSprite] += dx; yvel[nSprite] += dy; zvel[nSprite] += dz; @@ -2889,7 +2889,7 @@ spritetype *actDropObject(spritetype *pSprite, int nType) { bool actHealDude(XSPRITE *pXDude, int a2, int a3) { - dassert(pXDude != NULL); + assert(pXDude != NULL); a2 <<= 4; a3 <<= 4; 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) { spritetype *pKillerSprite = &sprite[nKillerSprite]; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); int nType = pSprite->type-kDudeBase; int nXSprite = pSprite->extra; - dassert(nXSprite > 0); + assert(nXSprite > 0); XSPRITE *pXSprite = &xsprite[pSprite->extra]; 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) { - dassert(nSource < kMaxSprites); + assert(nSource < kMaxSprites); if (pSprite->flags&32 || pSprite->extra <= 0 || pSprite->extra >= kMaxXSprites || xsprite[pSprite->extra].reference != pSprite->index) return 0; @@ -3500,7 +3500,7 @@ int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, in switch (pSprite->statnum) { case kStatDude: { 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; //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; 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]; 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) { - dassert(pHitInfo != NULL); + assert(pHitInfo != NULL); int nSprite = -1; spritetype *pSprite = NULL; XSPRITE *pXSprite = NULL; @@ -3631,7 +3631,7 @@ void actHitcodeToData(int a1, HITINFO *pHitInfo, int *a3, spritetype **a4, XSPRI case 3: case 5: nSprite = pHitInfo->hitsprite; - dassert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSprite >= 0 && nSprite < kMaxSprites); pSprite = &sprite[nSprite]; if (pSprite->extra > 0) pXSprite = &xsprite[pSprite->extra]; @@ -3639,7 +3639,7 @@ void actHitcodeToData(int a1, HITINFO *pHitInfo, int *a3, spritetype **a4, XSPRI case 0: case 4: nWall = pHitInfo->hitwall; - dassert(nWall >= 0 && nWall < kMaxWalls); + assert(nWall >= 0 && nWall < kMaxWalls); pWall = &wall[nWall]; if (pWall->extra > 0) pXWall = &xwall[pWall->extra]; @@ -3648,7 +3648,7 @@ void actHitcodeToData(int a1, HITINFO *pHitInfo, int *a3, spritetype **a4, XSPRI case 2: case 6: nSector = pHitInfo->hitsect; - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); pSector = §or[nSector]; if (pSector->extra > 0) 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) { int nXMissile = pMissile->extra; - dassert(nXMissile > 0 && nXMissile < kMaxXSprites); + assert(nXMissile > 0 && nXMissile < kMaxXSprites); XSPRITE *pXMissile = &xsprite[pMissile->extra]; int nSpriteHit = -1; int nWallHit = -1; int nSectorHit = -1; @@ -3833,7 +3833,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode) if (hitCode == 3) { int nObject = gHitInfo.hitsprite; - dassert(nObject >= 0 && nObject < kMaxSprites); + assert(nObject >= 0 && nObject < kMaxSprites); spritetype *pObject = &sprite[nObject]; if (pObject->extra > 0) { @@ -3851,7 +3851,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode) if (hitCode == 3) { int nObject = gHitInfo.hitsprite; - dassert(nObject >= 0 && nObject < kMaxSprites); + assert(nObject >= 0 && nObject < kMaxSprites); spritetype *pObject = &sprite[nObject]; if (pObject->extra > 0) { @@ -3872,7 +3872,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode) if (hitCode == 3) { int nObject = gHitInfo.hitsprite; - dassert(nObject >= 0 && nObject < kMaxSprites); + assert(nObject >= 0 && nObject < kMaxSprites); spritetype *pObject = &sprite[nObject]; if (pObject->extra > 0) { @@ -3896,7 +3896,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode) if (hitCode == 3) { int nObject = gHitInfo.hitsprite; - dassert(nObject >= 0 && nObject < kMaxSprites); + assert(nObject >= 0 && nObject < kMaxSprites); spritetype *pObject = &sprite[nObject]; if (pObject->statnum == kStatDude) { @@ -3914,7 +3914,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode) if (hitCode == 3) { int nObject = gHitInfo.hitsprite; - dassert(nObject >= 0 && nObject < kMaxSprites); + assert(nObject >= 0 && nObject < kMaxSprites); spritetype *pObject = &sprite[nObject]; if (pObject->statnum == kStatDude) { @@ -3939,7 +3939,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode) if (hitCode == 3) { int nObject = gHitInfo.hitsprite; - dassert(nObject >= 0 && nObject < kMaxSprites); + assert(nObject >= 0 && nObject < kMaxSprites); spritetype *pObject = &sprite[nObject]; int nOwner = actSpriteOwnerToSpriteId(pMissile); int nDamage = (15+Random(10))<<4; @@ -3952,7 +3952,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode) if (hitCode == 3) { int nObject = gHitInfo.hitsprite; - dassert(nObject >= 0 && nObject < kMaxSprites); + assert(nObject >= 0 && nObject < kMaxSprites); spritetype *pObject = &sprite[nObject]; int nOwner = actSpriteOwnerToSpriteId(pMissile); int nDamage = (10+Random(10))<<4; @@ -3981,8 +3981,8 @@ void actKickObject(spritetype *pSprite1, spritetype *pSprite2) void actTouchFloor(spritetype *pSprite, int nSector) { - dassert(pSprite != NULL); - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(pSprite != NULL); + assert(nSector >= 0 && nSector < kMaxSectors); sectortype * pSector = §or[nSector]; XSECTOR * pXSector = NULL; if (pSector->extra > 0) @@ -4321,12 +4321,12 @@ void actAirDrag(spritetype *pSprite, int a2) int vbp = 0; int v4 = 0; int nSector = pSprite->sectnum; - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); sectortype *pSector = §or[nSector]; int nXSector = pSector->extra; if (nXSector > 0) { - dassert(nXSector < kMaxXSectors); + assert(nXSector < kMaxXSectors); XSECTOR *pXSector = &xsector[nXSector]; if (pXSector->windVel && (pXSector->windAlways || pXSector->busy)) { @@ -4345,14 +4345,14 @@ void actAirDrag(spritetype *pSprite, int a2) int MoveThing(spritetype *pSprite) { int nXSprite = pSprite->extra; - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); XSPRITE *pXSprite = &xsprite[nXSprite]; int nSprite = pSprite->index; int v8 = 0; - dassert(pSprite->type >= kThingBase && pSprite->type < kThingMax); + assert(pSprite->type >= kThingBase && pSprite->type < kThingMax); const THINGINFO *pThingInfo = &thingInfo[pSprite->type-kThingBase]; int nSector = pSprite->sectnum; - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); if (xvel[nSprite] || yvel[nSprite]) @@ -4361,10 +4361,10 @@ int MoveThing(spritetype *pSprite) 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); pSprite->cstat = bakCstat; - dassert(nSector >= 0); + assert(nSector >= 0); if (pSprite->sectnum != nSector) { - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); ChangeSpriteSect(nSprite, nSector); } if ((gSpriteHit[nXSprite].hit&0xc000) == 0x8000) { @@ -4383,7 +4383,7 @@ int MoveThing(spritetype *pSprite) } else { - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); FindSector(pSprite->x, pSprite->y, pSprite->z, &nSector); } if (zvel[nSprite]) @@ -4529,7 +4529,7 @@ void MoveDude(spritetype *pSprite) if (IsPlayerSprite(pSprite)) pPlayer = &gPlayer[pSprite->type-kDudePlayer1]; if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -4539,7 +4539,7 @@ void MoveDude(spritetype *pSprite) int tz = (pSprite->z-top)/4; int wd = pSprite->clipdist<<2; int nSector = pSprite->sectnum; - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); if (xvel[nSprite] || yvel[nSprite]) { if (pPlayer && gNoClip) @@ -4569,7 +4569,7 @@ void MoveDude(spritetype *pSprite) if (nSector2 != -1) nSector = nSector2; } - dassert(nSector >= 0); + assert(nSector >= 0); pSprite->cstat = bakCstat; } switch (gSpriteHit[nXSprite].hit&0xc000) @@ -4633,12 +4633,12 @@ void MoveDude(spritetype *pSprite) } else { - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); FindSector(pSprite->x, pSprite->y, pSprite->z, &nSector); } if (pSprite->sectnum != nSector) { - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); XSECTOR *pXSector; int nXSector = sector[pSprite->sectnum].extra; if (nXSector > 0) @@ -5206,7 +5206,7 @@ int MoveMissile(spritetype *pSprite) updatesector(x, y, &nSector); if (nSector >= 0 && nSector != pSprite->sectnum) { - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); ChangeSpriteSect(nSprite, nSector); } CheckLink(pSprite); @@ -5517,13 +5517,13 @@ void actProcessSprites(void) continue; int nSector = pSprite->sectnum; int nXSprite = pSprite->extra; - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); int nXSector = sector[nSector].extra; XSECTOR *pXSector = NULL; if (nXSector > 0) { - dassert(nXSector > 0 && nXSector < kMaxXSectors); - dassert(xsector[nXSector].reference == nSector); + assert(nXSector > 0 && nXSector < kMaxXSectors); + assert(xsector[nXSector].reference == nSector); pXSector = &xsector[nXSector]; } if (pXSector && pXSector->panVel && (pXSector->panAlways || pXSector->state || pXSector->busy)) @@ -5592,7 +5592,7 @@ void actProcessSprites(void) pSprite->xrepeat = 32; pSprite->yrepeat = 32; int nObject = hit & 0x3fff; - dassert(nObject >= 0 && nObject < kMaxSprites); + assert(nObject >= 0 && nObject < kMaxSprites); spritetype * pObject = &sprite[nObject]; actDamageSprite(actSpriteOwnerToSpriteId(pSprite), pObject, DAMAGE_TYPE_0, pXSprite->data1); } @@ -5603,7 +5603,7 @@ void actProcessSprites(void) if ((hit&0xc000) == 0xc000) { int nObject = hit & 0x3fff; - dassert(nObject >= 0 && nObject < kMaxSprites); + assert(nObject >= 0 && nObject < kMaxSprites); spritetype *pObject = &sprite[nObject]; actDamageSprite(actSpriteOwnerToSpriteId(pSprite), pObject, DAMAGE_TYPE_0, 12); } @@ -5619,7 +5619,7 @@ void actProcessSprites(void) int nObject = hit & 0x3fff; if ((hit&0xc000) != 0xc000 && (nObject < 0 || nObject >= 4096)) break; - dassert(nObject >= 0 && nObject < kMaxSprites); + assert(nObject >= 0 && nObject < kMaxSprites); spritetype *pObject = &sprite[nObject]; actDamageSprite(actSpriteOwnerToSpriteId(pSprite), pObject, DAMAGE_TYPE_0, 12); evPost(pSprite->index, 3, 0, kCallbackFXPodBloodSplat); @@ -5630,7 +5630,7 @@ void actProcessSprites(void) int nObject = hit & 0x3fff; if ((hit&0xc000) != 0xc000 && (nObject < 0 || nObject >= 4096)) break; - dassert(nObject >= 0 && nObject < kMaxSprites); + assert(nObject >= 0 && nObject < kMaxSprites); actExplodeSprite(pSprite); break; } @@ -5660,10 +5660,10 @@ void actProcessSprites(void) continue; int nOwner = actSpriteOwnerToSpriteId(pSprite); int nType = pSprite->type; - dassert(nType >= 0 && nType < kExplodeMax); + assert(nType >= 0 && nType < kExplodeMax); const EXPLOSION *pExplodeInfo = &explodeInfo[nType]; int nXSprite = pSprite->extra; - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); XSPRITE *pXSprite = &xsprite[nXSprite]; int x = pSprite->x; int y = pSprite->y; @@ -5710,7 +5710,7 @@ void actProcessSprites(void) ConcussSprite(nOwner, pDude, x, y, z, pExplodeInfo->dmgType); if (pExplodeInfo->burnTime) { - dassert(pDude->extra > 0 && pDude->extra < kMaxXSprites); + assert(pDude->extra > 0 && pDude->extra < kMaxXSprites); XSPRITE *pXDude = &xsprite[pDude->extra]; if (!pXDude->burnTime) evPost(nSprite2, 3, 0, kCallbackFXFlameLick); @@ -5737,7 +5737,7 @@ void actProcessSprites(void) ConcussSprite(nOwner, pThing, x, y, z, pExplodeInfo->dmgType); if (pExplodeInfo->burnTime) { - dassert(pThing->extra > 0 && pThing->extra < kMaxXSprites); + assert(pThing->extra > 0 && pThing->extra < kMaxXSprites); XSPRITE *pXThing = &xsprite[pThing->extra]; if (pThing->type == kThingTNTBarrel && !pXThing->burnTime) evPost(nSprite2, 3, 0, kCallbackFXFlameLick); @@ -5815,7 +5815,7 @@ void actProcessSprites(void) if (pSprite->flags & 32) continue; int nXSprite = pSprite->extra; - //dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + //assert(nXSprite > 0 && nXSprite < kMaxXSprites); if (nXSprite <= 0 || nXSprite >= kMaxXSprites) continue; XSPRITE *pXSprite = &xsprite[nXSprite]; @@ -5960,15 +5960,15 @@ void actProcessSprites(void) if (pSprite->flags & 32) continue; int nXSprite = pSprite->extra; - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); int nSector = pSprite->sectnum; viewBackupSpriteLoc(nSprite, pSprite); int nXSector = sector[nSector].extra; XSECTOR *pXSector = NULL; if (nXSector > 0) { - dassert(nXSector > 0 && nXSector < kMaxXSectors); - dassert(xsector[nXSector].reference == nSector); + assert(nXSector > 0 && nXSector < kMaxXSectors); + assert(xsector[nXSector].reference == nSector); pXSector = &xsector[nXSector]; } if (pXSector) @@ -6009,12 +6009,12 @@ void actProcessSprites(void) if (pSprite->flags & 32) continue; int nXSprite = pSprite->extra; - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); XSPRITE *pXSprite = &xsprite[nXSprite]; int nTarget = pXSprite->target; - dassert(nTarget >= 0); + assert(nTarget >= 0); viewBackupSpriteLoc(nSprite, pSprite); - dassert(nTarget < kMaxSprites); + assert(nTarget < kMaxSprites); spritetype *pTarget = &sprite[nTarget]; if (pTarget->statnum == kMaxStatus) { @@ -6050,8 +6050,8 @@ spritetype * actSpawnSprite(int nSector, int x, int y, int z, int nStat, char a6 else { nSprite = headspritestat[kStatPurge]; - dassert(nSprite >= 0); - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSprite >= 0); + assert(nSector >= 0 && nSector < kMaxSectors); ChangeSpriteSect(nSprite, nSector); actPostSprite(nSprite, nStat); } @@ -6141,8 +6141,8 @@ spritetype * actSpawnSprite(spritetype *pSource, int nStat) if (nSprite < 0) { nSprite = headspritestat[kStatPurge]; - dassert(nSprite >= 0); - dassert(pSource->sectnum >= 0 && pSource->sectnum < kMaxSectors); + assert(nSprite >= 0); + assert(pSource->sectnum >= 0 && pSource->sectnum < kMaxSectors); ChangeSpriteSect(nSprite, pSource->sectnum); 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) { - dassert(nThingType >= kThingBase && nThingType < kThingMax); + assert(nThingType >= kThingBase && nThingType < kThingMax); spritetype *pSprite = actSpawnSprite(nSector, x, y, z, 4, 1); int nType = nThingType-kThingBase; int nThing = pSprite->index; int nXThing = pSprite->extra; pSprite->type = nThingType; - dassert(nXThing > 0 && nXThing < kMaxXSprites); + assert(nXThing > 0 && nXThing < kMaxXSprites); XSPRITE *pXThing = &xsprite[nXThing]; const THINGINFO *pThingInfo = &thingInfo[nType]; 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) { - dassert(thingType >= kThingBase && thingType < kThingMax); + assert(thingType >= kThingBase && thingType < kThingMax); int x = pSprite->x+mulscale30(a2, Cos(pSprite->ang+512)); int y = pSprite->y+mulscale30(a2, Sin(pSprite->ang+512)); 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) { - dassert(nType >= kMissileBase && nType < kMissileMax); + assert(nType >= kMissileBase && nType < kMissileMax); char v4 = 0; int nSprite = pSprite->index; 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); pMissile->cstat |= 1; int nXSprite = pMissile->extra; - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); xsprite[nXSprite].target = -1; evPost(nMissile, 3, 600, kCallbackRemove); @@ -6486,7 +6486,7 @@ bool actCheckRespawn(spritetype *pSprite) bool actCanSplatWall(int nWall) { - dassert(nWall >= 0 && nWall < kMaxWalls); + assert(nWall >= 0 && nWall < kMaxWalls); walltype *pWall = &wall[nWall]; if (pWall->cstat & 16384) 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) { int nShooter = pShooter->index; - dassert(vectorType >= 0 && vectorType < kVectorMax); + assert(vectorType >= 0 && vectorType < kVectorMax); const VECTORDATA *pVectorData = &gVectorData[vectorType]; int nRange = pVectorData->maxDist; int hit = VectorScan(pShooter, a2, a3, a4, a5, a6, nRange, 1); if (hit == 3) { int nSprite = gHitInfo.hitsprite; - dassert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSprite >= 0 && nSprite < kMaxSprites); spritetype *pSprite = &sprite[nSprite]; if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pShooter, pSprite)) return; if (IsPlayerSprite(pSprite)) { @@ -6558,7 +6558,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, case 0: { int nWall = gHitInfo.hitwall; - dassert(nWall >= 0 && nWall < kMaxWalls); + assert(nWall >= 0 && nWall < kMaxWalls); nSurf = surfType[wall[nWall].picnum]; 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 z = gHitInfo.hitz-mulscale(a6, 256, 14); int nSurf = surfType[wall[nWall].picnum]; - dassert(nSurf < kSurfMax); + assert(nSurf < kSurfMax); if (pVectorData->surfHit[nSurf].fx1 >= 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: { int nWall = gHitInfo.hitwall; - dassert(nWall >= 0 && nWall < kMaxWalls); + assert(nWall >= 0 && nWall < kMaxWalls); nSurf = surfType[wall[nWall].overpicnum]; int nXWall = wall[nWall].extra; 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; nSurf = surfType[sprite[nSprite].picnum]; - dassert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSprite >= 0 && nSprite < kMaxSprites); spritetype *pSprite = &sprite[nSprite]; x -= mulscale(a4, 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) gFX.fxSpawn(pVectorData->surfHit[nSurf].fx2, nSector, x, y, z, 0); if (pVectorData->surfHit[nSurf].fx3 >= 0) @@ -6848,15 +6848,15 @@ void DudeToGibCallback2(int, int nXSprite) void actPostSprite(int nSprite, int nStatus) { int n; - dassert(gPostCount < kMaxSprites); - dassert(nSprite < kMaxSprites && sprite[nSprite].statnum < kMaxStatus); - dassert(nStatus >= 0 && nStatus <= kStatFree); + assert(gPostCount < kMaxSprites); + assert(nSprite < kMaxSprites && sprite[nSprite].statnum < kMaxStatus); + assert(nStatus >= 0 && nStatus <= kStatFree); if (sprite[nSprite].flags&32) { for (n = 0; n < gPostCount; n++) if (gPost[n].TotalKills == nSprite) break; - dassert(n < gPostCount); + assert(n < gPostCount); } else { diff --git a/source/blood/src/ai.cpp b/source/blood/src/ai.cpp index 8e322be67..b39af2865 100644 --- a/source/blood/src/ai.cpp +++ b/source/blood/src/ai.cpp @@ -133,7 +133,7 @@ bool CanMove(spritetype *pSprite, int a2, int nAngle, int nRange) x += mulscale30(nRange, Cos(nAngle)); y += mulscale30(nRange, Sin(nAngle)); int nSector = pSprite->sectnum; - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); if (!FindSector(x, y, z, &nSector)) return false; 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) { 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 nCos = Cos(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) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; int nTurnRange = (pDudeInfo->angSpeed<<2)>>4; @@ -286,7 +286,7 @@ void aiMoveForward(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); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; int nTurnRange = (pDudeInfo->angSpeed<<2)>>4; @@ -296,7 +296,7 @@ void aiMoveTurn(spritetype *pSprite, XSPRITE *pXSprite) void aiMoveDodge(spritetype *pSprite, XSPRITE *pXSprite) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; int nTurnRange = (pDudeInfo->angSpeed<<2)>>4; @@ -321,7 +321,7 @@ void aiMoveDodge(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) { aiChooseDirection(pSprite, pXSprite, getangle(pXSprite->targetX-pSprite->x, pXSprite->targetY-pSprite->y)); pXSprite->state = 1; @@ -872,7 +872,7 @@ void aiSetTarget(XSPRITE *pXSprite, int x, int y, int z) void aiSetTarget(XSPRITE *pXSprite, int nTarget) { - dassert(nTarget >= 0 && nTarget < kMaxSprites); + assert(nTarget >= 0 && nTarget < kMaxSprites); spritetype *pTarget = &sprite[nTarget]; 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) { - dassert(nSource < kMaxSprites); + assert(nSource < kMaxSprites); if (!pXSprite->health) return 0; pXSprite->health = ClipLow(pXSprite->health - nDamage, 0); @@ -1339,7 +1339,7 @@ void RecoilDude(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); if (Chance(pDudeInfo->alertChance)) { @@ -1378,7 +1378,7 @@ void aiThinkTarget(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); if (Chance(pDudeInfo->alertChance)) { diff --git a/source/blood/src/aibat.cpp b/source/blood/src/aibat.cpp index ef65188d8..5d23d2b9f 100644 --- a/source/blood/src/aibat.cpp +++ b/source/blood/src/aibat.cpp @@ -80,18 +80,18 @@ static void batBiteSeqCallback(int, int nXSprite) spritetype *pTarget = &sprite[pXSprite->target]; int dx = CosScale16(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 *pDudeInfoT = getDudeInfo(pTarget->type); int height = (pSprite->yrepeat*pDudeInfo->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); } 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); DUDEEXTRA_at6_u1 *pDudeExtraE = &gDudeExtra[pSprite->extra].at6.u1; if (pDudeExtraE->at8 && pDudeExtraE->Kills < 10) @@ -149,7 +149,7 @@ static void batThinkSearch(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); int dx = pXSprite->targetX-pSprite->x; int dy = pXSprite->targetY-pSprite->y; @@ -168,9 +168,9 @@ static void batThinkPonder(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &batSearch); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; @@ -218,7 +218,7 @@ static void batThinkPonder(spritetype *pSprite, XSPRITE *pXSprite) static void batMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; int nTurnRange = (pDudeInfo->angSpeed<<2)>>4; @@ -242,7 +242,7 @@ static void batMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite) static void batMoveDodgeDown(spritetype *pSprite, XSPRITE *pXSprite) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; int nTurnRange = (pDudeInfo->angSpeed<<2)>>4; @@ -272,9 +272,9 @@ static void batThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &batGoto); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; @@ -328,7 +328,7 @@ static void batThinkChase(spritetype *pSprite, XSPRITE *pXSprite) static void batMoveForward(spritetype *pSprite, XSPRITE *pXSprite) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; int nTurnRange = (pDudeInfo->angSpeed<<2)>>4; @@ -360,7 +360,7 @@ static void batMoveForward(spritetype *pSprite, XSPRITE *pXSprite) static void batMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; int nTurnRange = (pDudeInfo->angSpeed<<2)>>4; @@ -391,7 +391,7 @@ static void batMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite) static void batMoveFly(spritetype *pSprite, XSPRITE *pXSprite) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; int nTurnRange = (pDudeInfo->angSpeed<<2)>>4; diff --git a/source/blood/src/aibeast.cpp b/source/blood/src/aibeast.cpp index cd811f44f..260960b0d 100644 --- a/source/blood/src/aibeast.cpp +++ b/source/blood/src/aibeast.cpp @@ -204,7 +204,7 @@ static void beastThinkSearch(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); XSECTOR *pXSector; int nXSector = sector[pSprite->sectnum].extra; @@ -243,9 +243,9 @@ static void beastThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &beastSearch); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; @@ -391,7 +391,7 @@ static void beastThinkChase(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); int dx = pXSprite->targetX-pSprite->x; int dy = pXSprite->targetY-pSprite->y; @@ -410,9 +410,9 @@ static void beastThinkSwimChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &beastSwimGoto); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; @@ -460,7 +460,7 @@ static void beastThinkSwimChase(spritetype *pSprite, XSPRITE *pXSprite) static void beastMoveForward(spritetype *pSprite, XSPRITE *pXSprite) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; 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) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; 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) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); spritetype *pTarget = &sprite[pXSprite->target]; 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) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); spritetype *pTarget = &sprite[pXSprite->target]; int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight; diff --git a/source/blood/src/aiboneel.cpp b/source/blood/src/aiboneel.cpp index f2ac03c14..be404748e 100644 --- a/source/blood/src/aiboneel.cpp +++ b/source/blood/src/aiboneel.cpp @@ -81,7 +81,7 @@ static void eelBiteSeqCallback(int, int nXSprite) spritetype *pTarget = &sprite[pXSprite->target]; int dx = CosScale16(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 *pDudeInfoT = getDudeInfo(pTarget->type); int height = (pSprite->yrepeat*pDudeInfo->eyeHeight)<<2; @@ -98,13 +98,13 @@ static void eelBiteSeqCallback(int, int nXSprite) aiNewState(pSprite, pXSprite, &eelSearch); 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); } 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); DUDEEXTRA_at6_u1 *pDudeExtraE = &gDudeExtra[pSprite->extra].at6.u1; if (pDudeExtraE->at8 && pDudeExtraE->Kills < 10) @@ -164,7 +164,7 @@ static void eelThinkSearch(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); int dx = pXSprite->targetX-pSprite->x; int dy = pXSprite->targetY-pSprite->y; @@ -183,9 +183,9 @@ static void eelThinkPonder(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &eelSearch); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; @@ -233,7 +233,7 @@ static void eelThinkPonder(spritetype *pSprite, XSPRITE *pXSprite) static void eelMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; int nTurnRange = (pDudeInfo->angSpeed<<2)>>4; @@ -257,7 +257,7 @@ static void eelMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite) static void eelMoveDodgeDown(spritetype *pSprite, XSPRITE *pXSprite) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; int nTurnRange = (pDudeInfo->angSpeed<<2)>>4; @@ -287,9 +287,9 @@ static void eelThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &eelGoto); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; @@ -339,7 +339,7 @@ static void eelThinkChase(spritetype *pSprite, XSPRITE *pXSprite) static void eelMoveForward(spritetype *pSprite, XSPRITE *pXSprite) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; int nTurnRange = (pDudeInfo->angSpeed<<2)>>4; @@ -371,7 +371,7 @@ static void eelMoveForward(spritetype *pSprite, XSPRITE *pXSprite) static void eelMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; int nTurnRange = (pDudeInfo->angSpeed<<2)>>4; @@ -399,7 +399,7 @@ static void eelMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite) static void eelMoveAscend(spritetype *pSprite, XSPRITE *pXSprite) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; int nTurnRange = (pDudeInfo->angSpeed<<2)>>4; diff --git a/source/blood/src/aiburn.cpp b/source/blood/src/aiburn.cpp index e285788f4..a87c034fc 100644 --- a/source/blood/src/aiburn.cpp +++ b/source/blood/src/aiburn.cpp @@ -99,7 +99,7 @@ static void burnThinkSearch(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); int dx = pXSprite->targetX-pSprite->x; int dy = pXSprite->targetY-pSprite->y; @@ -170,9 +170,9 @@ static void burnThinkChase(spritetype *pSprite, XSPRITE *pXSprite) } return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; diff --git a/source/blood/src/aicaleb.cpp b/source/blood/src/aicaleb.cpp index 5647c73da..d9b0059f8 100644 --- a/source/blood/src/aicaleb.cpp +++ b/source/blood/src/aicaleb.cpp @@ -105,7 +105,7 @@ static void calebThinkSearch(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); XSECTOR *pXSector; int nXSector = sector[pSprite->sectnum].extra; @@ -144,9 +144,9 @@ static void calebThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &tinycalebSearch); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; @@ -258,7 +258,7 @@ static void calebThinkChase(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); int dx = pXSprite->targetX-pSprite->x; int dy = pXSprite->targetY-pSprite->y; @@ -277,9 +277,9 @@ static void calebThinkSwimChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &tinycalebSwimGoto); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; 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) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; 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) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); spritetype *pTarget = &sprite[pXSprite->target]; 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) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); spritetype *pTarget = &sprite[pXSprite->target]; int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight; diff --git a/source/blood/src/aicerber.cpp b/source/blood/src/aicerber.cpp index 0453b2756..38736fb0d 100644 --- a/source/blood/src/aicerber.cpp +++ b/source/blood/src/aicerber.cpp @@ -80,14 +80,14 @@ static void cerberusBiteSeqCallback(int, int nXSprite) spritetype *pSprite = &sprite[nSprite]; int dx = CosScale16(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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } - ///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + ///assert(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; } spritetype *pTarget = &sprite[pXSprite->target]; @@ -104,9 +104,9 @@ static void cerberusBurnSeqCallback(int, int nXSprite) spritetype *pSprite = &sprite[nSprite]; DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); 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)) { - consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); + Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); return; } int x = pSprite->x; @@ -183,9 +183,9 @@ static void cerberusBurnSeqCallback2(int, int nXSprite) XSPRITE *pXSprite = &xsprite[nXSprite]; int nSprite = pXSprite->reference; 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)) { - consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); + Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -272,9 +272,9 @@ static void cerberusThinkSearch(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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -332,9 +332,9 @@ static void cerberusThinkTarget(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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -371,17 +371,17 @@ static void cerberusThinkChase(spritetype *pSprite, XSPRITE *pXSprite) return; } - ///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + ///assert(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; } 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)) { - consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); + Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); return; } spritetype *pTarget = &sprite[pXSprite->target]; diff --git a/source/blood/src/aicult.cpp b/source/blood/src/aicult.cpp index 38a3248d0..68a03e65e 100644 --- a/source/blood/src/aicult.cpp +++ b/source/blood/src/aicult.cpp @@ -166,9 +166,9 @@ static void cultThrowSeqCallback(int, int nXSprite) nMissile = kThingArmedTNTBundle; char v4 = Chance(0x6000); sfxPlay3DSound(pSprite, 455, -1, 0); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); 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 dy = pTarget->y - pSprite->y; int dz = pTarget->z - pSprite->z; @@ -205,9 +205,9 @@ static void sub_68230(int, int nXSprite) if (gGameOptions.nDifficulty > 2) nMissile = kThingArmedTNTBundle; sfxPlay3DSound(pSprite, 455, -1, 0); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); 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 dy = pTarget->y - pSprite->y; int dz = pTarget->z - pSprite->z; @@ -235,7 +235,7 @@ static void cultThinkSearch(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); int dx = pXSprite->targetX-pSprite->x; int dy = pXSprite->targetY-pSprite->y; @@ -274,9 +274,9 @@ static void cultThinkChase(spritetype *pSprite, XSPRITE *pXSprite) } return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; diff --git a/source/blood/src/aigarg.cpp b/source/blood/src/aigarg.cpp index b3165feab..08a8d42aa 100644 --- a/source/blood/src/aigarg.cpp +++ b/source/blood/src/aigarg.cpp @@ -231,9 +231,9 @@ static void ThrowSSeqCallback(int, int nXSprite) 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -294,9 +294,9 @@ static void gargThinkSearch(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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -313,9 +313,9 @@ static void gargThinkGoto(spritetype *pSprite, XSPRITE *pXSprite) static void gargMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite) { 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -341,9 +341,9 @@ static void gargMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite) static void gargMoveDodgeDown(spritetype *pSprite, XSPRITE *pXSprite) { 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -375,15 +375,15 @@ static void gargThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &gargoyleFGoto); return; } - ///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + ///assert(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; } 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)) { - consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); + Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); return; } spritetype *pTarget = &sprite[pXSprite->target]; @@ -565,9 +565,9 @@ static void entrySStatue(spritetype *pSprite, XSPRITE *pXSprite) static void gargMoveForward(spritetype *pSprite, XSPRITE *pXSprite) { 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -601,9 +601,9 @@ static void gargMoveForward(spritetype *pSprite, XSPRITE *pXSprite) static void gargMoveSlow(spritetype *pSprite, XSPRITE *pXSprite) { 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -644,9 +644,9 @@ static void gargMoveSlow(spritetype *pSprite, XSPRITE *pXSprite) static void gargMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite) { 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -686,9 +686,9 @@ static void gargMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite) static void gargMoveFly(spritetype *pSprite, XSPRITE *pXSprite) { 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); diff --git a/source/blood/src/aighost.cpp b/source/blood/src/aighost.cpp index c42879815..6530f0976 100644 --- a/source/blood/src/aighost.cpp +++ b/source/blood/src/aighost.cpp @@ -205,9 +205,9 @@ static void ghostBlastSeqCallback(int, int nXSprite) 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -267,9 +267,9 @@ static void ghostThinkSearch(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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -286,9 +286,9 @@ static void ghostThinkGoto(spritetype *pSprite, XSPRITE *pXSprite) static void ghostMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite) { 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -314,9 +314,9 @@ static void ghostMoveDodgeUp(spritetype *pSprite, XSPRITE *pXSprite) static void ghostMoveDodgeDown(spritetype *pSprite, XSPRITE *pXSprite) { 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -348,15 +348,15 @@ static void ghostThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &ghostGoto); return; } - ///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + ///assert(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; } 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)) { - consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); + Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); return; } spritetype *pTarget = &sprite[pXSprite->target]; @@ -456,9 +456,9 @@ static void ghostThinkChase(spritetype *pSprite, XSPRITE *pXSprite) static void ghostMoveForward(spritetype *pSprite, XSPRITE *pXSprite) { 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -492,9 +492,9 @@ static void ghostMoveForward(spritetype *pSprite, XSPRITE *pXSprite) static void ghostMoveSlow(spritetype *pSprite, XSPRITE *pXSprite) { 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -532,9 +532,9 @@ static void ghostMoveSlow(spritetype *pSprite, XSPRITE *pXSprite) static void ghostMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite) { 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -571,9 +571,9 @@ static void ghostMoveSwoop(spritetype *pSprite, XSPRITE *pXSprite) static void ghostMoveFly(spritetype *pSprite, XSPRITE *pXSprite) { 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); diff --git a/source/blood/src/aigilbst.cpp b/source/blood/src/aigilbst.cpp index c117b8c5c..c843dff1c 100644 --- a/source/blood/src/aigilbst.cpp +++ b/source/blood/src/aigilbst.cpp @@ -96,7 +96,7 @@ static void gillThinkSearch(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); XSECTOR *pXSector; int nXSector = sector[pSprite->sectnum].extra; @@ -135,9 +135,9 @@ static void gillThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &gillBeastSearch); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; @@ -245,7 +245,7 @@ static void gillThinkChase(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); int dx = pXSprite->targetX-pSprite->x; int dy = pXSprite->targetY-pSprite->y; @@ -264,9 +264,9 @@ static void gillThinkSwimChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &gillBeastSwimSearch); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; 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) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int nAng = ((pXSprite->goalAng+1024-pSprite->ang)&2047)-1024; 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) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); spritetype *pTarget = &sprite[pXSprite->target]; 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) { int nSprite = pSprite->index; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); spritetype *pTarget = &sprite[pXSprite->target]; int z = pSprite->z + getDudeInfo(pSprite->type)->eyeHeight; diff --git a/source/blood/src/aihand.cpp b/source/blood/src/aihand.cpp index 6efa16e22..758f61f9a 100644 --- a/source/blood/src/aihand.cpp +++ b/source/blood/src/aihand.cpp @@ -82,7 +82,7 @@ static void handThinkSearch(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); int dx = pXSprite->targetX-pSprite->x; int dy = pXSprite->targetY-pSprite->y; @@ -101,9 +101,9 @@ static void handThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &handGoto); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; diff --git a/source/blood/src/aihound.cpp b/source/blood/src/aihound.cpp index 77c978335..419288307 100644 --- a/source/blood/src/aihound.cpp +++ b/source/blood/src/aihound.cpp @@ -69,15 +69,15 @@ static void houndBiteSeqCallback(int, int nXSprite) spritetype *pSprite = &sprite[nSprite]; int dx = CosScale16(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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } - ///dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + ///assert(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; } spritetype *pTarget = &sprite[pXSprite->target]; @@ -106,9 +106,9 @@ static void houndThinkSearch(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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } @@ -130,15 +130,15 @@ static void houndThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &houndGoto); return; } - ///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + ///assert(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; } 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)) { - consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); + Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); return; } spritetype *pTarget = &sprite[pXSprite->target]; diff --git a/source/blood/src/aiinnoc.cpp b/source/blood/src/aiinnoc.cpp index aecc61675..c1f308041 100644 --- a/source/blood/src/aiinnoc.cpp +++ b/source/blood/src/aiinnoc.cpp @@ -61,7 +61,7 @@ static void innocThinkSearch(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); int dx = pXSprite->targetX-pSprite->x; int dy = pXSprite->targetY-pSprite->y; @@ -80,9 +80,9 @@ static void innocThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &innocentGoto); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; diff --git a/source/blood/src/aipod.cpp b/source/blood/src/aipod.cpp index 6d6b1dc32..1ca118547 100644 --- a/source/blood/src/aipod.cpp +++ b/source/blood/src/aipod.cpp @@ -93,17 +93,17 @@ static void sub_6FFA0(int, int nXSprite) XSPRITE *pXSprite = &xsprite[nXSprite]; int nSprite = pXSprite->reference; 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)) { - consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); + Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); return; } 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)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } 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) { - ///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + ///assert(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; } @@ -219,15 +219,15 @@ static void sub_704D8(spritetype *pSprite, XSPRITE *pXSprite) } return; } - ///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + ///assert(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; } 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)) { - consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); + Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); return; } spritetype *pTarget = &sprite[pXSprite->target]; diff --git a/source/blood/src/airat.cpp b/source/blood/src/airat.cpp index b53186950..766ed81df 100644 --- a/source/blood/src/airat.cpp +++ b/source/blood/src/airat.cpp @@ -64,8 +64,8 @@ static void ratBiteSeqCallback(int, int nXSprite) spritetype *pSprite = &sprite[nSprite]; int dx = CosScale16(pSprite->ang); int dy = SinScale16(pSprite->ang); - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; if (IsPlayerSprite(pTarget)) 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) { - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); int dx = pXSprite->targetX-pSprite->x; int dy = pXSprite->targetY-pSprite->y; @@ -98,9 +98,9 @@ static void ratThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &ratGoto); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; diff --git a/source/blood/src/aispid.cpp b/source/blood/src/aispid.cpp index a10f2d319..f8f29318c 100644 --- a/source/blood/src/aispid.cpp +++ b/source/blood/src/aispid.cpp @@ -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) { - dassert(pXDude != NULL); + assert(pXDude != NULL); int nDude = pXDude->reference; spritetype *pDude = &sprite[nDude]; if (IsPlayerSprite(pDude)) @@ -95,8 +95,8 @@ static void SpidBiteSeqCallback(int, int nXSprite) dx += Random2(2000); dy += Random2(2000); int dz = Random2(2000); - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; if (IsPlayerSprite(pTarget)) { @@ -145,8 +145,8 @@ static void SpidJumpSeqCallback(int, int nXSprite) dx += Random2(200); dy += Random2(200); int dz = Random2(200); - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; if (IsPlayerSprite(pTarget)) { dz += pTarget->z-pSprite->z; @@ -167,9 +167,9 @@ static void sub_71370(int, int nXSprite) XSPRITE *pXSprite = &xsprite[nXSprite]; int nSprite = pXSprite->reference; spritetype *pSprite = &sprite[nSprite]; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; DUDEEXTRA_at6_u1 *pDudeExtraE = &gDudeExtra[pSprite->extra].at6.u1; int dx = pXSprite->targetX-pSprite->x; @@ -204,7 +204,7 @@ static void spidThinkSearch(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); int dx = pXSprite->targetX-pSprite->x; int dy = pXSprite->targetY-pSprite->y; @@ -223,9 +223,9 @@ static void spidThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &spidGoto); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; diff --git a/source/blood/src/aitchern.cpp b/source/blood/src/aitchern.cpp index 4fe35aeaa..7bfd95717 100644 --- a/source/blood/src/aitchern.cpp +++ b/source/blood/src/aitchern.cpp @@ -88,9 +88,9 @@ static void sub_71BD4(int, int nXSprite) spritetype *pSprite = &sprite[nSprite]; DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); 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)) { - consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); + Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); return; } int x = pSprite->x; @@ -160,9 +160,9 @@ static void sub_720AC(int, int nXSprite) XSPRITE *pXSprite = &xsprite[nXSprite]; int nSprite = pXSprite->reference; 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)) { - consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); + Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); return; } 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) { - ///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + ///assert(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; } 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) { - ///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + ///assert(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; } DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); @@ -321,15 +321,15 @@ static void sub_72934(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &tcherno13A9B8); return; } - ///dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + ///assert(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; } 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)) { - consoleSysMsg("pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); + Printf(PRINT_HIGH, "pXSprite->target >= 0 && pXSprite->target < kMaxSprites"); return; } spritetype *pTarget = &sprite[pXSprite->target]; diff --git a/source/blood/src/aiunicult.cpp b/source/blood/src/aiunicult.cpp index 581ee487e..eacf8df42 100644 --- a/source/blood/src/aiunicult.cpp +++ b/source/blood/src/aiunicult.cpp @@ -210,14 +210,14 @@ static void punchCallback(int, int nXIndex) { static void genDudeAttack1(int, int nXIndex) { if (!(nXIndex >= 0 && nXIndex < kMaxXSprites)) { - consoleSysMsg("nXIndex >= 0 && nXIndex < kMaxXSprites"); + Printf(PRINT_HIGH, "nXIndex >= 0 && nXIndex < kMaxXSprites"); return; } XSPRITE* pXSprite = &xsprite[nXIndex]; int nSprite = pXSprite->reference; if (pXSprite->target < 0) return; else if (!(nSprite >= 0 && nSprite < kMaxSprites)) { - consoleSysMsg("nIndex >= 0 && nIndex < kMaxSprites"); + Printf(PRINT_HIGH, "nIndex >= 0 && nIndex < kMaxSprites"); return; } @@ -398,7 +398,7 @@ static void unicultThinkSearch( spritetype* pSprite, XSPRITE* pXSprite ) { static void unicultThinkGoto(spritetype* pSprite, XSPRITE* pXSprite) { if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } @@ -1025,7 +1025,7 @@ void aiGenDudeMoveForward(spritetype* pSprite, XSPRITE* pXSprite ) { void aiGenDudeChooseDirection(spritetype* pSprite, XSPRITE* pXSprite, int a3, int xvel, int yvel) { if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) { - consoleSysMsg("pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); + Printf(PRINT_HIGH, "pSprite->type >= kDudeBase && pSprite->type < kDudeMax"); return; } @@ -1061,7 +1061,7 @@ void aiGenDudeChooseDirection(spritetype* pSprite, XSPRITE* pXSprite, int a3, in void aiGenDudeNewState(spritetype* pSprite, AISTATE* pAIState) { if (!xspriRangeIsFine(pSprite->extra)) { - consoleSysMsg("!xspriRangeIsFine(pSprite->extra)"); + Printf(PRINT_HIGH, "!xspriRangeIsFine(pSprite->extra)"); return; } @@ -1693,7 +1693,7 @@ spritetype* genDudeSpawn(spritetype* pSprite, int nDist) { void genDudeTransform(spritetype* pSprite) { if (!(pSprite->extra >= 0 && pSprite->extra < kMaxXSprites)) { - consoleSysMsg("pSprite->extra >= 0 && pSprite->extra < kMaxXSprites"); + Printf(PRINT_HIGH, "pSprite->extra >= 0 && pSprite->extra < kMaxXSprites"); return; } @@ -1810,7 +1810,7 @@ void genDudeTransform(spritetype* pSprite) { void updateTargetOfLeech(spritetype* pSprite) { if (!(pSprite->extra >= 0 && pSprite->extra < kMaxXSprites)) { - consoleSysMsg("pSprite->extra >= 0 && pSprite->extra < kMaxXSprites"); + Printf(PRINT_HIGH, "pSprite->extra >= 0 && pSprite->extra < kMaxXSprites"); return; } @@ -1831,7 +1831,7 @@ void updateTargetOfLeech(spritetype* pSprite) { void updateTargetOfSlaves(spritetype* pSprite) { if (!xspriRangeIsFine(pSprite->extra)) { - consoleSysMsg("!xspriRangeIsFine(pSprite->extra)"); + Printf(PRINT_HIGH, "!xspriRangeIsFine(pSprite->extra)"); return; } @@ -1938,13 +1938,13 @@ int genDudeSeqStartId(XSPRITE* pXSprite) { bool genDudePrepare(spritetype* pSprite, int propId) { if (!spriRangeIsFine(pSprite->index)) { - consoleSysMsg("!spriRangeIsFine(pSprite->index)"); + Printf(PRINT_HIGH, "!spriRangeIsFine(pSprite->index)"); return false; } else if (!xspriRangeIsFine(pSprite->extra)) { - consoleSysMsg("!xspriRangeIsFine(pSprite->extra)"); + Printf(PRINT_HIGH, "!xspriRangeIsFine(pSprite->extra)"); return false; } else if (pSprite->type != kDudeModernCustom) { - consoleSysMsg("pSprite->type != kDudeModernCustom"); + Printf(PRINT_HIGH, "pSprite->type != kDudeModernCustom"); return false; } else if (propId < kGenDudePropertyAll || propId >= kGenDudePropertyMax) { viewSetSystemMessage("Unknown custom dude #%d property (%d)", pSprite->index, propId); diff --git a/source/blood/src/aizomba.cpp b/source/blood/src/aizomba.cpp index afa91d695..11e51f696 100644 --- a/source/blood/src/aizomba.cpp +++ b/source/blood/src/aizomba.cpp @@ -111,7 +111,7 @@ static void zombaThinkSearch(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); int dx = pXSprite->targetX-pSprite->x; int dy = pXSprite->targetY-pSprite->y; @@ -130,9 +130,9 @@ static void zombaThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &zombieASearch); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; @@ -180,9 +180,9 @@ static void zombaThinkPonder(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &zombieASearch); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; @@ -226,7 +226,7 @@ static void zombaThinkPonder(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); for (int p = connecthead; p >= 0; p = connectpoint2[p]) { diff --git a/source/blood/src/aizombf.cpp b/source/blood/src/aizombf.cpp index 0f28cf877..380660619 100644 --- a/source/blood/src/aizombf.cpp +++ b/source/blood/src/aizombf.cpp @@ -118,7 +118,7 @@ static void zombfThinkSearch(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); int dx = pXSprite->targetX-pSprite->x; int dy = pXSprite->targetY-pSprite->y; @@ -137,9 +137,9 @@ static void zombfThinkChase(spritetype *pSprite, XSPRITE *pXSprite) aiNewState(pSprite, pXSprite, &zombieFGoto); return; } - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type); - dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); + assert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites); spritetype *pTarget = &sprite[pXSprite->target]; XSPRITE *pXTarget = &xsprite[pTarget->extra]; int dx = pTarget->x-pSprite->x; diff --git a/source/blood/src/animatesprite.cpp b/source/blood/src/animatesprite.cpp index aeba8e6d9..90d0c94da 100644 --- a/source/blood/src/animatesprite.cpp +++ b/source/blood/src/animatesprite.cpp @@ -133,7 +133,7 @@ static const WEAPONICON gWeaponIcon[] = { static tspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect) { - dassert(nViewEffect >= 0 && nViewEffect < kViewEffectMax); + assert(nViewEffect >= 0 && nViewEffect < kViewEffectMax); auto pTSprite = &tsprite[nTSprite]; if (gDetail < effectDetail[nViewEffect] || nTSprite >= maxspritesonscreen) return NULL; switch (nViewEffect) @@ -239,7 +239,7 @@ static tspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect) int y = mulscale30(nLen, Sin(nAng)); pNSprite->y = pTSprite->y + y; pNSprite->z = pTSprite->z; - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); FindSector(pNSprite->x, pNSprite->y, pNSprite->z, &nSector); pNSprite->sectnum = nSector; pNSprite->owner = pTSprite->owner; @@ -395,7 +395,7 @@ static tspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect) } case VIEW_EFFECT_12: { - dassert(pTSprite->type >= kDudePlayer1 && pTSprite->type <= kDudePlayer8); + assert(pTSprite->type >= kDudePlayer1 && pTSprite->type <= kDudePlayer8); PLAYER *pPlayer = &gPlayer[pTSprite->type-kDudePlayer1]; WEAPONICON weaponIcon = gWeaponIcon[pPlayer->curWeapon]; 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. int myclock = (gFrameClock<<3) + mulscale16(4<<3, smoothratio); - dassert(spritesortcnt <= maxspritesonscreen); + assert(spritesortcnt <= maxspritesonscreen); gCameraAng = cA; int nViewSprites = spritesortcnt; 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; switch (picanm[nTile].extra & 7) { case 0: - //dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + //assert(nXSprite > 0 && nXSprite < kMaxXSprites); if (nXSprite <= 0 || nXSprite >= kMaxXSprites) break; switch (pTSprite->type) { 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); if ((pTSprite->flags&kHitagRespawn) && sprite[pTSprite->owner].owner == 3) { - dassert(pTXSprite != NULL); + assert(pTXSprite != NULL); pTSprite->xrepeat = 48; pTSprite->yrepeat = 48; 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 kMissileFlareAlt: if (pTSprite->statnum == kStatFlare) { - dassert(pTXSprite != NULL); + assert(pTXSprite != NULL); if (pTXSprite->target == gView->nSprite) { pTSprite->xrepeat = 0; 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) { spritetype *pTTarget = &sprite[pTXSprite->target]; - dassert(pTXSprite != NULL && pTTarget != NULL); + assert(pTXSprite != NULL && pTTarget != NULL); if (IsPlayerSprite(pTTarget)) { pTSprite->xrepeat = 0; diff --git a/source/blood/src/barf.cpp b/source/blood/src/barf.cpp index 83fedeb80..b2cd86fb9 100644 --- a/source/blood/src/barf.cpp +++ b/source/blood/src/barf.cpp @@ -131,7 +131,7 @@ void SortTags() void AddCmdDefine(char *text, int value) { - dassert(nCmdDefines < kMaxCmdLineDefines); + assert(nCmdDefines < kMaxCmdLineDefines); gCmdDefines[nCmdDefines]._text = text; gCmdDefines[nCmdDefines]._value = value; @@ -696,7 +696,7 @@ void ParseScript(int lumpnum) // loc_11FC3: gParseLevel++; - dassert(gParseLevel < kMaxParseLevels); + assert(gParseLevel < kMaxParseLevels); if (bGotDefine) { dword_44CE0[gParseLevel] = dword_44CE0[gParseLevel - 1]; diff --git a/source/blood/src/callback.cpp b/source/blood/src/callback.cpp index 1e32bedc4..49fb15e8b 100644 --- a/source/blood/src/callback.cpp +++ b/source/blood/src/callback.cpp @@ -88,7 +88,7 @@ void Remove(int nSprite) // 1 void FlareBurst(int nSprite) // 2 { - dassert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSprite >= 0 && nSprite < kMaxSprites); spritetype *pSprite = &sprite[nSprite]; int nAngle = getangle(xvel[nSprite], yvel[nSprite]); int nRadius = 0x55555; @@ -147,10 +147,10 @@ void fxFlareSparkLite(int nSprite) // 4 void fxZombieBloodSpurt(int nSprite) // 5 { - dassert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSprite >= 0 && nSprite < kMaxSprites); spritetype *pSprite = &sprite[nSprite]; int nXSprite = pSprite->extra; - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); XSPRITE *pXSprite = &xsprite[nXSprite]; int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); @@ -226,7 +226,7 @@ void fxDynPuff(int nSprite) // 8 void Respawn(int nSprite) // 9 { spritetype *pSprite = &sprite[nSprite]; - dassert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites); + assert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites); XSPRITE *pXSprite = &xsprite[pSprite->extra]; if (pSprite->statnum != kStatRespawn && pSprite->statnum != kStatThing) { @@ -251,8 +251,8 @@ void Respawn(int nSprite) // 9 break; } case 3: { - dassert(pSprite->owner != kStatRespawn); - dassert(pSprite->owner >= 0 && pSprite->owner < kMaxStatus); + assert(pSprite->owner != kStatRespawn); + assert(pSprite->owner >= 0 && pSprite->owner < kMaxStatus); ChangeSpriteStat(nSprite, pSprite->owner); pSprite->type = pSprite->inittype; pSprite->owner = -1; @@ -306,7 +306,7 @@ void PlayerBubble(int nSprite) // 10 if (IsPlayerSprite(pSprite)) { PLAYER *pPlayer = &gPlayer[pSprite->type-kDudePlayer1]; - dassert(pPlayer != NULL); + assert(pPlayer != NULL); if (!pPlayer->bubbleTime) return; int top, bottom; @@ -355,7 +355,7 @@ void EnemyBubble(int nSprite) // 11 void CounterCheck(int nSector) // 12 { - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); if (sector[nSector].type != kSectorCounter) return; if (sector[nSector].extra <= 0) return; @@ -403,7 +403,7 @@ void fxBloodBits(int nSprite) // 14 if (pSprite->ang == 1024) { int nChannel = 28+(pSprite->index&2); - dassert(nChannel < 32); + assert(nChannel < 32); sfxPlay3DSound(pSprite, 385, nChannel, 1); } if (Chance(0x5000)) @@ -452,7 +452,7 @@ void fxBouncingSleeve(int nSprite) // 16 } int nChannel = 28 + (pSprite->index & 2); - dassert(nChannel < 32); + assert(nChannel < 32); // tommy sleeve if (pSprite->type >= 37 && pSprite->type <= 39) { @@ -549,7 +549,7 @@ void fxPodBloodSplat(int nSprite) // 19 if (pSprite->ang == 1024) { int nChannel = 28+(pSprite->index&2); - dassert(nChannel < 32); + assert(nChannel < 32); sfxPlay3DSound(pSprite, 385, nChannel, 1); } spritetype *pFX = NULL; diff --git a/source/blood/src/common_game.h b/source/blood/src/common_game.h index 5cc8f2d9d..fb9b4dcb0 100644 --- a/source/blood/src/common_game.h +++ b/source/blood/src/common_game.h @@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #pragma once #include "build.h" +#include #include "pragmas.h" #include "misc.h" @@ -30,17 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 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 consoleSysMsg(const char* pMessage, ...); - -#define dassert(x) assert(x) enum { @@ -462,8 +453,6 @@ enum searchpathtypes_t { SEARCHPATH_REMOVE = 1<<0, }; -extern void G_ExtInit(void); - extern void G_SetupGlobalPsky(void); @@ -758,14 +747,14 @@ public: unsigned int readUnsigned(int nBits) { unsigned int n = 0; - dassert(nBits <= 32); + assert(nBits <= 32); for (int i = 0; i < nBits; i++) n += readBit()<>= 32-nBits; diff --git a/source/blood/src/db.cpp b/source/blood/src/db.cpp index 22cfe8d87..4b2773133 100644 --- a/source/blood/src/db.cpp +++ b/source/blood/src/db.cpp @@ -66,8 +66,8 @@ void dbCrypt(char *pPtr, int nLength, int nKey) void InsertSpriteSect(int nSprite, int nSector) { - dassert(nSprite >= 0 && nSprite < kMaxSprites); - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSector >= 0 && nSector < kMaxSectors); int nOther = headspritesect[nSector]; if (nOther >= 0) { @@ -87,9 +87,9 @@ void InsertSpriteSect(int nSprite, int nSector) void RemoveSpriteSect(int nSprite) { - dassert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSprite >= 0 && nSprite < kMaxSprites); int nSector = sprite[nSprite].sectnum; - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); int nOther = nextspritesect[nSprite]; if (nOther < 0) { @@ -109,8 +109,8 @@ void RemoveSpriteSect(int nSprite) void InsertSpriteStat(int nSprite, int nStat) { - dassert(nSprite >= 0 && nSprite < kMaxSprites); - dassert(nStat >= 0 && nStat <= kMaxStatus); + assert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nStat >= 0 && nStat <= kMaxStatus); int nOther = headspritestat[nStat]; if (nOther >= 0) { @@ -131,9 +131,9 @@ void InsertSpriteStat(int nSprite, int nStat) void RemoveSpriteStat(int nSprite) { - dassert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSprite >= 0 && nSprite < kMaxSprites); int nStat = sprite[nSprite].statnum; - dassert(nStat >= 0 && nStat <= kMaxStatus); + assert(nStat >= 0 && nStat <= kMaxStatus); int nOther = nextspritestat[nSprite]; if (nOther < 0) { @@ -176,7 +176,7 @@ void qinitspritelists(void) // Replace int InsertSprite(int nSector, int nStat) { int nSprite = headspritestat[kMaxStatus]; - dassert(nSprite < kMaxSprites); + assert(nSprite < kMaxSprites); if (nSprite < 0) { return nSprite; @@ -210,9 +210,9 @@ int DeleteSprite(int nSprite) { dbDeleteXSprite(sprite[nSprite].extra); } - dassert(sprite[nSprite].statnum >= 0 && sprite[nSprite].statnum < kMaxStatus); + assert(sprite[nSprite].statnum >= 0 && sprite[nSprite].statnum < kMaxStatus); RemoveSpriteStat(nSprite); - dassert(sprite[nSprite].sectnum >= 0 && sprite[nSprite].sectnum < kMaxSectors); + assert(sprite[nSprite].sectnum >= 0 && sprite[nSprite].sectnum < kMaxSectors); RemoveSpriteSect(nSprite); InsertSpriteStat(nSprite, kMaxStatus); @@ -228,9 +228,9 @@ int qdeletesprite(short nSprite) // Replace int ChangeSpriteSect(int nSprite, int nSector) { - dassert(nSprite >= 0 && nSprite < kMaxSprites); - dassert(nSector >= 0 && nSector < kMaxSectors); - dassert(sprite[nSprite].sectnum >= 0 && sprite[nSprite].sectnum < kMaxSectors); + assert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSector >= 0 && nSector < kMaxSectors); + assert(sprite[nSprite].sectnum >= 0 && sprite[nSprite].sectnum < kMaxSectors); RemoveSpriteSect(nSprite); InsertSpriteSect(nSprite, nSector); return 0; @@ -243,10 +243,10 @@ int qchangespritesect(short nSprite, short nSector) int ChangeSpriteStat(int nSprite, int nStatus) { - dassert(nSprite >= 0 && nSprite < kMaxSprites); - dassert(nStatus >= 0 && nStatus < kMaxStatus); - dassert(sprite[nSprite].statnum >= 0 && sprite[nSprite].statnum < kMaxStatus); - dassert(sprite[nSprite].sectnum >= 0 && sprite[nSprite].sectnum < kMaxSectors); + assert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nStatus >= 0 && nStatus < kMaxStatus); + assert(sprite[nSprite].statnum >= 0 && sprite[nSprite].statnum < kMaxStatus); + assert(sprite[nSprite].sectnum >= 0 && sprite[nSprite].sectnum < kMaxSectors); RemoveSpriteStat(nSprite); InsertSpriteStat(nSprite, nStatus); return 0; @@ -293,8 +293,8 @@ unsigned short dbInsertXSprite(int nSprite) void dbDeleteXSprite(int nXSprite) { - dassert(xsprite[nXSprite].reference >= 0); - dassert(sprite[xsprite[nXSprite].reference].extra == nXSprite); + assert(xsprite[nXSprite].reference >= 0); + assert(sprite[xsprite[nXSprite].reference].extra == nXSprite); InsertFree(nextXSprite, nXSprite); sprite[xsprite[nXSprite].reference].extra = -1; xsprite[nXSprite].reference = -1; @@ -316,7 +316,7 @@ unsigned short dbInsertXWall(int nWall) void dbDeleteXWall(int nXWall) { - dassert(xwall[nXWall].reference >= 0); + assert(xwall[nXWall].reference >= 0); InsertFree(nextXWall, nXWall); wall[xwall[nXWall].reference].extra = -1; xwall[nXWall].reference = -1; @@ -338,7 +338,7 @@ unsigned short dbInsertXSector(int nSector) void dbDeleteXSector(int nXSector) { - dassert(xsector[nXSector].reference >= 0); + assert(xsector[nXSector].reference >= 0); InsertFree(nextXSector, nXSector); sector[xsector[nXSector].reference].extra = -1; xsector[nXSector].reference = -1; @@ -355,7 +355,7 @@ void dbXSpriteClean(void) } if (sprite[i].statnum < kMaxStatus && nXSprite > 0) { - dassert(nXSprite < kMaxXSprites); + assert(nXSprite < kMaxXSprites); if (xsprite[nXSprite].reference != i) { int nXSprite2 = dbInsertXSprite(i); @@ -369,7 +369,7 @@ void dbXSpriteClean(void) int nSprite = xsprite[i].reference; if (nSprite >= 0) { - dassert(nSprite < kMaxSprites); + assert(nSprite < kMaxSprites); if (sprite[nSprite].statnum >= kMaxStatus || sprite[nSprite].extra != i) { InsertFree(nextXSprite, i); @@ -390,7 +390,7 @@ void dbXWallClean(void) } if (nXWall > 0) { - dassert(nXWall < kMaxXWalls); + assert(nXWall < kMaxXWalls); if (xwall[nXWall].reference == -1) { wall[i].extra = -1; @@ -406,7 +406,7 @@ void dbXWallClean(void) int nXWall = wall[i].extra; if (nXWall > 0) { - dassert(nXWall < kMaxXWalls); + assert(nXWall < kMaxXWalls); if (xwall[nXWall].reference != i) { int nXWall2 = dbInsertXWall(i); @@ -420,7 +420,7 @@ void dbXWallClean(void) int nWall = xwall[i].reference; if (nWall >= 0) { - dassert(nWall < kMaxWalls); + assert(nWall < kMaxWalls); if (nWall >= numwalls || wall[nWall].extra != i) { InsertFree(nextXWall, i); @@ -443,7 +443,7 @@ void dbXSectorClean(void) } if (nXSector > 0) { - dassert(nXSector < kMaxXSectors); + assert(nXSector < kMaxXSectors); if (xsector[nXSector].reference == -1) { sector[i].extra = -1; @@ -459,7 +459,7 @@ void dbXSectorClean(void) int nXSector = sector[i].extra; if (nXSector > 0) { - dassert(nXSector < kMaxXSectors); + assert(nXSector < kMaxXSectors); if (xsector[nXSector].reference != i) { int nXSector2 = dbInsertXSector(i); @@ -473,7 +473,7 @@ void dbXSectorClean(void) int nSector = xsector[i].reference; if (nSector >= 0) { - dassert(nSector < kMaxSectors); + assert(nSector < kMaxSectors); if (nSector >= numsectors || sector[nSector].extra != 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; } - dassert(nCount <= nXSectorSize); + assert(nCount <= nXSectorSize); fr.Read(pBuffer, nCount); BitReader bitReader(pBuffer, nCount); 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; } - dassert(nCount <= nXWallSize); + assert(nCount <= nXWallSize); fr.Read(pBuffer, nCount); BitReader bitReader(pBuffer, nCount); 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; } - dassert(nCount <= nXSpriteSize); + assert(nCount <= nXSpriteSize); fr.Read(pBuffer, nCount); BitReader bitReader(pBuffer, nCount); pXSprite->reference = bitReader.readSigned(14); diff --git a/source/blood/src/eventq.cpp b/source/blood/src/eventq.cpp index 2d816d84a..086a565ad 100644 --- a/source/blood/src/eventq.cpp +++ b/source/blood/src/eventq.cpp @@ -86,19 +86,19 @@ int GetBucketChannel(const RXBUCKET *pRX) case 6: { int nIndex = pRX->index; int nXIndex = sector[nIndex].extra; - dassert(nXIndex > 0); + assert(nXIndex > 0); return xsector[nXIndex].rxID; } case 0: { int nIndex = pRX->index; int nXIndex = wall[nIndex].extra; - dassert(nXIndex > 0); + assert(nXIndex > 0); return xwall[nXIndex].rxID; } case 3: { int nIndex = pRX->index; int nXIndex = sprite[nIndex].extra; - dassert(nXIndex > 0); + assert(nXIndex > 0); return xsprite[nXIndex].rxID; } } @@ -280,7 +280,7 @@ void evInit(void) I_Error("Invalid xsector reference in sector %d", i); if (nXSector > 0 && xsector[nXSector].rxID > 0) { - dassert(nCount < kChannelMax); + assert(nCount < kChannelMax); rxBucket[nCount].type = 6; rxBucket[nCount].index = i; nCount++; @@ -293,7 +293,7 @@ void evInit(void) I_Error("Invalid xwall reference in wall %d", i); if (nXWall > 0 && xwall[nXWall].rxID > 0) { - dassert(nCount < kChannelMax); + assert(nCount < kChannelMax); rxBucket[nCount].type = 0; rxBucket[nCount].index = i; nCount++; @@ -308,7 +308,7 @@ void evInit(void) I_Error("Invalid xsprite reference in sprite %d", i); if (nXSprite > 0 && xsprite[nXSprite].rxID > 0) { - dassert(nCount < kChannelMax); + assert(nCount < kChannelMax); rxBucket[nCount].type = 3; rxBucket[nCount].index = i; nCount++; @@ -333,19 +333,19 @@ char evGetSourceState(int nType, int nIndex) case 6: { int nXIndex = sector[nIndex].extra; - dassert(nXIndex > 0 && nXIndex < kMaxXSectors); + assert(nXIndex > 0 && nXIndex < kMaxXSectors); return xsector[nXIndex].state; } case 0: { int nXIndex = wall[nIndex].extra; - dassert(nXIndex > 0 && nXIndex < kMaxXWalls); + assert(nXIndex > 0 && nXIndex < kMaxXWalls); return xwall[nXIndex].state; } case 3: { int nXIndex = sprite[nIndex].extra; - dassert(nXIndex > 0 && nXIndex < kMaxXSprites); + assert(nXIndex > 0 && nXIndex < kMaxXSprites); 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) { - dassert(command != kCmdCallback); + assert(command != kCmdCallback); if (command == kCmdState) command = evGetSourceState(nType, nIndex) ? kCmdOn : kCmdOff; else if (command == kCmdNotState) command = evGetSourceState(nType, nIndex) ? kCmdOff : kCmdOn; EVENT evn = {}; @@ -524,8 +524,8 @@ void evProcess(unsigned int nTime) EVENT event = eventQ.ERemove(); if (event.cmd == kCmdCallback) { - dassert(event.funcID < kCallbackMax); - dassert(gCallback[event.funcID] != NULL); + assert(event.funcID < kCallbackMax); + assert(gCallback[event.funcID] != NULL); gCallback[event.funcID](event.index); } else @@ -600,7 +600,7 @@ void EventQLoadSave::Save() Write(&eventstime[i], sizeof(eventstime[i])); Write(&events[i], sizeof(events[i])); } - dassert(eventQ.PQueue->Size() == 0); + assert(eventQ.PQueue->Size() == 0); for (int i = 0; i < nEvents; i++) { eventQ.PQueue->Insert(eventstime[i], events[i]); diff --git a/source/blood/src/fx.cpp b/source/blood/src/fx.cpp index 0f044e298..00220fe09 100644 --- a/source/blood/src/fx.cpp +++ b/source/blood/src/fx.cpp @@ -209,8 +209,8 @@ void CFX::fxProcess(void) spritetype *pSprite = &sprite[nSprite]; viewBackupSpriteLoc(nSprite, pSprite); short nSector = pSprite->sectnum; - dassert(nSector >= 0 && nSector < kMaxSectors); - dassert(pSprite->type < kFXMax); + assert(nSector >= 0 && nSector < kMaxSectors); + assert(pSprite->type < kFXMax); FXDATA *pFXData = &gFXData[pSprite->type]; actAirDrag(pSprite, pFXData->ata); if (xvel[nSprite]) @@ -235,13 +235,13 @@ void CFX::fxProcess(void) sub_73FFC(nSprite); continue; } - dassert(gCallback[pFXData->funcID] != NULL); + assert(gCallback[pFXData->funcID] != NULL); gCallback[pFXData->funcID](nSprite); continue; } if (nSector != pSprite->sectnum) { - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); ChangeSpriteSect(nSprite, nSector); } } @@ -261,7 +261,7 @@ void CFX::fxProcess(void) sub_73FFC(nSprite); continue; } - dassert(gCallback[pFXData->funcID] != NULL); + assert(gCallback[pFXData->funcID] != NULL); gCallback[pFXData->funcID](nSprite); continue; } diff --git a/source/blood/src/gameutil.cpp b/source/blood/src/gameutil.cpp index b80068090..2500ebcd8 100644 --- a/source/blood/src/gameutil.cpp +++ b/source/blood/src/gameutil.cpp @@ -49,8 +49,8 @@ HITINFO gHitInfo; bool AreSectorsNeighbors(int sect1, int sect2) { - dassert(sect1 >= 0 && sect1 < kMaxSectors); - dassert(sect2 >= 0 && sect2 < kMaxSectors); + assert(sect1 >= 0 && sect1 < kMaxSectors); + assert(sect2 >= 0 && sect2 < kMaxSectors); if (sector[sect1].wallnum < sector[sect2].wallnum) { 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) { int32_t nZFloor, nZCeil; - dassert(*nSector >= 0 && *nSector < kMaxSectors); + assert(*nSector >= 0 && *nSector < kMaxSectors); if (inside(nX, nY, *nSector)) { 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) { - dassert(*nSector >= 0 && *nSector < kMaxSectors); + assert(*nSector >= 0 && *nSector < kMaxSectors); if (inside(nX, nY, *nSector)) { 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) { - dassert(pSprite != NULL); + assert(pSprite != NULL); int oX = klabs(nX-pSprite->x)>>4; if (oX >= nDist) return 0; @@ -327,7 +327,7 @@ int GetWallAngle(int nWall) void GetWallNormal(int nWall, int *pX, int *pY) { - dassert(nWall >= 0 && nWall < kMaxWalls); + assert(nWall >= 0 && nWall < kMaxWalls); int nWall2 = wall[nWall].point2; int dX = -(wall[nWall2].y - wall[nWall].y); 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) { - dassert(pSprite != NULL); - dassert(dx != 0 || dy != 0); + assert(pSprite != NULL); + assert(dx != 0 || dy != 0); gHitInfo.hitsect = -1; gHitInfo.hitwall = -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 nNum = 256; - dassert(pSprite != NULL); + assert(pSprite != NULL); gHitInfo.hitsect = -1; gHitInfo.hitwall = -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); if (nOffset) otherZ -= (nOffset*pOther->yrepeat)<<2; - dassert(height > 0); + assert(height > 0); int height2 = scale(otherZ-gHitInfo.hitz, tileHeight(nPicnum), height); if (!(pOther->cstat & 8)) 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; width = (width*3)/4; 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 nOffset = tileLeftOffset(nPicnum); 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) { - dassert(pSprite != NULL); + assert(pSprite != NULL); int bakCstat = pSprite->cstat; int32_t nTemp1, nTemp2; 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) { char sectbits[(kMaxSectors+7)>>3]; - dassert(pSectors != NULL); + assert(pSectors != NULL); memset(sectbits, 0, sizeof(sectbits)); pSectors[0] = 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) { char sectbits[(kMaxSectors+7)>>3]; - dassert(pSectors != NULL); + assert(pSectors != NULL); memset(sectbits, 0, sizeof(sectbits)); pSectors[0] = nSector; SetBitString(sectbits, nSector); diff --git a/source/blood/src/gib.cpp b/source/blood/src/gib.cpp index 0119dd853..58b0e0a83 100644 --- a/source/blood/src/gib.cpp +++ b/source/blood/src/gib.cpp @@ -392,7 +392,7 @@ void GibThing(spritetype *pSprite, GIBTHING *pGThing, CGibPosition *pPos, CGibVe int dz1 = floorZ-z; int dz2 = z-ceilZ; spritetype *pGib = actSpawnThing(nSector, x, y, z, pGThing->TotalKills); - dassert(pGib != NULL); + assert(pGib != NULL); if (pGThing->Kills > -1) pGib->picnum = pGThing->Kills; 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) { - dassert(pSprite != NULL); - dassert(nGibType >= 0 && nGibType < kGibMax); + assert(pSprite != NULL); + assert(nGibType >= 0 && nGibType < kGibMax); if (pSprite->sectnum < 0 || pSprite->sectnum >= numsectors) return; GIBLIST *pGib = &gibList[nGibType]; for (int i = 0; i < pGib->Kills; i++) { GIBFX *pGibFX = &pGib->TotalKills[i]; - dassert(pGibFX->chance > 0); + assert(pGibFX->chance > 0); GibFX(pSprite, pGibFX, pPos, pVel); } for (int i = 0; i < pGib->atc; i++) { GIBTHING *pGibThing = &pGib->at8[i]; - dassert(pGibThing->chance > 0); + assert(pGibThing->chance > 0); GibThing(pSprite, pGibThing, pPos, 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]; int nCount = ChanceToCount(pGFX->chance, pGFX->at9); 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) { - dassert(nWall >= 0 && nWall < numwalls); - dassert(nGibType >= 0 && nGibType < kGibMax); + assert(nWall >= 0 && nWall < numwalls); + assert(nGibType >= 0 && nGibType < kGibMax); int cx, cy, cz, wx, wy, wz; walltype *pWall = &wall[nWall]; 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++) { GIBFX *pGibFX = &pGib->TotalKills[i]; - dassert(pGibFX->chance > 0); + assert(pGibFX->chance > 0); GibFX(nWall, pGibFX, ceilZ, wx, wy, wz, pVel); } } diff --git a/source/blood/src/globals.cpp b/source/blood/src/globals.cpp index c70339b07..cb234ba7e 100644 --- a/source/blood/src/globals.cpp +++ b/source/blood/src/globals.cpp @@ -35,9 +35,6 @@ BEGIN_BLD_NS int gFrameClock; int gFrameCount; -static const char *_module; -static int _line; - int32_t gDetail = 4; bool gNoClip; bool gInfiniteAmmo; @@ -48,19 +45,4 @@ bool gFogMode = false; 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 diff --git a/source/blood/src/inifile.cpp b/source/blood/src/inifile.cpp index dfcf59857..d682040d6 100644 --- a/source/blood/src/inifile.cpp +++ b/source/blood/src/inifile.cpp @@ -122,7 +122,7 @@ void IniFile::LoadRes(void *res) } curNode->next = (FNODE*)malloc(strlen(pBuffer) + sizeof(FNODE)); - dassert(curNode->next != NULL); + assert(curNode->next != NULL); anotherNode = curNode; curNode = curNode->next; @@ -184,7 +184,7 @@ void IniFile::Save(void) { char buffer[256]; FILE *hFile = fopen(fileName, "w"); - dassert(hFile != NULL); + assert(hFile != NULL); curNode = head.next; while (curNode != &head) { @@ -238,7 +238,7 @@ bool IniFile::FindKey(const char *key) char *pEqual = strchr(curNode->name, '='); char *pEqualStart = pEqual; - dassert(pEqual != NULL); + assert(pEqual != NULL); // remove whitespace while (isspace(*(pEqual - 1))) { @@ -274,7 +274,7 @@ void IniFile::AddSection(const char *section) if (anotherNode != &head) { FNODE *newNode = (FNODE*)malloc(sizeof(FNODE)); - dassert(newNode != NULL); + assert(newNode != NULL); newNode->name[0] = 0; newNode->next = anotherNode->next; @@ -284,7 +284,7 @@ void IniFile::AddSection(const char *section) sprintf(buffer, "[%s]", section); FNODE *newNode = (FNODE*)malloc(strlen(buffer) + sizeof(FNODE)); - dassert(newNode != NULL); + assert(newNode != NULL); strcpy(newNode->name, buffer); @@ -300,7 +300,7 @@ void IniFile::AddKeyString(const char *key, const char *value) sprintf(buffer, "%s=%s", key, value); FNODE *newNode = (FNODE*)malloc(strlen(buffer) + sizeof(FNODE)); - dassert(newNode != NULL); + assert(newNode != NULL); strcpy(newNode->name, buffer); @@ -316,7 +316,7 @@ void IniFile::ChangeKeyString(const char *key, const char *value) sprintf(buffer, "%s=%s", key, value); FNODE *newNode = (FNODE*)realloc(curNode, strlen(buffer) + sizeof(FNODE)); - dassert(newNode != NULL); + assert(newNode != NULL); strcpy(newNode->name, buffer); diff --git a/source/blood/src/levels.cpp b/source/blood/src/levels.cpp index 8500f4de9..93e8c71cd 100644 --- a/source/blood/src/levels.cpp +++ b/source/blood/src/levels.cpp @@ -97,7 +97,7 @@ void CheckSectionAbend(const char *pzSection) void CheckKeyAbend(const char *pzSection, const char *pzKey) { - dassert(pzSection != NULL); + assert(pzSection != NULL); if (!pzKey || !BloodINI->KeyExists(pzSection, pzKey)) 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) { - dassert(pnEndingA != NULL && pnEndingB != NULL); + assert(pnEndingA != NULL && pnEndingB != NULL); int nEndingA = currentLevel->nextLevel; if (nEndingA >= 0) nEndingA--; diff --git a/source/blood/src/loadsave.cpp b/source/blood/src/loadsave.cpp index 8b1384526..dba177efb 100644 --- a/source/blood/src/loadsave.cpp +++ b/source/blood/src/loadsave.cpp @@ -460,7 +460,7 @@ void LoadSave::Load(void) void LoadSave::Read(void *pData, int nSize) { dword_27AA38 += nSize; - dassert(hLFile.isOpen()); + assert(hLFile.isOpen()); if (hLFile.Read(pData, nSize) != nSize) I_Error("Error reading save file."); } @@ -469,7 +469,7 @@ void LoadSave::Write(void *pData, int nSize) { dword_27AA38 += nSize; dword_27AA3C += nSize; - dassert(hSFile != NULL); + assert(hSFile != NULL); if (hSFile->Write(pData, nSize) != (size_t)nSize) I_Error("File error #%d writing save file.", errno); } @@ -573,12 +573,6 @@ void MyLoadSave::Load(void) psky_t *pSky = tileSetupSky(DEFAULTPSKY); int 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)); int nNumSprites; @@ -659,8 +653,6 @@ void MyLoadSave::Save(void) int nNumSprites = 0; int id = 0x5653424e/*'VSBN'*/; Write(&id, sizeof(id)); - short version = BYTEVERSION; - Write(&version, sizeof(version)); for (int nSprite = 0; nSprite < kMaxSprites; nSprite++) { if (sprite[nSprite].statnum < kMaxStatus && nSprite > nNumSprites) diff --git a/source/blood/src/nnexts.cpp b/source/blood/src/nnexts.cpp index 12767b9bc..ff8be0fe4 100644 --- a/source/blood/src/nnexts.cpp +++ b/source/blood/src/nnexts.cpp @@ -293,7 +293,7 @@ void nnExtInitModernStuff(bool bSaveLoad) { if (bSaveLoad) break; else if (!pXSprite->rxID) condError(pXSprite,"\nThe condition must have RX ID!\nSPRITE #%d", pSprite->index); 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; } @@ -440,7 +440,7 @@ void nnExtInitModernStuff(bool bSaveLoad) { if (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; @@ -633,7 +633,7 @@ void nnExtInitModernStuff(bool bSaveLoad) { } 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->xindex = pSprite->extra; @@ -653,7 +653,7 @@ int nnExtRandom(int a, int b) { } int GetDataVal(spritetype* pSprite, int data) { - dassert(xspriRangeIsFine(pSprite->extra)); + assert(xspriRangeIsFine(pSprite->extra)); switch (data) { case 0: return xsprite[pSprite->extra].data1; @@ -1095,10 +1095,10 @@ void debrisMove(int listIndex) { pSprite->cstat = oldcstat; - dassert(nSector >= 0); + assert(nSector >= 0); if (pSprite->sectnum != nSector) { - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); ChangeSpriteSect(nSprite, nSector); } @@ -1108,7 +1108,7 @@ void debrisMove(int listIndex) { } } else { - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); 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 2: // give just N ammo for selected weapon 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; } 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; } switch (weapon) { @@ -2299,7 +2299,7 @@ void useSpriteDamager(XSPRITE* pXSource, spritetype* pSprite) { if (dmgType >= kDmgFall) { if (dmg < pXSprite->health << 4) { 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; } @@ -2329,7 +2329,7 @@ void useSpriteDamager(XSPRITE* pXSource, spritetype* pSprite) { void useSeqSpawnerGen(XSPRITE* pXSource, int objType, int index) { if (pXSource->data2 > 0 && !getSequence(pXSource->data2)) { - consoleSysMsg("Missing sequence #%d", pXSource->data2); + Printf(PRINT_HIGH, "Missing sequence #%d", pXSource->data2); return; } @@ -4330,7 +4330,7 @@ void useIncDecGen(XSPRITE* pXSource, short objType, int objIndex) { for (int i = 0; i < len; i++) { dataIndex = (buffer[i] - 52) + 4; 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; } spritetype* pSource = &sprite[pXSource->reference]; @@ -5187,7 +5187,7 @@ void levelEndLevelCustom(int nLevel) { void callbackUniMissileBurst(int nSprite) // 22 { - dassert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSprite >= 0 && nSprite < kMaxSprites); if (sprite[nSprite].statnum != kStatProjectile) return; spritetype* pSprite = &sprite[nSprite]; int nAngle = getangle(xvel[nSprite], yvel[nSprite]); @@ -5238,7 +5238,7 @@ void callbackUniMissileBurst(int nSprite) // 22 void callbackMakeMissileBlocking(int nSprite) // 23 { - dassert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSprite >= 0 && nSprite < kMaxSprites); if (sprite[nSprite].statnum != kStatProjectile) return; sprite[nSprite].cstat |= CSTAT_SPRITE_BLOCK; } diff --git a/source/blood/src/player.cpp b/source/blood/src/player.cpp index ced466df9..cbb6c9115 100644 --- a/source/blood/src/player.cpp +++ b/source/blood/src/player.cpp @@ -250,8 +250,8 @@ DAMAGEINFO damageInfo[7] = { int powerupCheck(PLAYER *pPlayer, int nPowerUp) { - dassert(pPlayer != NULL); - dassert(nPowerUp >= 0 && nPowerUp < kMaxPowerUps); + assert(pPlayer != NULL); + assert(nPowerUp >= 0 && nPowerUp < kMaxPowerUps); int nPack = powerupToPackItem(nPowerUp); if (nPack >= 0 && !packItemActive(pPlayer, nPack)) return 0; @@ -598,7 +598,7 @@ char playerSeqPlaying(PLAYER * pPlayer, int nSeq) void playerSetRace(PLAYER *pPlayer, int nLifeMode) { - dassert(nLifeMode >= kModeHuman && nLifeMode <= kModeHumanGrown); + assert(nLifeMode >= kModeHuman && nLifeMode <= kModeHumanGrown); DUDEINFO *pDudeInfo = pPlayer->pDudeInfo; *pDudeInfo = gPlayerTemplate[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); - dassert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites); + assert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites); XSPRITE *pXSprite = &xsprite[pSprite->extra]; pPlayer->pSprite = pSprite; pPlayer->pXSprite = pXSprite; @@ -821,7 +821,7 @@ void playerReset(PLAYER *pPlayer) static int dword_136438[] = { 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++) { pPlayer->hasWeapon[i] = gInfiniteAmmo; @@ -1665,7 +1665,7 @@ void playerProcess(PLAYER *pPlayer) nSector = pSprite->sectnum; actDamageSprite(nSprite, pSprite, DAMAGE_TYPE_0, 500<<4); } - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); 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) { - 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); } void playerFrag(PLAYER *pKiller, PLAYER *pVictim) { - dassert(pKiller != NULL); - dassert(pVictim != NULL); + assert(pKiller != NULL); + assert(pVictim != NULL); char buffer[128] = ""; int nKiller = pKiller->pSprite->type-kDudePlayer1; - dassert(nKiller >= 0 && nKiller < kMaxPlayers); + assert(nKiller >= 0 && nKiller < kMaxPlayers); int nVictim = pVictim->pSprite->type-kDudePlayer1; - dassert(nVictim >= 0 && nVictim < kMaxPlayers); + assert(nVictim >= 0 && nVictim < kMaxPlayers); if (nKiller == nVictim) { 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) { - dassert(nSource < kMaxSprites); - dassert(pPlayer != NULL); + assert(nSource < kMaxSprites); + assert(pPlayer != NULL); if (pPlayer->damageControl[nDamageType]) return 0; nDamage = playerDamageArmor(pPlayer, nDamageType, nDamage); @@ -2052,7 +2052,7 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in FragPlayer(pPlayer, nSource); trTriggerSprite(nSprite, pXSprite, kCmdOff); } - dassert(getSequence(pDudeInfo->seqStartID + nDeathSeqID) != NULL); + assert(getSequence(pDudeInfo->seqStartID + nDeathSeqID) != NULL); seqSpawn(pDudeInfo->seqStartID+nDeathSeqID, 3, nXSprite, nKneelingPlayer); return nDamage; } diff --git a/source/blood/src/pqueue.h b/source/blood/src/pqueue.h index c4b149494..ea6a05dd2 100644 --- a/source/blood/src/pqueue.h +++ b/source/blood/src/pqueue.h @@ -112,13 +112,13 @@ public: } void Delete(uint32_t k) { - dassert(k <= fNodeCount); + assert(k <= fNodeCount); queueItems[k] = queueItems[fNodeCount--]; Downheap(k); } void Insert(uint32_t a1, T a2) { - dassert(fNodeCount < kPQueueSize); + assert(fNodeCount < kPQueueSize); fNodeCount++; queueItems[fNodeCount].TotalKills = a1; queueItems[fNodeCount].Kills = a2; @@ -133,7 +133,7 @@ public: } uint32_t LowestPriority(void) { - dassert(fNodeCount > 0); + assert(fNodeCount > 0); return queueItems[1].TotalKills; } void Kill(std::function pMatch) @@ -167,7 +167,7 @@ public: } T Remove(void) { - dassert(stdQueue.size() > 0); + assert(stdQueue.size() > 0); T data = stdQueue.begin()->Kills; stdQueue.erase(stdQueue.begin()); return data; diff --git a/source/blood/src/prediction.cpp b/source/blood/src/prediction.cpp index db808be38..847ed7639 100644 --- a/source/blood/src/prediction.cpp +++ b/source/blood/src/prediction.cpp @@ -367,7 +367,7 @@ static void fakeMoveDude(spritetype *pSprite) int bottom, top; if (IsPlayerSprite(pSprite)) pPlayer = &gPlayer[pSprite->type-kDudePlayer1]; - dassert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); + assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax); GetSpriteExtents(pSprite, &top, &bottom); top += 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 wd = pSprite->clipdist*4; int nSector = predict.at68; - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); if (predict.at5c || predict.at60) { if (pPlayer && gNoClip) @@ -401,7 +401,7 @@ static void fakeMoveDude(spritetype *pSprite) nSector = nSector2; } - dassert(nSector >= 0); + assert(nSector >= 0); pSprite->cstat = bakCstat; } @@ -426,7 +426,7 @@ static void fakeMoveDude(spritetype *pSprite) } if (predict.at68 != nSector) { - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); predict.at68 = nSector; } char bUnderwater = 0; @@ -578,12 +578,12 @@ static void fakeActAirDrag(spritetype *, int num) int xvec = 0; int yvec = 0; int nSector = predict.at68; - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); sectortype *pSector = §or[nSector]; int nXSector = pSector->extra; if (nXSector > 0) { - dassert(nXSector < kMaxXSectors); + assert(nXSector < kMaxXSectors); XSECTOR *pXSector = &xsector[nXSector]; if (pXSector->windVel && (pXSector->windAlways || pXSector->busy)) { @@ -605,14 +605,14 @@ void fakeActProcessSprites(void) if (pSprite->statnum == kStatDude) { int nXSprite = pSprite->extra; - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); int nSector = predict.at68; int nXSector = sector[nSector].extra; XSECTOR *pXSector = NULL; if (nXSector > 0) { - dassert(nXSector > 0 && nXSector < kMaxXSectors); - dassert(xsector[nXSector].reference == nSector); + assert(nXSector > 0 && nXSector < kMaxXSectors); + assert(xsector[nXSector].reference == nSector); pXSector = &xsector[nXSector]; } if (pXSector) diff --git a/source/blood/src/qav.cpp b/source/blood/src/qav.cpp index 3227c2e9b..a55f11da2 100644 --- a/source/blood/src/qav.cpp +++ b/source/blood/src/qav.cpp @@ -40,7 +40,7 @@ static int nQavClients; int qavRegisterClient(void(*pClient)(int, void *)) { - dassert(nQavClients < kMaxQavClients); + assert(nQavClients < kMaxQavClients); qavClientCallback[nQavClients] = pClient; 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) { - dassert(ticksPerFrame > 0); + assert(ticksPerFrame > 0); int nFrame = ticks / ticksPerFrame; - dassert(nFrame >= 0 && nFrame < nFrames); + assert(nFrame >= 0 && nFrame < nFrames); FRAMEINFO *pFrame = &frames[nFrame]; 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) { - dassert(ticksPerFrame > 0); + assert(ticksPerFrame > 0); int frame; int ticks; if (start < 0) diff --git a/source/blood/src/sbar.cpp b/source/blood/src/sbar.cpp index ff993c522..721c00b4c 100644 --- a/source/blood/src/sbar.cpp +++ b/source/blood/src/sbar.cpp @@ -509,7 +509,7 @@ private: 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)) { diff --git a/source/blood/src/sectorfx.cpp b/source/blood/src/sectorfx.cpp index f3f5523f6..5bb5a0685 100644 --- a/source/blood/src/sectorfx.cpp +++ b/source/blood/src/sectorfx.cpp @@ -121,7 +121,7 @@ void DoSectorLighting(void) int nXSector = shadeList[i]; XSECTOR *pXSector = &xsector[nXSector]; int nSector = pXSector->reference; - dassert(sector[nSector].extra == nXSector); + assert(sector[nSector].extra == nXSector); if (pXSector->shade) { int v4 = pXSector->shade; @@ -267,9 +267,9 @@ void DoSectorPanning(void) int nXSector = panList[i]; XSECTOR *pXSector = &xsector[nXSector]; int nSector = pXSector->reference; - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); sectortype *pSector = §or[nSector]; - dassert(pSector->extra == nXSector); + assert(pSector->extra == nXSector); if (pXSector->panAlways || pXSector->busy) { int angle = pXSector->panAngle+1024; @@ -316,7 +316,7 @@ void DoSectorPanning(void) int nXWall = wallPanList[i]; XWALL *pXWall = &xwall[nXWall]; int nWall = pXWall->reference; - dassert(wall[nWall].extra == nXWall); + assert(wall[nWall].extra == nXWall); if (pXWall->panAlways || pXWall->busy) { int psx = pXWall->panXVel<<10; diff --git a/source/blood/src/seq.cpp b/source/blood/src/seq.cpp index db4f9a2d5..00dc6c037 100644 --- a/source/blood/src/seq.cpp +++ b/source/blood/src/seq.cpp @@ -54,7 +54,7 @@ static void(*seqClientCallback[kMaxSeqClients])(int, int); int seqRegisterClient(void(*pClient)(int, int)) { - dassert(nSeqClients < kMaxSeqClients); + assert(nSeqClients < kMaxSeqClients); seqClientCallback[nSeqClients] = pClient; return nSeqClients++; } @@ -93,11 +93,11 @@ SEQINST siMasked[kMaxXWalls]; void UpdateSprite(int nXSprite, SEQFRAME *pFrame) { - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); int nSprite = xsprite[nXSprite].reference; - dassert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSprite >= 0 && nSprite < kMaxSprites); spritetype *pSprite = &sprite[nSprite]; - dassert(pSprite->extra == nXSprite); + assert(pSprite->extra == nXSprite); if (pSprite->flags & 2) { 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) { - dassert(nXWall > 0 && nXWall < kMaxXWalls); + assert(nXWall > 0 && nXWall < kMaxXWalls); int nWall = xwall[nXWall].reference; - dassert(nWall >= 0 && nWall < kMaxWalls); + assert(nWall >= 0 && nWall < kMaxWalls); walltype *pWall = &wall[nWall]; - dassert(pWall->extra == nXWall); + assert(pWall->extra == nXWall); pWall->picnum = seqGetTile(pFrame); if (pFrame->at5_0) pWall->pal = pFrame->at5_0; @@ -192,12 +192,12 @@ void UpdateWall(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; - dassert(nWall >= 0 && nWall < kMaxWalls); + assert(nWall >= 0 && nWall < kMaxWalls); walltype *pWall = &wall[nWall]; - dassert(pWall->extra == nXWall); - dassert(pWall->nextwall >= 0); + assert(pWall->extra == nXWall); + assert(pWall->nextwall >= 0); walltype *pWallNext = &wall[pWall->nextwall]; pWall->overpicnum = pWallNext->overpicnum = seqGetTile(pFrame); if (pFrame->at5_0) @@ -246,11 +246,11 @@ void UpdateMasked(int nXWall, SEQFRAME *pFrame) void UpdateFloor(int nXSector, SEQFRAME *pFrame) { - dassert(nXSector > 0 && nXSector < kMaxXSectors); + assert(nXSector > 0 && nXSector < kMaxXSectors); int nSector = xsector[nXSector].reference; - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); sectortype *pSector = §or[nSector]; - dassert(pSector->extra == nXSector); + assert(pSector->extra == nXSector); pSector->floorpicnum = seqGetTile(pFrame); pSector->floorshade = pFrame->at4_0; if (pFrame->at5_0) @@ -259,11 +259,11 @@ void UpdateFloor(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; - dassert(nSector >= 0 && nSector < kMaxSectors); + assert(nSector >= 0 && nSector < kMaxSectors); sectortype *pSector = §or[nSector]; - dassert(pSector->extra == nXSector); + assert(pSector->extra == nXSector); pSector->ceilingpicnum = seqGetTile(pFrame); pSector->ceilingshade = pFrame->at4_0; if (pFrame->at5_0) @@ -272,7 +272,7 @@ void UpdateCeiling(int nXSector, SEQFRAME *pFrame) void SEQINST::Update(ACTIVE *pActive) { - dassert(frameIndex < pSequence->nFrames); + assert(frameIndex < pSequence->nFrames); switch (pActive->type) { case 0: @@ -369,8 +369,8 @@ SEQINST * GetInstance(int a1, int a2) void UnlockInstance(SEQINST *pInst) { - dassert(pInst != NULL); - dassert(pInst->pSequence != NULL); + assert(pInst != NULL); + assert(pInst->pSequence != NULL); pInst->pSequence = NULL; 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) break; } - dassert(i < seqActiveCount); + assert(i < seqActiveCount); } if (memcmp(pSeq->signature, "SEQ\x1a", 4) != 0) I_Error("Invalid sequence %d", a1); @@ -414,7 +414,7 @@ void seqSpawn(int a1, int a2, int a3, int a4) pInst->frameIndex = 0; if (i == seqActiveCount) { - dassert(seqActiveCount < kMaxSequences); + assert(seqActiveCount < kMaxSequences); activeList[seqActiveCount].type = a2; activeList[seqActiveCount].xindex = a3; seqActiveCount++; @@ -433,7 +433,7 @@ void seqKill(int a1, int a2) if (activeList[i].type == a1 && activeList[i].xindex == a2) break; } - dassert(i < seqActiveCount); + assert(i < seqActiveCount); seqActiveCount--; activeList[i] = activeList[seqActiveCount]; pInst->at13 = 0; @@ -486,7 +486,7 @@ void seqProcess(int a1) { SEQINST *pInst = GetInstance(activeList[i].type, activeList[i].xindex); Seq *pSeq = pInst->pSequence; - dassert(pInst->frameIndex < pSeq->nFrames); + assert(pInst->frameIndex < pSeq->nFrames); pInst->at10 -= a1; while (pInst->at10 < 0) { @@ -507,7 +507,7 @@ void seqProcess(int a1) { int nXSprite = activeList[i].xindex; int nSprite = xsprite[nXSprite].reference; - dassert(nSprite >= 0 && nSprite < kMaxSprites); + assert(nSprite >= 0 && nSprite < kMaxSprites); evKill(nSprite, 3); if ((sprite[nSprite].flags & kHitagRespawn) && sprite[nSprite].inittype >= kDudeBase && sprite[nSprite].inittype < kDudeMax) evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, kCallbackRespawn); @@ -519,7 +519,7 @@ void seqProcess(int a1) { int nXWall = activeList[i].xindex; int nWall = xwall[nXWall].reference; - dassert(nWall >= 0 && nWall < kMaxWalls); + assert(nWall >= 0 && nWall < kMaxWalls); wall[nWall].cstat &= ~(8 + 16 + 32); if (wall[nWall].nextwall != -1) wall[wall[nWall].nextwall].cstat &= ~(8 + 16 + 32); diff --git a/source/blood/src/sound.cpp b/source/blood/src/sound.cpp index 37c6c705d..56f6282f5 100644 --- a/source/blood/src/sound.cpp +++ b/source/blood/src/sound.cpp @@ -150,7 +150,7 @@ void sndStartSample(const char *pzSound, int nVolume, int nChannel) return; if (!strlen(pzSound)) return; - dassert(nChannel >= -1 && nChannel < kChannelMax); + assert(nChannel >= -1 && nChannel < kChannelMax); auto snd = soundEngine->FindSound(pzSound); if (snd > 0) { @@ -162,7 +162,7 @@ void sndStartSample(unsigned int nSound, int nVolume, int nChannel, bool bLoop, { if (!SoundEnabled()) return; - dassert(nChannel >= -1 && nChannel < kChannelMax); + assert(nChannel >= -1 && nChannel < kChannelMax); if (nChannel >= 7) nChannel = -1; auto snd = soundEngine->FindSoundByResID(nSound); if (snd > 0) diff --git a/source/blood/src/triggers.cpp b/source/blood/src/triggers.cpp index 85f6630a2..159b084b0 100644 --- a/source/blood/src/triggers.cpp +++ b/source/blood/src/triggers.cpp @@ -186,7 +186,7 @@ BUSY gBusy[128]; void AddBusy(int a1, BUSYID a2, int nDelta) { - dassert(nDelta != 0); + assert(nDelta != 0); int i; for (i = 0; i < gBusyCount; i++) { @@ -226,19 +226,19 @@ unsigned int GetSourceBusy(EVENT a1) case 6: { int nXIndex = sector[nIndex].extra; - dassert(nXIndex > 0 && nXIndex < kMaxXSectors); + assert(nXIndex > 0 && nXIndex < kMaxXSectors); return xsector[nXIndex].busy; } case 0: { int nXIndex = wall[nIndex].extra; - dassert(nXIndex > 0 && nXIndex < kMaxXWalls); + assert(nXIndex > 0 && nXIndex < kMaxXWalls); return xwall[nXIndex].busy; } case 3: { int nXIndex = sprite[nIndex].extra; - dassert(nXIndex > 0 && nXIndex < kMaxXSprites); + assert(nXIndex > 0 && nXIndex < kMaxXSprites); return xsprite[nXIndex].busy; } } @@ -766,7 +766,7 @@ void SectorStartSound(int nSector, int nState) if (pSprite->statnum == kStatDecoration && pSprite->type == kSoundSector) { int nXSprite = pSprite->extra; - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); XSPRITE *pXSprite = &xsprite[nXSprite]; if (nState) { @@ -790,7 +790,7 @@ void SectorEndSound(int nSector, int nState) if (pSprite->statnum == kStatDecoration && pSprite->type == kSoundSector) { int nXSprite = pSprite->extra; - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); XSPRITE *pXSprite = &xsprite[nXSprite]; if (nState) { @@ -1047,8 +1047,8 @@ int GetHighestSprite(int nSector, int nStatus, int *a3) int GetCrushedSpriteExtents(unsigned int nSector, int *pzTop, int *pzBot) { - dassert(pzTop != NULL && pzBot != NULL); - dassert(nSector < (unsigned int)numsectors); + assert(pzTop != NULL && pzBot != NULL); + assert(nSector < (unsigned int)numsectors); int vc = -1; sectortype *pSector = §or[nSector]; 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) { - dassert(nSector < (unsigned int)numsectors); + assert(nSector < (unsigned int)numsectors); int nXSector = sector[nSector].extra; - dassert(nXSector > 0 && nXSector < kMaxXSectors); + assert(nXSector > 0 && nXSector < kMaxXSectors); XSECTOR *pXSector = &xsector[nXSector]; int nWave; if (pXSector->busy < a2) @@ -1112,9 +1112,9 @@ int VCrushBusy(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; - dassert(nXSector > 0 && nXSector < kMaxXSectors); + assert(nXSector > 0 && nXSector < kMaxXSectors); XSECTOR *pXSector = &xsector[nXSector]; int nWave; if (pXSector->busy < a2) @@ -1161,9 +1161,9 @@ int VSpriteBusy(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; - dassert(nXSector > 0 && nXSector < kMaxXSectors); + assert(nXSector > 0 && nXSector < kMaxXSectors); XSECTOR *pXSector = &xsector[nXSector]; int vbp; if (pXSector->state) @@ -1175,7 +1175,7 @@ int VDoorBusy(unsigned int nSector, unsigned int a2) if (nSprite >= 0 && a2 > pXSector->busy) { spritetype *pSprite = &sprite[nSprite]; - dassert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites); + assert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites); XSPRITE *pXSprite = &xsprite[pSprite->extra]; 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) { spritetype *pSprite = &sprite[nSprite]; - dassert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites); + assert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites); XSPRITE *pXSprite = &xsprite[pSprite->extra]; 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) { - dassert(nSector < (unsigned int)numsectors); + assert(nSector < (unsigned int)numsectors); sectortype *pSector = §or[nSector]; int nXSector = pSector->extra; - dassert(nXSector > 0 && nXSector < kMaxXSectors); + assert(nXSector > 0 && nXSector < kMaxXSectors); XSECTOR *pXSector = &xsector[nXSector]; int nWave; if (pXSector->busy < a2) @@ -1288,10 +1288,10 @@ int HDoorBusy(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]; int nXSector = pSector->extra; - dassert(nXSector > 0 && nXSector < kMaxXSectors); + assert(nXSector > 0 && nXSector < kMaxXSectors); XSECTOR *pXSector = &xsector[nXSector]; int nWave; if (pXSector->busy < a2) @@ -1315,10 +1315,10 @@ int RDoorBusy(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]; int nXSector = pSector->extra; - dassert(nXSector > 0 && nXSector < kMaxXSectors); + assert(nXSector > 0 && nXSector < kMaxXSectors); XSECTOR *pXSector = &xsector[nXSector]; spritetype *pSprite = &sprite[pXSector->marker0]; int vbp; @@ -1349,10 +1349,10 @@ int StepRotateBusy(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]; int nXSector = pSector->extra; - dassert(nXSector > 0 && nXSector < kMaxXSectors); + assert(nXSector > 0 && nXSector < kMaxXSectors); XSECTOR *pXSector = &xsector[nXSector]; pXSector->busy = a2; 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) { - dassert(nSector < (unsigned int)numsectors); + assert(nSector < (unsigned int)numsectors); sectortype *pSector = §or[nSector]; int nXSector = pSector->extra; - dassert(nXSector > 0 && nXSector < kMaxXSectors); + assert(nXSector > 0 && nXSector < kMaxXSectors); XSECTOR *pXSector = &xsector[nXSector]; spritetype *pSprite = &sprite[basePath[nSector]]; spritetype *pSprite1 = &sprite[pXSector->marker0]; @@ -1452,13 +1452,13 @@ void TeleFrag(int nKiller, int nSector) void OperateTeleport(unsigned int nSector, XSECTOR *pXSector) { - dassert(nSector < (unsigned int)numsectors); + assert(nSector < (unsigned int)numsectors); int nDest = pXSector->marker0; - dassert(nDest < kMaxSprites); + assert(nDest < kMaxSprites); spritetype *pDest = &sprite[nDest]; - dassert(pDest->statnum == kStatMarker); - dassert(pDest->type == kMarkerWarpDest); - dassert(pDest->sectnum >= 0 && pDest->sectnum < kMaxSectors); + assert(pDest->statnum == kStatMarker); + assert(pDest->type == kMarkerWarpDest); + assert(pDest->sectnum >= 0 && pDest->sectnum < kMaxSectors); for (int nSprite = headspritesect[nSector]; nSprite >= 0; nSprite = nextspritesect[nSprite]) { spritetype *pSprite = &sprite[nSprite]; @@ -1498,7 +1498,7 @@ void OperatePath(unsigned int nSector, XSECTOR *pXSector, EVENT event) int nSprite; spritetype *pSprite = NULL; XSPRITE *pXSprite; - dassert(nSector < (unsigned int)numsectors); + assert(nSector < (unsigned int)numsectors); spritetype *pSprite2 = &sprite[pXSector->marker0]; XSPRITE *pXSprite2 = &xsprite[pSprite2->extra]; 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) { - dassert(nSector < (unsigned int)numsectors); + assert(nSector < (unsigned int)numsectors); sectortype *pSector = §or[nSector]; #ifdef NOONE_EXTENSIONS @@ -1653,7 +1653,7 @@ void InitPath(unsigned int nSector, XSECTOR *pXSector) int nSprite; spritetype *pSprite; XSPRITE *pXSprite; - dassert(nSector < (unsigned int)numsectors); + assert(nSector < (unsigned int)numsectors); int nId = pXSector->data; 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 nXSprite2 = sprite[nSprite2].extra; - dassert(nXSprite2 > 0 && nXSprite2 < kMaxXSprites); + assert(nXSprite2 > 0 && nXSprite2 < kMaxXSprites); pXSprite->data1 = xsprite[nXSprite2].data1; if (pXSprite->data1 == pXSprite->data2) 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) { - dassert(nSector < (unsigned int)numsectors); + assert(nSector < (unsigned int)numsectors); if (!pXSector->locked && !pXSector->isTriggered) { 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) { - dassert(nWall < (unsigned int)numwalls); + assert(nWall < (unsigned int)numwalls); if (!pXWall->locked && !pXWall->isTriggered) { if (pXWall->triggerOnce) @@ -1802,8 +1802,8 @@ void trTriggerSprite(unsigned int nSprite, XSPRITE *pXSprite, int command) { void trMessageSector(unsigned int nSector, EVENT event) { - dassert(nSector < (unsigned int)numsectors); - dassert(sector[nSector].extra > 0 && sector[nSector].extra < kMaxXSectors); + assert(nSector < (unsigned int)numsectors); + assert(sector[nSector].extra > 0 && sector[nSector].extra < kMaxXSectors); XSECTOR *pXSector = &xsector[sector[nSector].extra]; if (!pXSector->locked || event.cmd == kCmdUnlock || event.cmd == kCmdToggleLock) { switch (event.cmd) { @@ -1823,8 +1823,8 @@ void trMessageSector(unsigned int nSector, EVENT event) { } void trMessageWall(unsigned int nWall, EVENT event) { - dassert(nWall < (unsigned int)numwalls); - dassert(wall[nWall].extra > 0 && wall[nWall].extra < kMaxXWalls); + assert(nWall < (unsigned int)numwalls); + assert(wall[nWall].extra > 0 && wall[nWall].extra < kMaxXWalls); XWALL *pXWall = &xwall[wall[nWall].extra]; if (!pXWall->locked || event.cmd == kCmdUnlock || event.cmd == kCmdToggleLock) { @@ -2025,7 +2025,7 @@ void trInit(void) for (int i = 0; i < numwalls; i++) { int nXWall = wall[i].extra; - dassert(nXWall < kMaxXWalls); + assert(nXWall < kMaxXWalls); if (nXWall > 0) { XWALL *pXWall = &xwall[nXWall]; @@ -2033,7 +2033,7 @@ void trInit(void) pXWall->busy = 65536; } } - dassert((numsectors >= 0) && (numsectors < kMaxSectors)); + assert((numsectors >= 0) && (numsectors < kMaxSectors)); for (int i = 0; i < numsectors; i++) { sectortype *pSector = §or[i]; @@ -2042,7 +2042,7 @@ void trInit(void) int nXSector = pSector->extra; if (nXSector > 0) { - dassert(nXSector < kMaxXSectors); + assert(nXSector < kMaxXSectors); XSECTOR *pXSector = &xsector[nXSector]; if (pXSector->state) pXSector->busy = 65536; @@ -2115,7 +2115,7 @@ void trInit(void) int nXSprite = sprite[i].extra; if (sprite[i].statnum < kStatFree && nXSprite > 0) { - dassert(nXSprite < kMaxXSprites); + assert(nXSprite < kMaxXSprites); XSPRITE *pXSprite = &xsprite[nXSprite]; if (pXSprite->state) pXSprite->busy = 65536; @@ -2190,11 +2190,11 @@ void trTextOver(int nId) void InitGenerator(int nSprite) { - dassert(nSprite < kMaxSprites); + assert(nSprite < kMaxSprites); spritetype *pSprite = &sprite[nSprite]; - dassert(pSprite->statnum != kMaxStatus); + assert(pSprite->statnum != kMaxStatus); int nXSprite = pSprite->extra; - dassert(nXSprite > 0); + assert(nXSprite > 0); XSPRITE *pXSprite = &xsprite[nXSprite]; switch (sprite[nSprite].type) { case kGenTrigger: @@ -2208,11 +2208,11 @@ void InitGenerator(int nSprite) void ActivateGenerator(int nSprite) { - dassert(nSprite < kMaxSprites); + assert(nSprite < kMaxSprites); spritetype *pSprite = &sprite[nSprite]; - dassert(pSprite->statnum != kMaxStatus); + assert(pSprite->statnum != kMaxStatus); int nXSprite = pSprite->extra; - dassert(nXSprite > 0); + assert(nXSprite > 0); XSPRITE *pXSprite = &xsprite[nXSprite]; switch (pSprite->type) { case kGenDripWater: diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 2d40ac904..84d5eb90a 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -264,7 +264,7 @@ void viewInit(void) FontSet(4, 4480, 0); lensdata = fileSystem.LoadFile("lens.dat"); - dassert(lensdata.Size() == kLensSize * kLensSize * sizeof(int)); + assert(lensdata.Size() == kLensSize * kLensSize * sizeof(int)); lensTable = (int*)lensdata.Data(); #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 bakCstat = pSprite->cstat; pSprite->cstat &= ~256; - dassert(*vsectnum >= 0 && *vsectnum < kMaxSectors); + assert(*vsectnum >= 0 && *vsectnum < kMaxSectors); FindSector(*pX, *pY, *pZ, vsectnum); short nHSector; 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); othercameradist = ClipHigh(othercameradist+((myclock-othercameraclock)<<10), 65536); othercameraclock = myclock; - dassert(*vsectnum >= 0 && *vsectnum < kMaxSectors); + assert(*vsectnum >= 0 && *vsectnum < kMaxSectors); FindSector(*pX, *pY, *pZ, vsectnum); 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 bakCstat = pSprite->cstat; pSprite->cstat &= ~256; - dassert(*vsectnum >= 0 && *vsectnum < kMaxSectors); + assert(*vsectnum >= 0 && *vsectnum < kMaxSectors); FindSector(*pX, *pY, *pZ, vsectnum); short nHSector; 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); cameradist = ClipHigh(cameradist+((myclock-cameraclock)<<10), 65536); cameraclock = myclock; - dassert(*vsectnum >= 0 && *vsectnum < kMaxSectors); + assert(*vsectnum >= 0 && *vsectnum < kMaxSectors); FindSector(*pX, *pY, *pZ, vsectnum); pSprite->cstat = bakCstat; } @@ -404,9 +404,9 @@ void DoLensEffect(void) { // To investigate whether this can be implemented as a shader effect. auto d = tileData(4077); - dassert(d != NULL); + assert(d != NULL); auto s = tilePtr(4079); - dassert(s != NULL); + assert(s != NULL); for (int i = 0; i < kLensSize*kLensSize; i++, d++) if (lensTable[i] >= 0) *d = s[lensTable[i]]; @@ -847,7 +847,7 @@ void viewDrawScreen(bool sceneonly) { spritetype* pSprite = &sprite[nSprite]; int nXSprite = pSprite->extra; - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); XSPRITE* pXSprite = &xsprite[nXSprite]; if (TestBitString(gotsector, pSprite->sectnum)) { diff --git a/source/blood/src/warp.cpp b/source/blood/src/warp.cpp index 609b2365d..e21935f5a 100644 --- a/source/blood/src/warp.cpp +++ b/source/blood/src/warp.cpp @@ -158,7 +158,7 @@ void warpInit(void) { spritetype *pSprite = &sprite[nSprite]; int nXSprite = pSprite->extra; - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); XSPRITE *pXSprite = &xsprite[nXSprite]; int nLink = pXSprite->data1; for (int j = 0; j < kMaxSectors; j++) @@ -168,7 +168,7 @@ void warpInit(void) { spritetype *pSprite2 = &sprite[nSprite2]; int nXSprite = pSprite2->extra; - dassert(nXSprite > 0 && nXSprite < kMaxXSprites); + assert(nXSprite > 0 && nXSprite < kMaxXSprites); XSPRITE *pXSprite2 = &xsprite[nXSprite]; if (pXSprite2->data1 == nLink) { @@ -197,9 +197,9 @@ int CheckLink(spritetype *pSprite) if (z <= pSprite->z) { nLower = pUpper->owner; - dassert(nLower >= 0 && nLower < kMaxSprites); + assert(nLower >= 0 && nLower < kMaxSprites); spritetype *pLower = &sprite[nLower]; - dassert(pLower->sectnum >= 0 && pLower->sectnum < kMaxSectors); + assert(pLower->sectnum >= 0 && pLower->sectnum < kMaxSectors); ChangeSpriteSect(pSprite->index, pLower->sectnum); pSprite->x += pLower->x-pUpper->x; pSprite->y += pLower->y-pUpper->y; @@ -224,9 +224,9 @@ int CheckLink(spritetype *pSprite) if (z >= pSprite->z) { nUpper = pLower->owner; - dassert(nUpper >= 0 && nUpper < kMaxSprites); + assert(nUpper >= 0 && nUpper < kMaxSprites); spritetype *pUpper = &sprite[nUpper]; - dassert(pUpper->sectnum >= 0 && pUpper->sectnum < kMaxSectors); + assert(pUpper->sectnum >= 0 && pUpper->sectnum < kMaxSectors); ChangeSpriteSect(pSprite->index, pUpper->sectnum); pSprite->x += pUpper->x-pLower->x; pSprite->y += pUpper->y-pLower->y; @@ -258,9 +258,9 @@ int CheckLink(int *x, int *y, int *z, int *nSector) if (z1 <= *z) { nLower = pUpper->owner; - dassert(nLower >= 0 && nLower < kMaxSprites); + assert(nLower >= 0 && nLower < kMaxSprites); spritetype *pLower = &sprite[nLower]; - dassert(pLower->sectnum >= 0 && pLower->sectnum < kMaxSectors); + assert(pLower->sectnum >= 0 && pLower->sectnum < kMaxSectors); *nSector = pLower->sectnum; *x += pLower->x-pUpper->x; *y += pLower->y-pUpper->y; @@ -284,9 +284,9 @@ int CheckLink(int *x, int *y, int *z, int *nSector) if (z1 >= *z) { nUpper = pLower->owner; - dassert(nUpper >= 0 && nUpper < kMaxSprites); + assert(nUpper >= 0 && nUpper < kMaxSprites); spritetype *pUpper = &sprite[nUpper]; - dassert(pUpper->sectnum >= 0 && pUpper->sectnum < kMaxSectors); + assert(pUpper->sectnum >= 0 && pUpper->sectnum < kMaxSectors); *nSector = pUpper->sectnum; *x += pUpper->x-pLower->x; *y += pUpper->y-pLower->y; diff --git a/source/blood/src/weapon.cpp b/source/blood/src/weapon.cpp index 10dd850f7..64191d7a6 100644 --- a/source/blood/src/weapon.cpp +++ b/source/blood/src/weapon.cpp @@ -234,7 +234,7 @@ void WeaponPrecache(HitList &hits) void WeaponDraw(PLAYER *pPlayer, int a2, double a3, double a4, int a5, int smoothratio) { - dassert(pPlayer != NULL); + assert(pPlayer != NULL); if (pPlayer->weaponQav == -1) return; 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) { - dassert(pPlayer != NULL); + assert(pPlayer != NULL); if (pPlayer->weaponQav == -1) return; QAV *pQAV = weaponQAV[pPlayer->weaponQav]; @@ -268,7 +268,7 @@ void WeaponPlay(PLAYER *pPlayer) void StartQAV(PLAYER *pPlayer, int nWeaponQAV, int a3, char a4) { - dassert(nWeaponQAV < kQAVEnd); + assert(nWeaponQAV < kQAVEnd); pPlayer->weaponQav = nWeaponQAV; pPlayer->weaponTimer = weaponQAV[nWeaponQAV]->at10; pPlayer->qavCallback = a3; @@ -309,7 +309,7 @@ void UpdateAimVector(PLAYER * pPlayer) { short nSprite; spritetype *pSprite; - dassert(pPlayer != NULL); + assert(pPlayer != NULL); spritetype *pPSprite = pPlayer->pSprite; int x = pPSprite->x; int y = pPSprite->y; @@ -467,7 +467,7 @@ t_WeaponModes weaponModes[] = { void WeaponRaise(PLAYER *pPlayer) { - dassert(pPlayer != NULL); + assert(pPlayer != NULL); int prevWeapon = pPlayer->curWeapon; pPlayer->curWeapon = pPlayer->newWeapon; pPlayer->newWeapon = 0; @@ -617,7 +617,7 @@ void WeaponRaise(PLAYER *pPlayer) void WeaponLower(PLAYER *pPlayer) { - dassert(pPlayer != NULL); + assert(pPlayer != NULL); if (sub_4B1A4(pPlayer)) return; pPlayer->throwPower = 0; @@ -1113,7 +1113,7 @@ enum { kMaxShotgunBarrels = 4 }; void FireShotgun(int nTrigger, PLAYER *pPlayer) { - dassert(nTrigger > 0 && nTrigger <= kMaxShotgunBarrels); + assert(nTrigger > 0 && nTrigger <= kMaxShotgunBarrels); if (nTrigger == 1) { sfxPlay3DSound(pPlayer->pSprite, 411, 2, 0); @@ -1197,7 +1197,7 @@ enum { kMaxSpread = 14 }; void FireSpread(int nTrigger, PLAYER *pPlayer) { - dassert(nTrigger > 0 && nTrigger <= kMaxSpread); + assert(nTrigger > 0 && nTrigger <= kMaxSpread); Aim *aim = &pPlayer->aim; int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047; int dx = CosScale16(angle); @@ -1218,7 +1218,7 @@ void FireSpread(int nTrigger, PLAYER *pPlayer) void AltFireSpread(int nTrigger, PLAYER *pPlayer) { - dassert(nTrigger > 0 && nTrigger <= kMaxSpread); + assert(nTrigger > 0 && nTrigger <= kMaxSpread); Aim *aim = &pPlayer->aim; int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047; int dx = CosScale16(angle); @@ -1247,7 +1247,7 @@ void AltFireSpread(int nTrigger, PLAYER *pPlayer) void AltFireSpread2(int nTrigger, PLAYER *pPlayer) { - dassert(nTrigger > 0 && nTrigger <= kMaxSpread); + assert(nTrigger > 0 && nTrigger <= kMaxSpread); Aim *aim = &pPlayer->aim; int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047; int dx = CosScale16(angle); @@ -1346,7 +1346,7 @@ void FireVoodoo(int nTrigger, PLAYER *pPlayer) actDamageSprite(nSprite, pSprite, DAMAGE_TYPE_2, 1<<4); return; } - dassert(pPlayer->voodooTarget >= 0); + assert(pPlayer->voodooTarget >= 0); spritetype *pTarget = &sprite[pPlayer->voodooTarget]; if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pPlayer, pTarget)) return;