Compare commits
6 Commits
release-d2
...
125a235dd1
Author | SHA1 | Date | |
---|---|---|---|
125a235dd1 | |||
91a7129f8f | |||
df48a232ec | |||
ab11b885e6 | |||
36fc25fb7e | |||
4803cca334 |
30
deps/buildcore/scripts/file-to-cpp.py
vendored
Executable file
30
deps/buildcore/scripts/file-to-cpp.py
vendored
Executable 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)
|
27
deps/ox/src/ox/fs/filesystem/filesystem.hpp
vendored
27
deps/ox/src/ox/fs/filesystem/filesystem.hpp
vendored
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
1
src/nostalgia/studio/ns.rc
Normal file
1
src/nostalgia/studio/ns.rc
Normal file
@ -0,0 +1 @@
|
|||||||
|
IDI_ICON1 ICON DISCARDABLE "ns_logo.ico"
|
BIN
src/nostalgia/studio/ns_logo.ico
Normal file
BIN
src/nostalgia/studio/ns_logo.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 162 KiB |
@ -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;
|
||||||
|
@ -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()) {
|
||||||
|
Reference in New Issue
Block a user