diff --git a/src/nostalgia/modules/CMakeLists.txt b/src/nostalgia/modules/CMakeLists.txt index 9c5115d8..dc911253 100644 --- a/src/nostalgia/modules/CMakeLists.txt +++ b/src/nostalgia/modules/CMakeLists.txt @@ -1,6 +1,6 @@ # module dir list -add_subdirectory(core) +add_subdirectory(gfx) add_subdirectory(scene) # module libraries diff --git a/src/nostalgia/modules/core/CMakeLists.txt b/src/nostalgia/modules/gfx/CMakeLists.txt similarity index 100% rename from src/nostalgia/modules/core/CMakeLists.txt rename to src/nostalgia/modules/gfx/CMakeLists.txt diff --git a/src/nostalgia/modules/core/include/nostalgia/core/color.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/color.hpp similarity index 98% rename from src/nostalgia/modules/core/include/nostalgia/core/color.hpp rename to src/nostalgia/modules/gfx/include/nostalgia/gfx/color.hpp index 9eb9bdff..4a41a9d9 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/color.hpp +++ b/src/nostalgia/modules/gfx/include/nostalgia/gfx/color.hpp @@ -7,7 +7,7 @@ #include #include -namespace nostalgia::core { +namespace nostalgia::gfx { using Color16 = uint16_t; @@ -154,7 +154,7 @@ static_assert(color16(16, 32, 8) == 9200); [[nodiscard]] constexpr Color16 applySelectionColor(Color16 const color) noexcept { - namespace core = nostalgia::core; + namespace core = nostalgia::gfx; auto const r = core::red16(color) / 2; auto const g = (core::green16(color) + 20) / 2; auto const b = (core::blue16(color) + 31) / 2; diff --git a/src/nostalgia/modules/core/include/nostalgia/core/consts.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/consts.hpp similarity index 92% rename from src/nostalgia/modules/core/include/nostalgia/core/consts.hpp rename to src/nostalgia/modules/gfx/include/nostalgia/gfx/consts.hpp index 182fca53..be662241 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/consts.hpp +++ b/src/nostalgia/modules/gfx/include/nostalgia/gfx/consts.hpp @@ -6,7 +6,7 @@ #include -namespace nostalgia::core { +namespace nostalgia::gfx { constexpr auto TileWidth = 8; constexpr auto TileHeight = 8; diff --git a/src/nostalgia/modules/core/include/nostalgia/core/context.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/context.hpp similarity index 95% rename from src/nostalgia/modules/core/include/nostalgia/core/context.hpp rename to src/nostalgia/modules/gfx/include/nostalgia/gfx/context.hpp index 2f2df277..8ccb0d1f 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/context.hpp +++ b/src/nostalgia/modules/gfx/include/nostalgia/gfx/context.hpp @@ -13,7 +13,7 @@ #include "initparams.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { class Context; diff --git a/src/nostalgia/modules/core/include/nostalgia/core/core.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/core.hpp similarity index 100% rename from src/nostalgia/modules/core/include/nostalgia/core/core.hpp rename to src/nostalgia/modules/gfx/include/nostalgia/gfx/core.hpp diff --git a/src/nostalgia/modules/core/include/nostalgia/core/gfx.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/gfx.hpp similarity index 97% rename from src/nostalgia/modules/core/include/nostalgia/core/gfx.hpp rename to src/nostalgia/modules/gfx/include/nostalgia/gfx/gfx.hpp index e5f32bef..d2a256fe 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/gfx.hpp +++ b/src/nostalgia/modules/gfx/include/nostalgia/gfx/gfx.hpp @@ -13,7 +13,7 @@ #include "palette.hpp" #include "tilesheet.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { struct Sprite { static constexpr auto TypeName = "net.drinkingtea.nostalgia.core.Sprite"; @@ -242,15 +242,15 @@ void puts(Context &ctx, int column, int row, ox::StringViewCR str) noexcept; } -namespace nostalgia::core::gl { +namespace nostalgia::gfx::gl { constexpr ox::CStringView GlslVersion = "#version 330"; [[nodiscard]] ox::Size drawSize(int scale = 5) noexcept; -void draw(core::Context &ctx, ox::Size const&renderSz) noexcept; +void draw(gfx::Context &ctx, ox::Size const&renderSz) noexcept; -void draw(core::Context&, int scale = 5) noexcept; +void draw(gfx::Context&, int scale = 5) noexcept; } diff --git a/src/nostalgia/modules/core/include/nostalgia/core/initparams.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/initparams.hpp similarity index 89% rename from src/nostalgia/modules/core/include/nostalgia/core/initparams.hpp rename to src/nostalgia/modules/gfx/include/nostalgia/gfx/initparams.hpp index 52b61cc0..e7145d37 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/initparams.hpp +++ b/src/nostalgia/modules/gfx/include/nostalgia/gfx/initparams.hpp @@ -6,7 +6,7 @@ #include -namespace nostalgia::core { +namespace nostalgia::gfx { struct InitParams { bool glInstallDrawer = true; diff --git a/src/nostalgia/modules/core/include/nostalgia/core/keelmodule.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/keelmodule.hpp similarity index 86% rename from src/nostalgia/modules/core/include/nostalgia/core/keelmodule.hpp rename to src/nostalgia/modules/gfx/include/nostalgia/gfx/keelmodule.hpp index ace09a80..da976b3e 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/keelmodule.hpp +++ b/src/nostalgia/modules/gfx/include/nostalgia/gfx/keelmodule.hpp @@ -6,7 +6,7 @@ #include -namespace nostalgia::core { +namespace nostalgia::gfx { const keel::Module *keelModule() noexcept; diff --git a/src/nostalgia/modules/core/include/nostalgia/core/palette.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/palette.hpp similarity index 99% rename from src/nostalgia/modules/core/include/nostalgia/core/palette.hpp rename to src/nostalgia/modules/gfx/include/nostalgia/gfx/palette.hpp index 61cec29b..c5e0ff8d 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/palette.hpp +++ b/src/nostalgia/modules/gfx/include/nostalgia/gfx/palette.hpp @@ -11,7 +11,7 @@ #include "color.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { struct PaletteColorV1 { static constexpr auto TypeName = "net.drinkingtea.nostalgia.core.PaletteColor"; diff --git a/src/nostalgia/modules/core/include/nostalgia/core/ptidxconv.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/ptidxconv.hpp similarity index 98% rename from src/nostalgia/modules/core/include/nostalgia/core/ptidxconv.hpp rename to src/nostalgia/modules/gfx/include/nostalgia/gfx/ptidxconv.hpp index ad608995..8e2548ce 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/ptidxconv.hpp +++ b/src/nostalgia/modules/gfx/include/nostalgia/gfx/ptidxconv.hpp @@ -8,7 +8,7 @@ #include "consts.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { [[nodiscard]] constexpr std::size_t ptToIdx(int x, int y, int c, int scale = 1) noexcept { diff --git a/src/nostalgia/modules/core/include/nostalgia/core/studio.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/studio.hpp similarity index 100% rename from src/nostalgia/modules/core/include/nostalgia/core/studio.hpp rename to src/nostalgia/modules/gfx/include/nostalgia/gfx/studio.hpp diff --git a/src/nostalgia/modules/core/include/nostalgia/core/studiomodule.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/studiomodule.hpp similarity index 86% rename from src/nostalgia/modules/core/include/nostalgia/core/studiomodule.hpp rename to src/nostalgia/modules/gfx/include/nostalgia/gfx/studiomodule.hpp index 79e1db6a..c950021d 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/studiomodule.hpp +++ b/src/nostalgia/modules/gfx/include/nostalgia/gfx/studiomodule.hpp @@ -6,7 +6,7 @@ #include -namespace nostalgia::core { +namespace nostalgia::gfx { const studio::Module *studioModule() noexcept; diff --git a/src/nostalgia/modules/core/include/nostalgia/core/tilesheet.hpp b/src/nostalgia/modules/gfx/include/nostalgia/gfx/tilesheet.hpp similarity index 99% rename from src/nostalgia/modules/core/include/nostalgia/core/tilesheet.hpp rename to src/nostalgia/modules/gfx/include/nostalgia/gfx/tilesheet.hpp index 6348903a..ac1cd5b8 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/tilesheet.hpp +++ b/src/nostalgia/modules/gfx/include/nostalgia/gfx/tilesheet.hpp @@ -12,11 +12,11 @@ #include #include -#include +#include #include "palette.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { struct SubSheetTemplate { static constexpr auto TypeName = "net.drinkingtea.nostalgia.gfx.SubSheetTemplate"; diff --git a/src/nostalgia/modules/core/src/CMakeLists.txt b/src/nostalgia/modules/gfx/src/CMakeLists.txt similarity index 100% rename from src/nostalgia/modules/core/src/CMakeLists.txt rename to src/nostalgia/modules/gfx/src/CMakeLists.txt diff --git a/src/nostalgia/modules/core/src/gba/CMakeLists.txt b/src/nostalgia/modules/gfx/src/gba/CMakeLists.txt similarity index 100% rename from src/nostalgia/modules/core/src/gba/CMakeLists.txt rename to src/nostalgia/modules/gfx/src/gba/CMakeLists.txt diff --git a/src/nostalgia/modules/core/src/gba/context.cpp b/src/nostalgia/modules/gfx/src/gba/context.cpp similarity index 92% rename from src/nostalgia/modules/core/src/gba/context.cpp rename to src/nostalgia/modules/gfx/src/gba/context.cpp index ab378d31..9f7be14c 100644 --- a/src/nostalgia/modules/core/src/gba/context.cpp +++ b/src/nostalgia/modules/gfx/src/gba/context.cpp @@ -4,11 +4,11 @@ #include -#include +#include #include "context.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { void safeDelete(Context *ctx) noexcept { delete ctx; diff --git a/src/nostalgia/modules/core/src/gba/context.hpp b/src/nostalgia/modules/gfx/src/gba/context.hpp similarity index 90% rename from src/nostalgia/modules/core/src/gba/context.hpp rename to src/nostalgia/modules/gfx/src/gba/context.hpp index 99d2a229..c748d2d4 100644 --- a/src/nostalgia/modules/core/src/gba/context.hpp +++ b/src/nostalgia/modules/gfx/src/gba/context.hpp @@ -4,9 +4,9 @@ #pragma once -#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { struct BgCbbData { unsigned bpp = 4; diff --git a/src/nostalgia/modules/core/src/gba/gfx.cpp b/src/nostalgia/modules/gfx/src/gba/gfx.cpp similarity index 98% rename from src/nostalgia/modules/core/src/gba/gfx.cpp rename to src/nostalgia/modules/gfx/src/gba/gfx.cpp index eac447b0..65b9ca73 100644 --- a/src/nostalgia/modules/core/src/gba/gfx.cpp +++ b/src/nostalgia/modules/gfx/src/gba/gfx.cpp @@ -11,15 +11,15 @@ #include -#include -#include -#include +#include +#include +#include #include "context.hpp" OX_ALLOW_UNSAFE_BUFFERS_BEGIN -namespace nostalgia::core { +namespace nostalgia::gfx { static constexpr auto SpriteCount = 128; diff --git a/src/nostalgia/modules/core/src/gba/gfx.hpp b/src/nostalgia/modules/gfx/src/gba/gfx.hpp similarity index 71% rename from src/nostalgia/modules/core/src/gba/gfx.hpp rename to src/nostalgia/modules/gfx/src/gba/gfx.hpp index 21aad7e5..ea7aee73 100644 --- a/src/nostalgia/modules/core/src/gba/gfx.hpp +++ b/src/nostalgia/modules/gfx/src/gba/gfx.hpp @@ -4,8 +4,8 @@ #pragma once -#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { ox::Error initGfx(Context &ctx, InitParams const&) noexcept; } diff --git a/src/nostalgia/modules/core/src/gba/panic.cpp b/src/nostalgia/modules/gfx/src/gba/panic.cpp similarity index 96% rename from src/nostalgia/modules/core/src/gba/panic.cpp rename to src/nostalgia/modules/gfx/src/gba/panic.cpp index 1014a4a1..106bd383 100644 --- a/src/nostalgia/modules/core/src/gba/panic.cpp +++ b/src/nostalgia/modules/gfx/src/gba/panic.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include "gfx.hpp" @@ -22,7 +22,7 @@ namespace ox { -using namespace nostalgia::core; +using namespace nostalgia::gfx; void panic(const char *file, int line, const char *panicMsg, ox::Error const&err) noexcept { // reset heap to make sure we have enough memory to allocate context data diff --git a/src/nostalgia/modules/core/src/gfx.cpp b/src/nostalgia/modules/gfx/src/gfx.cpp similarity index 98% rename from src/nostalgia/modules/core/src/gfx.cpp rename to src/nostalgia/modules/gfx/src/gfx.cpp index c5094ad4..8509fa8f 100644 --- a/src/nostalgia/modules/core/src/gfx.cpp +++ b/src/nostalgia/modules/gfx/src/gfx.cpp @@ -3,9 +3,9 @@ */ #include -#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { constexpr auto GbaTileColumns = 32; constexpr auto GbaTileRows = 32; diff --git a/src/nostalgia/modules/core/src/keel/CMakeLists.txt b/src/nostalgia/modules/gfx/src/keel/CMakeLists.txt similarity index 100% rename from src/nostalgia/modules/core/src/keel/CMakeLists.txt rename to src/nostalgia/modules/gfx/src/keel/CMakeLists.txt diff --git a/src/nostalgia/modules/core/src/keel/keelmodule.cpp b/src/nostalgia/modules/gfx/src/keel/keelmodule.cpp similarity index 96% rename from src/nostalgia/modules/core/src/keel/keelmodule.cpp rename to src/nostalgia/modules/gfx/src/keel/keelmodule.cpp index e56d90d2..a334c863 100644 --- a/src/nostalgia/modules/core/src/keel/keelmodule.cpp +++ b/src/nostalgia/modules/gfx/src/keel/keelmodule.cpp @@ -7,12 +7,12 @@ #include #include -#include -#include +#include +#include #include "typeconv.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { static class: public keel::Module { private: diff --git a/src/nostalgia/modules/core/src/keel/typeconv.cpp b/src/nostalgia/modules/gfx/src/keel/typeconv.cpp similarity index 99% rename from src/nostalgia/modules/core/src/keel/typeconv.cpp rename to src/nostalgia/modules/gfx/src/keel/typeconv.cpp index 04ffb4bb..466e69dd 100644 --- a/src/nostalgia/modules/core/src/keel/typeconv.cpp +++ b/src/nostalgia/modules/gfx/src/keel/typeconv.cpp @@ -4,7 +4,7 @@ #include "typeconv.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { ox::Error NostalgiaPaletteToPaletteV1Converter::convert( keel::Context&, diff --git a/src/nostalgia/modules/core/src/keel/typeconv.hpp b/src/nostalgia/modules/gfx/src/keel/typeconv.hpp similarity index 93% rename from src/nostalgia/modules/core/src/keel/typeconv.hpp rename to src/nostalgia/modules/gfx/src/keel/typeconv.hpp index b35b2e30..1d52a13e 100644 --- a/src/nostalgia/modules/core/src/keel/typeconv.hpp +++ b/src/nostalgia/modules/gfx/src/keel/typeconv.hpp @@ -8,11 +8,11 @@ #include -#include -#include -#include +#include +#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { // Type converters diff --git a/src/nostalgia/modules/core/src/opengl/CMakeLists.txt b/src/nostalgia/modules/gfx/src/opengl/CMakeLists.txt similarity index 100% rename from src/nostalgia/modules/core/src/opengl/CMakeLists.txt rename to src/nostalgia/modules/gfx/src/opengl/CMakeLists.txt diff --git a/src/nostalgia/modules/core/src/opengl/context.cpp b/src/nostalgia/modules/gfx/src/opengl/context.cpp similarity index 96% rename from src/nostalgia/modules/core/src/opengl/context.cpp rename to src/nostalgia/modules/gfx/src/opengl/context.cpp index fd727bc0..45e0d795 100644 --- a/src/nostalgia/modules/core/src/opengl/context.cpp +++ b/src/nostalgia/modules/gfx/src/opengl/context.cpp @@ -5,7 +5,7 @@ #include "context.hpp" #include "gfx.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { void safeDelete(Context *ctx) noexcept { delete ctx; diff --git a/src/nostalgia/modules/core/src/opengl/context.hpp b/src/nostalgia/modules/gfx/src/opengl/context.hpp similarity index 89% rename from src/nostalgia/modules/core/src/opengl/context.hpp rename to src/nostalgia/modules/gfx/src/opengl/context.hpp index df8ad4f7..be93bf0c 100644 --- a/src/nostalgia/modules/core/src/opengl/context.hpp +++ b/src/nostalgia/modules/gfx/src/opengl/context.hpp @@ -8,12 +8,12 @@ #include -#include -#include +#include +#include #include "gfx.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { class Context { diff --git a/src/nostalgia/modules/core/src/opengl/gfx.cpp b/src/nostalgia/modules/gfx/src/opengl/gfx.cpp similarity index 98% rename from src/nostalgia/modules/core/src/opengl/gfx.cpp rename to src/nostalgia/modules/gfx/src/opengl/gfx.cpp index 0357237d..c35ba026 100644 --- a/src/nostalgia/modules/core/src/opengl/gfx.cpp +++ b/src/nostalgia/modules/gfx/src/opengl/gfx.cpp @@ -10,15 +10,15 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include "context.hpp" #include "gfx.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { namespace renderer { @@ -28,7 +28,7 @@ static constexpr auto PriorityScale = 0.01f; Drawer::Drawer(Context &ctx) noexcept: m_ctx(ctx) {} void Drawer::draw(turbine::Context &tctx) noexcept { - core::gl::draw(m_ctx, turbine::getScreenSize(tctx)); + gfx::gl::draw(m_ctx, turbine::getScreenSize(tctx)); } static constexpr ox::CStringView bgvshadTmpl = R"glsl( @@ -768,7 +768,7 @@ ox::Size drawSize(int scale) noexcept { return {240 * scale, 160 * scale}; } -void draw(core::Context &ctx, ox::Size const&renderSz) noexcept { +void draw(gfx::Context &ctx, ox::Size const&renderSz) noexcept { glViewport(0, 0, renderSz.width, renderSz.height); glEnable(GL_DEPTH_TEST); glEnable(GL_BLEND); @@ -783,7 +783,7 @@ void draw(core::Context &ctx, ox::Size const&renderSz) noexcept { glDisable(GL_BLEND); } -void draw(core::Context &ctx, int scale) noexcept { +void draw(gfx::Context &ctx, int scale) noexcept { draw(ctx, drawSize(scale)); } diff --git a/src/nostalgia/modules/core/src/opengl/gfx.hpp b/src/nostalgia/modules/gfx/src/opengl/gfx.hpp similarity index 94% rename from src/nostalgia/modules/core/src/opengl/gfx.hpp rename to src/nostalgia/modules/gfx/src/opengl/gfx.hpp index 56813801..b852a2c3 100644 --- a/src/nostalgia/modules/core/src/opengl/gfx.hpp +++ b/src/nostalgia/modules/gfx/src/opengl/gfx.hpp @@ -10,9 +10,9 @@ #include -#include +#include -namespace nostalgia::core::renderer { +namespace nostalgia::gfx::renderer { constexpr uint64_t TileRows = 128; constexpr uint64_t TileColumns = 128; @@ -59,7 +59,7 @@ class Drawer: public turbine::gl::Drawer { } -namespace nostalgia::core { +namespace nostalgia::gfx { ox::Error initGfx(Context &ctx, InitParams const&) noexcept; void shutdownGfx(Context &ctx) noexcept; } diff --git a/src/nostalgia/modules/core/src/studio/CMakeLists.txt b/src/nostalgia/modules/gfx/src/studio/CMakeLists.txt similarity index 100% rename from src/nostalgia/modules/core/src/studio/CMakeLists.txt rename to src/nostalgia/modules/gfx/src/studio/CMakeLists.txt diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/CMakeLists.txt b/src/nostalgia/modules/gfx/src/studio/paletteeditor/CMakeLists.txt similarity index 100% rename from src/nostalgia/modules/core/src/studio/paletteeditor/CMakeLists.txt rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/CMakeLists.txt diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/addcolorcommand.cpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/addcolorcommand.cpp similarity index 96% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/addcolorcommand.cpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/addcolorcommand.cpp index 7e5d4b04..016fee52 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/addcolorcommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/addcolorcommand.cpp @@ -5,7 +5,7 @@ #include "commands.hpp" #include "addcolorcommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { AddColorCommand::AddColorCommand(Palette &pal, Color16 const color, size_t const idx) noexcept: m_pal(pal), diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/addcolorcommand.hpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/addcolorcommand.hpp similarity index 89% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/addcolorcommand.hpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/addcolorcommand.hpp index cf7ba653..9fad4bb5 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/addcolorcommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/addcolorcommand.hpp @@ -6,9 +6,9 @@ #include -#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { class AddColorCommand: public studio::UndoCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/addpagecommand.cpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/addpagecommand.cpp similarity index 95% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/addpagecommand.cpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/addpagecommand.cpp index 828bbc9b..aa97232f 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/addpagecommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/addpagecommand.cpp @@ -6,7 +6,7 @@ #include "addpagecommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { AddPageCommand::AddPageCommand(Palette &pal) noexcept: m_pal(pal) {} diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/addpagecommand.hpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/addpagecommand.hpp similarity index 87% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/addpagecommand.hpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/addpagecommand.hpp index 58f31d76..01f659dd 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/addpagecommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/addpagecommand.hpp @@ -6,9 +6,9 @@ #include -#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { class AddPageCommand: public studio::UndoCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/applycolorallpagescommand.cpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/applycolorallpagescommand.cpp similarity index 97% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/applycolorallpagescommand.cpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/applycolorallpagescommand.cpp index 902d339d..a80d76dd 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/applycolorallpagescommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/applycolorallpagescommand.cpp @@ -5,7 +5,7 @@ #include "commands.hpp" #include "applycolorallpagescommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { ApplyColorAllPagesCommand::ApplyColorAllPagesCommand(Palette &pal, size_t const page, size_t const idx): m_pal(pal), diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/applycolorallpagescommand.hpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/applycolorallpagescommand.hpp similarity index 89% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/applycolorallpagescommand.hpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/applycolorallpagescommand.hpp index 02725449..8b5eec23 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/applycolorallpagescommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/applycolorallpagescommand.hpp @@ -6,9 +6,9 @@ #include -#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { class ApplyColorAllPagesCommand: public studio::UndoCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/commands.hpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/commands.hpp similarity index 90% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/commands.hpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/commands.hpp index e6be3b4b..7ca6ee69 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/commands.hpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/commands.hpp @@ -4,7 +4,7 @@ #pragma once -namespace nostalgia::core { +namespace nostalgia::gfx { enum class PaletteEditorCommandId { ApplyColorAllPages, diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/duplicatepagecommand.cpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/duplicatepagecommand.cpp similarity index 96% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/duplicatepagecommand.cpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/duplicatepagecommand.cpp index e4888ef7..6d935ded 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/duplicatepagecommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/duplicatepagecommand.cpp @@ -6,7 +6,7 @@ #include "duplicatepagecommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { DuplicatePageCommand::DuplicatePageCommand(Palette &pal, size_t srcIdx, size_t dstIdx) noexcept: m_pal(pal), diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/duplicatepagecommand.hpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/duplicatepagecommand.hpp similarity index 90% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/duplicatepagecommand.hpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/duplicatepagecommand.hpp index 6fba6ba4..7765e275 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/duplicatepagecommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/duplicatepagecommand.hpp @@ -6,9 +6,9 @@ #include -#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { class DuplicatePageCommand: public studio::UndoCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/movecolorcommand.cpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/movecolorcommand.cpp similarity index 96% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/movecolorcommand.cpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/movecolorcommand.cpp index cbb7e8aa..282790f6 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/movecolorcommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/movecolorcommand.cpp @@ -6,7 +6,7 @@ #include "movecolorcommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { MoveColorCommand::MoveColorCommand( Palette &pal, size_t page, size_t srcIdx, size_t dstIdx) noexcept: diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/movecolorcommand.hpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/movecolorcommand.hpp similarity index 91% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/movecolorcommand.hpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/movecolorcommand.hpp index 9397a65b..7858ef6f 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/movecolorcommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/movecolorcommand.hpp @@ -6,9 +6,9 @@ #include -#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { class MoveColorCommand: public studio::UndoCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/removecolorcommand.cpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/removecolorcommand.cpp similarity index 97% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/removecolorcommand.cpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/removecolorcommand.cpp index 2472af6d..269372a0 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/removecolorcommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/removecolorcommand.cpp @@ -5,7 +5,7 @@ #include "commands.hpp" #include "removecolorcommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { RemoveColorCommand::RemoveColorCommand(Palette &pal, size_t const idx) noexcept: m_pal(pal), diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/removecolorcommand.hpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/removecolorcommand.hpp similarity index 89% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/removecolorcommand.hpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/removecolorcommand.hpp index 64c70c05..d94e021c 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/removecolorcommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/removecolorcommand.hpp @@ -6,9 +6,9 @@ #include -#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { class RemoveColorCommand: public studio::UndoCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/removepagecommand.cpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/removepagecommand.cpp similarity index 95% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/removepagecommand.cpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/removepagecommand.cpp index a63935ba..1376b0f0 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/removepagecommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/removepagecommand.cpp @@ -6,7 +6,7 @@ #include "removepagecommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { RemovePageCommand::RemovePageCommand(Palette &pal, size_t idx) noexcept: m_pal(pal), diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/removepagecommand.hpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/removepagecommand.hpp similarity index 88% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/removepagecommand.hpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/removepagecommand.hpp index ef7f6d77..bd4264b3 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/removepagecommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/removepagecommand.hpp @@ -6,9 +6,9 @@ #include -#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { class RemovePageCommand: public studio::UndoCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/renamepagecommand.cpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/renamepagecommand.cpp similarity index 95% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/renamepagecommand.cpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/renamepagecommand.cpp index b7042e9f..965b2bb7 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/renamepagecommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/renamepagecommand.cpp @@ -4,7 +4,7 @@ #include "renamepagecommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { RenamePageCommand::RenamePageCommand(Palette &pal, size_t const page, ox::StringParam name) noexcept: m_pal(pal), diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/renamepagecommand.hpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/renamepagecommand.hpp similarity index 89% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/renamepagecommand.hpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/renamepagecommand.hpp index 4e1733f4..fbc520e5 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/renamepagecommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/renamepagecommand.hpp @@ -6,11 +6,11 @@ #include -#include +#include #include "commands.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { class RenamePageCommand: public studio::UndoCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/updatecolorcommand.cpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/updatecolorcommand.cpp similarity index 97% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/updatecolorcommand.cpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/updatecolorcommand.cpp index a384839f..b1c9eb64 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/updatecolorcommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/updatecolorcommand.cpp @@ -5,7 +5,7 @@ #include "commands.hpp" #include "updatecolorcommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { UpdateColorCommand::UpdateColorCommand( Palette &pal, diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/updatecolorcommand.hpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/updatecolorcommand.hpp similarity index 91% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/updatecolorcommand.hpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/updatecolorcommand.hpp index 387afbfe..6b7b63cc 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/updatecolorcommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/updatecolorcommand.hpp @@ -6,9 +6,9 @@ #include -#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { class UpdateColorCommand: public studio::UndoCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/updatecolorinfocommand.cpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/updatecolorinfocommand.cpp similarity index 97% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/updatecolorinfocommand.cpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/updatecolorinfocommand.cpp index e86797ae..1657075b 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/updatecolorinfocommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/updatecolorinfocommand.cpp @@ -5,7 +5,7 @@ #include "commands.hpp" #include "updatecolorinfocommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { UpdateColorInfoCommand::UpdateColorInfoCommand( Palette &pal, diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/updatecolorinfocommand.hpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/updatecolorinfocommand.hpp similarity index 91% rename from src/nostalgia/modules/core/src/studio/paletteeditor/commands/updatecolorinfocommand.hpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/updatecolorinfocommand.hpp index 170514f9..c5dac8c6 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/commands/updatecolorinfocommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/commands/updatecolorinfocommand.hpp @@ -6,9 +6,9 @@ #include -#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { class UpdateColorInfoCommand: public studio::UndoCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.cpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.cpp similarity index 99% rename from src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.cpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.cpp index bd33d678..1221d350 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.cpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.cpp @@ -19,7 +19,7 @@ #include "paletteeditor-imgui.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { namespace ig = studio::ig; diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.hpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.hpp similarity index 94% rename from src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.hpp rename to src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.hpp index 14eca234..f3865e34 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.hpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.hpp @@ -6,10 +6,10 @@ #include -#include -#include +#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { class PaletteEditorImGui: public studio::Editor { diff --git a/src/nostalgia/modules/core/src/studio/studiomodule.cpp b/src/nostalgia/modules/gfx/src/studio/studiomodule.cpp similarity index 97% rename from src/nostalgia/modules/core/src/studio/studiomodule.cpp rename to src/nostalgia/modules/gfx/src/studio/studiomodule.cpp index 91a2dc5b..a541d94b 100644 --- a/src/nostalgia/modules/core/src/studio/studiomodule.cpp +++ b/src/nostalgia/modules/gfx/src/studio/studiomodule.cpp @@ -9,7 +9,7 @@ #include "paletteeditor/paletteeditor-imgui.hpp" #include "tilesheeteditor/tilesheeteditor-imgui.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { static class: public studio::Module { ox::Vector editors(studio::StudioContext &ctx) const noexcept final { diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/CMakeLists.txt b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/CMakeLists.txt similarity index 100% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/CMakeLists.txt rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/CMakeLists.txt diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/CMakeLists.txt b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/CMakeLists.txt similarity index 100% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/CMakeLists.txt rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/CMakeLists.txt diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/addsubsheetcommand.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/addsubsheetcommand.cpp similarity index 98% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/addsubsheetcommand.cpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/addsubsheetcommand.cpp index e61a5f45..78574284 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/addsubsheetcommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/addsubsheetcommand.cpp @@ -4,7 +4,7 @@ #include "addsubsheetcommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { AddSubSheetCommand::AddSubSheetCommand( TileSheet &img, diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/addsubsheetcommand.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/addsubsheetcommand.hpp similarity index 95% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/addsubsheetcommand.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/addsubsheetcommand.hpp index 65f79b5d..e268a6d5 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/addsubsheetcommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/addsubsheetcommand.hpp @@ -6,7 +6,7 @@ #include "commands.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { class AddSubSheetCommand: public TileSheetCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/commands.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/commands.hpp similarity index 90% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/commands.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/commands.hpp index 27db437b..68b15e3c 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/commands.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/commands.hpp @@ -5,9 +5,9 @@ #pragma once #include -#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { // Command IDs to use with QUndoCommand::id() enum class CommandId { diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/cutpastecommand.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/cutpastecommand.cpp similarity index 96% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/cutpastecommand.cpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/cutpastecommand.cpp index 60e19f50..86b0fbe3 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/cutpastecommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/cutpastecommand.cpp @@ -4,7 +4,7 @@ #include "cutpastecommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { TileSheetClipboard::Pixel::Pixel(uint16_t pColorIdx, ox::Point pPt) noexcept { colorIdx = pColorIdx; @@ -37,7 +37,7 @@ CutPasteCommand::CutPasteCommand( for (auto const&p : cb.pixels()) { auto const dstPt = p.pt + dstStart; if (dstPt.x <= dstEnd.x && dstPt.y <= dstEnd.y) { - auto const idx = core::idx(ss, dstPt); + auto const idx = gfx::idx(ss, dstPt); m_changes.emplace_back(static_cast(idx), p.colorIdx, getPixel(ss, m_img.bpp, idx)); } } diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/cutpastecommand.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/cutpastecommand.hpp similarity index 98% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/cutpastecommand.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/cutpastecommand.hpp index 4d263e51..5110bb5c 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/cutpastecommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/cutpastecommand.hpp @@ -8,7 +8,7 @@ #include "commands.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { OX_MODEL_FWD_DECL(class TileSheetClipboard); diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/deletetilescommand.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/deletetilescommand.cpp similarity index 92% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/deletetilescommand.cpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/deletetilescommand.cpp index 9eff5259..9be5a29c 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/deletetilescommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/deletetilescommand.cpp @@ -6,9 +6,9 @@ #include "deletetilescommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { -core::DeleteTilesCommand::DeleteTilesCommand( +gfx::DeleteTilesCommand::DeleteTilesCommand( TileSheet &img, TileSheet::SubSheetIdx idx, std::size_t tileIdx, @@ -28,7 +28,7 @@ core::DeleteTilesCommand::DeleteTilesCommand( } } -ox::Error core::DeleteTilesCommand::redo() noexcept { +ox::Error gfx::DeleteTilesCommand::redo() noexcept { auto &s = getSubSheet(m_img, m_idx); auto &p = s.pixels; auto srcPos = m_deletePos + m_deleteSz; diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/deletetilescommand.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/deletetilescommand.hpp similarity index 96% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/deletetilescommand.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/deletetilescommand.hpp index 792848b3..846c2283 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/deletetilescommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/deletetilescommand.hpp @@ -6,7 +6,7 @@ #include "commands.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { class DeleteTilesCommand: public TileSheetCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/drawcommand.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/drawcommand.cpp similarity index 98% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/drawcommand.cpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/drawcommand.cpp index 6217f8fd..c75a3e8e 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/drawcommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/drawcommand.cpp @@ -4,7 +4,7 @@ #include "drawcommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { DrawCommand::DrawCommand( TileSheet &img, diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/drawcommand.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/drawcommand.hpp similarity index 97% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/drawcommand.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/drawcommand.hpp index 593ade1d..21cf845a 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/drawcommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/drawcommand.hpp @@ -6,7 +6,7 @@ #include "commands.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { class DrawCommand: public TileSheetCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/inserttilescommand.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/inserttilescommand.cpp similarity index 98% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/inserttilescommand.cpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/inserttilescommand.cpp index 9651feed..1c9ce146 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/inserttilescommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/inserttilescommand.cpp @@ -4,7 +4,7 @@ #include "inserttilescommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { InsertTilesCommand::InsertTilesCommand( TileSheet &img, diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/inserttilescommand.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/inserttilescommand.hpp similarity index 96% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/inserttilescommand.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/inserttilescommand.hpp index 5761c9a3..49f77ab5 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/inserttilescommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/inserttilescommand.hpp @@ -6,7 +6,7 @@ #include "commands.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { class InsertTilesCommand: public TileSheetCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/palettechangecommand.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/palettechangecommand.cpp similarity index 91% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/palettechangecommand.cpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/palettechangecommand.cpp index 741ad01c..6b17871a 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/palettechangecommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/palettechangecommand.cpp @@ -4,9 +4,9 @@ #include "palettechangecommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { -core::PaletteChangeCommand::PaletteChangeCommand( +gfx::PaletteChangeCommand::PaletteChangeCommand( TileSheet::SubSheetIdx idx, TileSheet &img, ox::StringViewCR newPalette) noexcept: diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/palettechangecommand.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/palettechangecommand.hpp similarity index 95% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/palettechangecommand.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/palettechangecommand.hpp index 3be318e6..f79f1c7c 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/palettechangecommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/palettechangecommand.hpp @@ -6,7 +6,7 @@ #include "commands.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { class PaletteChangeCommand: public TileSheetCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/rmsubsheetcommand.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/rmsubsheetcommand.cpp similarity index 87% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/rmsubsheetcommand.cpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/rmsubsheetcommand.cpp index 8246c9ff..bb6011bb 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/rmsubsheetcommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/rmsubsheetcommand.cpp @@ -4,9 +4,9 @@ #include "rmsubsheetcommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { -core::RmSubSheetCommand::RmSubSheetCommand(TileSheet &img, TileSheet::SubSheetIdx idx) noexcept: +gfx::RmSubSheetCommand::RmSubSheetCommand(TileSheet &img, TileSheet::SubSheetIdx idx) noexcept: m_img(img), m_idx(std::move(idx)), m_parentIdx(m_idx) { diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/rmsubsheetcommand.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/rmsubsheetcommand.hpp similarity index 95% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/rmsubsheetcommand.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/rmsubsheetcommand.hpp index 0b0f9cec..1813c774 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/rmsubsheetcommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/rmsubsheetcommand.hpp @@ -6,7 +6,7 @@ #include "commands.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { class RmSubSheetCommand: public TileSheetCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/updatesubsheetcommand.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/updatesubsheetcommand.cpp similarity index 91% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/updatesubsheetcommand.cpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/updatesubsheetcommand.cpp index f15a3603..7038320b 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/updatesubsheetcommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/updatesubsheetcommand.cpp @@ -4,9 +4,9 @@ #include "updatesubsheetcommand.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { -core::UpdateSubSheetCommand::UpdateSubSheetCommand( +gfx::UpdateSubSheetCommand::UpdateSubSheetCommand( TileSheet &img, TileSheet::SubSheetIdx idx, ox::StringParam name, diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/updatesubsheetcommand.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/updatesubsheetcommand.hpp similarity index 95% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/updatesubsheetcommand.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/updatesubsheetcommand.hpp index 9a90feef..b2c55117 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/commands/updatesubsheetcommand.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/updatesubsheetcommand.hpp @@ -6,7 +6,7 @@ #include "commands.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { class UpdateSubSheetCommand: public TileSheetCommand { private: diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp similarity index 99% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp index a7a5c05e..9c721f34 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp @@ -11,7 +11,7 @@ #include "tilesheeteditor-imgui.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { namespace ig = studio::ig; @@ -136,7 +136,7 @@ void TileSheetEditorImGui::keyStateChanged(turbine::Key key, bool down) { auto const popupOpen = m_subsheetEditor.isOpen() || m_exportMenu.isOpen(); auto const pal = m_model.pal(); if (!popupOpen) { - auto const colorCnt = core::colorCnt(pal, m_model.palettePage()); + auto const colorCnt = gfx::colorCnt(pal, m_model.palettePage()); if (key == turbine::Key::Alpha_D) { m_tool = TileSheetTool::Draw; setCopyEnabled(false); diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp similarity index 98% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp index 46797d09..f3490b34 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp @@ -14,7 +14,7 @@ #include "tilesheetpixels.hpp" #include "tilesheeteditorview.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { class TileSheetEditorImGui: public studio::Editor { diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditormodel.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.cpp similarity index 97% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditormodel.cpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.cpp index c31620f0..df31d5b3 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditormodel.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include "commands/commands.hpp" #include "commands/addsubsheetcommand.hpp" @@ -24,7 +24,7 @@ #include "commands/updatesubsheetcommand.hpp" #include "tilesheeteditormodel.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { // delete pixels of all non-leaf nodes static void normalizeSubsheets(TileSheet::SubSheet &ss) noexcept { @@ -66,7 +66,7 @@ void TileSheetEditorModel::cut() { auto const&s = activeSubSheet(); iterateSelectionRows(*m_selection, [&](int const x, int const y) { auto pt = ox::Point{x, y}; - auto const idx = core::idx(s, pt); + auto const idx = gfx::idx(s, pt); auto const c = getPixel(s, m_img.bpp, idx); pt -= m_selection->a; cb->addPixel(pt, c); @@ -87,7 +87,7 @@ void TileSheetEditorModel::copy() { iterateSelectionRows(*m_selection, [&](int const x, int const y) { auto pt = ox::Point{x, y}; const auto&s = activeSubSheet(); - const auto idx = core::idx(s, pt); + const auto idx = gfx::idx(s, pt); const auto c = getPixel(s, m_img.bpp, idx); pt -= m_selection->a; cb->addPixel(pt, c); @@ -156,7 +156,7 @@ void TileSheetEditorModel::drawCommand(ox::Point const&pt, std::size_t const pal if (pt.x >= activeSubSheet.columns * TileWidth || pt.y >= activeSubSheet.rows * TileHeight) { return; } - const auto idx = core::idx(activeSubSheet, pt); + const auto idx = gfx::idx(activeSubSheet, pt); if (m_ongoingDrawCommand) { m_updated = m_updated || m_ongoingDrawCommand->append(idx); } else if (getPixel(activeSubSheet, m_img.bpp, idx) != palIdx) { @@ -209,7 +209,7 @@ void TileSheetEditorModel::fill(ox::Point const&pt, int const palIdx) noexcept { auto const oldColor = getPixel(activeSubSheet, m_img.bpp, pt); getFillPixels(activeSubSheet, updateMap, pt, oldColor); ox::Vector idxList; - auto i = core::idx(activeSubSheet, pt) / PixelsPerTile * PixelsPerTile; + auto i = gfx::idx(activeSubSheet, pt) / PixelsPerTile * PixelsPerTile; for (auto const u : updateMap) { if (u) { idxList.emplace_back(i); diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditormodel.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.hpp similarity index 97% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditormodel.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.hpp index 6371a4e3..ef652051 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditormodel.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.hpp @@ -9,10 +9,10 @@ #include -#include -#include +#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { class TileSheetEditorModel: public ox::SignalHandler { diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditorview.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditorview.cpp similarity index 98% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditorview.cpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditorview.cpp index 0ac18ae8..03fdaee6 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditorview.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditorview.cpp @@ -5,11 +5,11 @@ #include #include -#include +#include #include "tilesheeteditorview.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { TileSheetEditorView::TileSheetEditorView(studio::StudioContext &sctx, ox::StringView path, studio::UndoStack &undoStack): m_model(sctx, path, undoStack), diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditorview.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditorview.hpp similarity index 97% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditorview.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditorview.hpp index 5c0d11f5..a3198151 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditorview.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditorview.hpp @@ -10,13 +10,13 @@ #include #include -#include +#include #include "tilesheeteditormodel.hpp" #include "tilesheetpixelgrid.hpp" #include "tilesheetpixels.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { enum class TileSheetTool { None, diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixelgrid.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheetpixelgrid.cpp similarity index 98% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixelgrid.cpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheetpixelgrid.cpp index e84b6f5b..414aa316 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixelgrid.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheetpixelgrid.cpp @@ -4,11 +4,11 @@ #include -#include +#include #include "tilesheetpixelgrid.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { void TileSheetGrid::setPixelSizeMod(float sm) noexcept { m_pixelSizeMod = sm; diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixelgrid.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheetpixelgrid.hpp similarity index 94% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixelgrid.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheetpixelgrid.hpp index f1690d88..6a08895a 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixelgrid.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheetpixelgrid.hpp @@ -7,10 +7,10 @@ #include #include -#include -#include +#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { class TileSheetGrid { diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixels.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheetpixels.cpp similarity index 95% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixels.cpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheetpixels.cpp index fc9551f6..c12ebf31 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixels.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheetpixels.cpp @@ -2,12 +2,12 @@ * Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved. */ -#include -#include +#include +#include #include "tilesheeteditormodel.hpp" #include "tilesheetpixels.hpp" -namespace nostalgia::core { +namespace nostalgia::gfx { const glutils::ProgramSource TileSheetPixels::s_programSrc = { .shaderParams = { @@ -29,7 +29,7 @@ const glutils::ProgramSource TileSheetPixels::s_programSrc = { void main() { gl_Position = vec4(vPosition + vScroll, 0.0, 1.0); fColor = vColor; - })", core::gl::GlslVersion), + })", gfx::gl::GlslVersion), .fragShader = ox::sfmt(R"( {} in vec3 fColor; @@ -37,7 +37,7 @@ const glutils::ProgramSource TileSheetPixels::s_programSrc = { void main() { //outColor = vec4(0.0, 0.7, 1.0, 1.0); outColor = vec4(fColor, 1.0); - })", core::gl::GlslVersion), + })", gfx::gl::GlslVersion), }; TileSheetPixels::TileSheetPixels(TileSheetEditorModel &model) noexcept: m_model(model) { @@ -131,7 +131,7 @@ void TileSheetPixels::setBufferObjects(ox::Vec2 const&paneSize) noexcept { m_bufferSet.elements.resize(pixels * VertexEboLength); // set pixels walkPixels(subSheet, m_model.img().bpp, [&](std::size_t i, uint8_t p) { - auto color = core::color(pal, m_model.palettePage(), p); + auto color = gfx::color(pal, m_model.palettePage(), p); auto const pt = idxToPt(static_cast(i), subSheet.columns); auto const fx = static_cast(pt.x); auto const fy = static_cast(pt.y); diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixels.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheetpixels.hpp similarity index 92% rename from src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixels.hpp rename to src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheetpixels.hpp index f9fabea4..117b2a90 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheetpixels.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheetpixels.hpp @@ -9,10 +9,10 @@ #include #include -#include -#include +#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { class TileSheetPixels { diff --git a/src/nostalgia/modules/core/src/tilesheet.cpp b/src/nostalgia/modules/gfx/src/tilesheet.cpp similarity index 96% rename from src/nostalgia/modules/core/src/tilesheet.cpp rename to src/nostalgia/modules/gfx/src/tilesheet.cpp index 3856b958..77967b4b 100644 --- a/src/nostalgia/modules/core/src/tilesheet.cpp +++ b/src/nostalgia/modules/gfx/src/tilesheet.cpp @@ -5,10 +5,10 @@ #include #include -#include -#include +#include +#include -namespace nostalgia::core { +namespace nostalgia::gfx { std::size_t idx(TileSheet::SubSheet const&ss, ox::Point const&pt) noexcept { return ptToIdx(pt, ss.columns); @@ -241,11 +241,11 @@ TileSheet::SubSheet &getSubSheet( } TileSheet::SubSheet const&getSubSheet(TileSheet const&ts, TileSheet::SubSheetIdx const&idx) noexcept { - return core::getSubSheet(idx, 0, ts.subsheet); + return gfx::getSubSheet(idx, 0, ts.subsheet); } TileSheet::SubSheet &getSubSheet(TileSheet &ts, TileSheet::SubSheetIdx const&idx) noexcept { - return core::getSubSheet(idx, 0, ts.subsheet); + return gfx::getSubSheet(idx, 0, ts.subsheet); } ox::Error addSubSheet(TileSheet &ts, TileSheet::SubSheetIdx const&idx) noexcept { @@ -382,15 +382,15 @@ static ox::Result getTileOffset( } ox::Result getTileOffset(TileSheet const&ts, ox::StringViewCR pNamePath) noexcept { - return core::getTileOffset(ts.subsheet, ox::split<8>(pNamePath, '.'), ts.bpp); + return gfx::getTileOffset(ts.subsheet, ox::split<8>(pNamePath, '.'), ts.bpp); } ox::Result getNameFor(TileSheet &ts, SubSheetId pId) noexcept { - return core::getNameFor(ts.subsheet, pId); + return gfx::getNameFor(ts.subsheet, pId); } ox::Result getNameFor(TileSheet const&ts, SubSheetId pId) noexcept { - return core::getNameFor(ts.subsheet, pId); + return gfx::getNameFor(ts.subsheet, pId); } static void readPixelsTo(TileSheet::SubSheet &ss, ox::Vector &pPixels) noexcept { diff --git a/src/nostalgia/modules/core/test/CMakeLists.txt b/src/nostalgia/modules/gfx/test/CMakeLists.txt similarity index 100% rename from src/nostalgia/modules/core/test/CMakeLists.txt rename to src/nostalgia/modules/gfx/test/CMakeLists.txt diff --git a/src/nostalgia/modules/core/test/tests.cpp b/src/nostalgia/modules/gfx/test/tests.cpp similarity index 87% rename from src/nostalgia/modules/core/test/tests.cpp rename to src/nostalgia/modules/gfx/test/tests.cpp index 03c59fc6..21476b3c 100644 --- a/src/nostalgia/modules/core/test/tests.cpp +++ b/src/nostalgia/modules/gfx/test/tests.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include using namespace nostalgia; @@ -15,9 +15,9 @@ static std::map tests = { { "readWriteTileSheet", []() -> ox::Error { - core::TileSheet in; + gfx::TileSheet in; OX_REQUIRE(buff, ox::writeMC(in)); - OX_REQUIRE(out, ox::readMC(buff)); + OX_REQUIRE(out, ox::readMC(buff)); oxAssert(in.subsheet.name == out.subsheet.name, "subsheet.name serialization broken"); return {}; } diff --git a/src/nostalgia/modules/keelmodules.cpp b/src/nostalgia/modules/keelmodules.cpp index 00f4745b..c296b7c2 100644 --- a/src/nostalgia/modules/keelmodules.cpp +++ b/src/nostalgia/modules/keelmodules.cpp @@ -2,7 +2,7 @@ * Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved. */ -#include +#include #include namespace nostalgia { @@ -13,7 +13,7 @@ void registerKeelModules() noexcept { return; } modulesRegistered = true; - keel::registerModule(core::keelModule()); + keel::registerModule(gfx::keelModule()); keel::registerModule(scene::keelModule()); } diff --git a/src/nostalgia/modules/scene/include/nostalgia/scene/scene.hpp b/src/nostalgia/modules/scene/include/nostalgia/scene/scene.hpp index 7863d791..46ba1a41 100644 --- a/src/nostalgia/modules/scene/include/nostalgia/scene/scene.hpp +++ b/src/nostalgia/modules/scene/include/nostalgia/scene/scene.hpp @@ -4,7 +4,7 @@ #pragma once -#include +#include #include "scenestatic.hpp" @@ -17,10 +17,10 @@ class Scene { public: explicit Scene(SceneStatic const&sceneStatic) noexcept; - ox::Error setupDisplay(core::Context &ctx) const noexcept; + ox::Error setupDisplay(gfx::Context &ctx) const noexcept; private: - void setupLayer(core::Context&, ox::Vector const&layer, unsigned layerNo) const noexcept; + void setupLayer(gfx::Context&, ox::Vector const&layer, unsigned layerNo) const noexcept; }; diff --git a/src/nostalgia/modules/scene/include/nostalgia/scene/scenestatic.hpp b/src/nostalgia/modules/scene/include/nostalgia/scene/scenestatic.hpp index 19747c9c..1291c1c8 100644 --- a/src/nostalgia/modules/scene/include/nostalgia/scene/scenestatic.hpp +++ b/src/nostalgia/modules/scene/include/nostalgia/scene/scenestatic.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include namespace nostalgia::scene { @@ -21,7 +21,7 @@ struct SpriteDoc { constexpr static auto Preloadable = true; ox::String tilesheetPath; - ox::Vector subsheetId; + ox::Vector subsheetId; }; @@ -31,13 +31,13 @@ struct TileDoc { constexpr static auto TypeVersion = 1; constexpr static auto Preloadable = true; - core::SubSheetId subsheetId = -1; + gfx::SubSheetId subsheetId = -1; ox::String subsheetPath; uint8_t type = 0; ox::Array layerAttachments; [[nodiscard]] - constexpr ox::Result getSubsheetId(core::TileSheet const&ts) const noexcept { + constexpr ox::Result getSubsheetId(gfx::TileSheet const&ts) const noexcept { // prefer the already present ID if (subsheetId > -1) { return subsheetId; @@ -47,10 +47,10 @@ struct TileDoc { [[nodiscard]] constexpr ox::Result getSubsheetPath( - core::TileSheet const&ts) const noexcept { + gfx::TileSheet const&ts) const noexcept { // prefer the already present path if (!subsheetPath.len()) { - return core::getNameFor(ts, subsheetId); + return gfx::getNameFor(ts, subsheetId); } return ox::StringView(subsheetPath); } diff --git a/src/nostalgia/modules/scene/src/keel/typeconv.cpp b/src/nostalgia/modules/scene/src/keel/typeconv.cpp index f9c51fcd..9ab112fe 100644 --- a/src/nostalgia/modules/scene/src/keel/typeconv.cpp +++ b/src/nostalgia/modules/scene/src/keel/typeconv.cpp @@ -2,7 +2,7 @@ * Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved. */ -#include +#include #include #include "typeconv.hpp" @@ -37,7 +37,7 @@ ox::Error SceneDocToSceneStaticConverter::convert( keel::Context &ctx, SceneDoc &src, SceneStatic &dst) const noexcept { - OX_REQUIRE(ts, keel::readObj(ctx, src.tilesheet)); + OX_REQUIRE(ts, keel::readObj(ctx, src.tilesheet)); const auto layerCnt = src.tiles.size(); dst.setLayerCnt(layerCnt); dst.tilesheet = ox::FileAddress(src.tilesheet); diff --git a/src/nostalgia/modules/scene/src/scene.cpp b/src/nostalgia/modules/scene/src/scene.cpp index 558e76d1..99c8d42b 100644 --- a/src/nostalgia/modules/scene/src/scene.cpp +++ b/src/nostalgia/modules/scene/src/scene.cpp @@ -2,7 +2,7 @@ * Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved. */ -#include +#include #include @@ -12,15 +12,15 @@ Scene::Scene(SceneStatic const&sceneStatic) noexcept: m_sceneStatic(sceneStatic) { } -ox::Error Scene::setupDisplay(core::Context &ctx) const noexcept { +ox::Error Scene::setupDisplay(gfx::Context &ctx) const noexcept { if (m_sceneStatic.palettes.empty()) { return ox::Error(1, "Scene has no palettes"); } auto const&palette = m_sceneStatic.palettes[0]; - OX_RETURN_ERROR(core::loadBgTileSheet(ctx, 0, m_sceneStatic.tilesheet)); - OX_RETURN_ERROR(core::loadBgPalette(ctx, 0, palette)); + OX_RETURN_ERROR(gfx::loadBgTileSheet(ctx, 0, m_sceneStatic.tilesheet)); + OX_RETURN_ERROR(gfx::loadBgPalette(ctx, 0, palette)); // disable all backgrounds - core::setBgStatus(ctx, 0); + gfx::setBgStatus(ctx, 0); for (auto layerNo = 0u; auto const&layer : m_sceneStatic.tileMapIdx) { setupLayer(ctx, layer, layerNo); ++layerNo; @@ -29,20 +29,20 @@ ox::Error Scene::setupDisplay(core::Context &ctx) const noexcept { } void Scene::setupLayer( - core::Context &ctx, + gfx::Context &ctx, ox::Vector const&layer, unsigned layerNo) const noexcept { - core::setBgStatus(ctx, layerNo, true); - core::setBgCbb(ctx, layerNo, 0); + gfx::setBgStatus(ctx, layerNo, true); + gfx::setBgCbb(ctx, layerNo, 0); auto x = 0; auto y = 0; const auto width = m_sceneStatic.rows[layerNo]; for (auto const&tile : layer) { const auto tile8 = static_cast(tile); - core::setBgTile(ctx, layerNo, x, y, tile8); - core::setBgTile(ctx, layerNo, x + 1, y, tile8 + 1); - core::setBgTile(ctx, layerNo, x, y + 1, tile8 + 2); - core::setBgTile(ctx, layerNo, x + 1, y + 1, tile8 + 3); + gfx::setBgTile(ctx, layerNo, x, y, tile8); + gfx::setBgTile(ctx, layerNo, x + 1, y, tile8 + 1); + gfx::setBgTile(ctx, layerNo, x, y + 1, tile8 + 2); + gfx::setBgTile(ctx, layerNo, x + 1, y + 1, tile8 + 3); x += 2; if (x >= width * 2) { x = 0; diff --git a/src/nostalgia/modules/scene/src/studio/sceneeditorview.cpp b/src/nostalgia/modules/scene/src/studio/sceneeditorview.cpp index 6d0776f6..7a15f84e 100644 --- a/src/nostalgia/modules/scene/src/studio/sceneeditorview.cpp +++ b/src/nostalgia/modules/scene/src/studio/sceneeditorview.cpp @@ -2,31 +2,31 @@ * Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved. */ -#include +#include #include "sceneeditorview.hpp" namespace nostalgia::scene { SceneEditorView::SceneEditorView(turbine::Context &tctx, SceneStatic const&sceneStatic): - m_cctx(core::init(tctx, {.glInstallDrawer = false}).unwrapThrow()), + m_cctx(gfx::init(tctx, {.glInstallDrawer = false}).unwrapThrow()), m_sceneStatic(sceneStatic), m_scene(m_sceneStatic) { } ox::Error SceneEditorView::setupScene() noexcept { - glutils::resizeInitFrameBuffer(m_frameBuffer, core::gl::drawSize(m_scale)); + glutils::resizeInitFrameBuffer(m_frameBuffer, gfx::gl::drawSize(m_scale)); return m_scene.setupDisplay(*m_cctx); } void SceneEditorView::draw(ox::Size const&targetSz) noexcept { - auto const scaleSz = targetSz / core::gl::drawSize(1); + auto const scaleSz = targetSz / gfx::gl::drawSize(1); if (m_scaleSz != scaleSz) [[unlikely]] { m_scale = ox::max(1, ox::max(scaleSz.width, scaleSz.height)); - glutils::resizeInitFrameBuffer(m_frameBuffer, core::gl::drawSize(m_scale)); + glutils::resizeInitFrameBuffer(m_frameBuffer, gfx::gl::drawSize(m_scale)); } glutils::FrameBufferBind const frameBufferBind(m_frameBuffer); - core::gl::draw(*m_cctx, m_scale); + gfx::gl::draw(*m_cctx, m_scale); } glutils::FrameBuffer const&SceneEditorView::framebuffer() const noexcept { diff --git a/src/nostalgia/modules/scene/src/studio/sceneeditorview.hpp b/src/nostalgia/modules/scene/src/studio/sceneeditorview.hpp index c1f29910..6e21e40f 100644 --- a/src/nostalgia/modules/scene/src/studio/sceneeditorview.hpp +++ b/src/nostalgia/modules/scene/src/studio/sceneeditorview.hpp @@ -6,8 +6,8 @@ #include -#include -#include +#include +#include #include namespace nostalgia::scene { @@ -15,12 +15,12 @@ namespace nostalgia::scene { class SceneEditorView { private: - core::ContextUPtr m_cctx; + gfx::ContextUPtr m_cctx; SceneStatic const&m_sceneStatic; Scene m_scene; glutils::FrameBuffer m_frameBuffer; int m_scale = 1; - ox::Size m_scaleSz = core::gl::drawSize(m_scale); + ox::Size m_scaleSz = gfx::gl::drawSize(m_scale); public: SceneEditorView(turbine::Context &ctx, SceneStatic const&sceneStatic); diff --git a/src/nostalgia/modules/studiomodules.cpp b/src/nostalgia/modules/studiomodules.cpp index ead8a18b..516e2cee 100644 --- a/src/nostalgia/modules/studiomodules.cpp +++ b/src/nostalgia/modules/studiomodules.cpp @@ -4,7 +4,7 @@ #include -#include +#include #include namespace nostalgia { @@ -15,7 +15,7 @@ void registerStudioModules() noexcept { return; } modulesRegistered = true; - studio::registerModule(core::studioModule()); + studio::registerModule(gfx::studioModule()); studio::registerModule(scene::studioModule()); } diff --git a/src/nostalgia/player/app.cpp b/src/nostalgia/player/app.cpp index a2d20ea8..19cd31d8 100644 --- a/src/nostalgia/player/app.cpp +++ b/src/nostalgia/player/app.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include using namespace nostalgia; @@ -16,7 +16,7 @@ static bool s_paused = false; [[maybe_unused]] static int testUpdateHandler(turbine::Context &tctx) noexcept { - auto &cctx = *turbine::applicationData(tctx); + auto &cctx = *turbine::applicationData(tctx); constexpr auto sleepTime = 16; if (s_paused) { return sleepTime; @@ -41,7 +41,7 @@ static int testUpdateHandler(turbine::Context &tctx) noexcept { constexpr ox::StringView sprites = "nostalgia"; for (unsigned i = 0; i < sprites.len(); ++i) { auto const c = static_cast(sprites[i] - ('a' - 1)); - core::setSprite(cctx, i, { + gfx::setSprite(cctx, i, { .enabled = true, .x = spriteX + 8 * (static_cast(i) + 1), .y = spriteY, @@ -67,13 +67,13 @@ static void testKeyEventHandler(turbine::Context &tctx, turbine::Key key, bool d static ox::Error runTest(turbine::Context &tctx) { constexpr ox::StringView TileSheetAddr{"/TileSheets/Charset.ng"}; constexpr ox::StringView PaletteAddr{"/Palettes/Chester.npal"}; - OX_REQUIRE_M(cctx, core::init(tctx)); + OX_REQUIRE_M(cctx, gfx::init(tctx)); turbine::setApplicationData(tctx, cctx.get()); OX_REQUIRE(tsStat, turbine::rom(tctx)->stat(PaletteAddr)); - OX_RETURN_ERROR(core::loadSpriteTileSheet(*cctx, TileSheetAddr)); - OX_RETURN_ERROR(core::loadSpritePalette(*cctx, PaletteAddr)); - OX_RETURN_ERROR(core::initConsole(*cctx)); - core::puts(*cctx, 10, 9, "DOPENESS!!!"); + OX_RETURN_ERROR(gfx::loadSpriteTileSheet(*cctx, TileSheetAddr)); + OX_RETURN_ERROR(gfx::loadSpritePalette(*cctx, PaletteAddr)); + OX_RETURN_ERROR(gfx::initConsole(*cctx)); + gfx::puts(*cctx, 10, 9, "DOPENESS!!!"); turbine::setUpdateHandler(tctx, testUpdateHandler); turbine::setKeyEventHandler(tctx, testKeyEventHandler); return turbine::run(tctx); @@ -85,10 +85,10 @@ static ox::Error runTileSheetSetTest(turbine::Context &tctx) { // this should make the screen display 'ABCDB', with the A being upside down // and the first B being backwards constexpr ox::StringView PaletteAddr{"/Palettes/Charset.npal"}; - OX_REQUIRE_M(cctx, core::init(tctx)); + OX_REQUIRE_M(cctx, gfx::init(tctx)); turbine::setApplicationData(tctx, cctx.get()); OX_REQUIRE(tsStat, turbine::rom(tctx)->stat(PaletteAddr)); - core::TileSheetSet const set{ + gfx::TileSheetSet const set{ .bpp = 4, .entries = { { .tilesheet = ox::StringLiteral{"/TileSheets/Chester.ng"}, .sections{{.begin = 0, .tiles = 1}} }, @@ -98,23 +98,23 @@ static ox::Error runTileSheetSetTest(turbine::Context &tctx) { }, }; constexpr auto bgPalBank = 1; - OX_RETURN_ERROR(core::loadBgTileSheet(*cctx, 0, set)); - OX_RETURN_ERROR(core::loadSpriteTileSheet(*cctx, set)); - OX_RETURN_ERROR(core::loadBgPalette(*cctx, bgPalBank, PaletteAddr)); - OX_RETURN_ERROR(core::loadBgPalette(*cctx, 0, PaletteAddr)); - OX_RETURN_ERROR(core::loadSpritePalette(*cctx, PaletteAddr)); - core::setBgStatus(*cctx, 0, true); - core::setBgTile(*cctx, 0, 10, 9, { .tileIdx = 1, .palBank = bgPalBank, .flipX = 0, .flipY = 1 }); - core::setBgTile(*cctx, 0, 11, 9, { .tileIdx = 2, .palBank = bgPalBank, .flipX = 1, .flipY = 0 }); - core::setBgTile(*cctx, 0, 13, 9, { .tileIdx = 4, .palBank = bgPalBank, .flipX = 0, .flipY = 0 }); - core::setSprite(*cctx, 16, { + OX_RETURN_ERROR(gfx::loadBgTileSheet(*cctx, 0, set)); + OX_RETURN_ERROR(gfx::loadSpriteTileSheet(*cctx, set)); + OX_RETURN_ERROR(gfx::loadBgPalette(*cctx, bgPalBank, PaletteAddr)); + OX_RETURN_ERROR(gfx::loadBgPalette(*cctx, 0, PaletteAddr)); + OX_RETURN_ERROR(gfx::loadSpritePalette(*cctx, PaletteAddr)); + gfx::setBgStatus(*cctx, 0, true); + gfx::setBgTile(*cctx, 0, 10, 9, { .tileIdx = 1, .palBank = bgPalBank, .flipX = 0, .flipY = 1 }); + gfx::setBgTile(*cctx, 0, 11, 9, { .tileIdx = 2, .palBank = bgPalBank, .flipX = 1, .flipY = 0 }); + gfx::setBgTile(*cctx, 0, 13, 9, { .tileIdx = 4, .palBank = bgPalBank, .flipX = 0, .flipY = 0 }); + gfx::setSprite(*cctx, 16, { .enabled = true, .x = 12 * 8, .y = 9 * 8, .tileIdx = 3, .bpp = static_cast(set.bpp), }); - core::setSprite(*cctx, 17, { + gfx::setSprite(*cctx, 17, { .enabled = true, .x = 14 * 8, .y = 9 * 8, @@ -148,7 +148,7 @@ static void sceneKeyEventHandler(turbine::Context &tctx, turbine::Key key, bool [[maybe_unused]] static ox::Error runScene(turbine::Context &tctx) { constexpr ox::StringView SceneAddr{"/Scenes/Chester.nscn"}; - OX_REQUIRE_M(cctx, core::init(tctx)); + OX_REQUIRE_M(cctx, gfx::init(tctx)); OX_REQUIRE(scn, keel::readObj(keelCtx(tctx), SceneAddr)); turbine::setUpdateHandler(tctx, sceneUpdateHandler); turbine::setKeyEventHandler(tctx, sceneKeyEventHandler);