Squashed 'deps/nostalgia/' changes from 5d1f680a..124c7029

124c7029 [olympic/studio] Change Studio modules to pass StudioContext instead of turbine::Context

git-subtree-dir: deps/nostalgia
git-subtree-split: 124c7029bda328e9ddc208b00e53a2e6452f2ede
This commit is contained in:
2024-01-20 15:41:04 -06:00
parent 6640e00ad9
commit ae1f8ce11a
13 changed files with 26 additions and 24 deletions

View File

@ -15,9 +15,9 @@
namespace nostalgia::core {
PaletteEditorImGui::PaletteEditorImGui(turbine::Context &ctx, ox::CRStringView path):
PaletteEditorImGui::PaletteEditorImGui(studio::StudioContext &ctx, ox::CRStringView path):
Editor(path),
m_ctx(ctx),
m_ctx(ctx.tctx),
m_pal(*keel::readObj<Palette>(keelCtx(m_ctx), ox::FileAddress(itemPath())).unwrapThrow()) {
undoStack()->changeTriggered.connect(this, &PaletteEditorImGui::handleCommand);
}

View File

@ -20,7 +20,7 @@ class PaletteEditorImGui: public studio::Editor {
size_t m_page = 0;
public:
PaletteEditorImGui(turbine::Context &ctx, ox::CRStringView path);
PaletteEditorImGui(studio::StudioContext &ctx, ox::CRStringView path);
void keyStateChanged(turbine::Key key, bool down) override;

View File

@ -12,14 +12,14 @@
namespace nostalgia::core {
class StudioModule: public studio::Module {
ox::Vector<studio::EditorMaker> editors(turbine::Context &ctx) const noexcept final {
ox::Vector<studio::EditorMaker> editors(studio::StudioContext &ctx) const noexcept final {
return {
studio::editorMaker<TileSheetEditorImGui>(ctx, FileExt_ng),
studio::editorMaker<PaletteEditorImGui>(ctx, FileExt_npal),
};
}
ox::Vector<ox::UPtr<studio::ItemMaker>> itemMakers(turbine::Context&) const noexcept final {
ox::Vector<ox::UPtr<studio::ItemMaker>> itemMakers(studio::StudioContext&) const noexcept final {
ox::Vector<ox::UniquePtr<studio::ItemMaker>> out;
out.emplace_back(ox::make<studio::ItemMakerT<core::TileSheet>>("Tile Sheet", "TileSheets", FileExt_ng));
out.emplace_back(ox::make<studio::ItemMakerT<core::Palette>>("Palette", "Palettes", FileExt_npal));

View File

@ -75,9 +75,9 @@ static ox::Error toPngFile(
8)));
}
TileSheetEditorImGui::TileSheetEditorImGui(turbine::Context &ctx, ox::CRStringView path):
TileSheetEditorImGui::TileSheetEditorImGui(studio::StudioContext &ctx, ox::CRStringView path):
Editor(path),
m_ctx(ctx),
m_ctx(ctx.tctx),
m_view(m_ctx, path, *undoStack()),
m_model(m_view.model()) {
oxIgnoreError(setPaletteSelection());

View File

@ -73,7 +73,7 @@ class TileSheetEditorImGui: public studio::Editor {
Tool m_tool = Tool::Draw;
public:
TileSheetEditorImGui(turbine::Context &ctx, ox::CRStringView path);
TileSheetEditorImGui(studio::StudioContext &ctx, ox::CRStringView path);
~TileSheetEditorImGui() override = default;

View File

@ -10,9 +10,9 @@
namespace nostalgia::scene {
SceneEditorImGui::SceneEditorImGui(turbine::Context &ctx, ox::StringView path):
SceneEditorImGui::SceneEditorImGui(studio::StudioContext &ctx, ox::StringView path):
Editor(path),
m_ctx(ctx),
m_ctx(ctx.tctx),
m_editor(m_ctx, path),
m_view(m_ctx, m_editor.scene()) {
setRequiresConstantRefresh(false);

View File

@ -21,7 +21,7 @@ class SceneEditorImGui: public studio::Editor {
SceneEditorView m_view;
public:
SceneEditorImGui(turbine::Context &ctx, ox::StringView path);
SceneEditorImGui(studio::StudioContext &ctx, ox::StringView path);
void draw(turbine::Context&) noexcept final;

View File

@ -12,12 +12,12 @@ constexpr ox::StringLiteral FileExt_nscn("nscn");
class StudioModule: public studio::Module {
public:
ox::Vector<studio::EditorMaker> editors(turbine::Context &ctx) const noexcept override {
ox::Vector<studio::EditorMaker> editors(studio::StudioContext &ctx) const noexcept override {
return {
studio::editorMaker<SceneEditorImGui>(ctx, FileExt_nscn),
};
}
ox::Vector<ox::UPtr<studio::ItemMaker>> itemMakers(turbine::Context&) const noexcept override {
ox::Vector<ox::UPtr<studio::ItemMaker>> itemMakers(studio::StudioContext&) const noexcept override {
ox::Vector<ox::UPtr<studio::ItemMaker>> out;
return out;
}