mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-29 04:18:49 -04:00
A Randomizer page in the launcher, a new title screen with Mods and Save Select tabs, scaling changes applied in game, the Jabu-Jabu bars fixed, renderer frame-time work and the brightness-flash fix, and fixes from the 0.8.4 reports.
41 lines
2.4 KiB
C
41 lines
2.4 KiB
C
/* ((Triforce, 11-26) The Render resolution's scale as the menu applies it, each present (host/nn_vi.c realtime_step), as plain
|
|
code: tests/test_res_follow.py compiles it alone.
|
|
The owner: "Every option that requires a restart should be changed in game without having to restart". The menu's Render
|
|
resolution was read once, at the start; now the host takes the scale the menu has applied (gpu/vk/vk_menu.cpp menu_apply,
|
|
options 2 and 3) at each present, and the game's own recompute makes its 3D's targets again at it (nx2/oot_patches.py
|
|
APPLY_NEW). One case waits for the next start: where the render targets' pool is held to its size (host/nn_applet.c
|
|
hos_rt_pool_pinned: the 900 MB of a picture past 3840 x 2160's pixels, or HOS_RT_POOL_MB set), a 3D larger than any this run
|
|
has had. There is no room to spare in that pool, and the old targets and the new ones may be held at once while the game
|
|
makes them again; the menu then says the row takes a restart (HOS_OPT_RES_HELD). */
|
|
#pragma once
|
|
|
|
typedef struct {
|
|
int scale; /* the scale in force, 1/10000; -1 none yet (the game's 1.0 until the renderer answers) */
|
|
int largest; /* the largest 3D this run has had: the first scale, or 7500 from Auto (the dynamic path's own, 3/4) */
|
|
int held; /* the scale kept for the next start, 0 none */
|
|
} ResFollow;
|
|
|
|
enum { RES_SAME, RES_TAKE, RES_HOLD, RES_FREE }; /* (res_follow: nothing new; take f->scale; keep asked back; nothing kept back now) */
|
|
|
|
/* One present: dyn the menu's Auto (1), fixed (0) or not answered yet (-1); asked its scale (0 with Auto, -1 not answered);
|
|
pinned hos_rt_pool_pinned's answer (1 held to its size). What to do with the 3D's scale */
|
|
static inline int res_follow(ResFollow *f, int dyn, int asked, int pinned) {
|
|
if (!f->largest && dyn >= 0) f->largest = dyn ? 7500 : asked > 0 ? asked : 0;
|
|
if (asked > 0 && asked != f->scale) {
|
|
if (f->scale > 0 && f->largest && asked > f->largest && pinned == 1) {
|
|
if (f->held == asked) return RES_SAME;
|
|
f->held = asked;
|
|
return RES_HOLD;
|
|
}
|
|
f->held = 0;
|
|
f->scale = asked;
|
|
if (asked > f->largest) f->largest = asked;
|
|
return RES_TAKE;
|
|
}
|
|
if (f->held && (asked == f->scale || asked <= 0)) { /* (back to the scale in force, or Auto: nothing kept back) */
|
|
f->held = 0;
|
|
return RES_FREE;
|
|
}
|
|
return RES_SAME;
|
|
}
|