Compare commits

...

4 Commits

Author SHA1 Message Date
17c9f673bd [studio] Fix navigate back not to iterate on the first item twice
All checks were successful
Build / build (push) Successful in 1m29s
2025-08-09 15:15:54 -05:00
870fb9c6e3 [nostalgia/studio] Set version to d2025.07.0
All checks were successful
Build / build (push) Successful in 1m17s
2025-07-31 22:07:22 -05:00
31b39982c5 [keel] Fix AssetRef to call incRef on initial creation of ref, not just copy
All checks were successful
Build / build (push) Successful in 1m18s
2025-07-31 22:06:52 -05:00
5476417be2 [nostalgia] Add release notes for d2025.07.0
All checks were successful
Build / build (push) Successful in 1m18s
2025-07-31 01:05:29 -05:00
5 changed files with 21 additions and 6 deletions

View File

@@ -1,3 +1,9 @@
# d2025.07.0
* Add sub-command for exporting TileSheets as PNG files.
* Add 'Reload Project' menu item under File.
* Fix opening a project to mark an unopenable file as closed in the config file on startup.
# d2025.06.0
* Add ability to remember recent projects in config

View File

@@ -15,7 +15,7 @@ target_link_libraries(
target_compile_definitions(
NostalgiaStudio PUBLIC
OLYMPIC_APP_VERSION="dev build"
OLYMPIC_APP_VERSION="d2025.07.0"
)
install(

View File

@@ -18,7 +18,7 @@
<string>APPL</string>
<key>CFBundleVersion</key>
<string>dev build</string>
<string>d2025.07.0</string>
<key>LSMinimumSystemVersion</key>
<string>12.0.0</string>

View File

@@ -64,11 +64,13 @@ class AssetContainer {
protected:
constexpr void incRefs() const noexcept {
oxAssert(m_references < ox::MaxValue<decltype(m_references)>, "reference count exceeds maximum");
++m_references;
}
constexpr void decRefs() const noexcept {
--m_references;
oxAssert(m_references >= 0, "negative references");
}
[[nodiscard]]
@@ -162,6 +164,7 @@ template<typename T>
constexpr AssetRef<T>::AssetRef(AssetContainer<T> const*c) noexcept: m_ctr(c) {
if (m_ctr) {
m_ctr->updated.connect(this, &AssetRef::emitUpdated);
m_ctr->incRefs();
}
}

View File

@@ -8,13 +8,18 @@ namespace studio {
void navigateTo(Context &ctx, ox::StringParam filePath, ox::StringParam navArgs) noexcept {
ox::String path = std::move(filePath);
if (beginsWith(path, "uuid://")) {
if (keel::isUuidUrl(path)) {
auto const [p, err] = keel::uuidUrlToPath(keelCtx(ctx), path);
if (err) {
return;
}
path = p;
}
//if (
// auto const [np, err] = ctx.navStack.back();
// !err && np->filePath == path && np->navArgs == navArgs.view()) {
// return;
//}
ctx.navStack.resize(ctx.navIdx + 1);
ctx.navStack.emplace_back(ox::String{path}, ox::String{navArgs.view()});
try {
@@ -49,8 +54,9 @@ void navigateBack(Context &ctx) noexcept {
}
void navigateForward(Context &ctx) noexcept {
while (ctx.navIdx < ctx.navStack.size()) {
auto const &n = ctx.navStack[ctx.navIdx];
auto const nextIdx = ctx.navIdx + 1;
while (nextIdx < ctx.navStack.size()) {
auto const &n = ctx.navStack[nextIdx];
try {
ctx.navCallback(n.filePath, n.navArgs);
} catch (std::exception const &e) {
@@ -58,7 +64,7 @@ void navigateForward(Context &ctx) noexcept {
oxErrf("navigateForward failed: {}", e.what());
}
if (!ctx.project->exists(n.filePath)) {
std::ignore = ctx.navStack.erase(ctx.navIdx);
std::ignore = ctx.navStack.erase(nextIdx);
continue;
}
++ctx.navIdx;