- angular cleanup.

This commit is contained in:
Christoph Oelckers 2022-09-29 14:54:36 +02:00
parent 65a5394cf0
commit d41e370aad
6 changed files with 9 additions and 9 deletions

View file

@ -6471,7 +6471,7 @@ DBloodActor* actFireMissile(DBloodActor* actor, double xyoff, double zoff, DVect
spawned->spr.xrepeat = pMissileInfo->xrepeat; spawned->spr.xrepeat = pMissileInfo->xrepeat;
spawned->spr.yrepeat = pMissileInfo->yrepeat; spawned->spr.yrepeat = pMissileInfo->yrepeat;
spawned->spr.picnum = pMissileInfo->picnum; spawned->spr.picnum = pMissileInfo->picnum;
spawned->spr.angle = actor->spr.angle += DAngle::fromBuild(pMissileInfo->angleOfs); spawned->spr.angle = actor->spr.angle += mapangle(pMissileInfo->angleOfs);
spawned->vel = dv * pMissileInfo->fVelocity(); spawned->vel = dv * pMissileInfo->fVelocity();
spawned->SetOwner(actor); spawned->SetOwner(actor);
spawned->spr.cstat |= CSTAT_SPRITE_BLOCK; spawned->spr.cstat |= CSTAT_SPRITE_BLOCK;

View file

@ -253,6 +253,7 @@ void StartLevel(MapRecord* level, bool newgame)
BloodSpawnSpriteDef sprites; BloodSpawnSpriteDef sprites;
DVector3 startpos; DVector3 startpos;
dbLoadMap(currentLevel->fileName, startpos, &startang, &startsector, nullptr, sprites); dbLoadMap(currentLevel->fileName, startpos, &startang, &startsector, nullptr, sprites);
auto startangle = mapangle(startang);
SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name); SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name);
STAT_NewLevel(currentLevel->fileName); STAT_NewLevel(currentLevel->fileName);
TITLE_InformName(currentLevel->name); TITLE_InformName(currentLevel->name);
@ -294,18 +295,18 @@ void StartLevel(MapRecord* level, bool newgame)
for (int i = 0; i < kMaxPlayers; i++) { for (int i = 0; i < kMaxPlayers; i++) {
gStartZone[i].pos = startpos; gStartZone[i].pos = startpos;
gStartZone[i].sector = startsector; gStartZone[i].sector = startsector;
gStartZone[i].angle = DAngle::fromBuild(startang); gStartZone[i].angle = startangle;
#ifdef NOONE_EXTENSIONS #ifdef NOONE_EXTENSIONS
// Create spawn zones for players in teams mode. // Create spawn zones for players in teams mode.
if (gModernMap && i <= kMaxPlayers / 2) { if (gModernMap && i <= kMaxPlayers / 2) {
gStartZoneTeam1[i].pos = startpos; gStartZoneTeam1[i].pos = startpos;
gStartZoneTeam1[i].sector = startsector; gStartZoneTeam1[i].sector = startsector;
gStartZoneTeam1[i].angle = DAngle::fromBuild(startang); gStartZoneTeam1[i].angle = startangle;
gStartZoneTeam2[i].pos = startpos; gStartZoneTeam2[i].pos = startpos;
gStartZoneTeam2[i].sector = startsector; gStartZoneTeam2[i].sector = startsector;
gStartZoneTeam2[i].angle = DAngle::fromBuild(startang); gStartZoneTeam2[i].angle = startangle;
} }
#endif #endif
} }

View file

@ -94,7 +94,6 @@ public:
void destroy(DBloodActor*); void destroy(DBloodActor*);
void remove(DBloodActor*); void remove(DBloodActor*);
DBloodActor* fxSpawnActor(FX_ID a, sectortype* b, const DVector3& pos, DAngle f); DBloodActor* fxSpawnActor(FX_ID a, sectortype* b, const DVector3& pos, DAngle f);
DBloodActor* fxSpawnActor(FX_ID a, sectortype* b, const DVector3& pos, unsigned int f);
void fxProcess(void); void fxProcess(void);
}; };

View file

@ -6077,7 +6077,7 @@ bool modernTypeOperateSprite(DBloodActor* actor, EVENT& event)
} }
else if (valueIsBetween(actor->xspr.data2, -kAng360, kAng360)) else if (valueIsBetween(actor->xspr.data2, -kAng360, kAng360))
{ {
pPlayer->angle.settarget(DAngle::fromBuild(actor->xspr.data2)); pPlayer->angle.settarget(mapangle(actor->xspr.data2));
pPlayer->angle.lockinput(); pPlayer->angle.lockinput();
} }
break; break;
@ -8169,7 +8169,7 @@ void aiPatrolMove(DBloodActor* actor)
actor->spr.flags |= kPhysGravity | kPhysFalling; actor->spr.flags |= kPhysGravity | kPhysFalling;
} }
DAngle nTurnRange = DAngle::fromBuild((pDudeInfo->angSpeed << 2) >> 4); DAngle nTurnRange = pDudeInfo->TurnRange() / 64;
DAngle nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); DAngle nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng);
actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange);
@ -9203,7 +9203,7 @@ void callbackUniMissileBurst(DBloodActor* actor, sectortype*) // 22
burstactor->spr.flags = actor->spr.flags; burstactor->spr.flags = actor->spr.flags;
burstactor->spr.xrepeat = actor->spr.xrepeat / 2; burstactor->spr.xrepeat = actor->spr.xrepeat / 2;
burstactor->spr.yrepeat = actor->spr.yrepeat / 2; burstactor->spr.yrepeat = actor->spr.yrepeat / 2;
burstactor->spr.angle = actor->spr.angle + DAngle::fromBuild(missileInfo[actor->spr.type - kMissileBase].angleOfs); burstactor->spr.angle = actor->spr.angle + mapangle(missileInfo[actor->spr.type - kMissileBase].angleOfs);
burstactor->SetOwner(actor); burstactor->SetOwner(actor);
actBuildMissile(burstactor, actor); actBuildMissile(burstactor, actor);

View file

@ -2282,6 +2282,7 @@ void voodooTarget(PLAYER* pPlayer)
} }
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
// both voodooVar's are always 0. This is only kept in case someone implements an extension.
DAngle ang1 = DAngle::fromBuild(pPlayer->voodooVar1 + pPlayer->vodooVar2); DAngle ang1 = DAngle::fromBuild(pPlayer->voodooVar1 + pPlayer->vodooVar2);
actFireVector(actor, 0, dz, DVector3(ang1.ToVector(), aimz), kVectorVoodoo10); actFireVector(actor, 0, dz, DVector3(ang1.ToVector(), aimz), kVectorVoodoo10);
DAngle ang2 = DAngle::fromBuild(pPlayer->voodooVar1 - pPlayer->vodooVar2); DAngle ang2 = DAngle::fromBuild(pPlayer->voodooVar1 - pPlayer->vodooVar2);

View file

@ -114,7 +114,6 @@ struct PLAYER
double ozWeapon; double ozWeapon;
double zWeaponVel; double zWeaponVel;
double slope; double slope;
[[deprecated]] int int_slope() const { return slope * 16384; }
bool isUnderwater; bool isUnderwater;
bool hasKey[8]; bool hasKey[8];
int8_t hasFlag; int8_t hasFlag;