Squashed 'deps/nostalgia/' changes from ab11b885..3fe62464

3fe62464 [nostalgia/sample_project] Add NS_Logo32
db55fc72 [nostalgia/player] Cleanup
20944508 [studio] Cleanup
889bec04 [nostalgia/gfx/studio/tilesheet] Cleanup
ac1e34d4 [nostalgia] Update release notes
55ed75f4 [nostalgia/gfx/studio/tilesheet] Fix selection clearing to work when clicking outside image
2751872c [nostalgia] Cleanup file-to-cpp output
2a3cd35c [nostalgia] Fix release notes version, add d2025.02.1
b66f459f [nostalgia] Cleanup icon rsrc generation
3910f4e7 [nostalgia] Fix debug and gba-run commands in Makefile
c0e96216 [turbine] Make accessor functions take const ref to Context
f9512d72 [turbine/glfw] Fix implicit conversion
b7f2c169 [nostalgia/studio/gfx] Fix typo
1e5057d6 [nostalgia] Add app icon note to release notes
c6255e32 [nostalgia/studio] Add icon 16 src
02230ef6 [turbine,studio,nostalgia/studio] Add support for window icon scaling, expand icons sizes for Nostalgia Studio
9b6b60e4 [turbine] Cleanup
b9a26ab6 [turbine] Fix GLFWimage member init order
a521887d [studio,turbine] Add support for window icons
5ca7e2f2 [ox/fs] Cleanup
125a235d [ox/fs] Cleanup
91a7129f [nostalgia/gfx/keel] Cleanup
df48a232 [nostalgia/studio] Add icon to Windows executable

git-subtree-dir: deps/nostalgia
git-subtree-split: 3fe62464c3ee45055e8c732840f949cdf373ae2a
This commit is contained in:
2025-04-16 19:48:37 -05:00
parent 6bcd6deb76
commit 09b4a705a9
32 changed files with 3065 additions and 87 deletions

View File

