Freeciv-3.3
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
savegame3.c File Reference
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bitvector.h"
#include "fcintl.h"
#include "idex.h"
#include "log.h"
#include "mem.h"
#include "rand.h"
#include "registry.h"
#include "shared.h"
#include "support.h"
#include "timing.h"
#include "achievements.h"
#include "ai.h"
#include "capability.h"
#include "citizens.h"
#include "city.h"
#include "counters.h"
#include "game.h"
#include "government.h"
#include "map.h"
#include "mapimg.h"
#include "movement.h"
#include "multipliers.h"
#include "packets.h"
#include "research.h"
#include "rgbcolor.h"
#include "sex.h"
#include "specialist.h"
#include "unit.h"
#include "unitlist.h"
#include "version.h"
#include "barbarian.h"
#include "citizenshand.h"
#include "citytools.h"
#include "cityturn.h"
#include "diplhand.h"
#include "maphand.h"
#include "meta.h"
#include "notify.h"
#include "plrhand.h"
#include "report.h"
#include "ruleload.h"
#include "sanitycheck.h"
#include "savecompat.h"
#include "score.h"
#include "settings.h"
#include "spacerace.h"
#include "srv_main.h"
#include "stdinhand.h"
#include "techtools.h"
#include "unittools.h"
#include "advdata.h"
#include "advbuilding.h"
#include "infracache.h"
#include "mapgen.h"
#include "mapgen_utils.h"
#include "script_server.h"
#include "aitraits.h"
#include "difficulty.h"
#include "savegame3.h"

Go to the source code of this file.

Data Structures

struct  savedata
 
struct  treaty_cb_data
 

Macros

#define ACTIVITY_OLD_POLLUTION_SG3   (ACTIVITY_LAST + 1)
 
#define ACTIVITY_OLD_FALLOUT_SG3   (ACTIVITY_OLD_POLLUTION_SG3 + 1)
 
#define ACTIVITY_LAST_SAVEGAME3   (ACTIVITY_OLD_FALLOUT_SG3 + 1)
 
#define SAVE_MAP_CHAR(ptile, GET_XY_CHAR, secfile, secpath, ...)
 
#define LOAD_MAP_CHAR(ch, ptile, SET_XY_CHAR, secfile, secpath, ...)
 
#define halfbyte_iterate_extras(e, num_extras_types)
 
#define halfbyte_iterate_extras_end
 
#define TOKEN_SIZE   10
 
#define PART_SIZE   (3*256)
 
#define PART_ADJUST   (3)
 

Functions

static void savegame3_save_real (struct section_file *file, const char *save_reason, bool scenario)
 
static struct loaddataloaddata_new (struct section_file *file)
 
static void loaddata_destroy (struct loaddata *loading)
 
static struct savedatasavedata_new (struct section_file *file, const char *save_reason, bool scenario)
 
static void savedata_destroy (struct savedata *saving)
 
static enum unit_orders char2order (char order)
 
static char order2char (enum unit_orders order)
 
static enum direction8 char2dir (char dir)
 
static char dir2char (enum direction8 dir)
 
static char activity2char (int activity)
 
static enum unit_activity char2activity (char activity)
 
static charquote_block (const void *const data, int length)
 
static int unquote_block (const char *const quoted_, void *dest, int dest_length)
 
static void worklist_load (struct section_file *file, int wlist_max_length, struct worklist *pwl, const char *path,...)
 
static void worklist_save (struct section_file *file, const struct worklist *pwl, int max_length, const char *path,...)
 
static void unit_ordering_calc (void)
 
static void unit_ordering_apply (void)
 
static void sg_extras_set_dbv (struct dbv *extras, char ch, struct extra_type **idx)
 
static void sg_extras_set_bv (bv_extras *extras, char ch, struct extra_type **idx)
 
static char sg_extras_get_dbv (struct dbv *extras, struct extra_type *presource, const int *idx)
 
static char sg_extras_get_bv (bv_extras extras, struct extra_type *presource, const int *idx)
 
static struct terrainchar2terrain (char ch)
 
static char terrain2char (const struct terrain *pterrain)
 
static Tech_type_id technology_load (struct section_file *file, const char *path, int plrno)
 
static void technology_save (struct section_file *file, const char *path, int plrno, Tech_type_id tech)
 
static void sg_load_savefile (struct loaddata *loading)
 
static void sg_save_savefile (struct savedata *saving)
 
