Freeciv-3.1
|
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" |
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) |
void | set_unit_activity_base (struct unit *punit, Base_type_id base) |
void | set_unit_activity_road (struct unit *punit, Road_type_id road) |
#define hex_chars "0123456789abcdef" |
Definition at line 196 of file savecompat.h.
#define log_sg log_error |
Definition at line 137 of file savecompat.h.
#define log_sgfix log_normal |
Definition at line 139 of file savecompat.h.
#define sg_check_ret | ( | ... | ) |
Definition at line 141 of file savecompat.h.
#define sg_check_ret_val | ( | _val | ) |
Definition at line 146 of file savecompat.h.
#define sg_failure_ret | ( | condition, | |
message, | |||
... | |||
) |
Definition at line 168 of file savecompat.h.
#define sg_failure_ret_val | ( | condition, | |
_val, | |||
message, | |||
... | |||
) |
Definition at line 175 of file savecompat.h.
#define sg_regr | ( | fixversion, | |
message, | |||
... | |||
) |
Definition at line 184 of file savecompat.h.
#define sg_warn | ( | condition, | |
message, | |||
... | |||
) |
Definition at line 151 of file savecompat.h.
#define sg_warn_ret | ( | condition, | |
message, | |||
... | |||
) |
Definition at line 156 of file savecompat.h.
#define sg_warn_ret_val | ( | condition, | |
_val, | |||
message, | |||
... | |||
) |
Definition at line 162 of file savecompat.h.
enum sgf_version |
Enumerator | |
---|---|
SAVEGAME_2 | |
SAVEGAME_3 |
Definition at line 27 of file savecompat.h.
enum tile_special_type |
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.
enum ai_level ai_level_convert | ( | int | old_level | ) |
Convert old ai level value to ai_level
Definition at line 1883 of file savecompat.c.
Referenced by sg_load_game(), and sg_load_player_main().
int ascii_hex2bin | ( | char | ch, |
int | halfbyte | ||
) |
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 221 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().
enum barbarian_type barb_type_convert | ( | int | old_type | ) |
Convert old barbarian type value to barbarian_type
Definition at line 1912 of file savecompat.c.
Referenced by compat_load_020600().
char bin2ascii_hex | ( | int | value, |
int | halfbyte_wanted | ||
) |
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 209 of file savecompat.c.
Referenced by compat_load_020400(), sg_save_map_known(), and sg_save_player_vision().
int char2num | ( | char | ch | ) |
Converts single character into numerical value. This is not hex conversion.
Definition at line 245 of file savecompat.c.
Referenced by compat_load_030100(), and sg_load_player_unit().
int current_compat_ver | ( | void | ) |
Return current compatibility version
Definition at line 199 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 300 of file savecompat.c.
Referenced by char2resource().
void set_unit_activity_base | ( | struct unit * | punit, |
Base_type_id | base | ||
) |
Assign a new base building task to unit
Definition at line 1929 of file savecompat.c.
Referenced by sg_load_player_unit().
void set_unit_activity_road | ( | struct unit * | punit, |
Road_type_id | road | ||
) |
Assign a new road building task to unit
Definition at line 1939 of file savecompat.c.
Referenced by sg_load_player_unit().
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 132 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 177 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 260 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 286 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 276 of file savecompat.c.
Referenced by sg_special_set().