From 679248fb51b89b51b00eb10dfe58ab7f26606c6d Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 5 Apr 2009 08:01:36 +0000 Subject: (svn r15956) -Codechange: Enumorize station spec flags. --- src/newgrf_station.cpp | 4 ++-- src/newgrf_station.h | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index 26b49cc87..e961dd87c 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -558,7 +558,7 @@ static const SpriteGroup *StationResolveReal(const ResolverObject *object, const break; } - if (HasBit(statspec->flags, 1)) cargo /= (st->trainst_w + st->trainst_h); + if (HasBit(statspec->flags, SSF_DIV_BY_STATION_SIZE)) cargo /= (st->trainst_w + st->trainst_h); cargo = min(0xfff, cargo); if (cargo > statspec->cargo_threshold) { @@ -904,7 +904,7 @@ void AnimateStationTile(TileIndex tile) bool frame_set_by_callback = false; if (HasBit(ss->callbackmask, CBM_STATION_ANIMATION_NEXT_FRAME)) { - uint32 param = HasBit(ss->flags, 2) ? Random() : 0; + uint32 param = HasBit(ss->flags, SSF_CB141_RANDOM_BITS) ? Random() : 0; uint16 callback = GetStationCallback(CBID_STATION_ANIM_NEXT_FRAME, param, 0, ss, st, tile); if (callback != CALLBACK_FAILED) { diff --git a/src/newgrf_station.h b/src/newgrf_station.h index 9af801f05..5bd52891b 100644 --- a/src/newgrf_station.h +++ b/src/newgrf_station.h @@ -29,6 +29,14 @@ typedef TinyEnumT StationClassIDByte; /** Allow incrementing of StationClassID variables */ DECLARE_POSTFIX_INCREMENT(StationClassID); +enum StationSpecFlags { + SSF_SEPARATE_GROUND, ///< Use different sprite set for ground sprites. + SSF_DIV_BY_STATION_SIZE, ///< Divide cargo amount by station size. + SSF_CB141_RANDOM_BITS, ///< Callback 141 needs random bits. + SSF_CUSTOM_FOUNDATIONS, ///< Draw custom foundations. + SSF_EXTENDED_FOUNDATIONS, ///< Extended foundation block instead of simple. +}; + /* Station layout for given dimensions - it is a two-dimensional array * where index is computed as (x * platforms) + platform. */ typedef byte *StationLayout; -- cgit v1.2.3-70-g09d2