Squashed 'deps/nostalgia/' changes from 2a8e3c2d..26fc5565

26fc5565 [nostalgia/gfx] Make dangling reference warning suppressions check for GCC 13
388541ce [nostalgia/player] Cleanup
6c194667 [nostalgia] Fix NostalgiaGfx lib name, stub out sound package
62d0579f [ox/fs] Restructure stat error handling to make easier to debug
202595b2 [keel] Fix loading assets by path
cb21ff3f Merge commit 'a6b9657268eb3fe139b0c22df27c2cb2efc0013c'
8459d3ba Merge commit 'c42adc290cd8a27d01bb6d9877032dd2c963a4b7'
8d04af69 Merge commit 'ab760b064fd6a302bad13274e0e02b2b2c957b67'
6c34198f Merge commit '897a59cdad66e593fd45eece9414d8414fa7f1ae'
f63c5816 [studio] Add filepickerpopup.hpp to studio.hpp

git-subtree-dir: deps/nostalgia
git-subtree-split: 26fc5565e86e09c6c51a615683fd9003816a24ac
This commit is contained in:
2025-02-20 20:11:03 -06:00
parent a6b9657268
commit 4e94c92568
31 changed files with 282 additions and 53 deletions

View File

@@ -64,12 +64,16 @@ ox::Result<ox::CStringView> uuidToPath(Context &ctx, ox::UUID const&uuid) noexce
namespace detail {
template<typename T>
constexpr auto makeLoader(Context &ctx) {
return [&ctx](ox::StringViewCR assetId) -> ox::Result<T> {
auto const p = ctx.uuidToPath.at(assetId);
if (p.error) {
return ox::Error{1, "Asset ID not found"};
return [&ctx](ox::StringView assetId) -> ox::Result<T> {
if (!beginsWith(assetId, "/")) {
auto const p = ctx.uuidToPath.at(assetId);
if (p.error) {
oxErrf("Could not find asset: {}", assetId);
return ox::Error{1, "Asset ID not found"};
}
assetId = *p.value;
}
OX_REQUIRE(buff, ctx.rom->read(*p.value));
OX_REQUIRE(buff, ctx.rom->read(assetId));
auto [obj, err] = readAsset<T>(buff);
if (err) {
if (err != ox::Error_ClawTypeVersionMismatch && err != ox::Error_ClawTypeMismatch) {

View File

@@ -9,6 +9,7 @@
#include <studio/dragdrop.hpp>
#include <studio/editor.hpp>
#include <studio/filedialog.hpp>
#include <studio/filepickerpopup.hpp>
#include <studio/filetreemodel.hpp>
#include <studio/imguiutil.hpp>
#include <studio/module.hpp>