Freeciv-3.4
|
#include "capability.h"
#include "log.h"
#include "map.h"
#include "specialist.h"
#include "aiiface.h"
#include "setcompat.h"
#include "settings.h"
#include "unittools.h"
#include "savecompat.h"
Go to the source code of this file.
Data Structures | |
struct | compatibility |
Macros | |
#define | compat_current (compat_num - 1) |
Typedefs | |
typedef void(* | load_version_func_t) (struct loaddata *loading, enum sgf_version format_class) |
Variables | |
bool | sg_success |
static char * | special_names [] |
static struct compatibility | compat [] |
static const int | compat_num = ARRAY_SIZE(compat) |
static const char | num_chars [] |
#define compat_current (compat_num - 1) |
Definition at line 142 of file savecompat.c.
typedef void(* load_version_func_t) (struct loaddata *loading, enum sgf_version format_class) |
Definition at line 94 of file savecompat.c.
Translate savegame secfile data from earlier development version format to current one. Convert old ai level value to ai_level
Definition at line 3157 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 252 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 3186 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 240 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 276 of file savecompat.c.
Referenced by compat_load_030100(), and sg_load_player_unit().
Translate savegame secfile data from 2.3.x to 2.4.0 format.
Definition at line 349 of file savecompat.c.
Translate savegame secfile data from 2.4.x to 2.5.0 format.
Definition at line 585 of file savecompat.c.
Translate savegame secfile data from 2.5.x to 2.6.0 format.
Definition at line 711 of file savecompat.c.
Translate savegame secfile data from 2.6.x to 3.0.0 format. Note that even after 2.6 savegame has gone through this compatibility function, it's still 2.6 savegame in the sense that savegame2.c, and not savegame3.c, handles it.
Definition at line 1317 of file savecompat.c.
Translate savegame secfile data from 3.0.x to 3.1.0 format. Note that even after 2.6 savegame has gone through all the compatibility functions, it's still 2.6 savegame in the sense that savegame2.c, and not savegame3.c, handles it.
Definition at line 1523 of file savecompat.c.
Translate savegame secfile data from 3.1.x to 3.2.0 format. Note that even after 2.6 savegame has gone through all the compatibility functions, it's still 2.6 savegame in the sense that savegame2.c, and not savegame3.c, handles it.
Definition at line 1919 of file savecompat.c.
Translate savegame secfile data from 3.2.x to 3.3.0 format. Note that even after 2.6 savegame has gone through all the compatibility functions, it's still 2.6 savegame in the sense that savegame2.c, and not savegame3.c, handles it.
Definition at line 2434 of file savecompat.c.
Translate savegame secfile data from 3.3.x to 3.4.0 format. Note that even after 2.6 savegame has gone through all the compatibility functions, it's still 2.6 savegame in the sense that savegame2.c, and not savegame3.c, handles it.
Definition at line 2659 of file savecompat.c.
|
static |
Update loaded game data from 3.0.x to something usable by 3.1.0.
Definition at line 1828 of file savecompat.c.
Return current compatibility version
Definition at line 230 of file savecompat.c.
Referenced by sg_save_savefile().
|
static |
Returns the opposite direction.
Definition at line 1706 of file savecompat.c.
Referenced by upgrade_unit_order_targets().
|
static |
Increase turn value in secfile by one.
Definition at line 1296 of file savecompat.c.
Referenced by compat_load_030000().
|
static |
Insert server side agent information.
Definition at line 1432 of file savecompat.c.
Referenced by compat_load_030100().
|
static |
Callback to get name of old killcitizen setting bit.
Definition at line 568 of file savecompat.c.
Referenced by compat_load_020500().
struct extra_type * resource_by_identifier | ( | const char | identifier | ) |
Return the resource type matching the identifier, or NULL when none matches.
Definition at line 331 of file savecompat.c.
Referenced by char2resource().
|
static |
Return string representation of revolentype
Definition at line 692 of file savecompat.c.
Referenced by compat_load_020600().
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 151 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 202 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 291 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 317 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 307 of file savecompat.c.
Referenced by sg_special_set_bv(), and sg_special_set_dbv().
Upgrade unit activity orders to unit action orders.
Definition at line 1654 of file savecompat.c.
Referenced by compat_post_load_030100().
Correct the server side agent information.
Definition at line 1814 of file savecompat.c.
Referenced by compat_post_load_030100().
Upgrade unit action order target encoding.
Definition at line 1733 of file savecompat.c.
Referenced by compat_post_load_030100().
|
static |
Definition at line 114 of file savecompat.c.
Referenced by current_compat_ver(), load_action_names(), load_building_names(), load_game_names(), load_government_names(), load_nation_names(), load_ruleset_actions(), load_ruleset_cities(), load_ruleset_effects(), load_style_names(), load_tech_names(), load_terrain_names(), load_unit_names(), real_menus_update(), receive_packet_ruleset_road_100(), road_by_compat_special(), sanity_check_ruleset_data(), setting_ruleset_one(), settings_ruleset(), sg_load_compat(), sg_load_post_load_compat(), and sg_load_savefile().
|
static |
Definition at line 141 of file savecompat.c.
Referenced by sg_load_compat(), and sg_load_post_load_compat().
Definition at line 270 of file savecompat.c.
Referenced by char2num().
bool sg_success |
Definition at line 34 of file savecompat.c.
Referenced by savegame2_load(), savegame3_load(), savegame3_save_real(), and sg_load_savefile().
|
static |
Definition at line 36 of file savecompat.c.
Referenced by special_by_rule_name(), and special_rule_name().