FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::MapLoader Class Reference

#include <maploader.h>

+ Inheritance diagram for FIFE::MapLoader:
+ Collaboration diagram for FIFE::MapLoader:

Public Member Functions

 MapLoader (Model *model, VFS *vfs, ImageManager *imageManager, RenderBackend *renderBackend)
 
 ~MapLoader ()
 
void setObjectLoader (const FIFE::ObjectLoaderPtr &objectLoader)
 
FIFE::ObjectLoaderPtr getObjectLoader ()
 
void setAnimationLoader (const FIFE::AnimationLoaderPtr &animationLoader)
 
FIFE::AnimationLoaderPtr getAnimationLoader ()
 
void setAtlasLoader (const FIFE::AtlasLoaderPtr &atlasLoader)
 
FIFE::AtlasLoaderPtr getAtlasLoader ()
 
bool isLoadable (const std::string &filename) const
 
Mapload (const std::string &filename)
 
void loadImportFile (const std::string &file, const std::string &directory="")
 used to load an object file if directory is provided then file is assumed relative to directory if relativeToMap is true then the file/directory is assumed to be relative to location of map file More...
 
void loadImportDirectory (const std::string &directory)
 used to load a directory of object files recursively if relativeToMap is true then the directory is assumed to be relative to location of map file More...
 
void addPercentDoneListener (PercentDoneListener *listener)
 allows adding a listener to the map loader for percent completed events More...
 
const std::string & getLoaderName () const
 returns the loader name associated with this map file loader, this will only be populated after the load function is called More...
 
- Public Member Functions inherited from FIFE::IMapLoader
virtual ~IMapLoader ()
 

Private Attributes

Modelm_model
 
VFSm_vfs
 
ImageManagerm_imageManager
 
AnimationManagerm_animationManager
 
ObjectLoaderPtr m_objectLoader
 
RenderBackendm_renderBackend
 
PercentDoneCallback m_percentDoneListener
 
std::string m_loaderName
 
std::string m_mapDirectory
 
std::vector< std::string > m_importDirectories
 

Detailed Description

Definition at line 50 of file maploader.h.

Constructor & Destructor Documentation

FIFE::MapLoader::MapLoader ( Model model,
VFS vfs,
ImageManager imageManager,
RenderBackend renderBackend 
)

Definition at line 71 of file maploader.cpp.

References m_animationManager, m_imageManager, m_model, m_objectLoader, m_vfs, and FIFE::SharedPtr< T >::reset().

Referenced by FIFE::createDefaultMapLoader().

+ Here is the caller graph for this function:

FIFE::MapLoader::~MapLoader ( )

Definition at line 79 of file maploader.cpp.

Member Function Documentation

void FIFE::MapLoader::addPercentDoneListener ( PercentDoneListener listener)

allows adding a listener to the map loader for percent completed events

Definition at line 896 of file maploader.cpp.

References FIFE::PercentDoneCallback::addListener(), and m_percentDoneListener.

FIFE::AnimationLoaderPtr FIFE::MapLoader::getAnimationLoader ( )
See also
IMapLoader::getAnimationLoader

Definition at line 783 of file maploader.cpp.

References FIFE::IObjectLoader::getAnimationLoader(), and m_objectLoader.

FIFE::AtlasLoaderPtr FIFE::MapLoader::getAtlasLoader ( )
See also
IMapLoader::getAtlasLoader

Definition at line 796 of file maploader.cpp.

References FIFE::IObjectLoader::getAtlasLoader(), and m_objectLoader.

const std::string & FIFE::MapLoader::getLoaderName ( ) const

returns the loader name associated with this map file loader, this will only be populated after the load function is called

Definition at line 900 of file maploader.cpp.

References m_loaderName.

Referenced by isLoadable().

+ Here is the caller graph for this function:

FIFE::ObjectLoaderPtr FIFE::MapLoader::getObjectLoader ( )
See also
IMapLoader::getObjectLoader

Definition at line 773 of file maploader.cpp.

References m_objectLoader.

bool FIFE::MapLoader::isLoadable ( const std::string &  filename) const
virtual
Map * FIFE::MapLoader::load ( const std::string &  filename)
virtual
See also
IMapLoader::load

Implements FIFE::IMapLoader.

Definition at line 83 of file maploader.cpp.