static void sg_save_savefile_options (struct savedata *saving, const char *option)
 
static void sg_load_game (struct loaddata *loading)
 
static void sg_save_game (struct savedata *saving)
 
static void sg_load_ruledata (struct loaddata *loading)
 
static void sg_save_ruledata (struct savedata *saving)
 
static void sg_load_random (struct loaddata *loading)
 
static void sg_save_random (struct savedata *saving)
 
static void sg_load_script (struct loaddata *loading)
 
static void sg_save_script (struct savedata *saving)
 
static void sg_load_scenario (struct loaddata *loading)
 
static void sg_save_scenario (struct savedata *saving)
 
static void sg_load_settings (struct loaddata *loading)
 
static void sg_save_settings (struct savedata *saving)
 
static void sg_load_counters (struct loaddata *loading)
 
static void sg_save_counters (struct savedata *saving)
 
static void sg_load_map (struct loaddata *loading)
 
static void sg_save_map (struct savedata *saving)
 
static void sg_load_map_tiles (struct loaddata *loading)
 
static void sg_load_map_altitude (struct loaddata *loading)
 
static void sg_save_map_tiles (struct savedata *saving)
 
static void sg_save_map_altitude (struct savedata *saving)
 
static void sg_load_map_tiles_extras (struct loaddata *loading)
 
static void sg_save_map_tiles_extras (struct savedata *saving)
 
static void sg_load_map_startpos (struct loaddata *loading)
 
static void sg_save_map_startpos (struct savedata *saving)
 
static void sg_load_map_owner (struct loaddata *loading)
 
static void sg_save_map_owner (struct savedata *saving)
 
static void sg_load_map_worked (struct loaddata *loading)
 
static void sg_save_map_worked (struct savedata *saving)
 
static void sg_load_map_known (struct loaddata *loading)
 
static void sg_save_map_known (struct savedata *saving)
 
static void sg_load_players_basic (struct loaddata *loading)
 
static void sg_load_players (struct loaddata *loading)
 
static void sg_load_player_main (struct loaddata *loading, struct player *plr)
 
static void sg_load_player_cities (struct loaddata *loading, struct player *plr)
 
static bool sg_load_player_city (struct loaddata *loading, struct player *plr, struct city *pcity, const char *citystr, int wlist_max_length, int routes_max)
 
static void sg_load_player_city_citizens (struct loaddata *loading, struct player *plr, struct city *pcity, const char *citystr)
 
static void sg_load_player_units (struct loaddata *loading, struct player *plr)
 
static bool sg_load_player_unit (struct loaddata *loading, struct player *plr, struct unit *punit, int orders_max_length, const char *unitstr)
 
static void sg_load_player_units_transport (struct loaddata *loading, struct player *plr)
 
static void sg_load_player_attributes (struct loaddata *loading, struct player *plr)
 
static void sg_load_player_vision (struct loaddata *loading, struct player *plr)
 
static bool sg_load_player_vision_city (struct loaddata *loading, struct player *plr, struct vision_site *pdcity, const char *citystr)
 
static void sg_save_players (struct savedata *saving)
 
static void sg_save_player_main (struct savedata *saving, struct player *plr)
 
static void sg_save_player_cities (struct savedata *saving, struct player *plr)
 
static void sg_save_player_units (struct savedata *saving, struct player *plr)
 
static void sg_save_player_attributes (struct savedata *saving, struct player *plr)
 
static void sg_save_player_vision (struct savedata *saving, struct player *plr)
 
static void sg_load_researches (struct loaddata *loading)
 
static void sg_save_researches (struct savedata *saving)
 
static void sg_load_event_cache (struct loaddata *loading)
 
static void sg_save_event_cache (struct savedata *saving)
 
static void sg_load_treaties (struct loaddata *loading)
 
static void sg_save_treaties (struct savedata *saving)
 
static void sg_load_history (struct loaddata *loading)
 
static void sg_save_history (struct savedata *saving)
 
static void sg_load_mapimg (struct loaddata *loading)
 
static void sg_save_mapimg (struct savedata *saving)
 
static void sg_load_sanitycheck (struct loaddata *loading)
 
static void sg_save_sanitycheck (struct savedata *saving)
 
void savegame3_save (struct section_file *sfile, const char *save_reason, bool scenario)
 
void savegame3_load (struct section_file *file)
 
static void treaty_save (struct treaty *ptr, void *data_in)
 

Variables

bool sg_success
 
