Game_map Class Reference

#include <gamemap.h>

Collaboration diagram for Game_map:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Game_map ()
 ~Game_map ()
void init ()
void clear ()
void read_map_data ()
short get_terrain_num (int cx, int cy) const
Map_patch_collectionget_map_patches ()
void set_map_modified ()
bool was_map_modified () const
bool is_chunk_read (int cx, int cy)
void set_ifix_modified (int cx, int cy)
Map_chunkget_chunk (int cx, int cy)
Map_chunkget_chunk_safely (int cx, int cy)
void get_map_objects (int schunk)
void get_chunk_objects (int cx, int cy)
void get_all_terrain ()
Chunk_terrainget_terrain (int tnum)
int get_num_chunk_terrains () const
void set_chunk_terrain (int cx, int cy, int chunknum)
void write_static ()
void write_ifix_objects (int schunk)
void get_ifix_objects (int schunk)
void get_ifix_chunk_objects (DataSource *ifix, long filepos, int cnt, int cx, int cy)
void write_ireg ()
void write_ireg_objects (int schunk)
void write_ireg_objects (int schunk, DataSource *ireg)
void get_ireg_objects (int schunk)
void read_special_ireg (DataSource *ireg, Game_object *obj)
void read_ireg_objects (DataSource *ireg, int scx, int scy, Game_object *container=0, unsigned long flags=(1<< Obj_flags::okay_to_take))
Ireg_game_objectcreate_ireg_object (Shape_info &info, int shnum, int frnum, int tilex, int tiley, int lift)
Ireg_game_objectcreate_ireg_object (int shnum, int frnum)
Ifix_game_objectcreate_ifix_object (int shnum, int frnum)
void get_superchunk_objects (int schunk)
bool locate_terrain (int tnum, int &cx, int &cy, bool upwards=false)
bool swap_terrains (int tnum)
bool insert_terrain (int tnum, bool dup=false)
bool delete_terrain (int tnum)
void commit_terrain_edits ()
void abort_terrain_edits ()
void find_unused_shapes (unsigned char *found, int foundlen)
Game_objectlocate_shape (int shapenum, bool upwards, Game_object *start)
void cache_out (int cx, int cy)

Static Public Member Functions

static char * get_schunk_file_name (char *prefix, int schunk, char *fname)
static void write_scheduled (DataSource *ireg, Game_object *obj, bool write_mark=false)

Private Member Functions

Map_chunkcreate_chunk (int cx, int cy)
Chunk_terrainread_terrain (int chunk_num)
void cache_out_schunk (int schunk)

Private Attributes

Exult_vector< Chunk_terrain * > chunk_terrains
bool read_all_terrain
bool map_modified
short terrain_map [c_num_chunks][c_num_chunks]
Map_chunkobjects [c_num_chunks][c_num_chunks]
bool schunk_read [144]
bool schunk_modified [144]
char * schunk_cache [144]
int schunk_cache_sizes [144]
std::ifstream * chunks
Map_patch_collectionmap_patches

Detailed Description

Definition at line 48 of file gamemap.h.


Constructor & Destructor Documentation

Game_map::Game_map (  ) 

Definition at line 116 of file gamemap.cc.

Game_map::~Game_map (  ) 

Definition at line 129 of file gamemap.cc.


Member Function Documentation

Map_chunk * Game_map::create_chunk ( int  cx,
int  cy 
) [private]

Definition at line 86 of file gamemap.cc.

Referenced by get_chunk(), and get_chunk_safely().

Chunk_terrain * Game_map::read_terrain ( int  chunk_num  )  [private]

Definition at line 98 of file gamemap.cc.

Referenced by get_terrain().

void Game_map::cache_out_schunk ( int  schunk  )  [private]

Definition at line 1559 of file gamemap.cc.

References BufferDataSource::getPos(), map_modified, objects, schunk_cache, schunk_cache_sizes, schunk_modified, schunk_read, size, and write_ireg_objects().

Referenced by cache_out().

Here is the call graph for this function:

void Game_map::init (  ) 

Definition at line 142 of file gamemap.cc.

References c_num_schunks, c_tiles_per_chunk, Game::is_editing(), is_system_path_defined(), patch_exists, PATCH_U7CHUNKS, PATCH_U7MAP, Read2(), U7CHUNKS, U7exists(), U7MAP, and U7open().

Referenced by BuildGameMap().

Here is the call graph for this function:

void Game_map::clear (  ) 

Definition at line 224 of file gamemap.cc.

References c_num_chunks.

void Game_map::read_map_data (  ) 

Definition at line 258 of file gamemap.cc.

