changeset 17779:c4ca794c8396 draft

(svn r22564) -Codechange: Rename Get and Store persistent storage functions to GetValue and StoreValue.
author terkhen <terkhen@openttd.org>
date Sun, 12 Jun 2011 20:40:21 +0000
parents 878445afa25b
children 6da2ed3e68e4
files src/newgrf_airport.cpp src/newgrf_industries.cpp src/newgrf_industrytiles.cpp src/newgrf_spritegroup.cpp src/newgrf_spritegroup.h src/newgrf_storage.h src/newgrf_text.cpp
diffstat 7 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/newgrf_airport.cpp
+++ b/src/newgrf_airport.cpp
@@ -149,7 +149,7 @@
 
 	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 @@
 {
 	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)
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -283,7 +283,7 @@
 		}
 
 		/* 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 @@
 {
 	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)
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -158,7 +158,7 @@
 {
 	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)
--- a/src/newgrf_spritegroup.cpp
+++ b/src/newgrf_spritegroup.cpp
@@ -53,7 +53,7 @@
 
 		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 @@
 		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);
--- a/src/newgrf_spritegroup.h
+++ b/src/newgrf_spritegroup.h
@@ -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 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 */
--- a/src/newgrf_storage.h
+++ b/src/newgrf_storage.h
@@ -36,7 +36,7 @@
 	 * @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 @@
 	 * @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 @@
 	 * @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 @@
 	 * @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 @@
 	 * @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;
--- a/src/newgrf_text.cpp
+++ b/src/newgrf_text.cpp
@@ -967,7 +967,7 @@
 	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++;
 		}
 	}