src/currency.h
branchgamebalance
changeset 9895 7bd07f43b0e3
parent 6449 e520244dc71e
child 6303 84c215fc8eb8
equal deleted inserted replaced
9894:70d78ac95d6c 9895:7bd07f43b0e3
    10 	CF_ISEURO = 1,
    10 	CF_ISEURO = 1,
    11 	NUM_CURRENCY = 28,
    11 	NUM_CURRENCY = 28,
    12 	CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1
    12 	CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1
    13 };
    13 };
    14 
    14 
    15 typedef struct {
    15 struct CurrencySpec {
    16 	uint16 rate;
    16 	uint16 rate;
    17 	char separator;
    17 	char separator;
    18 	Year to_euro;
    18 	Year to_euro;
    19 	char prefix[16];
    19 	char prefix[16];
    20 	char suffix[16];
    20 	char suffix[16];
    27 	 *            It is not a spec from Newgrf,
    27 	 *            It is not a spec from Newgrf,
    28 	 *            rather a way to let users do what they want with custom curency
    28 	 *            rather a way to let users do what they want with custom curency
    29 	 */
    29 	 */
    30 	byte symbol_pos;
    30 	byte symbol_pos;
    31 	StringID name;
    31 	StringID name;
    32 } CurrencySpec;
    32 };
    33 
    33 
    34 
    34 
    35 extern CurrencySpec _currency_specs[NUM_CURRENCY];
    35 extern CurrencySpec _currency_specs[NUM_CURRENCY];
    36 
    36 
    37 // XXX small hack, but makes the rest of the code a bit nicer to read
    37 // XXX small hack, but makes the rest of the code a bit nicer to read
    38 #define _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID])
    38 #define _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID])
    39 #define _currency ((const CurrencySpec*)&_currency_specs[_opt_ptr->currency])
    39 #define _currency ((const CurrencySpec*)&_currency_specs[_opt_ptr->currency])
    40 
    40 
    41 uint GetMaskOfAllowedCurrencies(void);
    41 uint GetMaskOfAllowedCurrencies();
    42 void CheckSwitchToEuro(void);
    42 void CheckSwitchToEuro();
    43 void ResetCurrencies(void);
    43 void ResetCurrencies();
    44 StringID* BuildCurrencyDropdown(void);
    44 StringID* BuildCurrencyDropdown();
    45 byte GetNewgrfCurrencyIdConverted(byte grfcurr_id);
    45 byte GetNewgrfCurrencyIdConverted(byte grfcurr_id);
    46 
    46 
    47 #endif /* CURRENCY_H */
    47 #endif /* CURRENCY_H */