References c_num_schunks, c_tiles_per_chunk, c_tiles_per_schunk, c_tilesize, Game_window::get_height(), Game_window::get_instance(), Game_window::get_scrolltx(), Game_window::get_scrollty(), Game_window::get_width(), and gwin.

Referenced by Game_window::paint().

Here is the call graph for this function:

short Game_map::get_terrain_num ( int  cx,
int  cy 
) const [inline]

Definition at line 76 of file gamemap.h.

References terrain_map.

Referenced by Game_render::paint_map(), and Game_render::paint_terrain_only().

Map_patch_collection* Game_map::get_map_patches (  )  [inline]

Definition at line 78 of file gamemap.h.

References map_patches.

Referenced by Game_window::get_map_patches().

void Game_map::set_map_modified (  )  [inline]

Definition at line 80 of file gamemap.h.

References map_modified.

bool Game_map::was_map_modified (  )  const [inline]

Definition at line 82 of file gamemap.h.

References map_modified.

bool Game_map::is_chunk_read ( int  cx,
int  cy 
) [inline]

Definition at line 84 of file gamemap.h.

References c_chunks_per_schunk, c_num_chunks, and schunk_read.

Referenced by Actor::set_schedule_and_loc().

void Game_map::set_ifix_modified ( int  cx,
int  cy 
) [inline]

Definition at line 88 of file gamemap.h.

References c_chunks_per_schunk, map_modified, and schunk_modified.

Map_chunk* Game_map::get_chunk ( int  cx,
int  cy 
) [inline]

Definition at line 95 of file gamemap.h.

References c_num_chunks, create_chunk(), and objects.

Referenced by Fast_pathfinder_client::get_step_cost(), Actor_pathfinder_client::get_step_cost(), Map_chunk::is_blocked(), Game_render::paint_blackness(), Game_render::paint_chunk_flat_rles(), Game_render::paint_chunk_flats(), Game_render::paint_chunk_objects(), Game_render::paint_terrain_only(), Map_chunk::remove(), and Map_chunk::setup_dungeon_levels().

Here is the call graph for this function:

Map_chunk* Game_map::get_chunk_safely ( int  cx,
int  cy 
) [inline]

Definition at line 102 of file gamemap.h.

References c_num_chunks, create_chunk(), and objects.

Referenced by Check_spot(), Game_window::emulate_cache(), Map_chunk::find_in_area(), Map_chunk::is_blocked(), and Map_chunk::try_all_eggs().

Here is the call graph for this function:

void Game_map::get_map_objects ( int  schunk  ) 

Definition at line 294 of file gamemap.cc.

void Game_map::get_chunk_objects ( int  cx,
int  cy 
)

Definition at line 312 of file gamemap.cc.

References Map_chunk::set_terrain().

Here is the call graph for this function:

void Game_map::get_all_terrain (  ) 

Definition at line 328 of file gamemap.cc.

Chunk_terrain* Game_map::get_terrain ( int  tnum  )  [inline]

Definition at line 116 of file gamemap.h.

References chunk_terrains, and read_terrain().

Here is the call graph for this function:

int Game_map::get_num_chunk_terrains (  )  const [inline]

Definition at line 121 of file gamemap.h.

References chunk_terrains.

void Game_map::set_chunk_terrain ( int  cx,
int  cy,
int  chunknum 
)

Definition at line 345 of file gamemap.cc.

char * Game_map::get_schunk_file_name ( char *  prefix,
int  schunk,
char *  fname 
) [static]

Definition at line 361 of file gamemap.cc.

References len.

void Game_map::write_static (  ) 

Definition at line 381 of file gamemap.cc.

References c_num_schunks, PATCH_U7CHUNKS, PATCH_U7MAP, U7CHUNKS, U7MAP, U7mkdir(), U7open(), and Write2().

Here is the call graph for this function:

void Game_map::write_ifix_objects ( int  schunk  ) 

Definition at line 452 of file gamemap.cc.

References c_chunks_per_schunk, T_Object_iterator_backwards< T, L >::get_next(), StreamDataSource::getPos(), Exult_server::obj, PATCH_U7IFIX, StreamDataSource::seek(), U7open(), StreamDataSource::write(), Write4(), and Flex::write_header().

Here is the call graph for this function:

void Game_map::get_ifix_objects ( int  schunk  ) 

Definition at line 499 of file gamemap.cc.

References Game::is_editing(), is_system_path_defined(), PATCH_U7IFIX, StreamDataSource::read4(), StreamDataSource::seek(), U7exists(), U7IFIX, and U7open().

Here is the call graph for this function:

