[nostalgia/core/studio] Cleanup
This commit is contained in:
parent
f40c912365
commit
b225d976f5
@ -16,7 +16,7 @@ TileSheetEditorImGui::TileSheetEditorImGui(Context *ctx, const ox::String &path)
|
|||||||
const auto lastSlash = std::find(m_itemPath.rbegin(), m_itemPath.rend(), '/').offset();
|
const auto lastSlash = std::find(m_itemPath.rbegin(), m_itemPath.rend(), '/').offset();
|
||||||
m_itemName = m_itemPath.substr(lastSlash + 1);
|
m_itemName = m_itemPath.substr(lastSlash + 1);
|
||||||
undoStack()->changeTriggered.connect(this, &TileSheetEditorImGui::markUnsavedChanges);
|
undoStack()->changeTriggered.connect(this, &TileSheetEditorImGui::markUnsavedChanges);
|
||||||
m_subsheetEditor.inputSubmitted.connect(model(), &TileSheetEditorModel::updateActiveSubsheet);
|
m_subsheetEditor.inputSubmitted.connect(this, &TileSheetEditorImGui::updateActiveSubsheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::String TileSheetEditorImGui::itemName() const noexcept {
|
ox::String TileSheetEditorImGui::itemName() const noexcept {
|
||||||
@ -232,6 +232,10 @@ void TileSheetEditorImGui::drawPalettePicker() noexcept {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ox::Error TileSheetEditorImGui::updateActiveSubsheet(const ox::String &name, int cols, int rows) noexcept {
|
||||||
|
return model()->updateSubsheet(model()->activeSubSheetIdx(), name, cols, rows);
|
||||||
|
}
|
||||||
|
|
||||||
ox::Error TileSheetEditorImGui::markUnsavedChanges(int) noexcept {
|
ox::Error TileSheetEditorImGui::markUnsavedChanges(int) noexcept {
|
||||||
setUnsavedChanges(true);
|
setUnsavedChanges(true);
|
||||||
return OxError(0);
|
return OxError(0);
|
||||||
|
@ -97,6 +97,8 @@ class TileSheetEditorImGui: public studio::Editor {
|
|||||||
|
|
||||||
void drawPalettePicker() noexcept;
|
void drawPalettePicker() noexcept;
|
||||||
|
|
||||||
|
ox::Error updateActiveSubsheet(const ox::String &name, int cols, int rows) noexcept;
|
||||||
|
|
||||||
// slots
|
// slots
|
||||||
private:
|
private:
|
||||||
ox::Error updateAfterClicked() noexcept;
|
ox::Error updateAfterClicked() noexcept;
|
||||||
|
@ -55,8 +55,8 @@ void TileSheetEditorModel::rmSubsheet(const TileSheet::SubSheetIdx &idx) noexcep
|
|||||||
pushCommand(new RmSubSheetCommand(&m_img, idx));
|
pushCommand(new RmSubSheetCommand(&m_img, idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::Error TileSheetEditorModel::updateActiveSubsheet(const ox::String &name, int cols, int rows) noexcept {
|
ox::Error TileSheetEditorModel::updateSubsheet(const TileSheet::SubSheetIdx &idx, const ox::String &name, int cols, int rows) noexcept {
|
||||||
pushCommand(new UpdateSubSheetCommand(&m_img, m_activeSubsSheetIdx, name, cols, rows));
|
pushCommand(new UpdateSubSheetCommand(&m_img, idx, name, cols, rows));
|
||||||
return OxError(0);
|
return OxError(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ class TileSheetEditorModel: public ox::SignalHandler {
|
|||||||
|
|
||||||
void rmSubsheet(const TileSheet::SubSheetIdx &idx) noexcept;
|
void rmSubsheet(const TileSheet::SubSheetIdx &idx) noexcept;
|
||||||
|
|
||||||
ox::Error updateActiveSubsheet(const ox::String &name, int cols, int rows) noexcept;
|
ox::Error updateSubsheet(const TileSheet::SubSheetIdx &idx, const ox::String &name, int cols, int rows) noexcept;
|
||||||
|
|
||||||
void setActiveSubsheet(const TileSheet::SubSheetIdx&) noexcept;
|
void setActiveSubsheet(const TileSheet::SubSheetIdx&) noexcept;
|
||||||
|
|
||||||
|
@ -82,7 +82,6 @@ void TileSheetPixels::setBufferObjects(const geo::Vec2 &paneSize, const TileShee
|
|||||||
// set buffer lengths
|
// set buffer lengths
|
||||||
const auto width = subSheet.columns * TileWidth;
|
const auto width = subSheet.columns * TileWidth;
|
||||||
const auto height = subSheet.rows * TileHeight;
|
const auto height = subSheet.rows * TileHeight;
|
||||||
oxDebugf("rows: {}", subSheet.rows);
|
|
||||||
const auto pixels = static_cast<unsigned>(width * height);
|
const auto pixels = static_cast<unsigned>(width * height);
|
||||||
m_bufferSet.vertices.resize(pixels * VertexVboLength);
|
m_bufferSet.vertices.resize(pixels * VertexVboLength);
|
||||||
m_bufferSet.elements.resize(pixels * VertexEboLength);
|
m_bufferSet.elements.resize(pixels * VertexEboLength);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user