mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 04:58:59 -05:00
Some more cleanup of the assets
This commit is contained in:
@@ -38,7 +38,7 @@ class AssetLoader;
|
||||
|
||||
class Asset : public std::enable_shared_from_this<Asset> {
|
||||
public:
|
||||
enum class State : unsigned int {
|
||||
enum class State {
|
||||
Unloaded,
|
||||
LoadingFailed,
|
||||
Loaded,
|
||||
|
||||
@@ -33,11 +33,8 @@ class AssetListener {
|
||||
public:
|
||||
virtual ~AssetListener() = default;
|
||||
virtual void assetStateChanged(Asset* asset, Asset::State state) = 0;
|
||||
virtual void assetRequested(Asset* parent,
|
||||
std::shared_ptr<Asset> child) = 0;
|
||||
|
||||
virtual void assetUnrequested(Asset* parent,
|
||||
std::shared_ptr<Asset> child) = 0;
|
||||
virtual void assetRequested(Asset* parent, std::shared_ptr<Asset> child) = 0;
|
||||
virtual void assetUnrequested(Asset* parent, std::shared_ptr<Asset> child) = 0;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -87,15 +87,10 @@ public:
|
||||
void untrackAsset(Asset* asset);
|
||||
|
||||
/**
|
||||
* Return the asset identified by the identifier,
|
||||
* if the asset is tracked. Otherwise return nullptr.
|
||||
*/
|
||||
std::shared_ptr<Asset> has(const std::string& identifier) const;
|
||||
|
||||
/**
|
||||
* Return the lua state
|
||||
* Return the asset identified by the identifier,
|
||||
* if the asset is tracked. Otherwise return nullptr.
|
||||
*/
|
||||
ghoul::lua::LuaState* luaState();
|
||||
std::shared_ptr<Asset> has(const std::string& identifier) const;
|
||||
|
||||
/**
|
||||
* Return the root asset
|
||||
@@ -103,8 +98,8 @@ public:
|
||||
std::shared_ptr<Asset> rootAsset() const;
|
||||
|
||||
/**
|
||||
* Return the asset root directory
|
||||
*/
|
||||
* Return the asset root directory
|
||||
*/
|
||||
const std::string& assetRootDirectory() const;
|
||||
|
||||
/**
|
||||
|
||||
@@ -61,11 +61,9 @@ public:
|
||||
void removeAll();
|
||||
std::shared_ptr<Asset> rootAsset();
|
||||
|
||||
void assetStateChanged(Asset* asset, Asset::State state) override;
|
||||
void assetRequested(Asset* parent,
|
||||
std::shared_ptr<Asset> child) override;
|
||||
void assetUnrequested(Asset* parent,
|
||||
std::shared_ptr<Asset> child) override;
|
||||
void assetStateChanged(Asset* asset, Asset::State state);
|
||||
void assetRequested(Asset* parent, std::shared_ptr<Asset> child);
|
||||
void assetUnrequested(Asset* parent, std::shared_ptr<Asset> child);
|
||||
|
||||
bool update();
|
||||
scripting::LuaLibrary luaLibrary();
|
||||
|
||||
@@ -69,7 +69,6 @@ public:
|
||||
void notify();
|
||||
|
||||
private:
|
||||
WatchHandle generateWatchHandle();
|
||||
std::mutex _mutex;
|
||||
std::unordered_map<WatchHandle, WatchData> _watchedSyncs;
|
||||
std::vector<NotificationData> _pendingNotifications;
|
||||
|
||||
Reference in New Issue
Block a user