- Duke: Partially address excessively fast sky in E4L1 as reported in #217.

* Before d545eb7aa9, `moveclouds()` simply set `ceilingxpanning`/`ceilingypanning`. Afterwards, it was accumulating with every passing loop.
* Despite fixing this, still seems a bit fast.
This commit is contained in:
Mitchell Richters 2020-12-06 23:51:20 +11:00
parent 51205fbdac
commit 1e8fe482f3
2 changed files with 6 additions and 2 deletions

View file

@ -46,6 +46,10 @@ struct sectortype
int ceilingypan() const { return int(ceilingypan_); }
int floorxpan() const { return int(floorxpan_); }
int floorypan() const { return int(floorypan_); }
void setfloorxpan(float val) { floorxpan_ = fmod(val + 512, 256); } // +512 is for handling negative offsets
void setfloorypan(float val) { floorypan_ = fmod(val + 512, 256); } // +512 is for handling negative offsets
void setceilingxpan(float val) { ceilingxpan_ = fmod(val + 512, 256); } // +512 is for handling negative offsets
void setceilingypan(float val) { ceilingypan_ = fmod(val + 512, 256); } // +512 is for handling negative offsets
void addfloorxpan(float add) { floorxpan_ = fmod(floorxpan_ + add + 512, 256); } // +512 is for handling negative offsets
void addfloorypan(float add) { floorypan_ = fmod(floorypan_ + add + 512, 256); } // +512 is for handling negative offsets
void addceilingxpan(float add) { ceilingxpan_ = fmod(ceilingxpan_ + add + 512, 256); } // +512 is for handling negative offsets

View file

@ -1261,8 +1261,8 @@ void moveclouds(double smoothratio)
cloudy += ps[screenpeek].angle.ang.bsin(-9);
for (int i = 0; i < numclouds; i++)
{
sector[clouds[i]].addceilingxpan(cloudx / 64.f);
sector[clouds[i]].addceilingypan(cloudy / 64.f);
sector[clouds[i]].setceilingxpan(cloudx / 64.f);
sector[clouds[i]].setceilingypan(cloudy / 64.f);
}
}
}