mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- improved RANDOM_P2F interface.
This commit is contained in:
parent
f77ecbed32
commit
2a8dd6b955
2 changed files with 2 additions and 2 deletions
|
@ -115,7 +115,7 @@ inline int RANDOM(void)
|
|||
return randomseed;
|
||||
}
|
||||
int RANDOM_P2(int pwr_of_2) { return (RANDOM() & (pwr_of_2 - 1)); }
|
||||
double RANDOM_P2F(int pwr_of_2) { return (RANDOM() & (pwr_of_2 - 1)) * maptoworld; }
|
||||
double RANDOM_P2F(int pwr_of_2, int shift) { return (RANDOM() & ((pwr_of_2 << shift) - 1)) * (1./(1 << shift)); }
|
||||
DAngle RANDOM_ANGLE() { return DAngle::fromBuild(RANDOM_P2(2048)); }
|
||||
|
||||
//
|
||||
|
|
|
@ -844,7 +844,7 @@ void SectorExp(DSWActor* actor, sectortype* sectp, double zh)
|
|||
auto mid = SectorMidPoint(sectp);
|
||||
// randomize the explosions
|
||||
actor->spr.angle = DAngle::fromBuild(RANDOM_P2(256) - 128);
|
||||
actor->spr.pos = { mid.X + RANDOM_P2F(256) - 16, mid.Y + RANDOM_P2F(1024) - 64, zh };
|
||||
actor->spr.pos = { mid.X + RANDOM_P2F(16, 4) - 16, mid.Y + RANDOM_P2F(64, 4) - 64, zh };
|
||||
|
||||
// setup vars needed by SectorExp
|
||||
ChangeActorSect(actor, sectp);
|
||||
|
|
Loading…
Reference in a new issue