static const char savefile_options_default []
 

Macro Definition Documentation

◆ ACTIVITY_LAST_SAVEGAME3

#define ACTIVITY_LAST_SAVEGAME3   (ACTIVITY_OLD_FALLOUT_SG3 + 1)

Definition at line 153 of file savegame3.c.

◆ ACTIVITY_OLD_FALLOUT_SG3

#define ACTIVITY_OLD_FALLOUT_SG3   (ACTIVITY_OLD_POLLUTION_SG3 + 1)

Definition at line 152 of file savegame3.c.

◆ ACTIVITY_OLD_POLLUTION_SG3

#define ACTIVITY_OLD_POLLUTION_SG3   (ACTIVITY_LAST + 1)

Definition at line 151 of file savegame3.c.

◆ halfbyte_iterate_extras

#define halfbyte_iterate_extras (   e,
  num_extras_types 
)
Value:
{ \
int e; \
for (e = 0; 4 * e < (num_extras_types); e++) {
char * incite_cost
Definition comments.c:76

Definition at line 255 of file savegame3.c.

◆ halfbyte_iterate_extras_end

#define halfbyte_iterate_extras_end
Value:
} \
}

Definition at line 260 of file savegame3.c.

◆ LOAD_MAP_CHAR

#define LOAD_MAP_CHAR (   ch,
  ptile,
  SET_XY_CHAR,
  secfile,
  secpath,
  ... 
)

Definition at line 219 of file savegame3.c.

◆ PART_ADJUST

#define PART_ADJUST   (3)

◆ PART_SIZE

#define PART_SIZE   (3*256)

◆ SAVE_MAP_CHAR

#define SAVE_MAP_CHAR (   ptile,
  GET_XY_CHAR,
  secfile,
  secpath,
  ... 
)
Value:
{ \
char _line[MAP_NATIVE_WIDTH + 1]; \
int _nat_x, _nat_y; \
struct tile *ptile = native_pos_to_tile(&(wld.map), _nat_x, _nat_y); \
fc_assert_action(ptile != NULL, continue); \
"Trying to write invalid map data at position " \
"(%d, %d) for path %s: '%c' (%d)", _nat_x, _nat_y, \
} \
} \
}
struct world wld
Definition game.c:62
struct tile * native_pos_to_tile(const struct civ_map *nmap, int nat_x, int nat_y)
Definition map.c:458
Definition tile.h:50
struct civ_map map
bool fc_isprint(char c)
Definition support.c:1229
#define MAP_NATIVE_WIDTH
#define MAP_NATIVE_HEIGHT

Definition at line 172 of file savegame3.c.

◆ TOKEN_SIZE

#define TOKEN_SIZE   10

Definition at line 276 of file savegame3.c.

Function Documentation

◆ activity2char()

static char activity2char ( int  activity)
static

Returns a character identifier for an activity. See also char2activity().

activity type is 'int', and not 'enum_activity' for supporting deprecated values (..._OLD_...)

Definition at line 823 of file savegame3.c.

Referenced by char2activity(), sg_save_player_cities(), and sg_save_player_units().

◆ char2activity()

static enum unit_activity char2activity ( char  activity)
static

Returns an activity for a character identifier. See also activity2char().

Definition at line 874 of file savegame3.c.

Referenced by sg_load_player_city(), and sg_load_player_unit().

◆ char2dir()

static enum direction8 char2dir ( char  dir)
static

Returns a direction for a character identifier. See also dir2char.

Definition at line 761 of file savegame3.c.

Referenced by sg_load_player_city(), and sg_load_player_unit().

◆ char2order()

static enum unit_orders char2order ( char  order)
static

Returns an order for a character identifier. See also order2char.

Definition at line 710 of file savegame3.c.

Referenced by sg_load_player_city(), and sg_load_player_unit().

◆ char2terrain()

static struct terrain * char2terrain ( char  ch)
static

Dereferences the terrain character. See terrains[].identifier example: char2terrain('a') => T_ARCTIC

Definition at line 1227 of file savegame3.c.

Referenced by sg_load_map_tiles(), and sg_load_player_vision().

◆ dir2char()

static char dir2char ( enum direction8  dir)
static

Returns a character identifier for a direction. See also char2dir.

Definition at line 790 of file savegame3.c.

Referenced by sg_save_player_cities(), and sg_save_player_units().

◆ loaddata_destroy()

static void loaddata_destroy ( struct loaddata loading)
static

