FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
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

◆ MapLoader()

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:

◆ ~MapLoader()

FIFE::MapLoader::~MapLoader ( )

Definition at line 79 of file maploader.cpp.

Member Function Documentation

◆ addPercentDoneListener()

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

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

Definition at line 857 of file maploader.cpp.

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

◆ getAnimationLoader()

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

Definition at line 744 of file maploader.cpp.

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

◆ getAtlasLoader()

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

Definition at line 757 of file maploader.cpp.

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

◆ getLoaderName()

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 861 of file maploader.cpp.

References m_loaderName.

Referenced by isLoadable().

+ Here is the caller graph for this function:

◆ getObjectLoader()

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

Definition at line 734 of file maploader.cpp.

References m_objectLoader.

◆ isLoadable()

bool FIFE::MapLoader::isLoadable ( const std::string &  filename) const
virtual

◆ load()

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::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(), 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::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::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().

◆ loadImportDirectory()

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 829 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:

◆ loadImportFile()

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 811 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:

◆ setAnimationLoader()

void FIFE::MapLoader::setAnimationLoader ( const FIFE::AnimationLoaderPtr animationLoader)
virtual

◆ setAtlasLoader()

void FIFE::MapLoader::setAtlasLoader ( const FIFE::AtlasLoaderPtr atlasLoader)
virtual

◆ setObjectLoader()

void FIFE::MapLoader::setObjectLoader ( const FIFE::ObjectLoaderPtr objectLoader)
virtual
See also
IMapLoader::setObjectLoader

Implements FIFE::IMapLoader.

Definition at line 728 of file maploader.cpp.

References m_objectLoader.

Member Data Documentation

◆ m_animationManager

AnimationManager* FIFE::MapLoader::m_animationManager
private

Definition at line 125 of file maploader.h.

Referenced by MapLoader().

◆ m_imageManager

ImageManager* FIFE::MapLoader::m_imageManager
private

Definition at line 124 of file maploader.h.

Referenced by MapLoader().

◆ m_importDirectories

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

Definition at line 132 of file maploader.h.

◆ m_loaderName

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

Definition at line 130 of file maploader.h.

Referenced by getLoaderName(), and load().

◆ m_mapDirectory

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

Definition at line 131 of file maploader.h.

Referenced by load().

◆ m_model

Model* FIFE::MapLoader::m_model
private

Definition at line 122 of file maploader.h.

Referenced by load(), and MapLoader().

◆ m_objectLoader

◆ m_percentDoneListener

PercentDoneCallback FIFE::MapLoader::m_percentDoneListener
private

Definition at line 128 of file maploader.h.

Referenced by addPercentDoneListener(), and load().

◆ m_renderBackend

RenderBackend* FIFE::MapLoader::m_renderBackend
private

Definition at line 127 of file maploader.h.

Referenced by load().

◆ m_vfs

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: