currency.h
author Darkvater
Sun, 29 Jan 2006 19:50:01 +0000
changeset 2919 3e42ca528f01
parent 2468 9ea52370a093
child 3596 6654541a3958
permissions -rw-r--r--
(svn r3475) - Fix: you couldn't remove an item from a list-type of config ingame from the configuration file. Whatever you did, upon restart of OpenTTD those items were still there. To fix this we initialize the first item to NULL in SaveList as it is rebuilt anyways fully.
2292
0b9d6e4ea0e6 (svn r2816) Forgot an Id tag and an #include
tron
parents: 2291
diff changeset
     1
/* $Id$ */
0b9d6e4ea0e6 (svn r2816) Forgot an Id tag and an #include
tron
parents: 2291
diff changeset
     2
2291
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
     3
#ifndef CURRENCY_H
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
     4
#define CURRENCY_H
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
     5
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
     6
enum {
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
     7
	CF_NOEURO = 0,
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
     8
	CF_ISEURO = 1,
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
     9
};
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    10
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    11
typedef struct {
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    12
	uint16 rate;
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    13
	char separator;
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    14
	uint16 to_euro;
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    15
	char prefix[16];
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    16
	char suffix[16];
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    17
} CurrencySpec;
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    18
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    19
extern CurrencySpec _currency_specs[];
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    20
extern const StringID _currency_string_list[];
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    21
2306
adb71c055afb (svn r2830) Move CheckSwitchToEuro() to currency.[ch] and hide the truth about the custom currency behind a #define
tron
parents: 2292
diff changeset
    22
// XXX small hack, but makes the rest of the code a bit nicer to read
adb71c055afb (svn r2830) Move CheckSwitchToEuro() to currency.[ch] and hide the truth about the custom currency behind a #define
tron
parents: 2292
diff changeset
    23
#define _custom_currency (_currency_specs[23])
2468
9ea52370a093 (svn r2994) Another small hack regarding currencies: add a #define to emulate a variable, that holds the current currency; again this should increase readability
tron
parents: 2436
diff changeset
    24
#define _currency ((const CurrencySpec*)&_currency_specs[_opt_ptr->currency])
2306
adb71c055afb (svn r2830) Move CheckSwitchToEuro() to currency.[ch] and hide the truth about the custom currency behind a #define
tron
parents: 2292
diff changeset
    25
2291
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    26
uint GetMaskOfAllowedCurrencies(void);
2306
adb71c055afb (svn r2830) Move CheckSwitchToEuro() to currency.[ch] and hide the truth about the custom currency behind a #define
tron
parents: 2292
diff changeset
    27
void CheckSwitchToEuro(void);
2291
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents:
diff changeset
    28
2436
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2306
diff changeset
    29
#endif /* CURRENCY_H */