diff options
author | terkhen <terkhen@openttd.org> | 2011-06-12 20:41:17 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2011-06-12 20:41:17 +0000 |
commit | 281bed03f4c7e7021a0b7c079cefe246f56e3fb9 (patch) | |
tree | 744141caf35170355b30e0d290afda69c9910ebc /src/table | |
parent | 0749c65d74e7368643e3c4f4f70768993e8b7f41 (diff) | |
download | openttd-281bed03f4c7e7021a0b7c079cefe246f56e3fb9.tar.xz |
(svn r22565) -Codechange: Use helper functions for getting the persistent storage in the NewGRF debug GUI.
Diffstat (limited to 'src/table')
-rw-r--r-- | src/table/newgrf_debug_data.h | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 240fd8ef0..39e9ee4a6 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -74,8 +74,6 @@ static const NIFeature _nif_vehicle = { _nic_vehicles, _niv_vehicles, new NIHVehicle(), - 0, - 0 }; @@ -132,8 +130,6 @@ static const NIFeature _nif_station = { _nic_stations, _niv_stations, new NIHStation(), - 0, - 0 }; @@ -193,8 +189,6 @@ static const NIFeature _nif_house = { _nic_house, _niv_house, new NIHHouse(), - 0, - 0 }; @@ -239,8 +233,6 @@ static const NIFeature _nif_industrytile = { _nic_industrytiles, _niv_industrytiles, new NIHIndustryTile(), - 0, - 0 }; @@ -299,6 +291,13 @@ class NIHIndustry : public NIHelper { const void *GetSpec(uint index) const { return GetIndustrySpec(Industry::Get(index)->type); } void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); } void Resolve(ResolverObject *ro, uint32 index) const { extern void GetIndustryResolver(ResolverObject *ro, uint index); GetIndustryResolver(ro, index); } + uint GetPSASize(uint index, uint32 grfid) const { return cpp_lengthof(Industry, psa.storage); } + + int32 *GetPSAFirstPosition(uint index, uint32 grfid) const + { + const void *base = this->GetInstance(index); + return (int32*)((byte*)base + cpp_offsetof(Industry, psa.storage)); + } }; static const NIFeature _nif_industry = { @@ -306,8 +305,6 @@ static const NIFeature _nif_industry = { _nic_industries, _niv_industries, new NIHIndustry(), - cpp_lengthof(Industry, psa.storage), - cpp_offsetof(Industry, psa.storage) }; @@ -357,8 +354,6 @@ static const NIFeature _nif_object = { _nic_objects, _niv_objects, new NIHObject(), - 0, - 0 }; @@ -385,8 +380,6 @@ static const NIFeature _nif_railtype = { NULL, _niv_railtypes, new NIHRailType(), - 0, - 0 }; @@ -415,8 +408,6 @@ static const NIFeature _nif_airporttile = { _nic_airporttiles, _niv_industrytiles, // Yes, they share this (at least now) new NIHAirportTile(), - 0, - 0 }; @@ -449,8 +440,6 @@ static const NIFeature _nif_town = { NULL, _niv_towns, new NIHTown(), - 0, - 0 }; /** Table with all NIFeatures. */ |