Freeciv-3.2
|
#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 129 of file savecompat.c.
typedef void(* load_version_func_t) (struct loaddata *loading, enum sgf_version format_class) |
Definition at line 85 of file savecompat.c.
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().
Translate savegame secfile data from 2.3.x to 2.4.0 format.
Definition at line 324 of file savecompat.c.
Translate savegame secfile data from 2.4.x to 2.5.0 format.
Definition at line 560 of file savecompat.c.
Translate savegame secfile data from 2.5.x to 2.6.0 format.
Definition at line 686 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 1292 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 1498 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 1894 of file savecompat.c.
|
static |
Update loaded game data from 3.0.x to something usable by 3.1.0.
Definition at line 1803 of file savecompat.c.
Return current compatibility version
Definition at line 205 of file savecompat.c.
Referenced by sg_save_savefile().
|
static |
Returns the opposite direction.
Definition at line 1681 of file savecompat.c.
Referenced by upgrade_unit_order_targets().
|
static |
Increase turn value in secfile by one.
Definition at line 1271 of file savecompat.c.
Referenced by compat_load_030000().
|
static |
Insert server side agent information.
Definition at line 1407 of file savecompat.c.
Referenced by compat_load_030100().
|
static |
Callback to get name of old killcitizen setting bit.
Definition at line 543 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 306 of file savecompat.c.
Referenced by char2resource().
|
static |
Return string representation of revolentype
Definition at line 667 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 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().
Upgrade unit activity orders to unit action orders.
Definition at line 1629 of file savecompat.c.
Referenced by compat_post_load_030100().
Correct the server side agent information.
Definition at line 1789 of file savecompat.c.
Referenced by compat_post_load_030100().
Upgrade unit action order target encoding.
Definition at line 1708 of file savecompat.c.
Referenced by compat_post_load_030100().
|
static |
Definition at line 105 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_buildings(), load_ruleset_cities(), load_ruleset_effects(), load_ruleset_game(), load_ruleset_governments(), load_ruleset_styles(), load_ruleset_techs(), load_ruleset_terrain(), load_ruleset_units(), load_style_names(), load_tech_names(), load_terrain_names(), load_unit_names(), lookup_req_list(), real_menus_update(), receive_packet_ruleset_road_100(), road_by_compat_special(), rscompat_action_rule_name_3_2(), rscompat_action_ui_name_3_2(), rscompat_genus_3_2(), rscompat_req_adjust_3_2(), rscompat_req_range_3_2(), 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 128 of file savecompat.c.
Referenced by sg_load_compat(), and sg_load_post_load_compat().
Definition at line 245 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().