[nostalgia/core/studio] Update itoa usages
All checks were successful
Build / build (push) Successful in 2m34s
All checks were successful
Build / build (push) Successful in 2m34s
This commit is contained in:
parent
20ff0f89fe
commit
227f3cd9f5
@ -68,12 +68,6 @@ void PaletteEditorImGui::drawColumn(ox::CStringView txt) noexcept {
|
|||||||
ImGui::Text("%s", txt.c_str());
|
ImGui::Text("%s", txt.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PaletteEditorImGui::drawColumn(uint64_t i) noexcept {
|
|
||||||
ox::Array<char, 10> numStr;
|
|
||||||
ox::itoa(i, numStr.data());
|
|
||||||
drawColumn(numStr.data());
|
|
||||||
}
|
|
||||||
|
|
||||||
void PaletteEditorImGui::drawColorsEditor() noexcept {
|
void PaletteEditorImGui::drawColorsEditor() noexcept {
|
||||||
constexpr auto tableFlags = ImGuiTableFlags_RowBg;
|
constexpr auto tableFlags = ImGuiTableFlags_RowBg;
|
||||||
auto const colorsSz = ImGui::GetContentRegionAvail();
|
auto const colorsSz = ImGui::GetContentRegionAvail();
|
||||||
|
@ -33,7 +33,9 @@ class PaletteEditorImGui: public studio::Editor {
|
|||||||
private:
|
private:
|
||||||
static void drawColumn(ox::CStringView txt) noexcept;
|
static void drawColumn(ox::CStringView txt) noexcept;
|
||||||
|
|
||||||
static void drawColumn(uint64_t i) noexcept;
|
static void drawColumn(ox::Integer_c auto i) noexcept {
|
||||||
|
drawColumn(ox::itoa(i));
|
||||||
|
}
|
||||||
|
|
||||||
void drawColorsEditor() noexcept;
|
void drawColorsEditor() noexcept;
|
||||||
|
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
#include <ox/std/point.hpp>
|
#include <ox/std/point.hpp>
|
||||||
#include <keel/media.hpp>
|
#include <keel/media.hpp>
|
||||||
|
|
||||||
#include "ox/std/buffer.hpp"
|
|
||||||
#include "ox/std/cstrops.hpp"
|
|
||||||
#include "tilesheeteditor-imgui.hpp"
|
#include "tilesheeteditor-imgui.hpp"
|
||||||
|
|
||||||
namespace nostalgia::core {
|
namespace nostalgia::core {
|
||||||
@ -412,14 +410,13 @@ void TileSheetEditorImGui::drawPaletteSelector() noexcept {
|
|||||||
auto const pages = m_model.pal().pages.size();
|
auto const pages = m_model.pal().pages.size();
|
||||||
if (pages > 1) {
|
if (pages > 1) {
|
||||||
ImGui::Indent(20);
|
ImGui::Indent(20);
|
||||||
ox::Array<char, 10> numStr;
|
auto numStr = ox::itoa(m_model.palettePage() + 1);
|
||||||
ox::itoa(m_model.palettePage() + 1, numStr.data());
|
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - comboWidthSub);
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - comboWidthSub);
|
||||||
if (ImGui::BeginCombo("Page", numStr.data(), 0)) {
|
if (ImGui::BeginCombo("Page", numStr.c_str(), 0)) {
|
||||||
for (auto n = 0u; n < pages; ++n) {
|
for (auto n = 0u; n < pages; ++n) {
|
||||||
auto const selected = (m_model.palettePage() == n);
|
auto const selected = (m_model.palettePage() == n);
|
||||||
ox::itoa(n + 1, numStr.data());
|
numStr = ox::itoa(n + 1);
|
||||||
if (ImGui::Selectable(numStr.data(), selected) && m_model.palettePage() != n) {
|
if (ImGui::Selectable(numStr.c_str(), selected) && m_model.palettePage() != n) {
|
||||||
m_model.setPalettePage(n);
|
m_model.setPalettePage(n);
|
||||||
}
|
}
|
||||||
if (selected) {
|
if (selected) {
|
||||||
@ -442,9 +439,7 @@ void TileSheetEditorImGui::drawPaletteSelector() noexcept {
|
|||||||
ImGui::PushID(static_cast<int>(i));
|
ImGui::PushID(static_cast<int>(i));
|
||||||
// Column: color idx
|
// Column: color idx
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ox::IString<8> label;
|
auto const label = ox::itoa(i + 1);
|
||||||
ox::CharBuffWriter w(label.data(), label.bytes());
|
|
||||||
std::ignore = ox::writeItoa(i + 1, w);
|
|
||||||
auto const rowSelected = i == m_view.palIdx();
|
auto const rowSelected = i == m_view.palIdx();
|
||||||
if (ImGui::Selectable(label.c_str(), rowSelected, ImGuiSelectableFlags_SpanAllColumns)) {
|
if (ImGui::Selectable(label.c_str(), rowSelected, ImGuiSelectableFlags_SpanAllColumns)) {
|
||||||
m_view.setPalIdx(i);
|
m_view.setPalIdx(i);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user