mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-19 06:29:58 -04:00
Fix small settings and overlay edge cases.
- An empty NX2NAVI_SPIN or NX2NAVI_VRAM_HEADROOM in the environment stopped the game: both read the key with cfg_bool, and an empty value falls back to the settings table, where these keys have no row. Empty now means unset. - find_ini checked for 10 bytes after the exe folder's separator where "nx2navi.ini" and its NUL take 12, so an exe path just under 1024 bytes wrote two bytes past the buffer. - The performance overlay read the clock before taking the lock, so a frame pushed in between was newer than "now", the unsigned age wrapped and the overlay showed 0 fps for that refresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -380,8 +380,10 @@ void perfmon_mode(int mode) {
|
||||
}
|
||||
|
||||
void perfmon_snapshot(PerfStats *out) {
|
||||
uint64_t now = plat_now_ns();
|
||||
// the time under the lock: a frame pushed between the two would be newer than now, and now - at wrapping would
|
||||
// end the frame window at once (0 fps on the overlay)
|
||||
plat_mutex_lock(&g_lock);
|
||||
uint64_t now = plat_now_ns();
|
||||
frames_summary(&g_stats, now);
|
||||
counters_summary(now);
|
||||
*out = g_stats;
|
||||
|
||||
Reference in New Issue
Block a user