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:
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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));
|
||||
|
@ -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());
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user