Skip to content

Commit

Permalink
feat(assets): add use paths instead of UUIDs to identifying assets
Browse files Browse the repository at this point in the history
  • Loading branch information
fallenatlas authored and GalaxyCrush committed Oct 8, 2024
1 parent 0b6072d commit 211e77a
Show file tree
Hide file tree
Showing 14 changed files with 174 additions and 66 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Print stacktrace with *cpptrace* on calls to CUBOS_FAIL (#1172, **@RiscadoA**).
- Orthographic Camera component (#1182, **@mkuritsu**).
- Importer plugin (#1299, **@Scarface1809**).
- Handle body rotation on penetration solving (#1272, **&fallenatlas**).

### Changed

- Moved Glad and stb-image libs to another repositories, cubos-glad and cubos-stb, respectively (#1323, **@kuukitenshi**).
- Moved most tools from Tesseratos to the engine (#1322, **@RiscadoA**).

- Allow identifying assets in code from their path (#1177. **@GalaxyCrush**).

### Fixed

- Spot light angle mismatch between light and shadows (#1310, **@tomas7770**).
Expand Down
12 changes: 8 additions & 4 deletions engine/include/cubos/engine/assets/asset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace cubos::engine

/// @brief Avoid using this field, use @ref getId() instead.
/// @todo This was added as a dirty fix for #692, should be removed once the issue is fixed.
uuids::uuid reflectedId;
std::string pathOrId;

~AnyAsset();

Expand Down Expand Up @@ -71,9 +71,13 @@ namespace cubos::engine
/// @return Asset version.
int getVersion() const;

/// @brief Gets the UUID of the asset.
/// @brief Gets the Path or UUID of the asset.
/// @return Asset Path or UUID.
std::string getIdString() const;

/// @brief Gets the UUID of the asset if it is the case of having one.
/// @return Asset UUID.
uuids::uuid getId() const;
std::optional<uuids::uuid> getId() const;

/// @brief Checks if the handle is null.
/// @return Whether the handle is null.
Expand Down Expand Up @@ -160,7 +164,7 @@ namespace cubos::engine
inline AnyAsset::operator Asset<T>() const
{
Asset<T> asset;
asset.reflectedId = reflectedId;
asset.pathOrId = pathOrId;

Check warning on line 167 in engine/include/cubos/engine/assets/asset.hpp

View check run for this annotation

Codecov / codecov/patch

engine/include/cubos/engine/assets/asset.hpp#L167

Added line #L167 was not covered by tests
asset.mId = mId;
asset.mRefCount = mRefCount;
asset.mVersion = mVersion;
Expand Down
5 changes: 5 additions & 0 deletions engine/include/cubos/engine/assets/assets.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ namespace cubos::engine
/// @return Lock guard.
std::unique_lock<std::shared_mutex> lockWrite(const AnyAsset& handle) const;

/// @brief Checks if the given path is a valid path to an asset.
/// @param path Path to check.
/// @return A string that says if the given string is a path, uuid or not a valid format string
static std::string isPath(const std::string& path);

/// @brief Gets a pointer to the entry associated with the given handle.
/// @param handle Handle to get the entry for.
/// @return Entry for the given handle, or nullptr if there is no such entry.
Expand Down
10 changes: 10 additions & 0 deletions engine/include/cubos/engine/assets/meta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <unordered_map>
#include <vector>

#include <uuid.h>

#include <cubos/engine/api.hpp>

namespace cubos::engine
Expand Down Expand Up @@ -44,6 +46,14 @@ namespace cubos::engine
/// @return The value of the parameter, if the parameter exists.
std::optional<std::string> get(std::string_view key) const;

/// @brief Gets the ID of the asset.
/// @return ID of the asset.
uuids::uuid getId() const;

/// @brief Gets the path of the asset.
/// @return Path of the asset.
std::string getPath() const;

/// @brief Sets a parameter on the asset's metadata.
/// @param key Key of the parameter.
/// @param value Value of the parameter.
Expand Down
6 changes: 3 additions & 3 deletions engine/samples/games/cubosurfers/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

using namespace cubos::engine;

static const Asset<Scene> SceneAsset = AnyAsset("ee5bb451-05b7-430f-a641-a746f7009eef");
static const Asset<VoxelPalette> PaletteAsset = AnyAsset("101da567-3d23-46ae-a391-c10ec00e8718");
static const Asset<InputBindings> InputBindingsAsset = AnyAsset("b20900a4-20ee-4caa-8830-14585050bead");
static const Asset<Scene> SceneAsset = AnyAsset("/assets/scenes/main.cubos");
static const Asset<VoxelPalette> PaletteAsset = AnyAsset("/assets/main.pal");
static const Asset<InputBindings> InputBindingsAsset = AnyAsset("/assets/input.bind");

int main(int argc, char** argv)
{
Expand Down
39 changes: 24 additions & 15 deletions engine/src/assets/asset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ AnyAsset::AnyAsset(std::nullptr_t)
}

AnyAsset::AnyAsset(uuids::uuid id)
: reflectedId(id)
: pathOrId(uuids::to_string(id))

Check warning on line 30 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L30

Added line #L30 was not covered by tests
, mId(id)
, mRefCount(nullptr)
, mVersion(-1)
Expand All @@ -40,17 +40,21 @@ AnyAsset::AnyAsset(std::string_view str)
{
if (auto id = uuids::uuid::from_string(str))
{
reflectedId = id.value();
pathOrId = str;

Check warning on line 43 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L43

Added line #L43 was not covered by tests
mId = id.value();
}
else if (str.find('/') != std::string_view::npos || str.find('\\') != std::string_view::npos)

Check warning on line 46 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L46

Added line #L46 was not covered by tests
{
pathOrId = str;

Check warning on line 48 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L48

Added line #L48 was not covered by tests
}
else
{
CUBOS_ERROR("Could not create asset handle, invalid UUID: \"{}\"", str);
}
}

AnyAsset::AnyAsset(const AnyAsset& other)
: reflectedId(other.reflectedId)
: pathOrId(other.pathOrId)

Check warning on line 57 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L57

Added line #L57 was not covered by tests
, mId(other.mId)
, mRefCount(other.mRefCount)
, mVersion(other.mVersion)
Expand All @@ -59,7 +63,7 @@ AnyAsset::AnyAsset(const AnyAsset& other)
}

AnyAsset::AnyAsset(AnyAsset&& other) noexcept
: reflectedId(other.reflectedId)
: pathOrId(other.pathOrId)

Check warning on line 66 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L66

Added line #L66 was not covered by tests
, mId(other.mId)
, mRefCount(other.mRefCount)
, mVersion(other.mVersion)
Expand All @@ -75,7 +79,7 @@ AnyAsset& AnyAsset::operator=(const AnyAsset& other)
}

this->decRef();
reflectedId = other.reflectedId;
pathOrId = other.pathOrId;

Check warning on line 82 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L82

Added line #L82 was not covered by tests
mId = other.mId;
mRefCount = other.mRefCount;
mVersion = other.mVersion;
Expand All @@ -91,7 +95,7 @@ AnyAsset& AnyAsset::operator=(AnyAsset&& other) noexcept
}

this->decRef();
reflectedId = other.reflectedId;
pathOrId = other.pathOrId;

Check warning on line 98 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L98

Added line #L98 was not covered by tests
mId = other.mId;
mRefCount = other.mRefCount;
mVersion = other.mVersion;
Expand All @@ -101,27 +105,32 @@ AnyAsset& AnyAsset::operator=(AnyAsset&& other) noexcept

bool AnyAsset::operator==(const AnyAsset& other) const
{
return this->getId() == other.getId();
return this->getIdString() == other.getIdString();

Check warning on line 108 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L108

Added line #L108 was not covered by tests
}

int AnyAsset::getVersion() const
{
return reflectedId == mId ? mVersion : 0;
return getId().has_value() && getId().value() == mId ? mVersion : 0;

Check warning on line 113 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L113

Added line #L113 was not covered by tests
}

std::string AnyAsset::getIdString() const

Check warning on line 116 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L116

Added line #L116 was not covered by tests
{
return pathOrId;

Check warning on line 118 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L118

Added line #L118 was not covered by tests
}

uuids::uuid AnyAsset::getId() const
std::optional<uuids::uuid> AnyAsset::getId() const

Check warning on line 121 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L121

Added line #L121 was not covered by tests
{
return reflectedId;
return uuids::uuid::from_string(pathOrId);

Check warning on line 123 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L123

Added line #L123 was not covered by tests
}

bool AnyAsset::isNull() const
{
return reflectedId.is_nil();
return pathOrId.empty();

Check warning on line 128 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L128

Added line #L128 was not covered by tests
}

bool AnyAsset::isStrong() const
{
return reflectedId == mId && mRefCount != nullptr;
return getId().has_value() && getId().value() == mId && mRefCount != nullptr;

Check warning on line 133 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L133

Added line #L133 was not covered by tests
}

void AnyAsset::makeWeak()
Expand All @@ -136,20 +145,20 @@ cubos::core::reflection::Type& AnyAsset::makeType(std::string name)

return Type::create(std::move(name))
.with(ConstructibleTrait::typed<AnyAsset>().withBasicConstructors().build())
.with(FieldsTrait().withField("id", &AnyAsset::reflectedId));
.with(FieldsTrait().withField("id", &AnyAsset::pathOrId));

Check warning on line 148 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L148

Added line #L148 was not covered by tests
}

void AnyAsset::incRef() const
{
if (reflectedId == mId && mRefCount != nullptr)
if (getId().has_value() && getId().value() == mId && mRefCount != nullptr)

Check warning on line 153 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L153

Added line #L153 was not covered by tests
{
static_cast<std::atomic<int>*>(mRefCount)->fetch_add(1);
}
}

void AnyAsset::decRef() const
{
if (reflectedId == mId && mRefCount != nullptr)
if (getId().has_value() && getId().value() == mId && mRefCount != nullptr)

Check warning on line 161 in engine/src/assets/asset.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/asset.cpp#L161

Added line #L161 was not covered by tests
{
static_cast<std::atomic<int>*>(mRefCount)->fetch_sub(1);
}
Expand Down
103 changes: 82 additions & 21 deletions engine/src/assets/assets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void Assets::loadMeta(std::string_view path)
// Get the UUID from the metadata, if it exists.
if (meta.get("id").has_value())
{
id = uuids::uuid::from_string(meta.get("id").value()).value_or(uuids::uuid());
id = meta.getId();

Check warning on line 222 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L222

Added line #L222 was not covered by tests
}

// If the UUID is invalid, generate a new random one.
Expand Down Expand Up @@ -287,6 +287,7 @@ AnyAsset Assets::load(AnyAsset handle) const
// Return a strong handle to the asset.
assetEntry->refCount += 1;
handle.mRefCount = &assetEntry->refCount;
handle.mId = assetEntry->meta.getId();

Check warning on line 290 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L290

Added line #L290 was not covered by tests
return handle;
}

Expand Down Expand Up @@ -354,7 +355,7 @@ Assets::Status Assets::status(const AnyAsset& handle) const
std::shared_lock lock(mMutex);

// Do not use .entry() here because we don't want to log errors if the asset is unknown.
auto it = mEntries.find(handle.getId());
auto it = mEntries.find(handle.getId().value());

Check warning on line 358 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L358

Added line #L358 was not covered by tests
if (it == mEntries.end())
{
return Status::Unknown;
Expand All @@ -372,9 +373,9 @@ bool Assets::update(AnyAsset& handle) const
return false;
}

if (handle.mId != handle.reflectedId)
if (handle.mId != assetEntry->meta.getId())

Check warning on line 376 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L376

Added line #L376 was not covered by tests
{
handle = AnyAsset{handle.reflectedId};
handle = AnyAsset{assetEntry->meta.getId()};

Check warning on line 378 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L378

Added line #L378 was not covered by tests
handle.mVersion = assetEntry->version;
return true;
}
Expand Down Expand Up @@ -596,6 +597,18 @@ std::unique_lock<std::shared_mutex> Assets::lockWrite(const AnyAsset& handle) co
abort();
}

std::string Assets::isPath(const std::string& path)

Check warning on line 600 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L600

Added line #L600 was not covered by tests
{
if (path.find('/') != std::string::npos || path.find('\\') != std::string::npos)

Check warning on line 602 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L602

Added line #L602 was not covered by tests
{
return "Path";

Check warning on line 604 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L604

Added line #L604 was not covered by tests
}
else if (auto id = uuids::uuid::from_string(path))

Check warning on line 606 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L606

Added line #L606 was not covered by tests
{
return "UUID";

Check warning on line 608 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L608

Added line #L608 was not covered by tests
}
return "Invalid format";

Check warning on line 610 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L610

Added line #L610 was not covered by tests
}
std::shared_ptr<Assets::Entry> Assets::entry(const AnyAsset& handle) const
{
// If the handle is null, we can't access the asset.
Expand All @@ -608,15 +621,33 @@ std::shared_ptr<Assets::Entry> Assets::entry(const AnyAsset& handle) const
// Lock the entries map for reading.
auto sharedLock = std::shared_lock(mMutex);

// Search for the entry in the map.
auto it = mEntries.find(handle.getId());
if (it == mEntries.end())
auto sid = handle.getIdString();

Check warning on line 624 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L624

Added line #L624 was not covered by tests

if (isPath(sid) == "Path")

Check warning on line 626 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L626

Added line #L626 was not covered by tests
{
for (const auto& [eid, entry] : mEntries)

Check warning on line 628 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L628

Added line #L628 was not covered by tests
{
if (entry->meta.getPath() == sid)

Check warning on line 630 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L630

Added line #L630 was not covered by tests
{
return entry;

Check warning on line 632 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L632

Added line #L632 was not covered by tests
}
}
CUBOS_ERROR("No such asset {}", handle);
return nullptr;
}

return it->second;
if (isPath(sid) == "UUID")

Check warning on line 638 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L638

Added line #L638 was not covered by tests
{
// Search for the entry in the map.
auto it = mEntries.find(handle.getId().value());
if (it == mEntries.end())

Check warning on line 642 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L641-L642

Added lines #L641 - L642 were not covered by tests
{
CUBOS_ERROR("No such asset {}", handle);
return nullptr;

Check warning on line 645 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L644-L645

Added lines #L644 - L645 were not covered by tests
}
return it->second;

Check warning on line 647 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L647

Added line #L647 was not covered by tests
}
CUBOS_ERROR("Invalid asset handle");
return nullptr;

Check warning on line 650 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L649-L650

Added lines #L649 - L650 were not covered by tests
}

std::shared_ptr<Assets::Entry> Assets::entry(const AnyAsset& handle, bool create)
Expand All @@ -641,27 +672,57 @@ std::shared_ptr<Assets::Entry> Assets::entry(const AnyAsset& handle, bool create
sharedLock.lock();
}

// Search for an existing entry for the asset.
auto it = mEntries.find(handle.getId());
if (it == mEntries.end())
auto sid = handle.getIdString();

Check warning on line 675 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L675

Added line #L675 was not covered by tests

if (isPath(sid) == "Path")

Check warning on line 677 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L677

Added line #L677 was not covered by tests
{
// If we're creating the asset, create a new entry for it.
// Otherwise, return nullptr.
for (const auto& [eid, entry] : mEntries)

Check warning on line 679 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L679

Added line #L679 was not covered by tests
{
if (entry->meta.getPath() == sid)

Check warning on line 681 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L681

Added line #L681 was not covered by tests
{
return entry;

Check warning on line 683 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L683

Added line #L683 was not covered by tests
}
}
if (create)
{
auto nUuid = uuids::uuid_random_generator(mRandom.value())();

Check warning on line 688 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L688

Added line #L688 was not covered by tests
auto entry = std::make_shared<Entry>();
entry->meta.set("id", uuids::to_string(handle.getId()));
it = mEntries.emplace(handle.getId(), std::move(entry)).first;
entry->meta.set("path", sid);
entry->meta.set("id", uuids::to_string(nUuid));
auto it = mEntries.emplace(nUuid, std::move(entry)).first;

Check warning on line 692 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L690-L692

Added lines #L690 - L692 were not covered by tests
CUBOS_TRACE("Created new asset entry for {}", handle);
return it->second;

Check warning on line 694 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L694

Added line #L694 was not covered by tests
}
else

CUBOS_ERROR("No such asset {}", handle);
return nullptr;

Check warning on line 698 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L697-L698

Added lines #L697 - L698 were not covered by tests
}
if (isPath(sid) == "UUID")

Check warning on line 700 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L700

Added line #L700 was not covered by tests
{

// Search for an existing entry for the asset.
auto it = mEntries.find(handle.getId().value());
if (it == mEntries.end())

Check warning on line 705 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L704-L705

Added lines #L704 - L705 were not covered by tests
{
CUBOS_ERROR("No such asset {}", handle);
return nullptr;
// If we're creating the asset, create a new entry for it.
// Otherwise, return nullptr.
if (create)

Check warning on line 709 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L709

Added line #L709 was not covered by tests
{
auto entry = std::make_shared<Entry>();
entry->meta.set("id", uuids::to_string(handle.getId().value()));
it = mEntries.emplace(handle.getId().value(), std::move(entry)).first;
CUBOS_TRACE("Created new asset entry for {}", handle);

Check warning on line 714 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L711-L714

Added lines #L711 - L714 were not covered by tests
}
else
{
CUBOS_ERROR("No such asset {}", handle);
return nullptr;

Check warning on line 719 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L718-L719

Added lines #L718 - L719 were not covered by tests
}
}
return it->second;

Check warning on line 722 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L722

Added line #L722 was not covered by tests
}

return it->second;
CUBOS_ERROR("Invalid asset handle");
return nullptr;

Check warning on line 725 in engine/src/assets/assets.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/assets/assets.cpp#L724-L725

Added lines #L724 - L725 were not covered by tests
}

std::shared_ptr<AssetBridge> Assets::bridge(const AnyAsset& handle, bool logError) const
Expand Down
Loading

0 comments on commit 211e77a

Please sign in to comment.