Free resources allocated for loaddata item.

Definition at line 623 of file savegame3.c.

Referenced by savegame3_load().

◆ loaddata_new()

static struct loaddata * loaddata_new ( struct section_file file)
static

Create new loaddata item for given section file.

Definition at line 584 of file savegame3.c.

Referenced by savegame3_load().

◆ order2char()

static char order2char ( enum unit_orders  order)
static

Returns a character identifier for an order. See also char2order.

Definition at line 737 of file savegame3.c.

Referenced by sg_save_player_cities(), and sg_save_player_units().

◆ quote_block()

static char * quote_block ( const void *const  data,
int  length 
)
static

Quote the memory block denoted by data and length so it consists only of " a-f0-9:". The returned string has to be freed by the caller using free().

Definition at line 897 of file savegame3.c.

Referenced by sg_save_player_attributes().

◆ savedata_destroy()

static void savedata_destroy ( struct savedata saving)
static

Free resources allocated for savedata item

Definition at line 698 of file savegame3.c.

Referenced by savegame3_save_real().

◆ savedata_new()

static struct savedata * savedata_new ( struct section_file file,
const char save_reason,
bool  scenario 
)
static

Create new savedata item for given file.

Definition at line 679 of file savegame3.c.

Referenced by savegame3_save_real().

◆ savegame3_load()

void savegame3_load ( struct section_file file)

Really loading the savegame.

Definition at line 458 of file savegame3.c.

Referenced by savegame_load().

◆ savegame3_save()

void savegame3_save ( struct section_file sfile,
const char save_reason,
bool  scenario 
)

Main entry point for saving a game in savegame3 format.

Definition at line 431 of file savegame3.c.

Referenced by savegame_save().

◆ savegame3_save_real()

static void savegame3_save_real ( struct section_file file,
const char save_reason,
bool  scenario 
)
static

Really save the game to a file.

Definition at line 527 of file savegame3.c.

Referenced by savegame3_save().

◆ sg_extras_get_bv()

static char sg_extras_get_bv ( bv_extras  extras,
struct extra_type presource,
const int idx 
)
static

Helper function for saving extras into a savegame.

Extras are packed in four to a character in hex notation. 'index' specifies which set of extras are included in this character.

Definition at line 1198 of file savegame3.c.

Referenced by sg_save_map_tiles_extras().

◆ sg_extras_get_dbv()

static char sg_extras_get_dbv ( struct dbv extras,
struct extra_type presource,
const int idx 
)
static

Helper function for saving extras into a savegame.

Extras are packed in four to a character in hex notation. 'index' specifies which set of extras are included in this character.

Definition at line 1165 of file savegame3.c.

Referenced by sg_save_player_vision().

◆ sg_extras_set_bv()

static void sg_extras_set_bv ( bv_extras extras,
char  ch,
struct extra_type **  idx 
)
static

Helper function for loading extras from a savegame.

'ch' gives the character loaded from the savegame. Extras are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> base bit.

Definition at line 1133 of file savegame3.c.

Referenced by sg_load_map_tiles_extras().

◆ sg_extras_set_dbv()

static void sg_extras_set_dbv ( struct dbv extras,
char  ch,
struct extra_type **  idx 
)
static

Helper function for loading extras from a savegame.

'ch' gives the character loaded from the savegame. Extras are packed in four to a character in hex notation. 'index' is a mapping of savegame bit -> base bit.

Definition at line 1100 of file savegame3.c.

Referenced by sg_load_player_vision().

◆ sg_load_counters()

static void sg_load_counters ( struct loaddata loading)
static

Load '[counters]'.

Definition at line 2702 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_event_cache()

static void sg_load_event_cache ( struct loaddata loading)
static

Load '[event_cache]'.

Definition at line 7760 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_game()

static void sg_load_game ( struct loaddata loading)
static

Load '[game]'.

Definition at line 2088 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_history()

static void sg_load_history ( struct loaddata loading)
static

Load '[history]'.

Definition at line 7915 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_map()

static void sg_load_map ( struct loaddata loading)
static

Load '[map'].

Definition at line 2814 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_map_altitude()

static void sg_load_map_altitude ( struct loaddata loading)
static

Load map tiles altitude

Definition at line 2986 of file savegame3.c.

Referenced by sg_load_map().

◆ sg_load_map_known()

static void sg_load_map_known ( struct loaddata loading)
static

Load tile known status

