#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <main.h>
#include <globals.h>
#include <handler.h>
#include <ui.h>
#include <simulation.h>
#include <inttypes.h>
#include <strings.h>
#include <mem_compat.h>
#include <stringsearch.h>
#include <savegame_be.h>
Go to the source code of this file.
Data Structures | |
struct | embedded_savegame |
an embedded savegame inside a savegame More... | |
struct | save_tag |
a savegame structure More... | |
Functions | |
unsigned char * | mapm_int32 (unsigned char *mem, unsigned char *val) |
map a memory element that's 32bits long | |
savegame_t * | savegame_open (char *filename) |
open a savegame file, breaking it into games | |
void | savegame_close (savegame_t *sg) |
close a previously created savegame structure | |
char * | savegame_getcityname (savegame_t *sg, int item) |
get the name of a city in the savegame structure | |
int | savegame_getcity (savegame_t *sg, int item, GameStruct *gs, char **map) |
get a city structure from the savegame structure | |
int | savegame_setcity (savegame_t *sg, int item, GameStruct *gs, char *map) |
store the contents of a city into the savegame structure | |
int | savegame_citycount (savegame_t *sg) |
get the count of the cities in a savegame structure | |
int | load_defaultfilename (void) |
load the default file name into the default game structures | |
int | save_defaultfilename () |
save the default savegame file and map | |
int | save_filename (char *sel, GameStruct *gs, char *world) |
save a filename using the gamestruct and worldptr passed | |
void | NewGame (void) |
Initialize the game structures for a new game. | |
char * | getCityFileName (void) |
get the name of default city file | |
int | setCityFileName (char *newName) |
set the city file name |
Deals with the savegames being loaded and saved. Can perform read-only work on palmOS games directly, but performs read/write on native games.
The code needs to be made more platform-independent, as it is it depends a lot on the endianness of the machine you're running it on.
Definition in file savegame_be.c.
|
get the name of default city file
Definition at line 473 of file savegame_be.c. Referenced by load_defaultfilename(), save_defaultfilename(), and savegame_handler(). |
|
load the default file name into the default game structures
Definition at line 396 of file savegame_be.c. References getCityFileName(), savegame_close(), savegame_getcity(), and savegame_open(). |
|
map a memory element that's 32bits long
Definition at line 126 of file savegame_be.c. References Int32. |
|
save the default savegame file and map
Definition at line 408 of file savegame_be.c. References getCityFileName(), and save_filename(). Referenced by savegame_handler(), and store_filename(). |
|
save a filename using the gamestruct and worldptr passed
Definition at line 414 of file savegame_be.c. References _game_struct06a::mapx, and _game_struct06a::mapy. Referenced by save_defaultfilename(). |
|
get the count of the cities in a savegame structure
Definition at line 389 of file savegame_be.c. Referenced by doOpen(), and loadCities(). |
|
close a previously created savegame structure
Definition at line 341 of file savegame_be.c. Referenced by doOpen(), free_listselect(), and load_defaultfilename(). |
|
get a city structure from the savegame structure
Definition at line 362 of file savegame_be.c. References _game_struct06a::mapx, and _game_struct06a::mapy. Referenced by doOpen(), ImportOneFromGame(), and load_defaultfilename(). |
|
get the name of a city in the savegame structure
Definition at line 353 of file savegame_be.c. |
|
open a savegame file, breaking it into games
Definition at line 274 of file savegame_be.c. References inMem(), and SAVEGAMEVERSION. Referenced by doOpen(), and load_defaultfilename(). |
|
store the contents of a city into the savegame structure
Definition at line 375 of file savegame_be.c. References _game_struct06a::mapx, and _game_struct06a::mapy. |
|
set the city file name
Definition at line 479 of file savegame_be.c. Referenced by doOpen(), and store_filename(). |