Codechange: Use EnumBitSet for StationSpecFlags.
This commit is contained in:
committed by
Peter Nelson
parent
1f7760dc7a
commit
1a6e7f2162
@@ -532,7 +532,7 @@ uint32_t Waypoint::GetNewGRFVariable(const ResolverObject &, uint8_t variable, [
|
||||
}
|
||||
}
|
||||
|
||||
if (HasBit(this->station_scope.statspec->flags, SSF_DIV_BY_STATION_SIZE)) cargo /= (st->train_station.w + st->train_station.h);
|
||||
if (this->station_scope.statspec->flags.Test(StationSpecFlag::DivByStationSize)) cargo /= (st->train_station.w + st->train_station.h);
|
||||
cargo = std::min(0xfffu, cargo);
|
||||
|
||||
if (cargo > this->station_scope.statspec->cargo_threshold) {
|
||||
@@ -608,7 +608,7 @@ StationResolverObject::StationResolverObject(const StationSpec *statspec, BaseSt
|
||||
* @param statspec Station spec
|
||||
* @param st Station (nullptr in GUI)
|
||||
* @param tile Station tile being drawn (INVALID_TILE in GUI)
|
||||
* @param var10 Value to put in variable 10; normally 0; 1 when resolving the groundsprite and SSF_SEPARATE_GROUND is set.
|
||||
* @param var10 Value to put in variable 10; normally 0; 1 when resolving the groundsprite and StationSpecFlag::SeparateGround is set.
|
||||
* @return First sprite of the Action 1 spriteset to use, minus an offset of 0x42D to accommodate for weird NewGRF specs.
|
||||
*/
|
||||
SpriteID GetCustomStationRelocation(const StationSpec *statspec, BaseStation *st, TileIndex tile, uint32_t var10)
|
||||
@@ -808,7 +808,7 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID
|
||||
|
||||
if (layout != nullptr) {
|
||||
/* Sprite layout which needs preprocessing */
|
||||
bool separate_ground = HasBit(statspec->flags, SSF_SEPARATE_GROUND);
|
||||
bool separate_ground = statspec->flags.Test(StationSpecFlag::SeparateGround);
|
||||
uint32_t var10_values = layout->PrepareLayout(total_offset, rti->fallback_railtype, 0, 0, separate_ground);
|
||||
for (uint8_t var10 : SetBitIterator(var10_values)) {
|
||||
uint32_t var10_relocation = GetCustomStationRelocation(statspec, nullptr, INVALID_TILE, var10);
|
||||
@@ -875,7 +875,7 @@ void AnimateStationTile(TileIndex tile)
|
||||
const StationSpec *ss = GetStationSpec(tile);
|
||||
if (ss == nullptr) return;
|
||||
|
||||
StationAnimationBase::AnimateTile(ss, BaseStation::GetByTile(tile), tile, HasBit(ss->flags, SSF_CB141_RANDOM_BITS));
|
||||
StationAnimationBase::AnimateTile(ss, BaseStation::GetByTile(tile), tile, ss->flags.Test(StationSpecFlag::Cb141RandomBits));
|
||||
}
|
||||
|
||||
void TriggerStationAnimation(BaseStation *st, TileIndex trigger_tile, StationAnimationTrigger trigger, CargoType cargo_type)
|
||||
|
||||
Reference in New Issue
Block a user