void Game_map::get_ifix_chunk_objects ( DataSource ifix,
long  filepos,
int  cnt,
int  cx,
int  cy 
)

Definition at line 544 of file gamemap.cc.

References Map_chunk::add(), ShapeID::get_info(), Game_window::get_instance(), gwin, Exult_server::info, Exult_server::obj, DataSource::read(), DataSource::seek(), and Map_chunk::setup_dungeon_levels().

Here is the call graph for this function:

void Game_map::write_scheduled ( DataSource ireg,
Game_object obj,
bool  write_mark = false 
) [static]

Definition at line 587 of file gamemap.cc.

References Usecode_script::find(), IREG_ENDMARK, IREG_SPECIAL, IREG_UCSCRIPT, len, Exult_server::obj, DataSource::write(), DataSource::write1(), and DataSource::write2().

Referenced by Actor::write(), Spellbook_object::write_ireg(), Ireg_game_object::write_ireg(), Egg_object::write_ireg(), Container_game_object::write_ireg(), and Barge_object::write_ireg().

Here is the call graph for this function:

void Game_map::write_ireg (  ) 

Definition at line 620 of file gamemap.cc.

References c_num_schunks, U7IREG, and U7open().

Here is the call graph for this function:

void Game_map::write_ireg_objects ( int  schunk  ) 

Definition at line 647 of file gamemap.cc.

References U7IREG, and U7open().

Referenced by cache_out_schunk().

Here is the call graph for this function:

void Game_map::write_ireg_objects ( int  schunk,
DataSource ireg 
)

Definition at line 670 of file gamemap.cc.

References T_Object_iterator_backwards< T, L >::get_next(), Exult_server::obj, and DataSource::write2().

Here is the call graph for this function:

void Game_map::get_ireg_objects ( int  schunk  ) 

Definition at line 698 of file gamemap.cc.

References c_any_qual, Game_object::find_nearby(), Game::get_game_type(), SERPENT_ISLE, U7IREG, and U7open().

Here is the call graph for this function:

void Game_map::read_special_ireg ( DataSource ireg,
Game_object obj 
)

Definition at line 783 of file gamemap.cc.

References DataSource::eof(), IREG_ENDMARK, IREG_SPECIAL, Exult_server::obj, DataSource::peek(), DataSource::read1(), and Read_special_ireg().

Referenced by Actor::read().

Here is the call graph for this function:

void Game_map::read_ireg_objects ( DataSource ireg,
int  scx,
int  scy,
Game_object container = 0,
unsigned long  flags = (1<< Obj_flags::okay_to_take) 
)

Definition at line 848 of file gamemap.cc.

References Map_chunk::add(), Game_object::add(), Map_chunk::add_egg(), Game_object::add_readied(), Create_egg(), Ucscript::egg, DataSource::eof(), Game::get_game_type(), ShapeID::get_info(), Game_window::get_instance(), Game_window::get_moving_barge(), Get_quality_flags(), DataSource::getPos(), gwin, Shape_info::hatchable, Exult_server::info, Obj_flags::invisible, IREG_SPECIAL, Is_body(), Obj_flags::is_temporary, Exult_server::obj, Obj_flags::okay_to_take, DataSource::read(), DataSource::read1(), DataSource::read2(), Read_special_ireg(), DataSource::seek(), SERPENT_ISLE, Game_window::set_body(), Game_window::set_moving_barge(), and Virtue_stone_object::set_pos().

Referenced by Actor::read().

Here is the call graph for this function:

Ireg_game_object * Game_map::create_ireg_object ( Shape_info info,
int  shnum,
int  frnum,
int  tilex,
int  tiley,
int  lift 
)

Definition at line 1059 of file gamemap.cc.

References Egg_object::caltrops_field, Shape_info::container, Egg_object::fire_field, GAME_SI, Exult_server::info, Egg_object::poison_field, and Egg_object::sleep_field.

Referenced by Cheat::create_last_shape(), Create_object(), Cheat::cut(), and Ready_duel_weapon().

Ireg_game_object * Game_map::create_ireg_object ( int  shnum,
int  frnum 
)

Definition at line 1115 of file gamemap.cc.

References ShapeID::get_info().

Here is the call graph for this function:

Ifix_game_object * Game_map::create_ifix_object ( int  shnum,
int  frnum 
)

Definition at line 1128 of file gamemap.cc.

References ShapeID::get_info(), and Exult_server::info.

Referenced by Create_object().

Here is the call graph for this function:

void Game_map::get_superchunk_objects ( int  schunk  ) 

Definition at line 1143 of file gamemap.cc.

