Ref T430, FG support for model loader (dummy loader) and model caches

This commit is contained in:
Klaus Basan
2018-11-10 17:12:52 +01:00
parent 5d3a765508
commit 53a77813a5
4 changed files with 155 additions and 63 deletions

View File

@@ -173,6 +173,26 @@ namespace BlackMisc
void onCacheChanged(const CSimulatorInfo &simulator);
};
/*!
* Dummy loader for testing
*/
class BLACKMISC_EXPORT CDummyModelLoader : public IAircraftModelLoader
{
public:
//! Dummy loader
CDummyModelLoader(const CSimulatorInfo &simulator, QObject *parent);
//! IAircraftModelLoader::isLoadingFinished
virtual bool isLoadingFinished() const override;
protected:
//! IAircraftModelLoader::startLoadingFromDisk
virtual void startLoadingFromDisk(LoadMode mode, const ModelConsolidationCallback &modelConsolidation, const QStringList &modelDirectories) override;
private:
qint64 m_loadingStartedTs = -1;
};
/*!
* Single instances of all model loaders (lazy init)
*/
@@ -192,6 +212,7 @@ namespace BlackMisc
IAircraftModelLoader *modelLoaderP3D() const { return m_loaderP3D; }
IAircraftModelLoader *modelLoaderXP() const { return m_loaderXP; }
IAircraftModelLoader *modelLoaderFS9() const { return m_loaderFS9; }
IAircraftModelLoader *modelLoaderFG() const { return m_loaderFG; }
//! @}
signals:
@@ -209,6 +230,7 @@ namespace BlackMisc
IAircraftModelLoader *m_loaderP3D = nullptr;
IAircraftModelLoader *m_loaderXP = nullptr;
IAircraftModelLoader *m_loaderFS9 = nullptr;
IAircraftModelLoader *m_loaderFG = nullptr;
//! Init the loader
IAircraftModelLoader *initLoader(const CSimulatorInfo &simulator);