Compare commits

..

4 Commits

Author SHA1 Message Date
e009f68fbe Make CLArgs::getBool use underlying m_bools member variable
All checks were successful
Build / build (push) Successful in 1m9s
2025-09-11 18:42:19 -05:00
671fa54f6f [ox/std] Make ox::Vector::push_back comply with std::vector::push_back
All checks were successful
Build / build (push) Successful in 1m12s
2025-09-10 23:47:36 -05:00
517432679b [nostalgia/gfx/studio] Cleanup includes
All checks were successful
Build / build (push) Successful in 1m15s
2025-09-04 22:40:58 -05:00
b31c01f724 [keel,studio] Cleanup 2025-09-04 22:37:01 -05:00
6 changed files with 23 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ ClArgs::ClArgs(ox::SpanView<const char*> args) noexcept {
} }
bool ClArgs::getBool(ox::StringViewCR arg, bool defaultValue) const noexcept { bool ClArgs::getBool(ox::StringViewCR arg, bool defaultValue) const noexcept {
auto const [value, err] = m_ints.at(arg); auto const [value, err] = m_bools.at(arg);
return !err ? *value : defaultValue; return !err ? *value : defaultValue;
} }

View File

@@ -271,7 +271,9 @@ class Vector: detail::VectorAllocator<T, Allocator, SmallVectorSize> {
template<typename... Args> template<typename... Args>
constexpr T &emplace_back(Args&&... args) noexcept(useNoexcept); constexpr T &emplace_back(Args&&... args) noexcept(useNoexcept);
constexpr void push_back(T item) noexcept(useNoexcept); constexpr void push_back(T const &item) noexcept(useNoexcept);
constexpr void push_back(T &&item) noexcept(useNoexcept);
constexpr void pop_back() noexcept(useNoexcept); constexpr void pop_back() noexcept(useNoexcept);
@@ -601,7 +603,16 @@ constexpr T &Vector<T, SmallVectorSize, Allocator>::emplace_back(Args&&... args)
} }
template<typename T, std::size_t SmallVectorSize, typename Allocator> template<typename T, std::size_t SmallVectorSize, typename Allocator>
constexpr void Vector<T, SmallVectorSize, Allocator>::push_back(T item) noexcept(useNoexcept) { constexpr void Vector<T, SmallVectorSize, Allocator>::push_back(T const &item) noexcept(useNoexcept) {
if (m_size == m_cap) {
reserve(m_cap ? m_cap * 2 : initialCap);
}
std::construct_at(&m_items[m_size], item);
++m_size;
}
template<typename T, std::size_t SmallVectorSize, typename Allocator>
constexpr void Vector<T, SmallVectorSize, Allocator>::push_back(T &&item) noexcept(useNoexcept) {
if (m_size == m_cap) { if (m_size == m_cap) {
reserve(m_cap ? m_cap * 2 : initialCap); reserve(m_cap ? m_cap * 2 : initialCap);
} }

View File

@@ -5,6 +5,13 @@
#pragma once #pragma once
#include <ox/std/error.hpp> #include <ox/std/error.hpp>
#include <ox/std/span.hpp>
#include <ox/std/stringview.hpp>
#include <studio/project.hpp>
#include <nostalgia/gfx/palette.hpp>
#include <nostalgia/gfx/tilesheet.hpp>
namespace nostalgia::gfx { namespace nostalgia::gfx {

View File

@@ -3,7 +3,6 @@
*/ */
#include <imgui.h> #include <imgui.h>
#include <lodepng.h>
#include <ox/std/point.hpp> #include <ox/std/point.hpp>
#include <keel/media.hpp> #include <keel/media.hpp>

View File

@@ -187,7 +187,7 @@ static ox::Error copy(
OX_DEFER [&status] { OX_DEFER [&status] {
oxOutf(" {}\n", status); oxOutf(" {}\n", status);
}; };
OX_REQUIRE_M(buff, src.read(currentFile)); OX_REQUIRE(buff, src.read(currentFile));
// write file to dest // write file to dest
OX_RETURN_ERROR(dest.write(currentFile, buff)); OX_RETURN_ERROR(dest.write(currentFile, buff));
status = "OK"; status = "OK";

View File

@@ -31,7 +31,7 @@ ox::Result<T> getDragDropPayload(ox::CStringViewCR name) noexcept {
return ox::Error(1, "No drag/drop payload"); return ox::Error(1, "No drag/drop payload");
} }
return ox::readClaw<T>({ return ox::readClaw<T>({
reinterpret_cast<char const*>(payload->Data), std::launder(reinterpret_cast<char const*>(payload->Data)),
static_cast<size_t>(payload->DataSize)}); static_cast<size_t>(payload->DataSize)});
} }