Compare commits

...

6 Commits

Author SHA1 Message Date
125a235dd1 [ox/fs] Cleanup
All checks were successful
Build / build (push) Successful in 1m26s
2025-04-02 01:29:02 -05:00
91a7129f8f [nostalgia/gfx/keel] Cleanup 2025-04-02 01:07:26 -05:00
df48a232ec [nostalgia/studio] Add icon to Windows executable
All checks were successful
Build / build (push) Successful in 1m28s
2025-04-02 00:49:13 -05:00
ab11b885e6 [keel] Add missing new line to log message
All checks were successful
Build / build (push) Successful in 1m25s
2025-03-24 21:02:20 -05:00
36fc25fb7e [studio] Fix closing tab with unsaved changes 2025-03-24 21:02:20 -05:00
4803cca334 [nostalgia/player] Cleanup
All checks were successful
Build / build (push) Successful in 1m29s
2025-03-08 22:28:29 -06:00
9 changed files with 53 additions and 20 deletions

30
deps/buildcore/scripts/file-to-cpp.py vendored Executable file
View File

@ -0,0 +1,30 @@
#! /usr/bin/env python3
#
# Copyright 2016 - 2025 gary@drinkingtea.net
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import argparse
import sys
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument('--file', help='path to file')
parser.add_argument('--out-cpp', help='path to output cpp file')
parser.add_argument('--out-hpp', help='path to output hpp file')
parser.add_argument('--namespace', help='path to output hpp file')
args = parser.parse_args()
return 0
if __name__ == '__main__':
try:
err = main()
sys.exit(err)
except KeyboardInterrupt:
sys.exit(1)

View File

@ -20,7 +20,7 @@
namespace ox { namespace ox {
namespace detail { namespace detail {
static inline void fsBuffFree(char *buff) noexcept { inline void fsBuffFree(char *buff) noexcept {
safeDelete(buff); safeDelete(buff);
} }
} }
@ -49,11 +49,11 @@ class FileSystem {
Result<Buffer> read(StringViewCR path) noexcept; Result<Buffer> read(StringViewCR path) noexcept;
inline Error read(StringViewCR path, void *buffer, std::size_t buffSize) noexcept { Error read(StringViewCR path, void *buffer, std::size_t buffSize) noexcept {
return readFilePath(path, buffer, buffSize); return readFilePath(path, buffer, buffSize);
} }
inline Error read(uint64_t inode, void *buffer, std::size_t buffSize) noexcept { Error read(uint64_t inode, void *buffer, std::size_t buffSize) noexcept {
return readFileInode(inode, buffer, buffSize); return readFileInode(inode, buffer, buffSize);
} }
@ -69,8 +69,7 @@ class FileSystem {
* @param path * @param path
* @param readStart * @param readStart
* @param readSize * @param readSize
* @param buffer * @param buff
* @param size
* @return error or number of bytes read * @return error or number of bytes read
*/ */
Result<size_t> read( Result<size_t> read(
@ -102,36 +101,36 @@ class FileSystem {
Error write(const FileAddress &addr, const void *buffer, uint64_t size, FileType fileType = FileType::NormalFile) noexcept; Error write(const FileAddress &addr, const void *buffer, uint64_t size, FileType fileType = FileType::NormalFile) noexcept;
inline Error write(StringViewCR path, const void *buffer, uint64_t size, FileType fileType) noexcept { Error write(StringViewCR path, const void *buffer, uint64_t size, FileType fileType) noexcept {
return writeFilePath(path, buffer, size, fileType); return writeFilePath(path, buffer, size, fileType);
} }
inline Error write(uint64_t inode, const void *buffer, uint64_t size, FileType fileType) noexcept { Error write(uint64_t inode, const void *buffer, uint64_t size, FileType fileType) noexcept {
return writeFileInode(inode, buffer, size, fileType); return writeFileInode(inode, buffer, size, fileType);
} }
inline Result<FileStat> stat(uint64_t inode) const noexcept { Result<FileStat> stat(uint64_t inode) const noexcept {
return statInode(inode); return statInode(inode);
} }
inline Result<FileStat> stat(StringViewCR path) const noexcept { Result<FileStat> stat(StringViewCR path) const noexcept {
return statPath(path); return statPath(path);
} }
Result<FileStat> stat(const FileAddress &addr) const noexcept; Result<FileStat> stat(const FileAddress &addr) const noexcept;
[[nodiscard]] [[nodiscard]]
inline bool exists(uint64_t inode) const noexcept { bool exists(uint64_t inode) const noexcept {
return statInode(inode).ok(); return statInode(inode).ok();
} }
[[nodiscard]] [[nodiscard]]
inline bool exists(ox::StringView path) const noexcept { bool exists(ox::StringView path) const noexcept {
return statPath(path).ok(); return statPath(path).ok();
} }
[[nodiscard]] [[nodiscard]]
inline bool exists(FileAddress const&addr) const noexcept { bool exists(FileAddress const&addr) const noexcept {
return stat(addr).ok(); return stat(addr).ok();
} }
@ -178,11 +177,11 @@ class MemFS: public FileSystem {
public: public:
Result<const char*> directAccess(const FileAddress &addr) const noexcept; Result<const char*> directAccess(const FileAddress &addr) const noexcept;
inline Result<const char*> directAccess(StringViewCR path) const noexcept { Result<const char*> directAccess(StringViewCR path) const noexcept {
return directAccessPath(path); return directAccessPath(path);
} }
inline Result<const char*> directAccess(uint64_t inode) const noexcept { Result<const char*> directAccess(uint64_t inode) const noexcept {
return directAccessInode(inode); return directAccessInode(inode);
} }

View File

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

View File

@ -134,7 +134,6 @@ ox::Error run(
return ox::Error{1, "Please provide path to project directory or OxFS file."}; return ox::Error{1, "Please provide path to project directory or OxFS file."};
} }
auto const path = args[1]; auto const path = args[1];
OX_REQUIRE_M(fs, keel::loadRomFs(path)); OX_REQUIRE_M(tctx, turbine::init(path, project));
OX_REQUIRE_M(tctx, turbine::init(std::move(fs), project));
return runTileSheetSetTest(*tctx); return runTileSheetSetTest(*tctx);
} }

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

View File

@ -68,7 +68,7 @@ constexpr auto makeLoader(Context &ctx) {
if (!beginsWith(assetId, "/")) { if (!beginsWith(assetId, "/")) {
auto const p = ctx.uuidToPath.at(assetId); auto const p = ctx.uuidToPath.at(assetId);
if (p.error) { if (p.error) {
oxErrf("Could not find asset: {}", assetId); oxErrf("Could not find asset: {}\n", assetId);
return ox::Error{1, "Asset ID not found"}; return ox::Error{1, "Asset ID not found"};
} }
assetId = *p.value; assetId = *p.value;

View File

@ -254,6 +254,7 @@ void StudioUI::drawTabs() noexcept {
if (!open) { if (!open) {
if (e->unsavedChanges()) { if (e->unsavedChanges()) {
m_closeFileConfirm.open(); m_closeFileConfirm.open();
++it;
} else { } else {
e->close(); e->close();
if (m_activeEditor == (*it).get()) { if (m_activeEditor == (*it).get()) {