Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

src/files.c File Reference


Detailed Description

Management of saved games, saved levels, and the data file.

Definition in file files.c.

#include "crogue.h"

Go to the source code of this file.

Functions

void compress_tiles (void)
void link_data_file (void)
void save_game (void)
int restore_game (void)
const char * levelfile_name (int levelnum)
void save_level (void)
int load_level (int source, coord pos)
void cleanup_save (void)

Variables

const uchar save_file_extension [6] = { 0,'S','A','V',0,0xf8 }
const uchar level_file_extension [6] = { 0,'L','E','V',0,0xf8 }


Function Documentation

void cleanup_save void   ) 
 

Definition at line 380 of file files.c.

References file_prefix, levelfile_name(), world::maxlevel, retprintf(), SAVEFILENAME, and w.

Referenced by end_game().

void compress_tiles void   ) 
 

Definition at line 420 of file files.c.

References tile::flags, MAPSIZE_X, MAPSIZE_Y, world::t, TFLAG_LIT, and w.

const char* levelfile_name int  levelnum  ) 
 

Definition at line 220 of file files.c.

References file_prefix, and retprintf().

Referenced by cleanup_save(), load_level(), and save_level().

void link_data_file void   ) 
 

Definition at line 67 of file files.c.

References body_functions, deref_file_ptr(), world::desc, dll_load(), world::itemdescs, world_descriptor::itemoffset, world_descriptor::playerclasses, world::playerclasses, world_descriptor::shopdescs, world::shopdescs, world::shuffledata, world::spelldescs, world_descriptor::spelllist, world_descriptor::stdata, world::tiledescs, world_descriptor::tileoffset, and w.

Referenced by sys_init_data_file().

int load_level int  source,
coord  pos
 

Definition at line 312 of file files.c.

References itemsinfo::alloced, cleanup_items(), debug_malloc, EXTERNAL_COMPRESSOR, fhuffmaninit_read(), frleinit_read(), frleread(), frleverify(), full_redraw(), itemsinfo::items, world::items, world::level, levelfile_name(), world::m, MAPSIZE_X, MAPSIZE_Y, message(), MONSTERS_MAX, place_player_on_map(), resize_map_store(), world::t, ushort, and w.

Referenced by follow_connection().

int restore_game void   ) 
 

Definition at line 154 of file files.c.

References itemsinfo::alloced, world::current_map, world::current_map_link, debug_malloc, deref_file_ptr(), world::desc, EXTERNAL_COMPRESSOR, fhuffmaninit_read(), file_prefix, frleinit_read(), frleread(), frleverify(), init_discoveries(), init_spells(), world_descriptor::itementries, world::itemids, itemsinfo::items, world::items, world::mapsize_x, world::mapsize_y, message(), world_descriptor::numspells, world::plr, read_char(), resize_map_store(), retprintf(), SAVEFILENAME, world_descriptor::shuffletabsize, world::shuffletranslation, slong, player::spellknowledge, sys_init_data_file(), world::t, uint, w, world::wandering_monsters, and world::wandering_monsters_num.

Referenced by initialize().

void save_game void   ) 
 

Definition at line 92 of file files.c.

References itemsinfo::alloced, world::desc, EXTERNAL_COMPRESSOR, fhuffmanflush(), fhuffmaninit_write(), fhuffmanputc(), file_prefix, frlefinalize(), frleflush(), frleinit_write(), frlewrite(), world_descriptor::itementries, world::itemids, itemsinfo::items, world::items, world::mapsize_x, world::mapsize_y, world_descriptor::numspells, OPTION_ARCHIVE_YES, OPTION_AUTOARCHIVE, world::options, world::plr, retprintf(), save_file_extension, SAVEFILENAME, world_descriptor::shuffletabsize, world::shuffletranslation, slong, player::spellknowledge, world::t, uint, w, world::wandering_monsters, and world::wandering_monsters_num.

Referenced by plr_move().

void save_level void   ) 
 

Definition at line 249 of file files.c.

References itemsinfo::alloced, compress_items(), compress_monsters(), EXTERNAL_COMPRESSOR, fhuffmanflush(), fhuffmaninit_write(), fhuffmanputc(), frlefinalize(), frleflush(), frleinit_write(), frlewrite(), itemsinfo::items, world::items, world::level, level_file_extension, levelfile_name(), world::m, MAPSIZE_X, world::mapsize_x, MAPSIZE_Y, world::mapsize_y, MONSTERS_MAX, OPTION_ARCHIVE_YES, OPTION_AUTOARCHIVE, world::options, world::t, ushort, and w.

Referenced by follow_connection().


Variable Documentation

const uchar level_file_extension[6] = { 0,'L','E','V',0,0xf8 }
 

Definition at line 217 of file files.c.

Referenced by save_level().

const uchar save_file_extension[6] = { 0,'S','A','V',0,0xf8 } [static]
 

Definition at line 27 of file files.c.

Referenced by save_game().


Generated on Thu May 20 13:12:12 2004 for CalcRogue by doxygen 1.3.6