References FIFE::_log, FIFE::RendererBase::activateAllLayers(), FIFE::Instance::actRepeat(), FIFE::Map::addCamera(), FIFE::CellCache::addCellToArea(), FIFE::CellCache::addCellToCost(), FIFE::CellCache::addNarrowCell(), FIFE::Trigger::addTriggerCondition(), FIFE::Trigger::assign(), FIFE::Trigger::attach(), FIFE::CELL_EDGES_AND_DIAGONALS, FIFE::CELL_EDGES_ONLY, FIFE::CELLV_CONCEALED, FIFE::CELLV_MASKED, FIFE::CELLV_REVEALED, FIFE::InstanceVisual::create(), FIFE::CellCache::createCell(), FIFE::Layer::createInstance(), FIFE::Map::createLayer(), FIFE::Model::createMap(), FIFE::Cell::createTransition(), FIFE::TriggerController::createTrigger(), FIFE::CTYPE_CELL_BLOCKER, FIFE::CTYPE_CELL_NO_BLOCKER, FIFE::Trigger::enableForAllInstances(), FIFE::Trigger::enableForInstance(), FIFE::Map::finalizeCellCaches(), FL_ERR, FIFE::Object::getAction(), FIFE::CellCache::getCell(), FIFE::Layer::getCellCache(), FIFE::Model::getCellGrid(), FIFE::RawData::getDataLength(), FIFE::InstanceRenderer::getInstance(), FIFE::Layer::getInstance(), FIFE::Map::getLayer(), FIFE::Model::getNamespaces(), FIFE::Model::getObject(), FIFE::Model::getObjects(), FIFE::GetParentPath(), FIFE::RenderBackend::getScreenHeight(), FIFE::RenderBackend::getScreenWidth(), FIFE::ObjectVisual::getStaticImageAngles(), FIFE::Map::getTriggerController(), FIFE::HasParentPath(), FIFE::PercentDoneCallback::incrementCount(), FIFE::Map::initializeCellCaches(), FIFE::ITYPE_CIRCLE_SHAPE, FIFE::ITYPE_NO_SHAPE, FIFE::ITYPE_QUAD_SHAPE, loadImportDirectory(), loadImportFile(), m_loaderName, m_mapDirectory, m_model, m_percentDoneListener, m_renderBackend, m_vfs, FIFE::VFS::open(), FIFE::RawData::readString(), FIFE::CellCache::registerCost(), FIFE::PercentDoneCallback::reset(), FIFE::Camera::setCellImageDimensions(), FIFE::Instance::setCellStackPosition(), FIFE::Cell::setCellType(), FIFE::Instance::setCost(), FIFE::Cell::setCostMultiplier(), FIFE::CellCache::setDefaultCostMultiplier(), FIFE::CellCache::setDefaultSpeedMultiplier(), FIFE::Map::setFilename(), FIFE::Cell::setFoWType(), FIFE::Layer::setInteract(), FIFE::Object::setMultiPart(), FIFE::Layer::setPathingStrategy(), FIFE::Camera::setRotation(), FIFE::Instance::setRotation(), FIFE::CellGrid::setRotation(), FIFE::CellCache::setSearchNarrowCells(), FIFE::Layer::setSortingStrategy(), FIFE::Cell::setSpeedMultiplier(), FIFE::InstanceVisual::setStackPosition(), FIFE::Camera::setTilt(), FIFE::PercentDoneCallback::setTotalNumberOfElements(), FIFE::Trigger::setTriggered(), FIFE::Instance::setVisitor(), FIFE::Instance::setVisitorRadius(), FIFE::Instance::setVisitorShape(), FIFE::Layer::setWalkable(), FIFE::CellGrid::setXScale(), FIFE::CellGrid::setXShift(), FIFE::CellGrid::setYScale(), FIFE::CellGrid::setYShift(), FIFE::Camera::setZoom(), FIFE::CellGrid::setZScale(), FIFE::CellGrid::setZShift(), FIFE::Camera::setZToY(), FIFE::SORTING_CAMERA, FIFE::SORTING_CAMERA_AND_LOCATION, FIFE::SORTING_LOCATION, and FIFE::tokenize().

void FIFE::MapLoader::loadImportDirectory ( const std::string &  directory)

used to load a directory of object files recursively if relativeToMap is true then the directory is assumed to be relative to location of map file

Definition at line 868 of file maploader.cpp.

References FIFE::VFS::listDirectories(), FIFE::VFS::listFiles(), loadImportFile(), and m_vfs.

Referenced by load().

+ Here is the caller graph for this function:

void FIFE::MapLoader::loadImportFile ( const std::string &  file,
const std::string &  directory = "" 
)

used to load an object file if directory is provided then file is assumed relative to directory if relativeToMap is true then the file/directory is assumed to be relative to location of map file

Definition at line 850 of file maploader.cpp.

References FIFE::IObjectLoader::getAnimationLoader(), FIFE::IObjectLoader::getAtlasLoader(), FIFE::IAnimationLoader::isLoadable(), FIFE::IAtlasLoader::isLoadable(), FIFE::IObjectLoader::isLoadable(), FIFE::IObjectLoader::load(), FIFE::IAnimationLoader::loadMultiple(), FIFE::IAtlasLoader::loadMultiple(), and m_objectLoader.

Referenced by load(), and loadImportDirectory().

+ Here is the caller graph for this function:

void FIFE::MapLoader::setAnimationLoader ( const FIFE::AnimationLoaderPtr animationLoader)
virtual
void FIFE::MapLoader::setAtlasLoader ( const FIFE::AtlasLoaderPtr atlasLoader)
virtual
void FIFE::MapLoader::setObjectLoader ( const FIFE::ObjectLoaderPtr objectLoader)
virtual
See also
IMapLoader::setObjectLoader

Implements FIFE::IMapLoader.

Definition at line 767 of file maploader.cpp.

References m_objectLoader.

Member Data Documentation

AnimationManager* FIFE::MapLoader::m_animationManager
private

Definition at line 125 of file maploader.h.

Referenced by MapLoader().

ImageManager* FIFE::MapLoader::m_imageManager
private

Definition at line 124 of file maploader.h.

Referenced by MapLoader().

std::vector<std::string> FIFE::MapLoader::m_importDirectories
private

Definition at line 132 of file maploader.h.

std::string FIFE::MapLoader::m_loaderName
private

Definition at line 130 of file maploader.h.

Referenced by getLoaderName(), and load().

std::string FIFE::MapLoader::m_mapDirectory
private

Definition at line 131 of file maploader.h.

Referenced by load().

Model* FIFE::MapLoader::m_model
private

Definition at line 122 of file maploader.h.

Referenced by load(), and MapLoader().

PercentDoneCallback FIFE::MapLoader::m_percentDoneListener
private

Definition at line 128 of file maploader.h.

Referenced by addPercentDoneListener(), and load().

RenderBackend* FIFE::MapLoader::m_renderBackend
private

Definition at line 127 of file maploader.h.

Referenced by load().

VFS* FIFE::MapLoader::m_vfs
private

Definition at line 123 of file maploader.h.

Referenced by isLoadable(), load(), loadImportDirectory(), and MapLoader().


The documentation for this class was generated from the following files: