Some more cleanup of the assets

This commit is contained in:
Alexander Bock
2020-05-06 16:21:47 +02:00
parent 5a41084027
commit fa56e9ecf4
9 changed files with 78 additions and 136 deletions
+1 -1
View File
@@ -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,
+2 -5
View File
@@ -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
+5 -10
View File
@@ -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;
/**
+3 -5
View File
@@ -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;