[olympic,nostalgia] Update Result copyTo and moveTo calls to take refs
This commit is contained in:
parent
d31938ba4f
commit
cdc7428eb6
@ -60,7 +60,7 @@ class KeelModule: public keel::Module {
|
||||
typeId == ox::buildTypeId<TileSheetV2>() ||
|
||||
typeId == ox::buildTypeId<TileSheet>()) {
|
||||
oxReturnError(keel::convertBuffToBuff<core::CompactTileSheet>(
|
||||
ctx, buff, ox::ClawFormat::Metal).moveTo(&buff));
|
||||
ctx, buff, ox::ClawFormat::Metal).moveTo(buff));
|
||||
}
|
||||
return {};
|
||||
},
|
||||
|
@ -364,9 +364,9 @@ ox::Error initGfx(
|
||||
const auto bgFshad = ox::sfmt(renderer::bgfshadTmpl, gl::GlslVersion);
|
||||
const auto spriteVshad = ox::sfmt(renderer::spritevshadTmpl, gl::GlslVersion);
|
||||
const auto spriteFshad = ox::sfmt(renderer::spritefshadTmpl, gl::GlslVersion);
|
||||
oxReturnError(glutils::buildShaderProgram(bgVshad, bgFshad).moveTo(&ctx.bgShader));
|
||||
oxReturnError(glutils::buildShaderProgram(bgVshad, bgFshad).moveTo(ctx.bgShader));
|
||||
oxReturnError(
|
||||
glutils::buildShaderProgram(spriteVshad, spriteFshad).moveTo(&ctx.spriteShader));
|
||||
glutils::buildShaderProgram(spriteVshad, spriteFshad).moveTo(ctx.spriteShader));
|
||||
for (auto &bg : ctx.cbbs) {
|
||||
initBackgroundBufferset(ctx.bgShader, bg);
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ ox::Error TileSheetEditorModel::markUpdatedCmdId(const studio::UndoCommand *cmd)
|
||||
m_updated = true;
|
||||
const auto cmdId = cmd->commandId();
|
||||
if (static_cast<CommandId>(cmdId) == CommandId::PaletteChange) {
|
||||
oxReturnError(readObj<Palette>(keelCtx(m_ctx), m_img.defaultPalette).moveTo(&m_pal));
|
||||
oxReturnError(readObj<Palette>(keelCtx(m_ctx), m_img.defaultPalette).moveTo(m_pal));
|
||||
paletteChanged.emit();
|
||||
}
|
||||
auto tsCmd = dynamic_cast<const TileSheetCommand*>(cmd);
|
||||
|
@ -18,7 +18,7 @@ ox::Error TileSheetGrid::buildShader() noexcept {
|
||||
const auto pixelLineVshad = ox::sfmt(VShad, gl::GlslVersion);
|
||||
const auto pixelLineFshad = ox::sfmt(FShad, gl::GlslVersion);
|
||||
const auto pixelLineGshad = ox::sfmt(GShad, gl::GlslVersion);
|
||||
return glutils::buildShaderProgram(pixelLineVshad, pixelLineFshad, pixelLineGshad).moveTo(&m_shader);
|
||||
return glutils::buildShaderProgram(pixelLineVshad, pixelLineFshad, pixelLineGshad).moveTo(m_shader);
|
||||
}
|
||||
|
||||
void TileSheetGrid::draw(bool update, ox::Vec2 const&scroll) noexcept {
|
||||
|
@ -19,7 +19,7 @@ void TileSheetPixels::setPixelSizeMod(float sm) noexcept {
|
||||
ox::Error TileSheetPixels::buildShader() noexcept {
|
||||
const auto Vshad = ox::sfmt(VShad, gl::GlslVersion);
|
||||
const auto Fshad = ox::sfmt(FShad, gl::GlslVersion);
|
||||
return glutils::buildShaderProgram(Vshad, Fshad).moveTo(&m_shader);
|
||||
return glutils::buildShaderProgram(Vshad, Fshad).moveTo(m_shader);
|
||||
}
|
||||
|
||||
void TileSheetPixels::draw(bool update, ox::Vec2 const&scroll) noexcept {
|
||||
|
@ -67,7 +67,7 @@ ox::Result<keel::AssetRef<T>> readObjFile(
|
||||
if (err) {
|
||||
oxRequire(buff, ctx.rom->read(path));
|
||||
oxRequire(obj, readConvert(ctx, buff));
|
||||
oxReturnError(ctx.assetManager.setAsset(assetId, obj).moveTo(&cached));
|
||||
oxReturnError(ctx.assetManager.setAsset(assetId, obj).moveTo(cached));
|
||||
}
|
||||
return cached;
|
||||
}
|
||||
|
@ -98,10 +98,10 @@ ox::Error preloadObj(
|
||||
oxReturnError(pl.endAlloc());
|
||||
oxReturnError(err);
|
||||
const keel::PreloadPtr p{.preloadAddr = static_cast<uint32_t>(a)};
|
||||
oxReturnError(ox::writeMC(p).moveTo(&buff));
|
||||
oxReturnError(ox::writeMC(p).moveTo(buff));
|
||||
} else {
|
||||
// strip the Claw header (it is not needed after preloading) and write back out to dest fs
|
||||
oxReturnError(ox::writeMC(obj).moveTo(&buff));
|
||||
oxReturnError(ox::writeMC(obj).moveTo(buff));
|
||||
}
|
||||
oxReturnError(romFs.write(path, buff.data(), buff.size()));
|
||||
return {};
|
||||
|
@ -183,7 +183,7 @@ auto transformRule(keel::Context &ctx, ox::Buffer &buff) noexcept -> ox::Error {
|
||||
const auto typeId = ox::buildTypeId(
|
||||
hdr.clawHdr.typeName, hdr.clawHdr.typeVersion, hdr.clawHdr.typeParams);
|
||||
if (typeId == ox::buildTypeId<From>()) {
|
||||
oxReturnError(keel::convertBuffToBuff<To>(ctx, buff, fmt).moveTo(&buff));
|
||||
oxReturnError(keel::convertBuffToBuff<To>(ctx, buff, fmt).moveTo(buff));
|
||||
}
|
||||
return {};
|
||||
};
|
||||
|
@ -31,11 +31,11 @@ ox::Result<ox::ModelObject> readAsset(ox::TypeStore *ts, ox::Buffer const&buff)
|
||||
|
||||
ox::Result<AssetHdr> readAssetHeader(const char *buff, std::size_t buffLen) noexcept {
|
||||
AssetHdr out;
|
||||
const auto err = readUuidHeader(buff, buffLen).moveTo(&out.uuid);
|
||||
const auto err = readUuidHeader(buff, buffLen).moveTo(out.uuid);
|
||||
const auto offset = err ? 0u : K1HdrSz;
|
||||
buff = buff + offset;
|
||||
buffLen = buffLen - offset;
|
||||
oxReturnError(ox::readClawHeader(buff, buffLen).moveTo(&out.clawHdr));
|
||||
oxReturnError(ox::readClawHeader(buff, buffLen).moveTo(out.clawHdr));
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ static ox::Error pathToInode(
|
||||
}
|
||||
if (beginsWith(path, "uuid://")) {
|
||||
const auto uuid = substr<ox::StringView>(path, 7);
|
||||
oxReturnError(keel::uuidToPath(ctx, uuid).moveTo(&path));
|
||||
oxReturnError(keel::uuidToPath(ctx, uuid).moveTo(path));
|
||||
}
|
||||
oxRequire(s, dest.stat(path));
|
||||
oxReturnError(o["type"].set(static_cast<int8_t>(ox::FileAddressType::Inode)));
|
||||
@ -97,7 +97,7 @@ static ox::Error doTransformations(
|
||||
// transform FileAddresses
|
||||
oxRequireM(obj, keel::readAsset(&ts, buff));
|
||||
oxReturnError(transformFileAddressesObj(ctx, dest, obj));
|
||||
oxReturnError(ox::writeClaw(obj).moveTo(&buff));
|
||||
oxReturnError(ox::writeClaw(obj).moveTo(buff));
|
||||
// write file to dest
|
||||
oxReturnError(dest.write(s.inode, buff));
|
||||
return {};
|
||||
|
@ -257,7 +257,7 @@ void StudioUI::drawTabs() noexcept {
|
||||
m_activeEditor = nullptr;
|
||||
}
|
||||
try {
|
||||
oxThrowError(m_editors.erase(it).moveTo(&it));
|
||||
oxThrowError(m_editors.erase(it).moveTo(it));
|
||||
} catch (const ox::Exception &ex) {
|
||||
oxErrf("Editor tab deletion failed: {} ({}:{})\n", ex.what(), ex.file, ex.line);
|
||||
} catch (const std::exception &ex) {
|
||||
@ -363,7 +363,7 @@ ox::Error StudioUI::openFileActiveTab(ox::CRStringView path, bool makeActiveTab)
|
||||
}
|
||||
editor = ox::make<ClawEditor>(path, std::move(obj));
|
||||
} else {
|
||||
const auto err = m_editorMakers[ext](path).moveTo(&editor);
|
||||
const auto err = m_editorMakers[ext](path).moveTo(editor);
|
||||
if (err) {
|
||||
if constexpr(!ox::defines::Debug) {
|
||||
oxErrf("Could not open Editor: {}\n", toStr(err));
|
||||
|
@ -60,7 +60,7 @@ ox::Result<ContextUPtr> init(
|
||||
auto ctx = ox::make_unique<Context>();
|
||||
oxReturnError(keel::init(ctx->keelCtx, std::move(fs), appName));
|
||||
#ifdef OX_BARE_METAL
|
||||
oxReturnError(findPreloadSection().moveTo(&ctx->keelCtx.preloadSectionOffset));
|
||||
oxReturnError(findPreloadSection().moveTo(ctx->keelCtx.preloadSectionOffset));
|
||||
#endif
|
||||
oxReturnError(initGfx(*ctx));
|
||||
initTimer();
|
||||
|
Loading…
Reference in New Issue
Block a user