Definition at line 3591 of file savegame3.c.

Referenced by sg_load_map().

◆ sg_load_map_owner()

static void sg_load_map_owner ( struct loaddata loading)
static

Load tile owner information

Definition at line 3250 of file savegame3.c.

Referenced by sg_load_map().

◆ sg_load_map_startpos()

static void sg_load_map_startpos ( struct loaddata loading)
static

Load starting positions for the players from a savegame file. There should be at least enough for every player.

Definition at line 3108 of file savegame3.c.

Referenced by sg_load_map().

◆ sg_load_map_tiles()

static void sg_load_map_tiles ( struct loaddata loading)
static

Load tiles of the map.

Definition at line 2918 of file savegame3.c.

Referenced by sg_load_map().

◆ sg_load_map_tiles_extras()

static void sg_load_map_tiles_extras ( struct loaddata loading)
static

Load extras to map

Definition at line 3050 of file savegame3.c.

Referenced by sg_load_map().

◆ sg_load_map_worked()

static void sg_load_map_worked ( struct loaddata loading)
static

Load worked tiles information

Definition at line 3508 of file savegame3.c.

Referenced by sg_load_map().

◆ sg_load_mapimg()

static void sg_load_mapimg ( struct loaddata loading)
static

Load '[mapimg]'.

Definition at line 7963 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_player_attributes()

static void sg_load_player_attributes ( struct loaddata loading,
struct player plr 
)
static

Load player (client) attributes data

Definition at line 6951 of file savegame3.c.

Referenced by sg_load_players().

◆ sg_load_player_cities()

static void sg_load_player_cities ( struct loaddata loading,
struct player plr 
)
static

Load city data

Definition at line 5042 of file savegame3.c.

Referenced by sg_load_players().

◆ sg_load_player_city()

static bool sg_load_player_city ( struct loaddata loading,
struct player plr,
struct city pcity,
const char citystr,
int  wlist_max_length,
int  routes_max 
)
static

Load data for one city. sg_save_player_city() is not defined.

Definition at line 5161 of file savegame3.c.

Referenced by sg_load_player_cities().

◆ sg_load_player_city_citizens()

static void sg_load_player_city_citizens ( struct loaddata loading,
struct player plr,
struct city pcity,
const char citystr 
)
static

Load nationality data for one city.

Definition at line 5610 of file savegame3.c.

Referenced by sg_load_player_cities().

◆ sg_load_player_main()

static void sg_load_player_main ( struct loaddata loading,
struct player plr 
)
static

Main player data loading function

Definition at line 4226 of file savegame3.c.

Referenced by sg_load_players().

◆ sg_load_player_unit()

static bool sg_load_player_unit ( struct loaddata loading,
struct player plr,
struct unit punit,
int  orders_max_length,
const char unitstr 
)
static

Load one unit. sg_save_player_unit() is not defined.

Definition at line 6133 of file savegame3.c.

Referenced by sg_load_player_units().

◆ sg_load_player_units()

static void sg_load_player_units ( struct loaddata loading,
struct player plr 
)
static

Load unit data

Definition at line 6064 of file savegame3.c.

Referenced by sg_load_players().

◆ sg_load_player_units_transport()

static void sg_load_player_units_transport ( struct loaddata loading,
struct player plr 
)
static

Load the transport status of all units. This is separated from the other code as all units must be known.

Definition at line 6632 of file savegame3.c.

Referenced by sg_load_players().

◆ sg_load_player_vision()

static void sg_load_player_vision ( struct loaddata loading,
struct player plr 
)
static

Load vision data

Definition at line 7114 of file savegame3.c.

Referenced by sg_load_players().

◆ sg_load_player_vision_city()

static bool sg_load_player_vision_city ( struct loaddata loading,
struct player plr,
struct vision_site pdcity,
const char citystr 
)
static

Load data for one seen city. sg_save_player_vision_city() is not defined.

Definition at line 7304 of file savegame3.c.

Referenced by sg_load_player_vision().

◆ sg_load_players()

static void sg_load_players ( struct loaddata loading)
static

Load '[player]'.

Definition at line 3970 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_players_basic()

static void sg_load_players_basic ( struct loaddata loading)
static

Load '[player]' (basic data).

Definition at line 3710 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_random()

static void sg_load_random ( struct loaddata loading)
static

Load '[random]'.

Definition at line 2394 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_researches()

static void sg_load_researches ( struct loaddata loading)
static

Load '[research]'.

