Squashed 'deps/nostalgia/' changes from 0c0ccd1a..227f3cd9
227f3cd9 [nostalgia/core/studio] Update itoa usages 20ff0f89 [ox/std] Rework itoa 4061b831 [ox/model] Remove broken global var 18bb5062 [ox/std] Add String::append(StringView), cleanup 6a4b4822 [nostalgia,studio] Fixes for Ox changes d2a3cfa7 [ox/std] Remove append operators from IString 7c4e2a65 [ox/std] Cleanup IString e30ebce4 [nostalgia] Add pyenv to .gitignore 7163947e [ox/std] Cleanup 0a0a6e30 [studio] Move UndoCommand implementation to its own file 97bc9332 [nostalgia/core] Fix TileSheetV1 to use PaletteV1 9caf7099 [keel] Fix for Ox change fda1280d [ox/std] Make substr always take and return a StringView 59aa4ad2 [cityhash] Cleanup 1a8afa1a [nostalgia/sample_project] Add missing type descriptor cdbc2d6c [olympic/studio] Move UndoCommand to its own file acd93337 [ox/std] Fix Integer assignment operator return cebd3b0a [ox/std] Fix Integer assignment operator return 43e2e215 [ox/std] Cleanup be1f9095 [ox/std] Make safeDelete constexpr 0f2c18d5 [ox/std] Add std::string(_view) variant of MaybeView git-subtree-dir: deps/nostalgia git-subtree-split: 227f3cd9f584039cfddad75f1fe1275ad6cac000
This commit is contained in:
		@@ -27,7 +27,7 @@ struct TileSheetV1 {
 | 
			
		||||
	int rows = 1;
 | 
			
		||||
	int columns = 1;
 | 
			
		||||
	ox::FileAddress defaultPalette;
 | 
			
		||||
	Palette pal;
 | 
			
		||||
	PaletteV1 pal;
 | 
			
		||||
	ox::Vector<uint8_t> pixels = {};
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -32,8 +32,7 @@ void panic(const char *file, int line, const char *panicMsg, ox::Error const&err
 | 
			
		||||
	std::ignore = initConsole(*ctx);
 | 
			
		||||
	setBgStatus(*ctx, 0, true);
 | 
			
		||||
	clearBg(*ctx, 0);
 | 
			
		||||
	ox::IString<23> serr = "Error code: ";
 | 
			
		||||
	serr += static_cast<int64_t>(err);
 | 
			
		||||
	auto const serr = ox::sfmt<ox::IString<23>>("Error code: {}", static_cast<int64_t>(err));
 | 
			
		||||
	puts(*ctx, 32 + 1,  1, "SADNESS...");
 | 
			
		||||
	puts(*ctx, 32 + 1,  4, "UNEXPECTED STATE:");
 | 
			
		||||
	puts(*ctx, 32 + 2,  6, panicMsg);
 | 
			
		||||
 
 | 
			
		||||
@@ -68,12 +68,6 @@ void PaletteEditorImGui::drawColumn(ox::CStringView txt) noexcept {
 | 
			
		||||
	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 {
 | 
			
		||||
	constexpr auto tableFlags = ImGuiTableFlags_RowBg;
 | 
			
		||||
	auto const colorsSz = ImGui::GetContentRegionAvail();
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,9 @@ class PaletteEditorImGui: public studio::Editor {
 | 
			
		||||
	private:
 | 
			
		||||
		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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -410,14 +410,13 @@ void TileSheetEditorImGui::drawPaletteSelector() noexcept {
 | 
			
		||||
	auto const pages = m_model.pal().pages.size();
 | 
			
		||||
	if (pages > 1) {
 | 
			
		||||
		ImGui::Indent(20);
 | 
			
		||||
		ox::Array<char, 10> numStr;
 | 
			
		||||
		ox::itoa(m_model.palettePage() + 1, numStr.data());
 | 
			
		||||
		auto numStr = ox::itoa(m_model.palettePage() + 1);
 | 
			
		||||
		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) {
 | 
			
		||||
				auto const selected = (m_model.palettePage() == n);
 | 
			
		||||
				ox::itoa(n + 1, numStr.data());
 | 
			
		||||
				if (ImGui::Selectable(numStr.data(), selected) && m_model.palettePage() != n) {
 | 
			
		||||
				numStr = ox::itoa(n + 1);
 | 
			
		||||
				if (ImGui::Selectable(numStr.c_str(), selected) && m_model.palettePage() != n) {
 | 
			
		||||
					m_model.setPalettePage(n);
 | 
			
		||||
				}
 | 
			
		||||
				if (selected) {
 | 
			
		||||
@@ -440,7 +439,7 @@ void TileSheetEditorImGui::drawPaletteSelector() noexcept {
 | 
			
		||||
				ImGui::PushID(static_cast<int>(i));
 | 
			
		||||
				// Column: color idx
 | 
			
		||||
				ImGui::TableNextColumn();
 | 
			
		||||
				auto const label = ox::IString<8>() + (i + 1);
 | 
			
		||||
				auto const label = ox::itoa(i + 1);
 | 
			
		||||
				auto const rowSelected = i == m_view.palIdx();
 | 
			
		||||
				if (ImGui::Selectable(label.c_str(), rowSelected, ImGuiSelectableFlags_SpanAllColumns)) {
 | 
			
		||||
					m_view.setPalIdx(i);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user