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

@ -1,30 +0,0 @@
#! /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

@ -433,14 +433,14 @@ Error FileStoreTemplate<size_t>::resize() {
template<typename size_t>
Error FileStoreTemplate<size_t>::resize(std::size_t size, void *newBuff) {
if (m_buffer->size() > size) {
return ox::Error(1);
return ox::Error{1, "new buffer is too small for existing data"};
}
m_buffSize = static_cast<size_t>(size);
if (newBuff) {
m_buffer = reinterpret_cast<Buffer*>(newBuff);
m_buffer = static_cast<Buffer*>(newBuff);
OX_RETURN_ERROR(m_buffer->setSize(static_cast<size_t>(size)));
}
return ox::Error(0);
return {};
}
template<typename size_t>

View File

@ -20,7 +20,7 @@
namespace ox {
namespace detail {
static inline void fsBuffFree(char *buff) noexcept {
inline void fsBuffFree(char *buff) noexcept {
safeDelete(buff);
}
}
@ -49,11 +49,11 @@ class FileSystem {
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);
}
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);
}
@ -69,8 +69,7 @@ class FileSystem {
* @param path
* @param readStart
* @param readSize
* @param buffer
* @param size
* @param buff
* @return error or number of bytes 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;
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);
}
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);
}
inline Result<FileStat> stat(uint64_t inode) const noexcept {
Result<FileStat> stat(uint64_t inode) const noexcept {
return statInode(inode);
}
inline Result<FileStat> stat(StringViewCR path) const noexcept {
Result<FileStat> stat(StringViewCR path) const noexcept {
return statPath(path);
}
Result<FileStat> stat(const FileAddress &addr) const noexcept;
[[nodiscard]]
inline bool exists(uint64_t inode) const noexcept {
bool exists(uint64_t inode) const noexcept {
return statInode(inode).ok();
}
[[nodiscard]]
inline bool exists(ox::StringView path) const noexcept {
bool exists(ox::StringView path) const noexcept {
return statPath(path).ok();
}
[[nodiscard]]
inline bool exists(FileAddress const&addr) const noexcept {
bool exists(FileAddress const&addr) const noexcept {
return stat(addr).ok();
}
@ -178,11 +177,11 @@ class MemFS: public FileSystem {
public:
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);
}
inline Result<const char*> directAccess(uint64_t inode) const noexcept {
Result<const char*> directAccess(uint64_t inode) const noexcept {
return directAccessInode(inode);
}