|
Pol
Revision:cb584c9
|
#include <mapwriter.h>
Public Member Functions | |
| MapWriter () | |
| ~MapWriter () | |
| void | AppendSolid (const SOLIDS_ELEM &solid) |
| void | AppendSolidx2Elem (const SOLIDX2_ELEM &elem) |
| void | CreateBaseDat (const std::string &realm_name, const std::string &directory) |
| void | CreateMaptileDat (const std::string &realm_name, const std::string &directory) |
| void | CreateNewFiles (const std::string &realm_name, unsigned short width, unsigned short height) |
| void | CreateSolidsDat (const std::string &realm_name, const std::string &directory) |
| void | CreateSolidx1Dat (const std::string &realm_name, const std::string &directory) |
| void | CreateSolidx2Dat (const std::string &realm_name, const std::string &directory) |
| void | Flush () |
| unsigned | height () const |
| unsigned int | NextSolidIndex () |
| unsigned int | NextSolidOffset () |
| unsigned int | NextSolidx2Offset () |
| void | OpenExistingFiles (const std::string &realm_name) |
| void | SetMapCell (unsigned short x, unsigned short y, MAPCELL cell) |
| void | SetMapTile (unsigned short x, unsigned short y, MAPTILE_CELL cell) |
| void | SetSolidx2Offset (unsigned short x_base, unsigned short y_base, unsigned int offset) |
| unsigned | width () const |
| void | WriteConfigFile () |
Private Member Functions | |
| void | FlushBaseFile () |
| void | FlushMapTileFile () |
| unsigned int | total_blocks () |
| unsigned int | total_maptile_blocks () |
| std::fstream::pos_type | total_size () |
| unsigned int | total_solid_blocks () |
Private Attributes | |
| MAPBLOCK | _block |
| int | _cur_mapblock_index |
| int | _cur_maptile_index |
| unsigned short | _height |
| MAPTILE_BLOCK | _maptile_block |
| std::fstream | _ofs_base |
| std::fstream | _ofs_maptile |
| std::fstream | _ofs_solids |
| std::fstream | _ofs_solidx1 |
| std::fstream | _ofs_solidx2 |
| std::string | _realm_name |
| unsigned short | _width |
| size_t | solids_offset |
| size_t | solidx2_offset |
Definition at line 25 of file mapwriter.h.
| Pol::Plib::MapWriter::MapWriter | ( | ) |
Definition at line 27 of file mapwriter.cpp.
References _ofs_base, _ofs_maptile, _ofs_solids, _ofs_solidx1, and _ofs_solidx2.
| Pol::Plib::MapWriter::~MapWriter | ( | ) |
Definition at line 189 of file mapwriter.cpp.
References Flush().
| void Pol::Plib::MapWriter::AppendSolid | ( | const SOLIDS_ELEM & | solid | ) |
Definition at line 299 of file mapwriter.cpp.
References _ofs_solids, and solids_offset.
Referenced by Pol::UoConvert::ProcessSolidBlock().
| void Pol::Plib::MapWriter::AppendSolidx2Elem | ( | const SOLIDX2_ELEM & | elem | ) |
Definition at line 305 of file mapwriter.cpp.
References _ofs_solidx2, and solidx2_offset.
Referenced by Pol::UoConvert::ProcessSolidBlock().
| void Pol::Plib::MapWriter::CreateBaseDat | ( | const std::string & | realm_name, |
| const std::string & | directory | ||
| ) |
Definition at line 69 of file mapwriter.cpp.
References _ofs_base, Pol::Clib::binary(), Pol::UoConvert::empty, Pol::Clib::open_file(), and total_blocks().
Referenced by CreateNewFiles().
| void Pol::Plib::MapWriter::CreateMaptileDat | ( | const std::string & | realm_name, |
| const std::string & | directory | ||
| ) |
Definition at line 112 of file mapwriter.cpp.
References _ofs_maptile, Pol::Clib::binary(), Pol::Clib::open_file(), and total_maptile_blocks().
Referenced by CreateNewFiles().
| void Pol::Plib::MapWriter::CreateNewFiles | ( | const std::string & | realm_name, |
| unsigned short | width, | ||
| unsigned short | height | ||
| ) |
Definition at line 126 of file mapwriter.cpp.
References _height, _realm_name, _width, CreateBaseDat(), CreateMaptileDat(), CreateSolidsDat(), CreateSolidx1Dat(), CreateSolidx2Dat(), height(), Pol::Clib::make_dir(), and width().
Referenced by Pol::UoConvert::create_map().
| void Pol::Plib::MapWriter::CreateSolidsDat | ( | const std::string & | realm_name, |
| const std::string & | directory | ||
| ) |
Definition at line 103 of file mapwriter.cpp.
References _ofs_solids, Pol::Clib::binary(), Pol::Clib::open_file(), and solids_offset.
Referenced by CreateNewFiles().
| void Pol::Plib::MapWriter::CreateSolidx1Dat | ( | const std::string & | realm_name, |
| const std::string & | directory | ||
| ) |
Definition at line 82 of file mapwriter.cpp.
References _ofs_solidx1, Pol::Clib::binary(), Pol::Plib::SOLIDX1_ELEM::offset, Pol::Clib::open_file(), and total_solid_blocks().
Referenced by CreateNewFiles().
| void Pol::Plib::MapWriter::CreateSolidx2Dat | ( | const std::string & | realm_name, |
| const std::string & | directory | ||
| ) |
Definition at line 95 of file mapwriter.cpp.
References _ofs_solidx2, Pol::Clib::binary(), Pol::Clib::open_file(), and solidx2_offset.
Referenced by CreateNewFiles().
| void Pol::Plib::MapWriter::Flush | ( | ) |
Definition at line 194 of file mapwriter.cpp.
References FlushBaseFile(), and FlushMapTileFile().
Referenced by ~MapWriter().
|
private |
Definition at line 265 of file mapwriter.cpp.
References _block, _cur_mapblock_index, and _ofs_base.
Referenced by Flush(), height(), and SetMapCell().
|
private |
Definition at line 274 of file mapwriter.cpp.
References _cur_maptile_index, _maptile_block, and _ofs_maptile.
Referenced by Flush(), height(), and SetMapTile().
|
inline |
Definition at line 56 of file mapwriter.h.
References _height, FlushBaseFile(), FlushMapTileFile(), total_blocks(), total_maptile_blocks(), total_size(), and total_solid_blocks().
Referenced by CreateNewFiles().
| unsigned int Pol::Plib::MapWriter::NextSolidIndex | ( | ) |
Definition at line 289 of file mapwriter.cpp.
References NextSolidOffset().
Referenced by Pol::UoConvert::ProcessSolidBlock().
| unsigned int Pol::Plib::MapWriter::NextSolidOffset | ( | ) |
Definition at line 284 of file mapwriter.cpp.
References solids_offset.
Referenced by NextSolidIndex().
| unsigned int Pol::Plib::MapWriter::NextSolidx2Offset | ( | ) |
Definition at line 294 of file mapwriter.cpp.
References solidx2_offset.
Referenced by Pol::UoConvert::ProcessSolidBlock().
| void Pol::Plib::MapWriter::OpenExistingFiles | ( | const std::string & | realm_name | ) |
Definition at line 147 of file mapwriter.cpp.
References _height, _ofs_base, _ofs_maptile, _ofs_solids, _ofs_solidx1, _ofs_solidx2, _realm_name, _width, Pol::Clib::binary(), Pol::Clib::open_file(), Pol::Clib::ConfigFile::read(), Pol::Clib::ConfigElem::remove_ushort(), solids_offset, and solidx2_offset.
Referenced by Pol::UoConvert::update_map().
| void Pol::Plib::MapWriter::SetMapCell | ( | unsigned short | x, |
| unsigned short | y, | ||
| MAPCELL | cell | ||
| ) |
Definition at line 217 of file mapwriter.cpp.
References _block, _cur_mapblock_index, _ofs_base, _width, Pol::Plib::MAPBLOCK::cell, FlushBaseFile(), Pol::Plib::MAPBLOCK_CELLMASK, and Pol::Plib::MAPBLOCK_SHIFT.
Referenced by Pol::UoConvert::ProcessSolidBlock().
| void Pol::Plib::MapWriter::SetMapTile | ( | unsigned short | x, |
| unsigned short | y, | ||
| MAPTILE_CELL | cell | ||
| ) |
Definition at line 241 of file mapwriter.cpp.
References _cur_maptile_index, _maptile_block, _ofs_maptile, _width, Pol::Plib::MAPTILE_BLOCK::cell, FlushMapTileFile(), Pol::Plib::MAPTILE_CELLMASK, and Pol::Plib::MAPTILE_SHIFT.
| void Pol::Plib::MapWriter::SetSolidx2Offset | ( | unsigned short | x_base, |
| unsigned short | y_base, | ||
| unsigned int | offset | ||
| ) |
Definition at line 311 of file mapwriter.cpp.
References _ofs_solidx1, _width, SOLIDX_X_SIZE, and SOLIDX_Y_SIZE.
Referenced by Pol::UoConvert::ProcessSolidBlock().
|
private |
Definition at line 204 of file mapwriter.cpp.
References _height, _width, and Pol::Plib::MAPBLOCK_CHUNK.
Referenced by CreateBaseDat(), height(), and total_size().
|
private |
Definition at line 212 of file mapwriter.cpp.
References _height, _width, and Pol::Plib::MAPTILE_CHUNK.
Referenced by CreateMaptileDat(), and height().
|
private |
|
private |
Definition at line 208 of file mapwriter.cpp.
References _height, _width, SOLIDX_X_SIZE, and SOLIDX_Y_SIZE.
Referenced by CreateSolidx1Dat(), and height().
|
inline |
| void Pol::Plib::MapWriter::WriteConfigFile | ( | ) |
Definition at line 48 of file mapwriter.cpp.
References _height, _realm_name, _width, Pol::Clib::open_file(), Pol::Core::uo_mapid, and Pol::Core::uo_usedif.
Referenced by Pol::UoConvert::create_map().
|
private |
Definition at line 74 of file mapwriter.h.
Referenced by FlushBaseFile(), and SetMapCell().
|
private |
Definition at line 73 of file mapwriter.h.
Referenced by FlushBaseFile(), and SetMapCell().
|
private |
Definition at line 81 of file mapwriter.h.
Referenced by FlushMapTileFile(), and SetMapTile().
|
private |
Definition at line 71 of file mapwriter.h.
Referenced by CreateNewFiles(), height(), OpenExistingFiles(), total_blocks(), total_maptile_blocks(), total_solid_blocks(), and WriteConfigFile().
|
private |
Definition at line 82 of file mapwriter.h.
Referenced by FlushMapTileFile(), and SetMapTile().
|
private |
Definition at line 72 of file mapwriter.h.
Referenced by CreateBaseDat(), FlushBaseFile(), MapWriter(), OpenExistingFiles(), and SetMapCell().
|
private |
Definition at line 80 of file mapwriter.h.
Referenced by CreateMaptileDat(), FlushMapTileFile(), MapWriter(), OpenExistingFiles(), and SetMapTile().
|
private |
Definition at line 78 of file mapwriter.h.
Referenced by AppendSolid(), CreateSolidsDat(), MapWriter(), and OpenExistingFiles().
|
private |
Definition at line 76 of file mapwriter.h.
Referenced by CreateSolidx1Dat(), MapWriter(), OpenExistingFiles(), and SetSolidx2Offset().
|
private |
Definition at line 77 of file mapwriter.h.
Referenced by AppendSolidx2Elem(), CreateSolidx2Dat(), MapWriter(), and OpenExistingFiles().
|
private |
Definition at line 69 of file mapwriter.h.
Referenced by CreateNewFiles(), OpenExistingFiles(), and WriteConfigFile().
|
private |
Definition at line 70 of file mapwriter.h.
Referenced by CreateNewFiles(), OpenExistingFiles(), SetMapCell(), SetMapTile(), SetSolidx2Offset(), total_blocks(), total_maptile_blocks(), total_solid_blocks(), width(), and WriteConfigFile().
|
private |
Definition at line 84 of file mapwriter.h.
Referenced by AppendSolid(), CreateSolidsDat(), NextSolidOffset(), and OpenExistingFiles().
|
private |
Definition at line 83 of file mapwriter.h.
Referenced by AppendSolidx2Elem(), CreateSolidx2Dat(), NextSolidx2Offset(), and OpenExistingFiles().