Definition at line 7596 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_ruledata()

static void sg_load_ruledata ( struct loaddata loading)
static

Load '[ruledata]'.

Definition at line 2064 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_sanitycheck()

static void sg_load_sanitycheck ( struct loaddata loading)
static

Sanity check for loaded game.

Definition at line 8028 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_savefile()

static void sg_load_savefile ( struct loaddata loading)
static

Load '[savefile]'.

Definition at line 1336 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_scenario()

static void sg_load_scenario ( struct loaddata loading)
static

Load '[scenario]'.

Definition at line 2499 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_script()

static void sg_load_script ( struct loaddata loading)
static

Load '[script]'.

Definition at line 2473 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_settings()

static void sg_load_settings ( struct loaddata loading)
static

Load '[settings]'.

Definition at line 2664 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_load_treaties()

static void sg_load_treaties ( struct loaddata loading)
static

Load '[treaty_xxx]'.

Definition at line 7791 of file savegame3.c.

Referenced by savegame3_load().

◆ sg_save_counters()

static void sg_save_counters ( struct savedata saving)
static

Save [counters].

Definition at line 2755 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_event_cache()

static void sg_save_event_cache ( struct savedata saving)
static

Save '[event_cache]'.

Definition at line 7771 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_game()

static void sg_save_game ( struct savedata saving)
static

Save '[game]'.

Definition at line 2263 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_history()

static void sg_save_history ( struct savedata saving)
static

Save '[history]'.

Definition at line 7944 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_map()

static void sg_save_map ( struct savedata saving)
static

Save 'map'.

Definition at line 2873 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_map_altitude()

static void sg_save_map_altitude ( struct savedata saving)
static

Save map tiles altitude

Definition at line 3019 of file savegame3.c.

Referenced by sg_save_map().

◆ sg_save_map_known()

static void sg_save_map_known ( struct savedata saving)
static

Save tile known status for whole map and all players

Definition at line 3647 of file savegame3.c.

Referenced by sg_save_map().

◆ sg_save_map_owner()

static void sg_save_map_owner ( struct savedata saving)
static

Save tile owner information

Definition at line 3372 of file savegame3.c.

Referenced by sg_save_map().

◆ sg_save_map_startpos()

static void sg_save_map_startpos ( struct savedata saving)
static

Save the map start positions.

Definition at line 3195 of file savegame3.c.

Referenced by sg_save_map().

◆ sg_save_map_tiles()

static void sg_save_map_tiles ( struct savedata saving)
static

Save all map tiles

Definition at line 2958 of file savegame3.c.

Referenced by sg_save_map().

◆ sg_save_map_tiles_extras()

static void sg_save_map_tiles_extras ( struct savedata saving)
static

Save information about extras on map

Definition at line 3082 of file savegame3.c.

Referenced by sg_save_map().

◆ sg_save_map_worked()

static void sg_save_map_worked ( struct savedata saving)
static

Save worked tiles information

Definition at line 3552 of file savegame3.c.

Referenced by sg_save_map().

◆ sg_save_mapimg()

static void sg_save_mapimg ( struct savedata saving)
static

Save '[mapimg]'.

Definition at line 8003 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_player_attributes()

static void sg_save_player_attributes ( struct savedata saving,
struct player plr 
)
static

Save player (client) attributes data.

Definition at line 7031 of file savegame3.c.

Referenced by sg_save_players().

◆ sg_save_player_cities()

static void sg_save_player_cities ( struct savedata saving,
struct player plr 
)
static

Save cities data

Definition at line 5658 of file savegame3.c.

Referenced by sg_save_players().

◆ sg_save_player_main()

static void sg_save_player_main ( struct savedata saving,
struct player plr 
)
static

Main player data saving function.

Definition at line 4716 of file savegame3.c.

Referenced by sg_save_players().

◆ sg_save_player_units()

static void sg_save_player_units ( struct savedata saving,
struct player plr 
)
static

Save unit data

Definition at line 6685 of file savegame3.c.

Referenced by sg_save_players().

◆ sg_save_player_vision()

static void sg_save_player_vision ( struct savedata saving,
struct player plr 
)
static

Save vision data

Definition at line 7426 of file savegame3.c.

Referenced by sg_save_players().

◆ sg_save_players()

static void sg_save_players ( struct savedata saving)
static

Save '[player]'.

Definition at line 4165 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_random()

static void sg_save_random ( struct savedata saving)
static