bool Game_map::locate_terrain ( int  tnum,
int &  cx,
int &  cy,
bool  upwards = false 
)

Definition at line 1165 of file gamemap.cc.

References c_num_chunks, c_tiles_per_chunk, Game_window::center_view(), and Game_window::get_instance().

Here is the call graph for this function:

bool Game_map::swap_terrains ( int  tnum  ) 

Definition at line 1217 of file gamemap.cc.

References c_num_chunks, Game_window::get_instance(), Game_window::set_all_dirty(), and Chunk_terrain::set_modified().

Here is the call graph for this function:

bool Game_map::insert_terrain ( int  tnum,
bool  dup = false 
)

Definition at line 1252 of file gamemap.cc.

References c_num_chunks, c_tiles_per_chunk, Chunk_terrain::get_flat(), Game_window::get_instance(), ShapeID::get_shapenum(), and Game_window::set_all_dirty().

Here is the call graph for this function:

bool Game_map::delete_terrain ( int  tnum  ) 

Definition at line 1304 of file gamemap.cc.

References c_num_chunks, Game_window::get_instance(), and Game_window::set_all_dirty().

Here is the call graph for this function:

void Game_map::commit_terrain_edits (  ) 

Definition at line 1336 of file gamemap.cc.

References c_num_chunks.

void Game_map::abort_terrain_edits (  ) 

Definition at line 1365 of file gamemap.cc.

void Game_map::find_unused_shapes ( unsigned char *  found,
int  foundlen 
)

Definition at line 1380 of file gamemap.cc.

References c_num_chunks, c_num_schunks, Effects_manager::center_text(), Game_window::get_effects(), ShapeID::get_info(), Shape_manager::get_instance(), Game_window::get_instance(), Vga_file::get_num_shapes(), Weapon_info::get_projectile(), Shape_manager::get_shapes(), gwin, Exult_server::info, Exult_server::obj, Game_window::paint(), sc, Game_window::show(), and snprintf.

Here is the call graph for this function:

Game_object * Game_map::locate_shape ( int  shapenum,
bool  upwards,
Game_object start 
)

Definition at line 1449 of file gamemap.cc.

References c_chunks_per_schunk, c_num_chunks, c_num_schunks, Game_object::get_cx(), Game_object::get_cy(), D_Recursive_object_iterator< D >::get_next(), Map_chunk::get_objects(), Game_object::get_outermost(), and Exult_server::obj.

Here is the call graph for this function:

void Game_map::cache_out ( int  cx,
int  cy 
)

Definition at line 1525 of file gamemap.cc.

References c_chunks_per_schunk, cache_out_schunk(), schunk_modified, and schunk_read.

Referenced by Game_window::emulate_cache().

Here is the call graph for this function:


Member Data Documentation

Exult_vector<Chunk_terrain *> Game_map::chunk_terrains [private]

Definition at line 51 of file gamemap.h.

Referenced by get_num_chunk_terrains(), and get_terrain().

bool Game_map::read_all_terrain [private]

Definition at line 52 of file gamemap.h.

bool Game_map::map_modified [private]

Definition at line 53 of file gamemap.h.

Referenced by cache_out_schunk(), set_ifix_modified(), set_map_modified(), and was_map_modified().

short Game_map::terrain_map[c_num_chunks][c_num_chunks] [private]

Definition at line 56 of file gamemap.h.

Referenced by get_terrain_num().

Map_chunk* Game_map::objects[c_num_chunks][c_num_chunks] [private]

Definition at line 58 of file gamemap.h.

Referenced by cache_out_schunk(), get_chunk(), and get_chunk_safely().

bool Game_map::schunk_read[144] [private]

Definition at line 59 of file gamemap.h.

Referenced by cache_out(), cache_out_schunk(), and is_chunk_read().

bool Game_map::schunk_modified[144] [private]

Definition at line 60 of file gamemap.h.

Referenced by cache_out(), cache_out_schunk(), and set_ifix_modified().

char* Game_map::schunk_cache[144] [private]

Definition at line 61 of file gamemap.h.

Referenced by cache_out_schunk().

int Game_map::schunk_cache_sizes[144] [private]

Definition at line 62 of file gamemap.h.

Referenced by cache_out_schunk().

std::ifstream* Game_map::chunks [private]

Definition at line 63 of file gamemap.h.

Map_patch_collection* Game_map::map_patches [private]

Definition at line 64 of file gamemap.h.

Referenced by get_map_patches().


The documentation for this class was generated from the following files:
Generated on Mon Jul 9 14:52:56 2007 for ExultEngine by  doxygen 1.5.1