@@ -183,8 +183,8 @@ ox::Error TileSheetV4ToTileSheetV5Converter::convert(
keel::Context&,
TileSheetV4 &src,
TileSheetV5 &dst) const noexcept {
dst.bpp = src.bpp;
dst.idIt = src.idIt;
dst.bpp = src.bpp;
dst.idIt = src.idIt;
OX_RETURN_ERROR(src.defaultPalette.getPath().moveTo(dst.defaultPalette));
convertSubsheet(dst.bpp, src.subsheet, dst.subsheet);
return {};

View File

@@ -96,7 +96,7 @@ TileSheetEditorImGui::TileSheetEditorImGui(studio::StudioContext &sctx, ox::Stri
m_model{m_view.model()} {
// connect signal/slots
m_subsheetEditor.inputSubmitted.connect(this, &TileSheetEditorImGui::updateActiveSubsheet);
m_exportMenu.inputSubmitted.connect(this, &TileSheetEditorImGui::exportSubhseetToPng);
m_exportMenu.inputSubmitted.connect(this, &TileSheetEditorImGui::exportSubsheetToPng);
// load config
auto const&config = studio::readConfig<TileSheetEditorConfig>(
keelCtx(m_sctx), itemPath());
@@ -397,7 +397,7 @@ void TileSheetEditorImGui::showSubsheetEditor() noexcept {
}
}
ox::Error TileSheetEditorImGui::exportSubhseetToPng(int const scale) const noexcept {
ox::Error TileSheetEditorImGui::exportSubsheetToPng(int const scale) const noexcept {
OX_REQUIRE(path, studio::saveFile({{"PNG", "png"}}));
// subsheet to png
auto const&s = m_model.activeSubSheet();

View File

@@ -10,7 +10,6 @@
#include <studio/editor.hpp>
#include <studio/filepickerpopup.hpp>
#include "tilesheetpixelgrid.hpp"
#include "tilesheetpixels.hpp"
#include "tilesheeteditorview.hpp"
@@ -91,7 +90,7 @@ class TileSheetEditorImGui: public studio::Editor {
private:
void showSubsheetEditor() noexcept;
ox::Error exportSubhseetToPng(int scale) const noexcept;
ox::Error exportSubsheetToPng(int scale) const noexcept;
void drawTileSheet(ox::Vec2 const&fbSize) noexcept;
@@ -99,8 +98,6 @@ class TileSheetEditorImGui: public studio::Editor {
ox::Error updateActiveSubsheet(ox::StringView const&name, int cols, int rows) noexcept;
// slots
private:
void setActiveSubsheet(TileSheet::SubSheetIdx path) noexcept;
};

View File

@@ -120,7 +120,7 @@ bool TileSheetEditorModel::acceptsClipboardPayload() const noexcept {
return cb.ok();
}
ox::StringView TileSheetEditorModel::palPath() const noexcept {
ox::String const &TileSheetEditorModel::palPath() const & noexcept {
return m_palPath;
}
@@ -263,7 +263,13 @@ ox::Error TileSheetEditorModel::rotateRight() noexcept {
}
void TileSheetEditorModel::setSelection(studio::Selection const&sel) noexcept {
m_selection.emplace(sel);
auto const &ss = activeSubSheet();
if (sel.a.x < ss.columns * TileWidth && sel.a.y < ss.rows * TileHeight) {
m_selection.emplace(sel);
} else {
m_selTracker.finishSelection();
m_selection.reset();
}
m_updated = true;
}

View File

@@ -62,7 +62,7 @@ class TileSheetEditorModel: public ox::SignalHandler {
constexpr Palette const&pal() const noexcept;
[[nodiscard]]
ox::StringView palPath() const noexcept;
ox::String const &palPath() const & noexcept;
ox::Error setPalette(ox::StringViewCR path) noexcept;

View File

@@ -64,13 +64,10 @@ static void testKeyEventHandler(turbine::Context &tctx, turbine::Key key, bool d
[[maybe_unused]]
static ox::Error runTest(turbine::Context &tctx) {
constexpr ox::StringView TileSheetAddr{"/TileSheets/Charset.nts"};
constexpr ox::StringView PaletteAddr{"/Palettes/Chester.npal"};
OX_REQUIRE_M(cctx, gfx::init(tctx));
turbine::setApplicationData(tctx, cctx.get());
OX_REQUIRE(tsStat, turbine::rom(tctx)->stat(PaletteAddr));
OX_RETURN_ERROR(gfx::loadSpriteTileSheet(*cctx, TileSheetAddr));
OX_RETURN_ERROR(gfx::loadSpritePalette(*cctx, PaletteAddr));
OX_RETURN_ERROR(gfx::loadSpriteTileSheet(*cctx, "/TileSheets/Charset.nts"));
OX_RETURN_ERROR(gfx::loadSpritePalette(*cctx, "/Palettes/Chester.npal"));
OX_RETURN_ERROR(gfx::initConsole(*cctx));
gfx::puts(*cctx, 10, 9, "DOPENESS!!!");
turbine::setUpdateHandler(tctx, testUpdateHandler);
@@ -86,7 +83,6 @@ static ox::Error runTileSheetSetTest(turbine::Context &tctx) {
constexpr ox::StringView PaletteAddr{"/Palettes/Charset.npal"};
OX_REQUIRE_M(cctx, gfx::init(tctx));
turbine::setApplicationData(tctx, cctx.get());
OX_REQUIRE(tsStat, turbine::rom(tctx)->stat(PaletteAddr));
gfx::TileSheetSet const set{
.bpp = 4,
.entries = {

View File

@@ -1,4 +1,8 @@
add_executable(NostalgiaStudio WIN32 MACOSX_BUNDLE)
add_executable(
NostalgiaStudio WIN32 MACOSX_BUNDLE
ns.rc
icondata.cpp
)
target_link_libraries(
NostalgiaStudio

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "ns_logo.ico"

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 851 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

View File

@@ -0,0 +1,39 @@
{
"cpp": "icondata.cpp",
"namespace": "studio",
"all_files": "WindowIcons",
"files": [
{
"path": "ns_logo16.png",
"cpp_name": "WindowIcon16"
},
{
"path": "ns_logo24.png",
"cpp_name": "WindowIcon24"
},
{
"path": "ns_logo32.png",
"cpp_name": "WindowIcon32"
},
{
"path": "ns_logo40.png",
"cpp_name": "WindowIcon40"
},
{
"path": "ns_logo48.png",
"cpp_name": "WindowIcon48"
},
{
"path": "ns_logo128.png",
"cpp_name": "WindowIcon128"
},
{
"path": "ns_logo264.png",
"cpp_name": "WindowIcon264"
},
{
"path": "ns_logo1080.png",
"cpp_name": "WindowIcon1080"
}
]
}