Skip to content

Commit

Permalink
fix(asset-back): invalid include + useless init list
Browse files Browse the repository at this point in the history
  • Loading branch information
Thyodas committed Dec 5, 2024
1 parent a5f88fe commit 3fd6594
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
23 changes: 5 additions & 18 deletions engine/src/assets/Asset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ namespace nexo::assets {
IAsset() = delete;
virtual ~IAsset() = default;

[[nodiscard]] const AssetMetadata& getMetadata() const { return m_metadata; }
[[nodiscard]] AssetType getType() const { return getMetadata().type; }
[[nodiscard]] AssetID getID() const { return getMetadata().id; }
[[nodiscard]] AssetStatus getStatus() const { return getMetadata().status; }
[[nodiscard]] virtual const AssetMetadata& getMetadata() const { return m_metadata; }
[[nodiscard]] virtual AssetType getType() const { return getMetadata().type; }
[[nodiscard]] virtual AssetID getID() const { return getMetadata().id; }
[[nodiscard]] virtual AssetStatus getStatus() const { return getMetadata().status; }
protected:
explicit IAsset(AssetType type)
: m_metadata({
Expand Down Expand Up @@ -103,26 +103,13 @@ namespace nexo::assets {
[[nodiscard]] AssetID getID() const { return getMetadata().id; }
[[nodiscard]] AssetStatus getStatus() const { return getMetadata().status; }
protected:
explicit Asset(AssetType type)
: IAsset(), m_metadata({
.type = type,
.status = AssetStatus::UNLOADED,
.referenceCount = 0,
.id = boost::uuids::nil_uuid(),
.manager = nullptr
})
explicit Asset(AssetType type) : IAsset(type)
{
}

private:
AssetMetadata m_metadata;
TAssetData m_data;

/**
* @brief Get the metadata of the asset (for modification)
*/
[[nodiscard]] AssetMetadata& getMetadata() { return m_metadata; }

virtual AssetStatus load() = 0;
virtual AssetStatus unload() = 0;

Expand Down
2 changes: 1 addition & 1 deletion tests/renderer/RendererAPI.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <glad/glad.h>
#include <opengl/OpenGlVertexArray.hpp>
#include "GraphicsBackends/opengl/OpenGlVertexArray.hpp"

#include "contexts/opengl.hpp"
#include "GraphicsBackends/opengl/OpenGlRendererAPI.hpp"
Expand Down

0 comments on commit 3fd6594

Please sign in to comment.