[nostalgia,studio] Cleanup
This commit is contained in:
@@ -30,7 +30,7 @@ ox::CStringView PaletteEditorImGui::itemDisplayName() const noexcept {
|
||||
return m_itemName;
|
||||
}
|
||||
|
||||
void PaletteEditorImGui::draw(turbine::Context*) noexcept {
|
||||
void PaletteEditorImGui::draw(turbine::Context&) noexcept {
|
||||
static constexpr auto flags = ImGuiTableFlags_RowBg;
|
||||
const auto paneSize = ImGui::GetContentRegionAvail();
|
||||
ImGui::BeginChild("Colors", ImVec2(paneSize.x - 208, paneSize.y), true);
|
||||
@@ -42,14 +42,14 @@ void PaletteEditorImGui::draw(turbine::Context*) noexcept {
|
||||
if (ImGui::Button("Add", sz)) {
|
||||
const auto colorSz = static_cast<int>(m_pal.colors.size());
|
||||
constexpr Color16 c = 0;
|
||||
undoStack()->push(ox::make<AddColorCommand>(&m_pal, c, colorSz));
|
||||
undoStack()->push(ox::make_unique<AddColorCommand>(&m_pal, c, colorSz));
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginDisabled(m_selectedRow >= m_pal.colors.size());
|
||||
{
|
||||
if (ImGui::Button("Remove", sz)) {
|
||||
undoStack()->push(
|
||||
ox::make<RemoveColorCommand>(
|
||||
ox::make_unique<RemoveColorCommand>(
|
||||
&m_pal,
|
||||
m_pal.colors[static_cast<std::size_t>(m_selectedRow)],
|
||||
static_cast<int>(m_selectedRow)));
|
||||
@@ -59,7 +59,7 @@ void PaletteEditorImGui::draw(turbine::Context*) noexcept {
|
||||
ImGui::BeginDisabled(m_selectedRow <= 0);
|
||||
{
|
||||
if (ImGui::Button("Move Up", sz)) {
|
||||
undoStack()->push(ox::make<MoveColorCommand>(&m_pal, m_selectedRow, -1));
|
||||
undoStack()->push(ox::make_unique<MoveColorCommand>(&m_pal, m_selectedRow, -1));
|
||||
--m_selectedRow;
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ void PaletteEditorImGui::draw(turbine::Context*) noexcept {
|
||||
ImGui::BeginDisabled(m_selectedRow >= m_pal.colors.size() - 1);
|
||||
{
|
||||
if (ImGui::Button("Move Down", sz)) {
|
||||
undoStack()->push(ox::make<MoveColorCommand>(&m_pal, m_selectedRow, 1));
|
||||
undoStack()->push(ox::make_unique<MoveColorCommand>(&m_pal, m_selectedRow, 1));
|
||||
++m_selectedRow;
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,7 @@ void PaletteEditorImGui::draw(turbine::Context*) noexcept {
|
||||
ImGui::InputInt("Blue", &b, 1, 5);
|
||||
const auto newColor = color16(r, g, b, a);
|
||||
if (c != newColor) {
|
||||
undoStack()->push(ox::make<UpdateColorCommand>(&m_pal, static_cast<int>(m_selectedRow), c, newColor));
|
||||
undoStack()->push(ox::make_unique<UpdateColorCommand>(&m_pal, static_cast<int>(m_selectedRow), c, newColor));
|
||||
}
|
||||
}
|
||||
ImGui::EndChild();
|
||||
|
||||
@@ -30,7 +30,7 @@ class PaletteEditorImGui: public studio::Editor {
|
||||
|
||||
ox::CStringView itemDisplayName() const noexcept final;
|
||||
|
||||
void draw(turbine::Context*) noexcept final;
|
||||
void draw(turbine::Context&) noexcept final;
|
||||
|
||||
protected:
|
||||
ox::Error saveItem() noexcept final;
|
||||
|
||||
@@ -106,7 +106,7 @@ void TileSheetEditorImGui::keyStateChanged(turbine::Key key, bool down) {
|
||||
}
|
||||
}
|
||||
|
||||
void TileSheetEditorImGui::draw(turbine::Context*) noexcept {
|
||||
void TileSheetEditorImGui::draw(turbine::Context&) noexcept {
|
||||
const auto paneSize = ImGui::GetContentRegionAvail();
|
||||
const auto tileSheetParentSize = ImVec2(paneSize.x - m_palViewWidth, paneSize.y);
|
||||
const auto fbSize = ox::Vec2(tileSheetParentSize.x - 16, tileSheetParentSize.y - 16);
|
||||
|
||||
@@ -73,7 +73,7 @@ class TileSheetEditorImGui: public studio::BaseEditor {
|
||||
|
||||
void keyStateChanged(turbine::Key key, bool down) override;
|
||||
|
||||
void draw(turbine::Context*) noexcept override;
|
||||
void draw(turbine::Context&) noexcept override;
|
||||
|
||||
void drawSubsheetSelector(TileSheet::SubSheet*, TileSheet::SubSheetIdx *path);
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@ void TileSheetEditorModel::getFillPixels(bool *pixels, ox::Point const&pt, int o
|
||||
}
|
||||
|
||||
void TileSheetEditorModel::pushCommand(studio::UndoCommand *cmd) noexcept {
|
||||
m_undoStack.push(cmd);
|
||||
m_undoStack.push(ox::UPtr<studio::UndoCommand>(cmd));
|
||||
m_ongoingDrawCommand = dynamic_cast<DrawCommand*>(cmd);
|
||||
m_updated = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user