ObjLoading: Add documentation for IObjLoader, ObjLoading and IWD

This commit is contained in:
Jan 2020-02-04 23:48:11 +01:00
parent b8de90a675
commit b67b4ee316
3 changed files with 53 additions and 0 deletions

View File

@ -8,10 +8,30 @@ class IObjLoader
public: public:
virtual ~IObjLoader() = default; virtual ~IObjLoader() = default;
/**
* \brief Checks whether this ObjLoader supports a specified zone.
* \param zone The zone to check.
* \return \c true if the specified zone is supported.
*/
virtual bool SupportsZone(Zone* zone) = 0; virtual bool SupportsZone(Zone* zone) = 0;
/**
* \brief Loads all containers that are referenced by a specified zone.
* \param searchPath The search path object to use to find the referenced containers.
* \param zone The zone to check for referenced containers.
*/
virtual void LoadReferencedContainersForZone(ISearchPath* searchPath, Zone* zone) = 0; virtual void LoadReferencedContainersForZone(ISearchPath* searchPath, Zone* zone) = 0;
/**
* \brief Unloads all containers of a specified zone. If a container is also loaded by another zone it will only be unloaded when all referencing zones are unloaded.
* \param zone The zone to unload all containers for.
*/
virtual void UnloadContainersOfZone(Zone* zone) = 0; virtual void UnloadContainersOfZone(Zone* zone) = 0;
/**
* \brief Loads the obj data for all assets of a specified zone.
* \param searchPath The search path object to use to find obj files.
* \param zone The zone of the assets to load the obj data for.
*/
virtual void LoadObjDataForZone(ISearchPath* searchPath, Zone* zone) = 0; virtual void LoadObjDataForZone(ISearchPath* searchPath, Zone* zone) = 0;
}; };

View File

@ -19,6 +19,10 @@ public:
IWD& operator=(const IWD& other) = delete; IWD& operator=(const IWD& other) = delete;
IWD& operator=(IWD&& other) noexcept; IWD& operator=(IWD&& other) noexcept;
/**
* \brief Initializes the IWD container.
* \return \c true when initialization was successful.
*/
bool Initialize() const; bool Initialize() const;
FileAPI::IFile* Open(const std::string& fileName) override; FileAPI::IFile* Open(const std::string& fileName) override;

View File

@ -13,12 +13,41 @@ public:
bool Verbose = false; bool Verbose = false;
} Configuration; } Configuration;
/**
* \brief Loads all containers that are being referenced by the specified zone.
* \param searchPath The search path to use to find the referenced containers.
* \param zone The zone to load all referenced containers of.
*/
static void LoadReferencedContainersForZone(ISearchPath* searchPath, Zone* zone); static void LoadReferencedContainersForZone(ISearchPath* searchPath, Zone* zone);
/**
* \brief Unloads all containers that were referenced by a specified zone. If referenced by more than one zone a container will only be unloaded once all referencing zones were unloaded the container.
* \param zone The zone to unload all referenced containers for.
*/
static void UnloadContainersOfZone(Zone* zone); static void UnloadContainersOfZone(Zone* zone);
/**
* \brief Loads all IWDs that can be found in a specified search path.
* \param searchPath The search path that contains IWDs to be loaded.
*/
static void LoadIWDsInSearchPath(ISearchPath* searchPath); static void LoadIWDsInSearchPath(ISearchPath* searchPath);
/**
* \brief Unloads all IWDs that were loaded from the specified search path.
* \param searchPath The search path that was used to load the IWDs to be unloaded.
*/
static void UnloadIWDsInSearchPath(ISearchPath* searchPath); static void UnloadIWDsInSearchPath(ISearchPath* searchPath);
/**
* \brief Creates a \c SearchPaths object containing all IWDs that are currently loaded.
* \return A \c SearchPaths object containing all IWDs that are currently loaded.
*/
static SearchPaths GetIWDSearchPaths(); static SearchPaths GetIWDSearchPaths();
/**
* \brief Loads the obj data for all assets of a zone.
* \param searchPath The search path to use to search for all obj data files.
* \param zone The zone of the assets to load the obj data for.
*/
static void LoadObjDataForZone(ISearchPath* searchPath, Zone* zone); static void LoadObjDataForZone(ISearchPath* searchPath, Zone* zone);
}; };