[nostalgia] Update for compatibility with Ox changes

This commit is contained in:
Gary Talent 2022-02-12 14:32:10 -06:00
parent 610dc2ceca
commit 34221f086c
4 changed files with 16 additions and 12 deletions

View File

@ -6,6 +6,8 @@
#include <imgui_impl_opengl3.h>
#include <imgui_impl_glfw.h>
#include <ox/std/defines.hpp>
#include <nostalgia/core/config.hpp>
#include <nostalgia/core/userland/gfx.hpp>
@ -23,7 +25,9 @@ static void handleKeyPress(Context *ctx, int key) noexcept {
switch (key) {
case GLFW_KEY_ESCAPE:
case GLFW_KEY_Q:
oxIgnoreError(shutdown(ctx));
if constexpr(ox::defines::Debug) {
oxIgnoreError(shutdown(ctx));
}
break;
default:
break;
@ -47,7 +51,7 @@ ox::Error initGfx(Context *ctx) noexcept {
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
if constexpr(ox::defines::OS == ox::defines::OS::Darwin) {
if constexpr(ox::defines::OS == ox::OS::Darwin) {
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
}
glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);

View File

@ -69,7 +69,7 @@ void TileSheetEditor::draw(core::Context*) noexcept {
const auto wheel = io.MouseWheel;
const auto wheelh = io.MouseWheelH;
if (wheel != 0) {
const auto zoomMod = ox::defines::OS == ox::defines::OS::Darwin ? io.KeySuper : io.KeyCtrl;
const auto zoomMod = ox::defines::OS == ox::OS::Darwin ? io.KeySuper : io.KeyCtrl;
const auto pixelSize = m_pixelsDrawer.pixelSize(paneSize);
const ImVec2 sheetSize(pixelSize.x * static_cast<float>(m_img.columns) * TileWidth,
pixelSize.y * static_cast<float>(m_img.rows) * TileHeight);

View File

@ -86,7 +86,7 @@ struct TileSheetClipboard {
};
template<typename T>
ox::Error model(T *io, TileSheetClipboard *b) {
constexpr ox::Error model(T *io, TileSheetClipboard *b) noexcept {
io->template setTypeInfo<TileSheetClipboard>();
oxReturnError(io->field("pixels", &b->m_pixels));
oxReturnError(io->field("p1", &b->m_p1));

View File

@ -21,16 +21,16 @@ namespace nostalgia::studio {
constexpr auto ConfigDir = [] {
switch (ox::defines::OS) {
case ox::defines::OS::Darwin:
case ox::OS::Darwin:
return "{}/Library/Preferences/{}";
case ox::defines::OS::DragonFlyBSD:
case ox::defines::OS::FreeBSD:
case ox::defines::OS::Linux:
case ox::defines::OS::NetBSD:
case ox::defines::OS::OpenBSD:
case ox::OS::DragonFlyBSD:
case ox::OS::FreeBSD:
case ox::OS::Linux:
case ox::OS::NetBSD:
case ox::OS::OpenBSD:
return "{}/.config/{}";
case ox::defines::OS::BareMetal:
case ox::defines::OS::Windows:
case ox::OS::BareMetal:
case ox::OS::Windows:
return "";
}
}();