Freeciv-3.2
|
Go to the source code of this file.
Data Structures | |
struct | loaddata |
Macros | |
#define | log_sg log_error |
#define | log_sgfix log_normal |
#define | sg_check_ret(...) |
#define | sg_check_ret_val(_val) |
#define | sg_warn(condition, message, ...) |
#define | sg_warn_ret(condition, message, ...) |
#define | sg_warn_ret_val(condition, _val, message, ...) |
#define | sg_failure_ret(condition, message, ...) |
#define | sg_failure_ret_val(condition, _val, message, ...) |
#define | sg_regr(fixversion, message, ...) |
#define | hex_chars "0123456789abcdef" |
#define | MAX_TRADE_ROUTES_OLD 5 |
Enumerations | |
enum | sgf_version { SAVEGAME_2 , SAVEGAME_3 } |
enum | tile_special_type { S_IRRIGATION , S_MINE , S_POLLUTION , S_HUT , S_FARMLAND , S_FALLOUT , S_LAST , S_OLD_FORTRESS , S_OLD_AIRBASE , S_OLD_ROAD , S_OLD_RAILROAD , S_OLD_RIVER } |
Functions | |
void | sg_load_compat (struct loaddata *loading, enum sgf_version format_class) |
void | sg_load_post_load_compat (struct loaddata *loading, enum sgf_version format_class) |
int | current_compat_ver (void) |
char | bin2ascii_hex (int value, int halfbyte_wanted) |
int | ascii_hex2bin (char ch, int halfbyte) |
int | char2num (char ch) |
enum tile_special_type | special_by_rule_name (const char *name) |
const char * | special_rule_name (enum tile_special_type type) |
struct extra_type * | special_extra_get (int spe) |
struct extra_type * | resource_by_identifier (const char identifier) |
enum ai_level | ai_level_convert (int old_level) |
enum barbarian_type | barb_type_convert (int old_type) |
#define hex_chars "0123456789abcdef" |
Definition at line 205 of file savecompat.h.
Definition at line 146 of file savecompat.h.
#define log_sgfix log_normal |
Definition at line 148 of file savecompat.h.
#define MAX_TRADE_ROUTES_OLD 5 |
Definition at line 222 of file savecompat.h.
#define sg_check_ret | ( | ... | ) |
Definition at line 150 of file savecompat.h.
Definition at line 155 of file savecompat.h.
Definition at line 177 of file savecompat.h.
Definition at line 184 of file savecompat.h.
#define sg_regr | ( | fixversion, | |
message, | |||
... | |||
) |
Definition at line 193 of file savecompat.h.
Definition at line 160 of file savecompat.h.
Definition at line 165 of file savecompat.h.
Definition at line 171 of file savecompat.h.
Enumerator | |
---|---|
SAVEGAME_2 | |
SAVEGAME_3 |
Definition at line 27 of file savecompat.h.
Enumerator | |
---|---|
S_IRRIGATION | |
S_MINE | |
S_POLLUTION | |
S_HUT | |
S_FARMLAND | |
S_FALLOUT | |
S_LAST | |
S_OLD_FORTRESS | |
S_OLD_AIRBASE | |
S_OLD_ROAD | |
S_OLD_RAILROAD | |
S_OLD_RIVER |
Definition at line 29 of file savecompat.h.
Convert old ai level value to ai_level
Definition at line 2406 of file savecompat.c.
Referenced by sg_load_player_main().
This returns a binary integer value of the ascii hex char, offset by the given number of half-bytes. See bin2ascii_hex(). example: ascii_hex2bin('a', 2) == 0xa00 This is only used in loading games, and it requires some error checking so it's done as a function.
Definition at line 227 of file savecompat.c.
Referenced by compat_load_020400(), sg_load_map_known(), sg_load_map_known(), sg_load_player_vision(), and sg_load_player_vision().
Convert old barbarian type value to barbarian_type
Definition at line 2435 of file savecompat.c.
Referenced by compat_load_020600().
This returns an ascii hex value of the given half-byte of the binary integer. See ascii_hex2bin(). example: bin2ascii_hex(0xa00, 2) == 'a'
Definition at line 215 of file savecompat.c.
Referenced by compat_load_020400(), sg_save_map_known(), and sg_save_player_vision().
Converts single character into numerical value. This is not hex conversion.
Definition at line 251 of file savecompat.c.
Referenced by compat_load_030100(), and sg_load_player_unit().
Return current compatibility version
Definition at line 205 of file savecompat.c.
Referenced by sg_save_savefile().
struct extra_type * resource_by_identifier | ( | const char | identifier | ) |
Return the resource type matching the identifier, or NULL when none matches.
Definition at line 306 of file savecompat.c.
Referenced by char2resource().
void sg_load_compat | ( | struct loaddata * | loading, |
enum sgf_version | format_class | ||
) |
Compatibility functions for loaded game.
This function is called at the beginning of loading a savegame. The data in loading->file should be change such, that the current loading functions can be executed without errors.
Definition at line 138 of file savecompat.c.
Referenced by savegame2_load(), and savegame3_load().
void sg_load_post_load_compat | ( | struct loaddata * | loading, |
enum sgf_version | format_class | ||
) |
Compatibility functions for loaded game that needs game state.
Some compatibility needs access to game state not available in sg_load_compat(). Do those here.
This function is called after a savegame has loaded the game state. The data should be changed in the game state since the game already is done loading. Prefer using sg_load_compat() when possible.
Definition at line 183 of file savecompat.c.
Referenced by savegame2_load(), and savegame3_load().
enum tile_special_type special_by_rule_name | ( | const char * | name | ) |
Return the special with the given name, or S_LAST.
Definition at line 266 of file savecompat.c.
Referenced by sg_load_savefile().
struct extra_type * special_extra_get | ( | int | spe | ) |
Get extra of the given special
Definition at line 292 of file savecompat.c.
Referenced by sg_load_player_unit().
const char * special_rule_name | ( | enum tile_special_type | type | ) |
Return the untranslated name of the given special.
Definition at line 282 of file savecompat.c.
Referenced by sg_special_set_bv(), and sg_special_set_dbv().