[keel] Make keel attempt to delete all existing assets when FS is changed
This commit is contained in:
@@ -25,12 +25,11 @@ ox::Error writeUuidHeader(ox::Writer_c auto &writer, ox::UUID const&uuid) noexce
|
||||
|
||||
template<typename T>
|
||||
ox::Result<T> readAsset(ox::BufferView buff) noexcept {
|
||||
std::size_t offset = 0;
|
||||
auto const err = readUuidHeader(buff).error;
|
||||
if (!err) {
|
||||
offset = K1HdrSz; // the size of K1 headers
|
||||
buff += K1HdrSz; // the size of K1 headers
|
||||
}
|
||||
auto out = ox::readClaw<T>(buff + offset);
|
||||
auto out = ox::readClaw<T>(buff);
|
||||
OX_RETURN_ERROR(out);
|
||||
OX_RETURN_ERROR(ensureValid(out.value));
|
||||
return out;
|
||||
|
@@ -261,6 +261,9 @@ namespace keel {
|
||||
ox::Error setRomFs(Context &ctx, ox::UPtr<ox::FileSystem> &&fs, DuplicateSet &duplicateSet) noexcept {
|
||||
ctx.rom = std::move(fs);
|
||||
clearUuidMap(ctx);
|
||||
#ifndef OX_BARE_METAL
|
||||
ctx.assetManager.gc();
|
||||
#endif
|
||||
return buildUuidMap(ctx, &duplicateSet);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user