Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef NEWGRF_RAILTYPE_H
00013 #define NEWGRF_RAILTYPE_H
00014
00015 #include "rail.h"
00016 #include "newgrf_commons.h"
00017 #include "newgrf_spritegroup.h"
00018
00020 struct RailTypeScopeResolver : public ScopeResolver {
00021 TileIndex tile;
00022 TileContext context;
00023
00024 RailTypeScopeResolver(ResolverObject &ro, TileIndex tile, TileContext context);
00025
00026 uint32 GetRandomBits() const;
00027 uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
00028 };
00029
00031 struct RailTypeResolverObject : public ResolverObject {
00032 RailTypeScopeResolver railtype_scope;
00033
00034 RailTypeResolverObject(TileIndex tile, TileContext context, const GRFFile *grffile, uint32 param1 = 0, uint32 param2 = 0);
00035
00036 ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
00037 {
00038 switch (scope) {
00039 case VSG_SCOPE_SELF: return &this->railtype_scope;
00040 default: return ResolverObject::GetScope(scope, relative);
00041 }
00042 }
00043
00044 const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
00045 };
00046
00047 SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context = TCX_NORMAL);
00048 SpriteID GetCustomSignalSprite(const RailtypeInfo *rti, TileIndex tile, SignalType type, SignalVariant var, SignalState state, bool gui = false);
00049
00050 uint8 GetReverseRailTypeTranslation(RailType railtype, const GRFFile *grffile);
00051
00052 #endif