(svn r18005) -Codechange: Convert the Prices struct into an array and an enum.

This commit is contained in:
frosch
2009-11-07 22:47:54 +00:00
parent 7984d90c40
commit ba1fc280e3
30 changed files with 249 additions and 242 deletions

View File

@@ -418,17 +418,17 @@ static void MapSpriteMappingRecolour(PalSpriteID *grf_sprite)
}
/**
* Converts TTD(P) Base Price pointers into the index used by OTTD
* Converts TTD(P) Base Price pointers into the enum used by OTTD
* See http://wiki.ttdpatch.net/tiki-index.php?page=BaseCosts
* @param base_pointer TTD(P) Base Price Pointer
* @param error_location Function name for grf error messages
* @param index If #base_pointer is valid, #index is assigned to the matching price; else it is left unchanged
*/
static void ConvertTTDBasePrice(uint32 base_pointer, const char *error_location, byte *index)
static void ConvertTTDBasePrice(uint32 base_pointer, const char *error_location, Price *index)
{
/* Special value for 'none' */
if (base_pointer == 0) {
*index = 0xFF;
*index = INVALID_PRICE;
return;
}
@@ -440,7 +440,7 @@ static void ConvertTTDBasePrice(uint32 base_pointer, const char *error_location,
return;
}
*index = (base_pointer - start) / size;
*index = (Price)((base_pointer - start) / size);
}
enum ChangeInfoResult {