![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
Include dependency graph for savecompat.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | loaddata |
Macros | |
| #define | log_sg qCritical |
| #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 | hex_chars "0123456789abcdef" |
| #define | ORDER_OLD_BUILD_CITY (-1) |
| #define | ORDER_OLD_DISBAND (-2) |
| #define | ORDER_OLD_BUILD_WONDER (-3) |
| #define | ORDER_OLD_TRADE_ROUTE (-4) |
| #define | ORDER_OLD_HOMECITY (-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_ROAD , S_OLD_RAILROAD , S_OLD_RIVER } |
Functions | |
| void | sg_load_compat (struct loaddata *loading, enum sgf_version format_class) |
| Compatibility functions for loaded game. More... | |
| void | sg_load_post_load_compat (struct loaddata *loading, enum sgf_version format_class) |
| Compatibility functions for loaded game that needs game state. More... | |
| int | current_compat_ver () |
| Return current compatibility version. More... | |
| char | bin2ascii_hex (int value, int halfbyte_wanted) |
| This returns an ascii hex value of the given half-byte of the binary integer. More... | |
| 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. More... | |
| int | char2num (char ch) |
| Converts single character into numerical value. More... | |
| enum tile_special_type | special_by_rule_name (const char *name) |
| Return the special with the given name, or S_LAST. More... | |
| const char * | special_rule_name (enum tile_special_type type) |
| Return the untranslated name of the given special. More... | |
| struct extra_type * | special_extra_get (int spe) |
| Get extra of the given special. More... | |
| struct extra_type * | resource_by_identifier (const char identifier) |
| Return the resource type matching the identifier, or nullptr when none matches. More... | |
| enum ai_level | ai_level_convert (int old_level) |
| Translate savegame secfile data from earlier development version format to current one. More... | |
| enum barbarian_type | barb_type_convert (int old_type) |
| Convert old barbarian type value to barbarian_type. More... | |
| void | set_unit_activity_base (struct unit *punit, Base_type_id base) |
| Assign a new base building task to unit. More... | |
| void | set_unit_activity_road (struct unit *punit, Road_type_id road) |
| Assign a new road building task to unit. More... | |
| int | sg_order_to_action (int order, struct unit *act_unit, struct tile *tgt_tile) |
| Returns the action id corresponding to the specified order id. More... | |
| #define hex_chars "0123456789abcdef" |
Definition at line 176 of file savecompat.h.
| #define log_sg qCritical |
Definition at line 132 of file savecompat.h.
| #define ORDER_OLD_BUILD_CITY (-1) |
Definition at line 195 of file savecompat.h.
| #define ORDER_OLD_BUILD_WONDER (-3) |
Definition at line 197 of file savecompat.h.
| #define ORDER_OLD_DISBAND (-2) |
Definition at line 196 of file savecompat.h.
| #define ORDER_OLD_HOMECITY (-5) |
Definition at line 199 of file savecompat.h.
| #define ORDER_OLD_TRADE_ROUTE (-4) |
Definition at line 198 of file savecompat.h.
| #define sg_check_ret | ( | ... | ) |
Definition at line 134 of file savecompat.h.
| #define sg_check_ret_val | ( | _val | ) |
Definition at line 138 of file savecompat.h.
| #define sg_failure_ret | ( | condition, | |
| message, | |||
| ... | |||
| ) |
Definition at line 158 of file savecompat.h.
| #define sg_failure_ret_val | ( | condition, | |
| _val, | |||
| message, | |||
| ... | |||
| ) |
Definition at line 164 of file savecompat.h.
| #define sg_warn | ( | condition, | |
| message, | |||
| ... | |||
| ) |
Definition at line 143 of file savecompat.h.
| #define sg_warn_ret | ( | condition, | |
| message, | |||
| ... | |||
| ) |
Definition at line 147 of file savecompat.h.
| #define sg_warn_ret_val | ( | condition, | |
| _val, | |||
| message, | |||
| ... | |||
| ) |
Definition at line 152 of file savecompat.h.
| enum sgf_version |
| Enumerator | |
|---|---|
| SAVEGAME_2 | |
| SAVEGAME_3 | |
Definition at line 26 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_ROAD | |
| S_OLD_RAILROAD | |
| S_OLD_RIVER | |
Definition at line 28 of file savecompat.h.
| enum ai_level ai_level_convert | ( | int | old_level | ) |
Translate savegame secfile data from earlier development version format to current one.
Convert old ai level value to ai_level
Definition at line 1739 of file savecompat.cpp.
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 239 of file savecompat.cpp.
Referenced by compat_load_020400(), sg_load_map_known(), 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 1739 of file savecompat.cpp.
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 227 of file savecompat.cpp.
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 264 of file savecompat.cpp.
Referenced by compat_load_030100(), and sg_load_player_unit().
| int current_compat_ver | ( | ) |
Return current compatibility version.
Definition at line 220 of file savecompat.cpp.
Referenced by sg_save_savefile().
| struct extra_type* resource_by_identifier | ( | const char | identifier | ) |
Return the resource type matching the identifier, or nullptr when none matches.
Definition at line 321 of file savecompat.cpp.
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 2276 of file savecompat.cpp.
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 2285 of file savecompat.cpp.
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 140 of file savecompat.cpp.
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 191 of file savecompat.cpp.
Referenced by savegame2_load(), and savegame3_load().
Returns the action id corresponding to the specified order id.
If no corresponding action is found ACTION_NONE is returned.
Relevant tile content information must be loaded before this function is called. Tile content information is relevant if it determines what action an old order result in. Example: a 2.6 ORDER_BUILD_CITY would result in Join City inside a domestic city and in Found City on a tile without a city. That makes domestic cities relevant tile content information.
Intended to be used while loading unit orders from pre Freeciv 3.0.0 save games (savegame and savegame2). Should be deleted with savegame2.
Temporarily used to provide development version internal save game compatibility for what will become Freeciv21. This use should cease before Freeciv21 3.0.0 is released.
Should never be called from savegame3 after the 3.0 development version internal save game compatibility is removed.
Definition at line 2311 of file savecompat.cpp.
Referenced by sg_load_player_unit().
| enum tile_special_type special_by_rule_name | ( | const char * | name | ) |
Return the special with the given name, or S_LAST.
Definition at line 264 of file savecompat.cpp.
Referenced by sg_load_savefile().
| struct extra_type* special_extra_get | ( | int | spe | ) |
Get extra of the given special.
Definition at line 305 of file savecompat.cpp.
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 295 of file savecompat.cpp.
Referenced by sg_special_set().