Save '[random]'.

Definition at line 2435 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_researches()

static void sg_save_researches ( struct savedata saving)
static

Save '[research]'.

Definition at line 7698 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_ruledata()

static void sg_save_ruledata ( struct savedata saving)
static

Save '[ruledata]'.

Definition at line 2243 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_sanitycheck()

static void sg_save_sanitycheck ( struct savedata saving)
static

Sanity check for saved game.

Definition at line 8192 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_savefile()

static void sg_save_savefile ( struct savedata saving)
static

Save '[savefile]'.

Definition at line 1775 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_savefile_options()

static void sg_save_savefile_options ( struct savedata saving,
const char option 
)
static

Save options for this savegame. sg_load_savefile_options() is not defined.

Definition at line 2041 of file savegame3.c.

Referenced by sg_save_savefile().

◆ sg_save_scenario()

static void sg_save_scenario ( struct savedata saving)
static

Save '[scenario]'.

Definition at line 2587 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_script()

static void sg_save_script ( struct savedata saving)
static

Save '[script]'.

Definition at line 2484 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_settings()

static void sg_save_settings ( struct savedata saving)
static

Save [settings].

Definition at line 2680 of file savegame3.c.

Referenced by savegame3_save_real().

◆ sg_save_treaties()

static void sg_save_treaties ( struct savedata saving)
static

Save all treaties.

Definition at line 7901 of file savegame3.c.

Referenced by savegame3_save_real().

◆ technology_load()

static Tech_type_id technology_load ( struct section_file file,
const char path,
int  plrno 
)
static

Load technology from path_name and if doesn't exist (because savegame is too old) load from path.

Definition at line 1263 of file savegame3.c.

Referenced by sg_load_researches().

◆ technology_save()

static void technology_save ( struct section_file file,
const char path,
int  plrno,
Tech_type_id  tech 
)
static

Save technology in secfile entry called path_name.

Definition at line 1299 of file savegame3.c.

Referenced by sg_save_researches().

◆ terrain2char()

static char terrain2char ( const struct terrain pterrain)
static

References the terrain character. See terrains[].identifier example: terrain2char(T_ARCTIC) => 'a'

Definition at line 1250 of file savegame3.c.

Referenced by sg_save_map_tiles(), and sg_save_player_vision().

◆ treaty_save()

static void treaty_save ( struct treaty ptr,
void data_in 
)
static

Save '[treaty_xxx]'.

Definition at line 7874 of file savegame3.c.

Referenced by sg_save_treaties().

◆ unit_ordering_apply()

static void unit_ordering_apply ( void  )
static

For each city and tile, sort unit lists according to ord_city and ord_map values.

Definition at line 1079 of file savegame3.c.

Referenced by sg_load_players().

◆ unit_ordering_calc()

static void unit_ordering_calc ( void  )
static

Assign values to ord_city and ord_map for each unit, so the values can be saved.

Definition at line 1050 of file savegame3.c.

Referenced by sg_save_players().

◆ unquote_block()

static int unquote_block ( const char *const  quoted_,
void dest,
int  dest_length 
)
static

Unquote a string. The unquoted data is written into dest. If the unquoted data will be larger than dest_length the function aborts. It returns the actual length of the unquoted block.

Definition at line 918 of file savegame3.c.

Referenced by sg_load_player_attributes().

◆ worklist_load()

static void worklist_load ( struct section_file file,
int  wlist_max_length,
struct worklist pwl,
const char path,
  ... 
)
static

Load the worklist elements specified by path to the worklist pointed to by 'pwl'. 'pwl' should be a pointer to an existing worklist.

Definition at line 966 of file savegame3.c.

Referenced by sg_load_player_city().

◆ worklist_save()

static void worklist_save ( struct section_file file,
const struct worklist pwl,
int  max_length,
const char path,
  ... 
)
static

Save the worklist elements specified by path from the worklist pointed to by 'pwl'. 'pwl' should be a pointer to an existing worklist.

Definition at line 1012 of file savegame3.c.

Referenced by sg_save_player_cities().

Variable Documentation

◆ savefile_options_default

const char savefile_options_default[]
static
Initial value:
=
" +version3"

Definition at line 278 of file savegame3.c.

Referenced by sg_save_savefile().

◆ sg_success

bool sg_success
extern

Definition at line 34 of file savecompat.c.

Referenced by savegame3_load(), savegame3_save_real(), and sg_load_savefile().