mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r22564) -Codechange: Rename Get and Store persistent storage functions to GetValue and StoreValue.
This commit is contained in:
parent
dc6218aa49
commit
0749c65d74
|
@ -149,7 +149,7 @@ uint32 AirportGetVariable(const ResolverObject *object, byte variable, byte para
|
|||
|
||||
switch (variable) {
|
||||
/* Get a variable from the persistent storage */
|
||||
case 0x7C: return st->airport.psa.Get(parameter);
|
||||
case 0x7C: return st->airport.psa.GetValue(parameter);
|
||||
|
||||
case 0xF0: return st->facilities;
|
||||
case 0xFA: return Clamp(st->build_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 65535);
|
||||
|
@ -194,7 +194,7 @@ void AirportStorePSA(ResolverObject *object, uint pos, int32 value)
|
|||
{
|
||||
Station *st = object->u.airport.st;
|
||||
if (object->scope != VSG_SCOPE_SELF || st == NULL) return;
|
||||
st->airport.psa.Store(pos, value);
|
||||
st->airport.psa.StoreValue(pos, value);
|
||||
}
|
||||
|
||||
static void NewAirportResolver(ResolverObject *res, TileIndex tile, Station *st, byte airport_id, byte layout)
|
||||
|
|
|
@ -283,7 +283,7 @@ uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte par
|
|||
}
|
||||
|
||||
/* Get a variable from the persistent storage */
|
||||
case 0x7C: return industry->psa.Get(parameter);
|
||||
case 0x7C: return industry->psa.GetValue(parameter);
|
||||
|
||||
/* Industry structure access*/
|
||||
case 0x80: return industry->location.tile;
|
||||
|
@ -386,7 +386,7 @@ void IndustryStorePSA(ResolverObject *object, uint pos, int32 value)
|
|||
{
|
||||
Industry *ind = object->u.industry.ind;
|
||||
if (object->scope != VSG_SCOPE_SELF || ind->index == INVALID_INDUSTRY) return;
|
||||
ind->psa.Store(pos, value);
|
||||
ind->psa.StoreValue(pos, value);
|
||||
}
|
||||
|
||||
static void NewIndustryResolver(ResolverObject *res, TileIndex tile, Industry *indus, IndustryType type)
|
||||
|
|
|
@ -158,7 +158,7 @@ void IndustryTileStorePSA(ResolverObject *object, uint pos, int32 value)
|
|||
{
|
||||
Industry *ind = object->u.industry.ind;
|
||||
if (object->scope != VSG_SCOPE_PARENT || ind->index == INVALID_INDUSTRY) return;
|
||||
ind->psa.Store(pos, value);
|
||||
ind->psa.StoreValue(pos, value);
|
||||
}
|
||||
|
||||
static void NewIndustryTileResolver(ResolverObject *res, IndustryGfx gfx, TileIndex tile, Industry *indus)
|
||||
|
|
|
@ -53,7 +53,7 @@ static inline uint32 GetVariable(const ResolverObject *object, byte variable, by
|
|||
|
||||
case 0x5F: return (object->GetRandomBits(object) << 8) | object->GetTriggers(object);
|
||||
|
||||
case 0x7D: return _temp_store.Get(parameter);
|
||||
case 0x7D: return _temp_store.GetValue(parameter);
|
||||
|
||||
case 0x7F:
|
||||
if (object == NULL || object->grffile == NULL) return 0;
|
||||
|
@ -111,7 +111,7 @@ static U EvalAdjustT(const DeterministicSpriteGroupAdjust *adjust, ResolverObjec
|
|||
case DSGA_OP_AND: return last_value & value;
|
||||
case DSGA_OP_OR: return last_value | value;
|
||||
case DSGA_OP_XOR: return last_value ^ value;
|
||||
case DSGA_OP_STO: _temp_store.Store((U)value, (S)last_value); return last_value;
|
||||
case DSGA_OP_STO: _temp_store.StoreValue((U)value, (S)last_value); return last_value;
|
||||
case DSGA_OP_RST: return value;
|
||||
case DSGA_OP_STOP: if (object->StorePSA != NULL) object->StorePSA(object, (U)value, (S)last_value); return last_value;
|
||||
case DSGA_OP_ROR: return RotateRight(last_value, value);
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
static inline uint32 GetRegister(uint i)
|
||||
{
|
||||
extern TemporaryStorageArray<int32, 0x110> _temp_store;
|
||||
return _temp_store.Get(i);
|
||||
return _temp_store.GetValue(i);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -43,7 +43,7 @@ static inline uint32 GetRegister(uint i)
|
|||
static inline void ClearRegister(uint i)
|
||||
{
|
||||
extern TemporaryStorageArray<int32, 0x110> _temp_store;
|
||||
_temp_store.Store(i, 0);
|
||||
_temp_store.StoreValue(i, 0);
|
||||
}
|
||||
|
||||
/* List of different sprite group types */
|
||||
|
|
|
@ -36,7 +36,7 @@ struct BaseStorageArray
|
|||
* @param pos the position to write at
|
||||
* @param value the value to write
|
||||
*/
|
||||
virtual void Store(uint pos, int32 value) = 0;
|
||||
virtual void StoreValue(uint pos, int32 value) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -75,7 +75,7 @@ struct PersistentStorageArray : BaseStorageArray {
|
|||
* @param pos the position to write at
|
||||
* @param value the value to write
|
||||
*/
|
||||
void Store(uint pos, int32 value)
|
||||
void StoreValue(uint pos, int32 value)
|
||||
{
|
||||
/* Out of the scope of the array */
|
||||
if (pos >= SIZE) return;
|
||||
|
@ -102,7 +102,7 @@ struct PersistentStorageArray : BaseStorageArray {
|
|||
* @param pos the position to get the data from
|
||||
* @return the data from that position
|
||||
*/
|
||||
TYPE Get(uint pos) const
|
||||
TYPE GetValue(uint pos) const
|
||||
{
|
||||
/* Out of the scope of the array */
|
||||
if (pos >= SIZE) return 0;
|
||||
|
@ -147,7 +147,7 @@ struct TemporaryStorageArray : BaseStorageArray {
|
|||
* @param pos the position to write at
|
||||
* @param value the value to write
|
||||
*/
|
||||
void Store(uint pos, int32 value)
|
||||
void StoreValue(uint pos, int32 value)
|
||||
{
|
||||
/* Out of the scope of the array */
|
||||
if (pos >= SIZE) return;
|
||||
|
@ -161,7 +161,7 @@ struct TemporaryStorageArray : BaseStorageArray {
|
|||
* @param pos the position to get the data from
|
||||
* @return the data from that position
|
||||
*/
|
||||
TYPE Get(uint pos) const
|
||||
TYPE GetValue(uint pos) const
|
||||
{
|
||||
/* Out of the scope of the array */
|
||||
if (pos >= SIZE) return 0;
|
||||
|
|
|
@ -967,7 +967,7 @@ void PrepareTextRefStackUsage(byte numEntries)
|
|||
byte *p = _newgrf_textrefstack->stack;
|
||||
for (uint i = 0; i < numEntries; i++) {
|
||||
for (uint j = 0; j < 32; j += 8) {
|
||||
*p = GB(_temp_store.Get(0x100 + i), j, 8);
|
||||
*p = GB(_temp_store.GetValue(0x100 + i), j, 8);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue