mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-25 22:15:57 +00:00
Merge pull request #1459: the UI is laid out for any screen shape from 4:3 to 32:9, 4:3, 7680x2160 and phone sizes join the list, the Purah Pad frame, the map and the loading screen fill wide screens; vert_plus (the 16:9 width at narrower shapes) is off by default with a row under the field of view (itaskaev2) (#632, #1453)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
6841675942
15 files changed
+291
-61
No files matched your search
@@ -26,7 +26,12 @@ Report problems as issues, following [CONTRIBUTING.md](CONTRIBUTING.md).
|
||||
modes as DLSS: for FSR 4 the setup downloads AMD's signed FSR SDK libraries
|
||||
(github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK, AMD FSR SDK license), ticked by default with an AMD GPU
|
||||
- HDR10 output with peak, game and HUD brightness settings
|
||||
- 16:10 (Steam Deck, handhelds), 3:2 (Surface, Framework), 21:9 and 32:9 (ultrawide) game resolutions, with the camera and the interface in that shape
|
||||
- Ultrawide monitors, 21:9 and 32:9 (2560x1080, 3440x1440, 3840x1600, 5120x2160, 3840x1080, 5120x1440, 7680x2160):
|
||||
the camera sees the whole width, the map and the loading screen fill it without bars or stretching, and the HUD sits
|
||||
at the screen's edges or in the middle 21:9 or 16:9 (`hud_width`)
|
||||
- Other screen shapes from 4:3 to 32:9, each with the camera and the interface in that shape: 16:10 (Steam Deck,
|
||||
handhelds), 3:2 (Surface, Framework), 4:3 (iPads, CRT monitors) and phones (19.5:9, 20:9) for streaming; on shapes
|
||||
narrower than 16:9 the view can keep the 16:9 width (`vert_plus`, off by default)
|
||||
- Anisotropic texture filtering up to 16x, for sharp ground into the distance
|
||||
- In-game settings menu (F1) and performance overlay (F10)
|
||||
- Play time across runs on the Game tab of the settings menu, kept in `playtime.txt` next to the saves
|
||||
|
||||
+3
-1
@@ -109,7 +109,9 @@ loads the saves 1.4.3 wrote.
|
||||
file but the UI archive; for `pc` with the same `--binds` as the PC prompts step, whose key the step follows). The shapes are those of every connected display (Windows: `EnumDisplayDevices`; Linux:
|
||||
`xrandr`, else the DRM connectors), of the `output_res` the game defaults to on each, and of the `totk.ini`
|
||||
`output_res` (`installer/screens.py`). One folder per shape, named after the shape's size in `ASPECT_SIZES` (the
|
||||
closest within 1%; `5120x2160` uses `2560x1080`); `runtime/romfs.c` `overlay_init` maps the game resolution the
|
||||
closest within 1%; `5120x2160` uses `2560x1080`), or for an unlisted shape from 4:3 to 32:9 its own size (a
|
||||
`totk.ini` `output_res` of `2560x1200`, say; a display of an unlisted shape gets none, as the game keeps 1920x1080
|
||||
there); `runtime/romfs.c` `overlay_init` maps the game resolution the
|
||||
same way, and a folder of the exact size from an older setup still wins. A 16:9 player gets none. The step runs
|
||||
again when the displays, the prompts or the patches change. At a game resolution whose shape has no folder the
|
||||
game draws 16:9 with bars and starts the generator itself, in the background, for the next start: at start and
|
||||
|
||||
+1
-1
@@ -250,7 +250,7 @@ These names are code patch sets built into the generated game code (`recomp/patc
|
||||
| `audio_drain_fix` (default `1`) | Patch set that sends the game's audio thread back to its command ring after each list (1.2.1 main+0x883780, 1.4.3 main+0x149244), so it takes every queued list per 5 ms audio frame instead of one (#337). Game 1.1.0 has no site and keeps the game's code. | `0` runs the game's code as shipped: above about 200 game updates a second the ring fills, and the game's guard (1.2.1 main+0x9bcdc4) switches the sound commands off until the game is restarted once 300 updates in a row find it full. The guard starts over whenever two audio frames fall between two updates, so by the code it fires only while the audio frames come evenly, 5 ms apart: with `audio = none`, or while the audio device takes nothing and the mixer keeps time by its own timer. The guard's count and the switch have not been read in a run. With a device playing the game kept its sound in every run on Linux with PipeWire and 1024-frame device periods, where the frames come in bursts after each period; on Windows the bursts are read from the code (`gap_ns = 0` in `runtime/audren.c`), not measured; a device with periods of 240 frames or less was not tried and may pace as evenly as the timer. The set acts only when more than one list is queued, so below that rate it seldom changes anything. Measured at `fps_limit = 240` (Linux, PipeWire), seconds with sound with `0` and with `1`. On 1.2.1: without a device 6 of 119 and 111 of 119; with a device 111 of 119 and 112 of 119; with the game's stream paused for 5 s from outside (`pw-cli`, not a real device stalling) 4 of 120 (silent from the pause on, also after the device resumed) and 113 of 119; a pause of 2 s silenced the game with `0`, a pause of 1 s did not. On 1.4.3: without a device 3 of 119 and 113 of 120; with a device 111 of 119 with `0`; with the stream paused for 5 s, in 60 s runs, 3 of 59 and 51 of 59; a pause of 2 s with `0`, 4 of 59. | Safe |
|
||||
| `fixed_res_patch` (default `0`) | Patch set that holds the game's dynamic resolution at 100 percent (the scene tier). | The resolution code switches this set from `dynamic_res` (on at `0`); a manual value is replaced. | Unknown |
|
||||
| `freecam_patch` (default `0`) | Patch set of the hook in the camera component update behind the free camera (`freecam_pad`, `freecam_key`) on game 1.4.3; the *Free camera* row of the Controls tab. Read at start. | `1` puts the hook in the camera update: while the free camera is off it runs the game's own load and one compare. `0` runs the game's code as shipped: the combo and the key do nothing and the game gets the combo's buttons. | Safe |
|
||||
| `fov_patch` (default `0`) | Patch set that scales the camera's vertical view angle by the field-of-view setting. | The resolution code switches this set itself whenever the field of view is not 100 percent; a manual value is replaced. | Unknown |
|
||||
| `fov_patch` (default `0`) | Patch set that scales the camera's vertical view angle by the field-of-view setting. | The resolution code switches this set itself whenever the field of view is not 100 percent or `vert_plus` widens the view; a manual value is replaced. | Unknown |
|
||||
| `lightning_fix` (default `1`) | Patch set on 1.2.1 and 1.4.3 (set `lightning`; 1.4.3 main+0x62b1fc, main+0x62b3d8, main+0x62b51c; 1.2.1 main+0xab8d50, main+0xab9014, main+0xab8f90): in a thunderstorm the world manager's lightning update runs once per frame and draws, each update, a random number for each of three fixed chances, 0.013333 for a distant bolt and 0.01 for a near strike and for the environment's lightning flag that near strikes also set (#1287). The set multiplies each chance by the frame ratio, at most 1, so above 30 fps a storm has as much lightning per second as at 30 fps; at 30 fps and below the chances are the game's own. Game 1.1.0 has no site and keeps the game's code. | `0` runs the game's code: the higher the frame rate, the more distant bolts and lightning flags. Counted on 1.4.3 in one storm (205 s, the reporter's save) with a local build that logs each draw that succeeds: distant bolts 22, 52 and 94 to 96 a minute at 30, 60 and 120 fps with `0`, and 26, 27 and 20 to 24 with `1`; the lightning flag 19, 34 and 64 to 80 a minute of the storm's lightning phase with `0`, 12 to 17 with `1`. Near strikes stayed at 14 to 18 per run at every rate with either value. On 1.2.1 counted from screenshots only (no logging build; a storm in Hyrule Field, one screenshot every 0.2 s, each counted bolt checked by eye): 19 screenshots with a distant bolt a minute at 30 fps, about 61 at 120 fps with `0`, 15 with `1`; the same count on 1.4.3 gives 25 to 26, 65 to 68 and 16 to 20. | Safe |
|
||||
| `mouse_direct_patch` (default `1`) | Patch set of the hooks in the game's camera code behind `mouse_mode = direct` on game 1.4.3. | `0` stops `mouse_mode = direct` from taking effect; other mouse modes are unaffected. | Safe |
|
||||
| `optref_guard` (default `1`) | Patch set that treats a negative value in the optional reference at object +0x6b0 (1.4.3 main+0x1bd01c0, 1.2.1 main+0x1622bec) as absent instead of loading through it (#1005). | `0` runs the game's code as shipped: the random crash reading `0xffffffffffffffff` after minutes to hours of play can return. | Risky |
|
||||
|
||||
+25
-9
@@ -16,22 +16,28 @@ from pathlib import Path
|
||||
|
||||
# The game resolutions of another shape than 16:9 that runtime/ui/menu.cpp row_output_res lists, in the order of
|
||||
# runtime/cfg.c SHAPED: 21:9 and 32:9 monitors, 16:10 screens (the Steam Deck's 1280x800, handhelds and laptops) and 3:2
|
||||
# screens (Surface and Framework laptops and tablets)
|
||||
ASPECT_SIZES = ('2560x1080', '3440x1440', '3840x1600', '5120x2160', '3840x1080', '5120x1440',
|
||||
# screens (Surface and Framework laptops and tablets), 4:3 screens (CRT monitors, iPads) and 19.5:9 and 20:9 phone screens
|
||||
# (streamed to a phone)
|
||||
ASPECT_SIZES = ('2560x1080', '3440x1440', '3840x1600', '5120x2160', '3840x1080', '5120x1440', '7680x2160',
|
||||
'1280x800', '1680x1050', '1920x1200', '2560x1600',
|
||||
'1920x1280', '2160x1440', '2256x1504', '2880x1920', '3000x2000')
|
||||
'1920x1280', '2160x1440', '2256x1504', '2880x1920', '3000x2000',
|
||||
'1440x1080', '1600x1200', '2048x1536', '2732x2048',
|
||||
'2340x1080', '3120x1440', '2400x1080', '3200x1440')
|
||||
SHAPED = tuple(tuple(int(v) for v in s.split('x')) for s in ASPECT_SIZES)
|
||||
TOLERANCE = 0.01 # cfg.c and resolution.c res_is_16x9: shapes within 1% are the same
|
||||
# cfg.c SHAPE_MIN / SHAPE_MAX: the aspect ratios a UI layout can be made for (tools/ultrawide_layout.py), 4:3 to 32:9
|
||||
SHAPE_MIN, SHAPE_MAX = 4 / 3 * 0.99, 32 / 9 * 1.01
|
||||
|
||||
|
||||
def is_16x9(w, h):
|
||||
return abs((w / h) / (16 / 9) - 1) <= TOLERANCE
|
||||
|
||||
|
||||
def shape_size(w, h):
|
||||
def shape_size(w, h, listed=False):
|
||||
"""The folder size of w x h's shape: of ASPECT_SIZES within 1% of its aspect ratio, the closest, the first of equal
|
||||
ones (5120x2160 is 2560x1080's shape). None for 16:9 and for a shape the setup has no layout for. The same rule as
|
||||
runtime/cfg.c cfg_shape_size."""
|
||||
ones (5120x2160 is 2560x1080's shape); another shape from 4:3 to 32:9 its own size (an output_res of a phone's
|
||||
3120x1440, say), unless listed. None for 16:9 and for a shape no layout can be made for (portrait, narrower than
|
||||
4:3, wider than 32:9). The same rule as runtime/cfg.c cfg_shape_size."""
|
||||
if not w or not h or is_16x9(w, h):
|
||||
return None
|
||||
r, best, err = w / h, None, None
|
||||
@@ -39,7 +45,15 @@ def shape_size(w, h):
|
||||
e = abs(sw / sh / r - 1)
|
||||
if e <= TOLERANCE and (err is None or e < err):
|
||||
best, err = f'{sw}x{sh}', e
|
||||
return best
|
||||
if best or listed or not SHAPE_MIN <= r <= SHAPE_MAX:
|
||||
return best
|
||||
return f'{w}x{h}'
|
||||
|
||||
|
||||
def size_order(size):
|
||||
"""Sort key: the ASPECT_SIZES order, then the sizes of unlisted shapes by width and height."""
|
||||
w, h = (int(v) for v in size.split('x'))
|
||||
return (ASPECT_SIZES.index(size), 0, 0) if size in ASPECT_SIZES else (len(ASPECT_SIZES), w, h)
|
||||
|
||||
|
||||
def default_size(w, h):
|
||||
@@ -199,8 +213,10 @@ def wanted(dest, screens=None):
|
||||
text = ''
|
||||
sizes = set()
|
||||
for w, h in screens:
|
||||
# A display of an unlisted shape keeps the 1920x1080 default (cfg.c screen_default): no folder for it unless
|
||||
# output_res asks for its size.
|
||||
w, h = max(w, h), min(w, h)
|
||||
sizes.add(shape_size(w, h))
|
||||
sizes.add(shape_size(w, h, listed=True))
|
||||
d = default_size(w, h)
|
||||
if d:
|
||||
sizes.add(shape_size(*(int(v) for v in d.split('x'))))
|
||||
@@ -208,4 +224,4 @@ def wanted(dest, screens=None):
|
||||
if m:
|
||||
sizes.add(shape_size(int(m.group(1)), int(m.group(2))))
|
||||
sizes.discard(None)
|
||||
return sorted(sizes, key=ASPECT_SIZES.index), prompts_style(text)
|
||||
return sorted(sizes, key=size_order), prompts_style(text)
|
||||
+20
-6
@@ -66,7 +66,7 @@ static const char *const known[] = {
|
||||
"SHADER_MEMO", "SHADOW", "SHADOW_DEFER", "SHADOW_RANGE", "SHADOW_RES", "SHADOW_SCALE", "SHADOW_SNAP", "SHARED_FONTS", "SHARPNESS", "SHOTS", "SHOTS_DIR", "SHUTTER_FIX",
|
||||
"SHOTS_FULL", "SKIP_CS", "SPEED_PROBE", "SPIN", "SPIN_HANDOFF_US", "SPLIT_DRAWS", "SPLIT_US", "STICK_DEADZONE", "STICK_SENS",
|
||||
"SWKBD_ANSWER", "SYNC_AHEAD",
|
||||
"SWKBD_TEST", "TEST_OOM", "TEST_PAD", "TEST_PAD_RUMBLE_MS", "TEST_PREPARE_SHADERS", "TEX_ALIAS", "TEX_BLOCK_MIB", "TEX_HEAP_EXTRA_MB", "TEX_MEMO", "TEX_RELEASED_MIB", "TEX_VRAM_PRESSURE", "TIMER_1MS", "TRACE", "TXD_TRANSPOSE", "UBO_SNAPSHOT", "UB_OVERLAY", "UB_OVERLAY_OUT", "UPSCALER", "VB_USED", "VK_DYN_A2C", "VK_DYN_VERTEX", "VK_NO_FLOAT64", "VK_NO_HOST_IMPORT",
|
||||
"SWKBD_TEST", "TEST_OOM", "TEST_PAD", "TEST_PAD_RUMBLE_MS", "TEST_PREPARE_SHADERS", "TEX_ALIAS", "TEX_BLOCK_MIB", "TEX_HEAP_EXTRA_MB", "TEX_MEMO", "TEX_RELEASED_MIB", "TEX_VRAM_PRESSURE", "TIMER_1MS", "TRACE", "TXD_TRANSPOSE", "UBO_SNAPSHOT", "UB_OVERLAY", "UB_OVERLAY_OUT", "UPSCALER", "VB_USED", "VERT_PLUS", "VK_DYN_A2C", "VK_DYN_VERTEX", "VK_NO_FLOAT64", "VK_NO_HOST_IMPORT",
|
||||
"VK_PRESENT", "VK_RECORDER", "VK_SSBO_ALIGN", "VK_SUBGROUP", "VK_SUBGROUP_PIN", "VK_VALIDATION", "VMA_BLOCK_MIB", "VOLUME", "VOLUME_MASK_BIAS", "VOLUME_MUSIC", "VOLUME_SFX", "VOLUME_VOICE", "VRAM_HEADROOM", "VRAM_LIMIT_MIB", "VS_OUTS",
|
||||
"WALK_KEY", "WALK_SCALE", "WB_EAGER", "WB_EXACT", "WB_FENCE_LIMIT", "WB_MERGE", "WINDOW_SIZE", "XLATE", "XLATE_ID", "XLATE_KEEP", "XLATE_PROCS",
|
||||
"ZSTD_CHECK", "ZSTD_NATIVE",
|
||||
@@ -81,7 +81,7 @@ static const struct { const char *key, *section; } sections[] = {
|
||||
{"FULLSCREEN", "display"}, {"WINDOW_SIZE", "display"}, {"PERF_OVERLAY", "display"}, {"VK_PRESENT", "display"},
|
||||
{"GPU_INDEX", "display"}, {"OUTPUT_RES", "display"}, {"RENDER_SCALE", "display"}, {"UPSCALER", "display"},
|
||||
{"HUD_WIDTH", "display"},
|
||||
{"SHARPNESS", "display"}, {"DYNAMIC_RES", "display"}, {"ASPECT", "display"}, {"MOVIE_ASPECT", "display"}, {"FOV", "display"}, {"ANISO", "display"},
|
||||
{"SHARPNESS", "display"}, {"DYNAMIC_RES", "display"}, {"ASPECT", "display"}, {"MOVIE_ASPECT", "display"}, {"FOV", "display"}, {"VERT_PLUS", "display"}, {"ANISO", "display"},
|
||||
{"LOD_STEADY", "display"}, {"COLOR_PRESET", "display"},
|
||||
{"COLOR_BRIGHTNESS", "display"}, {"COLOR_CONTRAST", "display"}, {"COLOR_SATURATION", "display"},
|
||||
{"COLOR_GAMMA", "display"}, {"HDR", "display"}, {"HDR_PEAK_NITS", "display"}, {"HDR_GAME_NITS", "display"},
|
||||
@@ -149,6 +149,7 @@ static const CfgMeta metas[] = {
|
||||
{"DLSS_CHAR_MASK", "65", "0|35|65|100", LIVE}, {"REFLEX", "off", "off|auto|on|boost", RESTART}, {"FXAA", "1", "0|1", LIVE},
|
||||
{"LOD_STEADY", "0", "0|1", RESTART}, // sets steady
|
||||
{"ASPECT", "fit", "fit|stretch", LIVE}, {"MOVIE_ASPECT", "keep", "keep|stretch", LIVE}, {"FOV", "100", "70..140", LIVE},
|
||||
{"VERT_PLUS", "0", "0|1", LIVE}, // resolution.c res_fov_live
|
||||
{"ANISO", "game", "game|2|4|8|16", RESTART}, // vk_texture.c sampler_features
|
||||
// colour adjustment (vk_color.c); the preset is the menu's, the four values are what the present uses
|
||||
{"COLOR_PRESET", "default", "default|vivid|clarity|custom", LIVE}, {"COLOR_BRIGHTNESS", "0", "-30..30", LIVE},
|
||||
@@ -408,15 +409,24 @@ static const char *raw_get(const char *name) {
|
||||
// the Switch ones.
|
||||
static const unsigned SHAPED[][2] = {
|
||||
{2560, 1080}, {3440, 1440}, {3840, 1600}, {5120, 2160}, // 21:9
|
||||
{3840, 1080}, {5120, 1440}, // 32:9
|
||||
{3840, 1080}, {5120, 1440}, {7680, 2160}, // 32:9
|
||||
{1280, 800}, {1680, 1050}, {1920, 1200}, {2560, 1600}, // 16:10
|
||||
{1920, 1280}, {2160, 1440}, {2256, 1504}, {2880, 1920}, {3000, 2000}, // 3:2
|
||||
{1440, 1080}, {1600, 1200}, {2048, 1536}, {2732, 2048}, // 4:3 (CRT monitors, iPads)
|
||||
{2340, 1080}, {3120, 1440}, {2400, 1080}, {3200, 1440}, // 19.5:9 and 20:9 (phones, streamed)
|
||||
};
|
||||
|
||||
// The shapes a UI layout can be made for (tools/ultrawide_layout.py works on any aspect ratio between these): from 4:3
|
||||
// to 32:9, 1% either side. A shape between them that SHAPED does not list takes a folder of its own exact size.
|
||||
#define SHAPE_MIN (4.0 / 3.0 * 0.99)
|
||||
#define SHAPE_MAX (32.0 / 9.0 * 1.01)
|
||||
|
||||
// The folder size of w x h's shape: of SHAPED within 1% of its aspect ratio, the closest, the first of equal ones
|
||||
// (5120x2160 takes 2560x1080). The UI layout depends on the aspect ratio alone (tools/ultrawide_layout.py apply), so
|
||||
// the setup writes one romfs-patches-<w>x<h> per shape, named after this size (installer/screens.py shape_size, the
|
||||
// same rule), and romfs.c overlay_init looks for it. 0 for 16:9 and for a shape without a layout.
|
||||
// same rule), and romfs.c overlay_init looks for it. A shape SHAPED does not list but within SHAPE_MIN..SHAPE_MAX (a
|
||||
// phone's 13:6 screen streamed to, say) is its own folder, w x h itself, which the setup and the game's background
|
||||
// generator make as they make the listed ones. 0 for 16:9 and outside that range (portrait screens).
|
||||
int cfg_shape_size(unsigned w, unsigned h, unsigned out[2]) {
|
||||
if (!w || !h) return 0;
|
||||
double r = (double)w / h, err = 0;
|
||||
@@ -426,8 +436,12 @@ int cfg_shape_size(unsigned w, unsigned h, unsigned out[2]) {
|
||||
double e = fabs((double)SHAPED[i][0] / SHAPED[i][1] / r - 1);
|
||||
if (e <= 0.01 && (best < 0 || e < err)) best = i, err = e;
|
||||
}
|
||||
if (best < 0) return 0;
|
||||
out[0] = SHAPED[best][0], out[1] = SHAPED[best][1];
|
||||
if (best >= 0) {
|
||||
out[0] = SHAPED[best][0], out[1] = SHAPED[best][1];
|
||||
return 1;
|
||||
}
|
||||
if (r < SHAPE_MIN || r > SHAPE_MAX) return 0;
|
||||
out[0] = w, out[1] = h;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -23,8 +23,9 @@ unsigned cfg_version(void);
|
||||
int cfg_from_env(const char *name);
|
||||
// 1 when the player set name (the environment or totk.ini), 0 when cfg_get gives a device profile's default or NULL.
|
||||
int cfg_is_set(const char *name);
|
||||
// The folder size of w x h's shape (cfg.c SHAPED: the closest aspect ratio within 1%, the first of equal ones), the
|
||||
// one romfs-patches-<w>x<h> the setup writes for it. 0 for 16:9 and for a shape without a UI layout.
|
||||
// The folder size of w x h's shape (cfg.c SHAPED: the closest aspect ratio within 1%, the first of equal ones; an
|
||||
// unlisted shape from 4:3 to 32:9 keeps w x h), the one romfs-patches-<w>x<h> the setup writes for it. 0 for 16:9 and
|
||||
// for a shape without a UI layout (portrait, narrower than 4:3, wider than 32:9).
|
||||
int cfg_shape_size(unsigned w, unsigned h, unsigned out[2]);
|
||||
// The size output_res defaults to on this display (its shape, cfg.c screen_default) while the player set no
|
||||
// output_res, also when the default stays 1920x1080 because that shape lacks the prompts' folder. The generator the game
|
||||
|
||||
+15
-4
@@ -146,6 +146,8 @@ int probe_cfg(void) {
|
||||
CHECK(m && EQ(m->def, "130") && EQ(m->values, "0..300"), "meta: rumble strength 130 in 0..300");
|
||||
m = cfg_meta("PERF_OVERLAY");
|
||||
CHECK(m && EQ(m->def, "off") && EQ(m->values, "off|fps|full") && m->live, "meta: perf_overlay is live, off by default");
|
||||
m = cfg_meta("VERT_PLUS");
|
||||
CHECK(m && EQ(m->def, "0") && m->live, "meta: vert_plus is live, off by default");
|
||||
CHECK(cfg_meta("BIND_A") == NULL && cfg_meta("FPS_COUNTER") == NULL && cfg_meta("NO_SUCH") == NULL,
|
||||
"meta: keys the menu does not show are NULL");
|
||||
|
||||
@@ -363,16 +365,25 @@ int probe_cfg(void) {
|
||||
"prompts: the PlayStation folder puts A on the circle exactly when the layout puts A on the east button");
|
||||
}
|
||||
// One folder per screen shape (cfg.c cfg_shape_size, installer/screens.py shape_size): the closest aspect ratio of
|
||||
// SHAPED within 1%, the first of equal ones; 16:9 and unlisted shapes have none.
|
||||
// SHAPED within 1%, the first of equal ones; an unlisted shape from 4:3 to 32:9 its own size; 16:9, portrait and
|
||||
// shapes narrower than 4:3 none.
|
||||
unsigned sz[2] = {0, 0};
|
||||
CHECK(cfg_shape_size(5120, 2160, sz) && sz[0] == 2560 && sz[1] == 1080, "shape: 5120x2160 takes 2560x1080's folder");
|
||||
CHECK(cfg_shape_size(3440, 1440, sz) && sz[0] == 3440 && sz[1] == 1440, "shape: 3440x1440 keeps its own (0.8% off 2560x1080)");
|
||||
CHECK(cfg_shape_size(1920, 800, sz) && sz[0] == 3840 && sz[1] == 1600, "shape: 1920x800 takes 3840x1600's folder");
|
||||
CHECK(cfg_shape_size(2560, 1600, sz) && sz[0] == 1280 && sz[1] == 800 && cfg_shape_size(3000, 2000, sz) &&
|
||||
sz[0] == 1920 && sz[1] == 1280 && cfg_shape_size(5120, 1440, sz) && sz[0] == 3840 && sz[1] == 1080,
|
||||
sz[0] == 1920 && sz[1] == 1280 && cfg_shape_size(5120, 1440, sz) && sz[0] == 3840 && sz[1] == 1080 &&
|
||||
cfg_shape_size(7680, 2160, sz) && sz[0] == 3840 && sz[1] == 1080,
|
||||
"shape: 16:10, 3:2 and 32:9 take their first size");
|
||||
CHECK(!cfg_shape_size(1920, 1080, sz) && !cfg_shape_size(2560, 1440, sz) && !cfg_shape_size(1024, 768, sz),
|
||||
"shape: none for 16:9 and 4:3");
|
||||
CHECK(cfg_shape_size(1024, 768, sz) && sz[0] == 1440 && sz[1] == 1080 && cfg_shape_size(2048, 1536, sz) &&
|
||||
sz[0] == 1440 && sz[1] == 1080 && cfg_shape_size(3120, 1440, sz) && sz[0] == 2340 && sz[1] == 1080,
|
||||
"shape: 4:3 and 19.5:9 take their first size");
|
||||
CHECK(cfg_shape_size(2560, 1200, sz) && sz[0] == 2560 && sz[1] == 1200 && cfg_shape_size(2000, 1080, sz) &&
|
||||
sz[0] == 2000 && sz[1] == 1080,
|
||||
"shape: an unlisted shape between 4:3 and 32:9 keeps its own size");
|
||||
CHECK(!cfg_shape_size(1920, 1080, sz) && !cfg_shape_size(2560, 1440, sz) && !cfg_shape_size(1280, 1024, sz) &&
|
||||
!cfg_shape_size(1080, 1920, sz) && !cfg_shape_size(7680, 1440, sz),
|
||||
"shape: none for 16:9, narrower than 4:3, portrait and wider than 32:9");
|
||||
// romfs.c shaped_name: the exact size's folder (an older setup wrote every size) wins, else the shape's
|
||||
{
|
||||
char dir[1100], f[1200];
|
||||
|
||||
+34
-9
@@ -44,6 +44,8 @@
|
||||
#include "ov.h"
|
||||
#include "platform/platform.h"
|
||||
|
||||
static void vert_plus_init(double ratio_over_16x9);
|
||||
|
||||
#define BASE_W 1920
|
||||
#define BASE_H 1080
|
||||
#define SCENE_W 1600
|
||||
@@ -643,6 +645,7 @@ void res_init(void) {
|
||||
memcpy(page + 56, &r, sizeof r);
|
||||
rt_patch_switch(aspect, 1);
|
||||
rt_log("resolution: camera aspect ratio %.4f (16:9 is %.4f)", ratio, game);
|
||||
if (ratio < game) vert_plus_init(ratio / game);
|
||||
}
|
||||
} else {
|
||||
rt_patch_switch(aspect, 0); // the page holds no ratio
|
||||
@@ -673,25 +676,47 @@ int res_wants_wide_overlay(const unsigned out[2]) {
|
||||
|
||||
// Field of view (TOTK_FOV, percent of the game's own, 70..140, live): the camera's vertical view angle times the factor
|
||||
// on page +60 (recomp/patches-v110.txt, patches-v121.txt and patches-v143.txt, set fov). The horizontal angle follows
|
||||
// through the aspect ratio. 100 switches the set off, so the camera code is the game's own. Runs on a settings change
|
||||
// (gfx_present.c window_settings_live), the first time at the first present.
|
||||
// through the aspect ratio. A factor of 1 switches the set off, so the camera code is the game's own. Runs on a settings
|
||||
// change (gfx_present.c window_settings_live), the first time at the first present.
|
||||
//
|
||||
// Vert+ (TOTK_VERT_PLUS, off by default; the Display tab's row under the field of view): the camera keeps the game's vertical view angle at every shape, so a shape
|
||||
// narrower than 16:9 (16:10, 3:2, 4:3) showed less of the world at the sides than 16:9 does. The factor is then also
|
||||
// multiplied by the one that gives the game's default view the horizontal angle it has at 16:9: tan(v'/2) = tan(v/2)
|
||||
// * (16/9) / aspect, so v' / v = 2 atan(tan(v/2) k) / v with k = 16:9 over the aspect. v is the game's default
|
||||
// vertical angle, 51.2 degrees, measured on 1.4.3 at Lookout Landing: a 4:3 frame at TOTK_FOV=130 is a 16:9 frame of
|
||||
// the same moment scaled by 0.730 about its middle (tan(v/2) / tan(1.3 v/2) = 0.730 gives v = 51.2). The patch scales
|
||||
// the angle linearly, so a zoomed view (the bow, the scope) gets the same factor, a few percent short of the exact one.
|
||||
#define FOV_MIN 70
|
||||
#define FOV_MAX 140
|
||||
#define VERT_PLUS_V (51.2 * 3.14159265358979 / 180)
|
||||
static float vert_plus_k = 1; // set by res_init (vert_plus_init) for a camera narrower than 16:9
|
||||
|
||||
static void vert_plus_init(double ratio_over_16x9) {
|
||||
double k = 1 / ratio_over_16x9, v = VERT_PLUS_V;
|
||||
vert_plus_k = (float)(2 * atan(tan(v / 2) * k) / v);
|
||||
}
|
||||
|
||||
void res_fov_live(void) {
|
||||
static int set = -2, shown = 100;
|
||||
static int set = -2, shown = 100, shown_vp = 0; // the game's own view: nothing to write until one changes
|
||||
if (set == -2) set = rt_patch_set("fov");
|
||||
int pct = cfg_int("TOTK_FOV");
|
||||
pct = pct < FOV_MIN ? FOV_MIN : pct > FOV_MAX ? FOV_MAX : pct;
|
||||
if (pct == shown) return;
|
||||
shown = pct;
|
||||
int vp = vert_plus_k != 1 && cfg_bool("TOTK_VERT_PLUS");
|
||||
if (pct == shown && vp == shown_vp) return;
|
||||
shown = pct, shown_vp = vp;
|
||||
if (set < 0) {
|
||||
rt_log("resolution: this game version has no field-of-view patch; TOTK_FOV=%d does nothing", pct);
|
||||
if (pct != 100 || vp)
|
||||
rt_log("resolution: this game version has no field-of-view patch; TOTK_FOV=%d and Vert+ do nothing", pct);
|
||||
return;
|
||||
}
|
||||
float k = pct / 100.0f;
|
||||
float k = pct / 100.0f * (vp ? vert_plus_k : 1);
|
||||
memcpy((uint8_t *)rt_patch_page() + 60, &k, sizeof k); // before the switch: a site that sees it on reads k
|
||||
rt_patch_switch(set, pct != 100);
|
||||
rt_log("resolution: field of view %d%% of the game's", pct);
|
||||
rt_patch_switch(set, k != 1);
|
||||
if (vp)
|
||||
rt_log("resolution: field of view %d%% of the game's, times %.4f for Vert+ (the 16:9 width at this narrower "
|
||||
"shape)", pct, vert_plus_k);
|
||||
else
|
||||
rt_log("resolution: field of view %d%% of the game's", pct);
|
||||
}
|
||||
|
||||
// TOTK_DYNAMIC_RES = 0 holds the game's dynamic resolution at 100 % (patches-v110.txt, patches-v121.txt and patches-v143.txt,
|
||||
|
||||
+10
-6
@@ -571,15 +571,18 @@ static void folders_retry(const char *id, int need) {
|
||||
}
|
||||
|
||||
// The game resolution (resolution.c): 16:9 sizes from its smallest, 1280x720 (for weak GPUs), up, the common 21:9 and
|
||||
// 32:9 monitor sizes, the 16:10 screens of the Steam Deck, handhelds and laptops and the 3:2 screens of laptops and
|
||||
// tablets (Surface, Framework; the camera and the HUD follow
|
||||
// another shape, resolution.c res_init; the installer lays the HUD out for each, installer/steps.py ASPECT_SIZES), and
|
||||
// the current value when it is another size.
|
||||
// 32:9 monitor sizes (7680x2160: the 57-inch dual-4K ones), the 16:10 screens of the Steam Deck, handhelds and laptops, the 3:2 screens of laptops and
|
||||
// tablets (Surface, Framework), the 4:3 screens of CRT monitors and iPads and the 19.5:9 and 20:9 screens of phones a
|
||||
// game is streamed to (the camera and the HUD follow another shape, resolution.c res_init; the installer lays the HUD
|
||||
// out for each, installer/screens.py ASPECT_SIZES), and the current value when it is another size: any shape from 4:3
|
||||
// to 32:9 gets a layout of its own (cfg.c cfg_shape_size).
|
||||
static void row_output_res(void) {
|
||||
static const char *const vals[] = {"1280x720", "1600x900", "1920x1080", "2560x1440", "3200x1800", "3840x2160",
|
||||
"2560x1080", "3440x1440", "3840x1600", "5120x2160", "3840x1080", "5120x1440",
|
||||
"2560x1080", "3440x1440", "3840x1600", "5120x2160", "3840x1080", "5120x1440", "7680x2160",
|
||||
"1280x800", "1680x1050", "1920x1200", "2560x1600",
|
||||
"1920x1280", "2160x1440", "2256x1504", "2880x1920", "3000x2000"};
|
||||
"1920x1280", "2160x1440", "2256x1504", "2880x1920", "3000x2000",
|
||||
"1440x1080", "1600x1200", "2048x1536", "2732x2048",
|
||||
"2340x1080", "3120x1440", "2400x1080", "3200x1440"};
|
||||
enum { N = sizeof vals / sizeof *vals };
|
||||
char shown[N][32];
|
||||
const char *names[N];
|
||||
@@ -822,6 +825,7 @@ static void tab_screen(float scale) {
|
||||
static const UiTextId movie_aspect[] = {UI_MENU_MOVIE_ASPECT_KEEP, UI_MENU_MOVIE_ASPECT_STRETCH};
|
||||
opt_choice("TOTK_MOVIE_ASPECT", UI_MENU_MOVIE_ASPECT, movie_aspect, 2, UI_MENU_MOVIE_ASPECT_DESC);
|
||||
opt_slider("TOTK_FOV", UI_MENU_FOV, 70, 140, UI_MENU_FOV_DESC, 5, "%.0f %%");
|
||||
opt_toggle("TOTK_VERT_PLUS", UI_MENU_VERT_PLUS, UI_MENU_VERT_PLUS_DESC);
|
||||
static const char *const aniso[] = {"game", "2", "4", "8", "16"};
|
||||
const char *aniso_names[] = {menu_text(UI_MENU_ANISO_GAME), "2x", "4x", "8x", "16x"};
|
||||
opt_choice_list("TOTK_ANISO", UI_MENU_ANISO, aniso, aniso_names, 5, UI_MENU_ANISO_DESC);
|
||||
|
||||
@@ -101,6 +101,8 @@ static const char *const text_en[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_MOVIE_ASPECT_KEEP] = "Black bars", [UI_MENU_MOVIE_ASPECT_STRETCH] = "Stretch",
|
||||
[UI_MENU_FOV] = "Field of view",
|
||||
[UI_MENU_FOV_DESC] = "How much of the world the camera shows, in percent of the game's own. Game versions 1.1.0, 1.2.1 and 1.4.3.",
|
||||
[UI_MENU_VERT_PLUS] = "Keep the 16:9 width",
|
||||
[UI_MENU_VERT_PLUS_DESC] = "On screens narrower than 16:9 (Steam Deck, 16:10, 4:3) the camera shows the same width of the world as at 16:9, and more above and below. No effect at 16:9 or wider.",
|
||||
[UI_MENU_SHADOW_RES] = "Shadow map size",
|
||||
[UI_MENU_SHADOW_RES_DESC] = "Size of the sun's shadow map. The game's own size changes with the view, down to about 400 "
|
||||
"near the ground, so leaf shadows look blocky and jump; a fixed size keeps them still and "
|
||||
@@ -750,6 +752,8 @@ static const char *const text_ru[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_MOVIE_ASPECT_KEEP] = "Чёрные полосы", [UI_MENU_MOVIE_ASPECT_STRETCH] = "Растянуть",
|
||||
[UI_MENU_FOV] = "Поле зрения",
|
||||
[UI_MENU_FOV_DESC] = "Сколько мира показывает камера, в процентах от игрового. Для версий игры 1.1.0, 1.2.1 и 1.4.3.",
|
||||
[UI_MENU_VERT_PLUS] = "Ширина обзора как в 16:9",
|
||||
[UI_MENU_VERT_PLUS_DESC] = "На экранах уже 16:9 (Steam Deck, 16:10, 4:3) камера показывает мир той же ширины, что и в 16:9, и больше сверху и снизу. На 16:9 и шире ничего не меняет.",
|
||||
[UI_MENU_SHADOW_RES] = "Размер карты теней",
|
||||
[UI_MENU_SHADOW_RES_DESC] = "Размер карты теней от солнца. Собственный размер игры меняется вместе с видом, у земли до "
|
||||
"примерно 400, поэтому тени листвы выглядят квадратными и дёргаются; постоянный размер делает "
|
||||
@@ -1749,6 +1753,8 @@ static const char *const text_pt_br[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_FOV] = "Campo de visão",
|
||||
[UI_MENU_FOV_DESC] = "Quanto do mundo a câmera mostra, em porcentagem do original do jogo. Nas versões 1.1.0, 1.2.1 e 1.4.3 "
|
||||
"do jogo.",
|
||||
[UI_MENU_VERT_PLUS] = "Manter a largura de 16:9",
|
||||
[UI_MENU_VERT_PLUS_DESC] = "Em telas mais estreitas que 16:9 (Steam Deck, 16:10, 4:3), a câmera mostra a mesma largura do mundo que em 16:9, e mais acima e abaixo. Sem efeito em 16:9 ou mais largo.",
|
||||
[UI_MENU_SHADOW_RES] = "Tamanho do mapa de sombras",
|
||||
[UI_MENU_SHADOW_RES_DESC] = "Tamanho do mapa de sombras do sol. O tamanho do jogo muda com a vista, até cerca de "
|
||||
"400 perto do chão, então as sombras das folhas ficam quadriculadas e pulam; um "
|
||||
@@ -2149,6 +2155,8 @@ static const char *const text_zh_hans[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_FOV] = "视野",
|
||||
[UI_MENU_FOV_DESC] = "镜头能看到多大范围,以游戏自身视野的百分比表示。"
|
||||
"支持游戏版本 1.1.0、1.2.1 和 1.4.3。",
|
||||
[UI_MENU_VERT_PLUS] = "保持 16:9 宽度",
|
||||
[UI_MENU_VERT_PLUS_DESC] = "在比 16:9 更窄的屏幕上(Steam Deck、16:10、4:3),镜头显示与 16:9 相同宽度的世界,上下显示更多。16:9 或更宽的屏幕没有变化。",
|
||||
[UI_MENU_SHARPNESS] = "FSR 锐度",
|
||||
[UI_MENU_SHARPNESS_DESC] = "FSR 缩放后的锐化强度;0 为关闭。",
|
||||
[UI_MENU_COLOR] = "色彩",
|
||||
@@ -2861,6 +2869,8 @@ static const char *const text_de[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_MOVIE_ASPECT_STRETCH] = "Strecken",
|
||||
[UI_MENU_FOV] = "Sichtfeld",
|
||||
[UI_MENU_FOV_DESC] = "Wie viel von der Welt die Kamera zeigt, in Prozent des Spielwerts. Nur Spielversion 1.4.3.",
|
||||
[UI_MENU_VERT_PLUS] = "16:9-Breite behalten",
|
||||
[UI_MENU_VERT_PLUS_DESC] = "Auf Bildschirmen, die schmaler als 16:9 sind (Steam Deck, 16:10, 4:3), zeigt die Kamera dieselbe Breite der Welt wie bei 16:9 und mehr darüber und darunter. Bei 16:9 oder breiter ohne Wirkung.",
|
||||
[UI_MENU_SHADOW_RES] = "Größe der Schattenkarte",
|
||||
[UI_MENU_SHADOW_RES_DESC] = "Größe der Schattenkarte der Sonne. Die Größe des Spiels ändert sich mit der Ansicht, "
|
||||
"bis etwa 400 nahe am Boden, daher wirken Blätterschatten klotzig und springen; eine "
|
||||
@@ -3766,6 +3776,8 @@ static const char *const text_fr[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_FOV] = "Champ de vision",
|
||||
[UI_MENU_FOV_DESC] = "La part du monde que montre la caméra, en pourcentage de celle du jeu. Version 1.4.3 du jeu "
|
||||
"uniquement.",
|
||||
[UI_MENU_VERT_PLUS] = "Garder la largeur 16:9",
|
||||
[UI_MENU_VERT_PLUS_DESC] = "Sur les écrans plus étroits que 16:9 (Steam Deck, 16:10, 4:3), la caméra montre la même largeur du monde qu'en 16:9, et davantage au-dessus et en dessous. Sans effet en 16:9 ou plus large.",
|
||||
[UI_MENU_SHADOW_RES] = "Taille de la carte d'ombres",
|
||||
[UI_MENU_SHADOW_RES_DESC] = "Taille de la carte d'ombres du soleil. La taille du jeu change avec la vue, jusqu'à "
|
||||
"environ 400 près du sol, si bien que les ombres des feuilles paraissent pixelisées "
|
||||
@@ -4692,6 +4704,8 @@ static const char *const text_es[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_FOV] = "Campo de visión",
|
||||
[UI_MENU_FOV_DESC] = "Cuánto del mundo muestra la cámara, en porcentaje del propio del juego. Solo la versión "
|
||||
"1.4.3 del juego.",
|
||||
[UI_MENU_VERT_PLUS] = "Mantener el ancho de 16:9",
|
||||
[UI_MENU_VERT_PLUS_DESC] = "En pantallas más estrechas que 16:9 (Steam Deck, 16:10, 4:3), la cámara muestra el mismo ancho del mundo que en 16:9, y más por arriba y por abajo. Sin efecto en 16:9 o más ancho.",
|
||||
[UI_MENU_SHADOW_RES] = "Tamaño del mapa de sombras",
|
||||
[UI_MENU_SHADOW_RES_DESC] = "Tamaño del mapa de sombras del sol. El tamaño del juego cambia con la vista, hasta "
|
||||
"unos 400 cerca del suelo, por lo que las sombras de las hojas se ven pixeladas y "
|
||||
@@ -5603,6 +5617,8 @@ static const char *const text_it[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_FOV] = "Campo visivo",
|
||||
[UI_MENU_FOV_DESC] = "Quanta parte del mondo mostra la telecamera, in percentuale di quella del gioco. Solo "
|
||||
"versione 1.4.3 del gioco.",
|
||||
[UI_MENU_VERT_PLUS] = "Mantieni la larghezza 16:9",
|
||||
[UI_MENU_VERT_PLUS_DESC] = "Sugli schermi più stretti di 16:9 (Steam Deck, 16:10, 4:3) la telecamera mostra la stessa larghezza del mondo che in 16:9, e di più sopra e sotto. Nessun effetto a 16:9 o più largo.",
|
||||
[UI_MENU_SHADOW_RES] = "Dimensione della mappa delle ombre",
|
||||
[UI_MENU_SHADOW_RES_DESC] = "Dimensione della mappa delle ombre del sole. Quella del gioco cambia con la visuale, "
|
||||
"fino a circa 400 vicino al suolo, quindi le ombre delle foglie sembrano squadrate e "
|
||||
@@ -6515,6 +6531,8 @@ static const char *const text_nl[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_FOV] = "Gezichtsveld",
|
||||
[UI_MENU_FOV_DESC] = "Hoeveel van de wereld de camera toont, in procenten van dat van het spel. Alleen spelversie "
|
||||
"1.4.3.",
|
||||
[UI_MENU_VERT_PLUS] = "16:9-breedte behouden",
|
||||
[UI_MENU_VERT_PLUS_DESC] = "Op schermen die smaller zijn dan 16:9 (Steam Deck, 16:10, 4:3) toont de camera dezelfde breedte van de wereld als bij 16:9, en meer erboven en eronder. Geen effect bij 16:9 of breder.",
|
||||
[UI_MENU_SHADOW_RES] = "Grootte van de schaduwkaart",
|
||||
[UI_MENU_SHADOW_RES_DESC] = "Grootte van de schaduwkaart van de zon. De grootte van het spel verandert met het "
|
||||
"zicht, tot ongeveer 400 dicht bij de grond, waardoor bladschaduwen blokkerig ogen en "
|
||||
@@ -7397,6 +7415,8 @@ static const char *const text_ja[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_MOVIE_ASPECT_STRETCH] = "引き伸ばし",
|
||||
[UI_MENU_FOV] = "視野角",
|
||||
[UI_MENU_FOV_DESC] = "カメラが映す範囲を、ゲーム本来の視野に対するパーセントで指定します。ゲームのバージョン 1.4.3 のみ。",
|
||||
[UI_MENU_VERT_PLUS] = "16:9 の横幅を保つ",
|
||||
[UI_MENU_VERT_PLUS_DESC] = "16:9 より横幅の狭い画面(Steam Deck、16:10、4:3)で、カメラが 16:9 と同じ横幅の世界を映し、上下はより広く映します。16:9 以上の横長の画面では変わりません。",
|
||||
[UI_MENU_SHADOW_RES] = "シャドウマップのサイズ",
|
||||
[UI_MENU_SHADOW_RES_DESC] = "太陽のシャドウマップの大きさです。ゲーム本来のサイズは視点によって変わり、地面近くでは約 400 まで下がるため、葉の影がブロック状になって跳ねます。固定サイ"
|
||||
"ズにすると影が安定し、くっきりします。1024 を超えると GPU 時間とビデオメモリが増えます。",
|
||||
@@ -8147,6 +8167,8 @@ static const char *const text_ko[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_MOVIE_ASPECT_STRETCH] = "늘리기",
|
||||
[UI_MENU_FOV] = "시야각",
|
||||
[UI_MENU_FOV_DESC] = "카메라가 보여 주는 범위를 게임 원래 시야에 대한 퍼센트로 지정합니다. 게임 버전 1.4.3 전용입니다.",
|
||||
[UI_MENU_VERT_PLUS] = "16:9 너비 유지",
|
||||
[UI_MENU_VERT_PLUS_DESC] = "16:9보다 좁은 화면(Steam Deck, 16:10, 4:3)에서 카메라가 16:9와 같은 너비의 세계를 보여 주고 위아래는 더 많이 보여 줍니다. 16:9 이상 넓은 화면에서는 효과가 없습니다.",
|
||||
[UI_MENU_SHADOW_RES] = "그림자 맵 크기",
|
||||
[UI_MENU_SHADOW_RES_DESC] = "태양 그림자 맵의 크기입니다. 게임 원래 크기는 시점에 따라 바뀌며 지면 가까이에서는 약 400까지 내려가서 나뭇잎 그림자가 각지고 튀게 됩니다. 고정 "
|
||||
"크기로 하면 그림자가 안정되고 선명해집니다. 1024를 넘으면 GPU 시간과 비디오 메모리가 늘어납니다.",
|
||||
@@ -8883,6 +8905,8 @@ static const char *const text_vi[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_MOVIE_ASPECT_KEEP] = "Dải đen", [UI_MENU_MOVIE_ASPECT_STRETCH] = "Kéo giãn",
|
||||
[UI_MENU_FOV] = "Góc nhìn",
|
||||
[UI_MENU_FOV_DESC] = "Camera cho thấy bao nhiêu thế giới, tính theo phần trăm của game gốc. Game phiên bản 1.1.0, 1.2.1 và 1.4.3.",
|
||||
[UI_MENU_VERT_PLUS] = "Giữ bề ngang 16:9",
|
||||
[UI_MENU_VERT_PLUS_DESC] = "Trên màn hình hẹp hơn 16:9 (Steam Deck, 16:10, 4:3), camera cho thấy thế giới rộng ngang như ở 16:9, và nhiều hơn ở phía trên và dưới. Không có tác dụng ở 16:9 hoặc rộng hơn.",
|
||||
[UI_MENU_SHADOW_RES] = "Kích thước bản đồ bóng",
|
||||
[UI_MENU_SHADOW_RES_DESC] = "Kích thước bản đồ bóng của mặt trời. Kích thước của game đổi theo tầm nhìn, xuống còn khoảng "
|
||||
"400 khi gần mặt đất, nên bóng lá trông bị vỡ ô và nhảy; kích thước cố định giữ chúng đứng "
|
||||
|
||||
@@ -45,6 +45,7 @@ typedef enum {
|
||||
UI_MENU_ASPECT, UI_MENU_ASPECT_DESC, UI_MENU_ASPECT_FIT, UI_MENU_ASPECT_STRETCH,
|
||||
UI_MENU_MOVIE_ASPECT, UI_MENU_MOVIE_ASPECT_DESC, UI_MENU_MOVIE_ASPECT_KEEP, UI_MENU_MOVIE_ASPECT_STRETCH,
|
||||
UI_MENU_FOV, UI_MENU_FOV_DESC,
|
||||
UI_MENU_VERT_PLUS, UI_MENU_VERT_PLUS_DESC,
|
||||
UI_MENU_SHADOW_RES, UI_MENU_SHADOW_RES_DESC, UI_MENU_SHADOW_RES_GAME,
|
||||
UI_MENU_ANISO, UI_MENU_ANISO_DESC, UI_MENU_ANISO_GAME,
|
||||
UI_MENU_LOD_STEADY, UI_MENU_LOD_STEADY_DESC,
|
||||
|
||||
@@ -156,6 +156,15 @@ class RealArchiveTest(unittest.TestCase):
|
||||
ui.apply(full, members, width, height)
|
||||
expected = bytearray(original)
|
||||
baseline['apply'](expected, members, width, height)
|
||||
# The map (its layout and the minimap animation's width keys), the Purah Pad's frame and the loading screen
|
||||
# changed on purpose after it (the maps fill the screen, the frame keeps its width, the camera's album window
|
||||
# has the screen's shape, the inn's clock follows the choices to the bottom edge); the rest is byte for byte.
|
||||
for member in ('blyt/AppMap_00.bflyt', 'blyt/AppMenuOverlay_00.bflyt', 'blyt/LoadingFade_00.bflyt',
|
||||
'blyt/CameraSystemWindow_00.bflyt', 'blyt/Time_00.bflyt',
|
||||
'anim/AppMap_00_MiniMap.bflan', 'anim/LoadingFade_00_BarIn.bflan',
|
||||
'anim/LoadingFade_00_BarOut.bflan'):
|
||||
lo, hi = members[member]
|
||||
expected[lo:hi] = full[lo:hi]
|
||||
self.assertEqual(full, expected)
|
||||
for cap, extension in ((16 / 9, 0), (21 / 9, 300)):
|
||||
data = bytearray(original)
|
||||
|
||||
@@ -1143,8 +1143,11 @@ class ShapesTest(unittest.TestCase):
|
||||
|
||||
def test_shape_rule(self):
|
||||
self.assertEqual([screens.shape_size(*s) for s in ((5120, 2160), (3440, 1440), (1920, 800), (2560, 1600),
|
||||
(1920, 1080), (1024, 768))],
|
||||
['2560x1080', '3440x1440', '3840x1600', '1280x800', None, None])
|
||||
(1920, 1080), (1024, 768), (3120, 1440), (2560, 1200),
|
||||
(1280, 1024), (1080, 1920), (7680, 1440), (7680, 2160))],
|
||||
['2560x1080', '3440x1440', '3840x1600', '1280x800', None, '1440x1080', '2340x1080',
|
||||
'2560x1200', None, None, None, '3840x1080'])
|
||||
self.assertIsNone(screens.shape_size(2560, 1200, listed=True)) # a display of an unlisted shape
|
||||
self.assertEqual(screens.default_size(3440, 1440), '2560x1080') # runtime/cfg.c screen_default
|
||||
self.assertEqual(screens.default_size(1280, 800), '1280x800')
|
||||
|
||||
@@ -1178,6 +1181,10 @@ class ShapesTest(unittest.TestCase):
|
||||
(['2560x1080', '3440x1440', '1280x800', '1920x1280'], 'pc'))
|
||||
self.assertEqual(screens.wanted(self.dest / 'none', [(2560, 1440)]), ([], None))
|
||||
|
||||
def test_wanted_unlisted_output_res_gets_its_own_size(self):
|
||||
(self.dest / 'totk.ini').write_text('output_res = 2560x1200\n')
|
||||
self.assertEqual(screens.wanted(self.dest, [(2560, 1200), (1600, 1200)]), (['1440x1080', '2560x1200'], None))
|
||||
|
||||
def test_layout_settings_keep_the_last_nonempty_value(self):
|
||||
for empty in ('', ' ', '""'):
|
||||
with self.subTest(empty=empty):
|
||||
|
||||
+113
-10
@@ -15,9 +15,10 @@ and every pane field and animation key holds the value the edit expects before i
|
||||
import math
|
||||
import struct
|
||||
|
||||
# BFLYT pane sections (pan1, pic1, txt1, ...): name at +12 (24 bytes), translate x / y at +44 / +48, scale x / y at +68 / +72.
|
||||
# BFLYT pane sections (pan1, pic1, txt1, ...): name at +12 (24 bytes), translate x / y at +44 / +48, scale x / y at +68 / +72,
|
||||
# size (width) at +76.
|
||||
PANE_MAGICS = (b'pan1', b'pic1', b'txt1', b'wnd1', b'bnd1', b'prt1', b'ali1', b'scr1')
|
||||
FIELD = {'x': 44, 'y': 48, 'scale_x': 68, 'scale_y': 72}
|
||||
FIELD = {'x': 44, 'y': 48, 'scale_x': 68, 'scale_y': 72, 'w': 76, 'h': 80}
|
||||
|
||||
# Full-screen layouts whose root pane stays as wide as the canvas.
|
||||
KEEP_ROOT = {'AppMenuBG_00', 'PauseMenuBG_00', 'ShopMenuParasailBG_00', 'ShortCutBG_00', 'TitleMenuBG_00', 'EventFade_00',
|
||||
@@ -60,6 +61,22 @@ def hud_extent(k, hud_aspect):
|
||||
inner = 1 / ((16 / 9) / hud_aspect) - 1 # 1 / kc - 1
|
||||
return 960 * inner, 960 * k * inner
|
||||
|
||||
# The loading screen's map is a capture of the world map that the game draws as the 3 x 3 tiles of 840 units around the
|
||||
# player's tile (measured with TOTK_DUMP at 3840x1080: nine 840x840 tile draws into the capture), so only 840 units
|
||||
# either side of the player are certain to hold map; wider, the capture shows black beside the tiles where the player
|
||||
# stands near a tile's edge. At 16:9 it is 1470 wide (the screen's 1920 less 450), its left edge 23 units past the
|
||||
# screen's, and the side panel (a window, so its frame keeps its proportions at any width) covers its right 237 units.
|
||||
LOADING_MAP_MAX = 1660
|
||||
|
||||
def loading_map(k):
|
||||
"""(width, shift, panel width) of the loading screen's map capture and side panel for k = 16:9 over the aspect: the
|
||||
map as wide as the screen allows up to LOADING_MAP_MAX, its left edge where 16:9 has it relative to the screen's
|
||||
edge (shift: how far its centre moves from x -248), and the panel from the map's right part to the screen's edge."""
|
||||
width = min(1920 / k - 450, max(1470, LOADING_MAP_MAX))
|
||||
centre = -960 / k - 23 + width / 2
|
||||
panel = 960 / k - (centre + width / 2 - 237)
|
||||
return width, centre + 248, panel
|
||||
|
||||
def edits(k, hud_aspect):
|
||||
"""(layout, pane, field, value) for the aspect: k = 16/9 over the aspect (the root's scale), w = how far a 1920-wide
|
||||
layout's edge moves out in its own units (960 * (1 / k - 1)). OFF moves a pane out of sight. hud_aspect: the
|
||||
@@ -71,7 +88,15 @@ def edits(k, hud_aspect):
|
||||
out = [
|
||||
('AppAlbum_00', 'N_FadeInOut_00', 'scale_x', k), ('AppAlbum_00', 'N_Open_01', 'scale_x', wide),
|
||||
*[('AppMap_00', f'N_BlurInOut_0{i}', 'scale_x', wide) for i in range(4)],
|
||||
('AppMap_00', 'N_MiniMap_00', 'x', -270 * (1 - k)),
|
||||
# With the map as wide as the screen, the layer tabs go to its left edge and the time, temperature and
|
||||
# position to its right edge, as at 16:9 (neither position is animated; AppMap_00_MiniMap keys their visibility).
|
||||
('AppMap_00', 'N_MiniMap_00', 'x', -w), ('AppMap_00', 'N_AllMapTime_00', 'x', w),
|
||||
# The map: the panes that cut it out and its black backing are 2250 wide, so under the 16:9 root the world map
|
||||
# ended short of the screen's sides and black bars showed there. They take the screen's width in the root's
|
||||
# units instead (a size, not a scale: the map inside keeps its proportions and more of it shows), and so do the
|
||||
# icon area and the shadow frame over it.
|
||||
*[('AppMap_00', pane, 'w', 2250 / k) for pane in ('N_Cut_00', 'N_Capture_00', 'Black8_01', 'N_Cut_01',
|
||||
'P_MapCapture_00', 'N_Cut_02', 'N_IconArea_00', 'W_Shadow_00')],
|
||||
('AppMenuOverlay_00', 'N_FadeInOut_00', 'scale_x', k), ('AppMenuOverlay_00', 'N_FadeInOut_01', 'scale_x', k),
|
||||
('AppMenuOverlay_00', 'N_Icon_00', 'scale_x', k), ('AppMenuOverlay_00', 'N_TitleOne_01', 'scale_x', k),
|
||||
('AppOpenDemoWindow_00', 'P_BG_00', 'scale_x', wide), ('AutoBuilder_00', 'N_BG_00', 'scale_x', wide),
|
||||
@@ -83,12 +108,17 @@ def edits(k, hud_aspect):
|
||||
('CameraSystemWindow_00', 'T_Text_00', 'scale_x', k),
|
||||
('ChallengeLog_00', 'C_CaptureUp_00', 'x', OFF), ('ChallengeLog_00', 'C_CaptureUp_01', 'x', OFF),
|
||||
('GameOver_00', 'P_BG_00', 'scale_x', wide),
|
||||
('LoadingFade_00', 'N_Base_00', 'scale_x', wide), ('LoadingFade_00', 'N_Logo_00', 'x', w),
|
||||
# The loading screen: the map starts at the screen's left edge and the side panel ends at its right edge, each
|
||||
# unstretched. See loading_map for the widths.
|
||||
('LoadingFade_00', 'N_Logo_00', 'x', w),
|
||||
('LoadingFade_00', 'N_Status_00', 'x', w), ('LoadingFade_00', 'N_Tips_00', 'x', -w),
|
||||
('LoadingFade_00', 'P_BG_00', 'scale_x', wide), ('LoadingFade_00', 'P_SideBGDeco_00', 'scale_x', k),
|
||||
('LoadingFade_00', 'Pa_IconPlayer_00', 'scale_x', k), ('LoadingFade_00', 'Pa_LargeDungeonMap_00', 'scale_x', k),
|
||||
('LoadingFade_00', 'Pa_LargeDungeonMap_01', 'scale_x', k), ('LoadingFade_00', 'Pa_Map_00', 'scale_x', k),
|
||||
('LoadingFade_00', 'Pa_Map_01', 'scale_x', k),
|
||||
('LoadingFade_00', 'P_BG_00', 'scale_x', wide), ('LoadingFade_00', 'P_BG_01', 'scale_x', wide),
|
||||
('LoadingFade_00', 'P_Grid_00', 'scale_x', wide), ('LoadingFade_00', 'P_Bar_00', 'scale_x', wide),
|
||||
*[('LoadingFade_00', pane, 'w', loading_map(k)[0]) for pane in ('C_CaptureMap_00', 'C_CaptureMap_01',
|
||||
'P_CaptureMap_00', 'P_CaptureMap_01')],
|
||||
('LoadingFade_00', 'N_Map_00', 'x', -248 + loading_map(k)[1]),
|
||||
('LoadingFade_00', 'W_SideBGDeco_00', 'x', 960 / k), ('LoadingFade_00', 'W_SideBGDeco_00', 'w', loading_map(k)[2]),
|
||||
('LoadingFade_00', 'P_SideBGDeco_00', 'x', 960 / k),
|
||||
('MessageLog_01', 'P_Capture_00', 'scale_x', wide), ('OwnedHorseList_00', 'N_BG_00', 'scale_x', wide),
|
||||
('PaCommonBtnTitle_00', 'B_Hit_00', 'x', OFF), ('PaCommonBtnTitle_00', 'N_Cursor_00', 'x', OFF),
|
||||
('PaLargeDungeonMap_00', 'P_BG_00', 'scale_x', wide), ('PaMessageBtn_00', 'B_Hit_00', 'x', OFF),
|
||||
@@ -99,6 +129,13 @@ def edits(k, hud_aspect):
|
||||
*[e for pane, x, _ in BALLOON_PART for e in (('PaBalloonMessage_00', pane, 'scale_x', k),
|
||||
('PaBalloonMessage_00', pane, 'x', x * k))],
|
||||
]
|
||||
# The Purah Pad's frame (map, album, ...): AppMenuOverlay_00 keeps a root as wide as the screen, so the stone and
|
||||
# light pieces at its left and right edges (x = -960 / 960, anchored at their outer side) were stretched with it.
|
||||
# They keep their own width at the edges.
|
||||
out += [('AppMenuOverlay_00', f'P_Frame{side}{part}', 'scale_x', k) for side in 'LR'
|
||||
for part in ('Core_00', 'AlbNrm_00', 'Light_00', 'EdgeFast_00', 'EdgeSlow_00', 'EdgeFastGlow_00',
|
||||
'EdgeSlowGlow_00')]
|
||||
out += [('AppMenuOverlay_00', f'P_Frame{side}Dent_0{i}', 'scale_x', k) for side in 'LR' for i in (0, 1)]
|
||||
# Menus framed by two side decorations, a header and a background: the frame stays at the screen's edges.
|
||||
for layout, deco in (('PauseMenuOverlay_00', 'P_Deco{}_00'), ('SystemLoadList_00', 'P_Deco{}_00'),
|
||||
('SystemOption_00', 'P_Deco{}_00'), ('SystemSaveLoad_00', 'P_Deco{}_00')):
|
||||
@@ -135,10 +172,21 @@ def tall_edits(k):
|
||||
out = [('AppAlbum_00', 'N_FadeInOut_00', 'scale_y', k), ('AppAlbum_00', 'N_Open_01', 'scale_y', tall),
|
||||
*[('AppMenuOverlay_00', p, 'scale_y', k) for p in ('N_FadeInOut_00', 'N_FadeInOut_01', 'N_Icon_00',
|
||||
'N_TitleOne_01')],
|
||||
('CameraPointer_00', 'N_Type_01', 'scale_y', k), ('CameraSystemWindow_00', 'N_FirstOut_00', 'scale_y', k),
|
||||
('CameraPointer_00', 'N_Type_01', 'scale_y', k),
|
||||
# The camera's "save to the album?" window: N_InOut_00 takes the screen's height (below), so the photo's
|
||||
# frame (N_AlbumPic_00) has the screen's shape, as the photo has. The compendium's square photos
|
||||
# (N_PictureBook_00) and the album's question and buttons (N_AlbumCon_00) keep their proportions, and the
|
||||
# question and the buttons move out by the frame's extra half height (319.5 of its 639).
|
||||
*[('CameraSystemWindow_00', p, 'scale_y', k) for p in ('N_PictureBook_00', 'N_AlbumCon_00')],
|
||||
('CameraSystemWindow_00', 'T_TextAlbum_00', 'y', 380 + 319.5 * (tall - 1)),
|
||||
*[('CameraSystemWindow_00', p, 'y', -396 - 319.5 * (tall - 1)) for p in ('Pa_BtnL_01', 'Pa_BtnR_01')],
|
||||
*[('LoadingFade_00', p, 'scale_y', k) for p in ('Pa_IconPlayer_00', 'Pa_LargeDungeonMap_00',
|
||||
'Pa_LargeDungeonMap_01', 'Pa_Map_00', 'Pa_Map_01')],
|
||||
*[('AppMap_00', f'N_BlurInOut_0{i}', 'scale_y', tall) for i in range(4)],
|
||||
# The map's capture, its cut, backing and shadow are 1080 high, the height of a 16:9 layout: they take the
|
||||
# screen's height, 1080 / k, so the map fills it instead of leaving black above and below (tall_anim
|
||||
# does the same for the keys of AppMap_00_MiniMap that hold 1080)
|
||||
*[('AppMap_00', pane, 'h', 1080 * tall) for pane in MAP_TALL + ('W_Shadow_00',)],
|
||||
*[(layout, 'P_BG_00', 'scale_y', tall) for layout in ('AppOpenDemoWindow_00', 'GameOver_00', 'LoadingFade_00',
|
||||
'PaLargeDungeonMap_00', 'PaRecipeCardList_00')],
|
||||
('LoadingFade_00', 'N_Base_00', 'scale_y', tall),
|
||||
@@ -157,7 +205,10 @@ def tall_edits(k):
|
||||
'ShopMenu_00', 'SystemActionGuide_00') + SYSTEM_MENUS]
|
||||
out += [(name, 'RootPane', 'y', -540 * (1 - k)) for name in (
|
||||
'CtrlGuide_00', 'DoCommand_00', 'EnvironmentInfo_00', 'HorseGauge_00', 'MessageDialog_00', 'MessageLog_01',
|
||||
'PauseMenuOverlay_00', 'SaveLoadIcon_00', 'TreasureFullShortCut_00')]
|
||||
'PauseMenuOverlay_00', 'SaveLoadIcon_00', 'TreasureFullShortCut_00',
|
||||
# the clock an inn's choices show (05:00) under MessageDialog_00's list: it stayed in the middle 16:9 and was
|
||||
# drawn over the list's last rows
|
||||
'Time_00')]
|
||||
out += [('AppAlbum_00', 'N_PicLoad_01', 'y', -540 * (1 - k)), ('AppMap_00', 'N_AllMapTime_00', 'y', -h),
|
||||
('AppMenuOverlay_00', 'A_Align_00', 'y', -(505 + h)), ('AppMenuOverlay_00', 'Pa_GuideLeft_00', 'y', -(505 + h)),
|
||||
('AppMenuOverlay_00', 'N_TitleTab_00', 'y', 491 + h),
|
||||
@@ -200,6 +251,49 @@ def anim_keys(blarc, lo, pane, tag, target):
|
||||
pos += size
|
||||
return out
|
||||
|
||||
FLPA_SIZE_X = 8 # BFLAN FLPA target: the pane's width
|
||||
|
||||
# The map's panes that AppMap_00_MiniMap sizes: in the full map they hold the width 2250 in its keys (the minimap
|
||||
# shrinks them), and the animation's keys win over the layout's size, so a wider screen still cut the map at 2250.
|
||||
MAP_SIZED = ('N_IconArea_00', 'N_Cut_00', 'N_Capture_00', 'P_MapCapture_00', 'Black8_01', 'N_Cut_01', 'N_Cut_02')
|
||||
|
||||
# The map's panes that hold the 16:9 layout's height, 1080, in the layout and in the full map's keys of AppMap_00_MiniMap
|
||||
MAP_TALL = ('N_Cut_00', 'N_Capture_00', 'P_MapCapture_00', 'Black8_01')
|
||||
FLPA_SIZE_Y = 9 # BFLAN FLPA target: the pane's height
|
||||
|
||||
def wide_anim(blarc, members, k, changed):
|
||||
"""The animation keys that hold the full map's width, for a canvas wider than 16:9: 2250 becomes 2250 / k, the
|
||||
screen's width in the 16:9 root's units plus the same margin, as edits() does for the layout's sizes."""
|
||||
member = 'anim/AppMap_00_MiniMap.bflan'
|
||||
if member not in members: raise SystemExit(f'AppMap_00_MiniMap: no animation {member} in the archive')
|
||||
lo = members[member][0]
|
||||
if blarc[lo:lo + 4] != b'FLAN': return # tests/hud_layout_test.py's synthetic archive: fixed-offset keys only
|
||||
found = 0
|
||||
for pane in MAP_SIZED:
|
||||
for keys in anim_keys(blarc, lo, pane, b'FLPA', FLPA_SIZE_X):
|
||||
for key in keys:
|
||||
if abs(struct.unpack_from('<f', blarc, key + 4)[0] - 2250) < 1e-3:
|
||||
struct.pack_into('<f', blarc, key + 4, 2250 / k); found += 1
|
||||
if found < len(MAP_SIZED): raise SystemExit(f'AppMap_00_MiniMap: {found} width keys of 2250, expected at least {len(MAP_SIZED)}')
|
||||
changed.add(member)
|
||||
|
||||
def loading_anim(blarc, members, k, changed):
|
||||
"""The loading screen's map slides by 24 units when the bar comes in and goes out (LoadingFade_00_BarIn: x -278 to
|
||||
-302, BarOut: -302 to -326); the keys move with the map's centre (loading_map)."""
|
||||
shift = loading_map(k)[1]
|
||||
for name, shipped in (('LoadingFade_00_BarIn', (-278, -302)), ('LoadingFade_00_BarOut', (-302, -326))):
|
||||
member = f'anim/{name}.bflan'
|
||||
mini = members.get('anim/AppMap_00_MiniMap.bflan')
|
||||
if mini and blarc[mini[0]:mini[0] + 4] != b'FLAN': return # tests/hud_layout_test.py's synthetic archive
|
||||
if member not in members: raise SystemExit(f'{name}: no animation {member} in the archive')
|
||||
lo = members[member][0]
|
||||
curves = anim_keys(blarc, lo, 'N_Map_00', b'FLPA', 0)
|
||||
keys = [key for curve in curves for key in curve]
|
||||
values = tuple(round(struct.unpack_from('<f', blarc, key + 4)[0], 3) for key in keys)
|
||||
if values != shipped: raise SystemExit(f'{name} N_Map_00 x: keys {values}, expected {shipped}')
|
||||
for key in keys: struct.pack_into('<f', blarc, key + 4, struct.unpack_from('<f', blarc, key + 4)[0] + shift)
|
||||
changed.add(member)
|
||||
|
||||
def tall_anim(blarc, members, k, changed):
|
||||
"""The animation keys that hold positions or zooms on the screen's height, for a canvas narrower than 16:9."""
|
||||
h = 540 * (1 / k - 1)
|
||||
@@ -221,6 +315,13 @@ def tall_anim(blarc, members, k, changed):
|
||||
abs(get(k1 + 4) + 360) < 1e-3 and get(k1 + 8) == 0):
|
||||
raise SystemExit(f'AppMap_00_MiniMap {pane}: not a line from 0 to y -360')
|
||||
put(k0 + 8, -(360 + h)), put(k1 + 4, -(360 + h))
|
||||
# The full map's height keys hold 1080 (the minimap shrinks the panes), and they win over the layout's sizes
|
||||
found = 0
|
||||
for pane in MAP_TALL:
|
||||
for keys in anim_keys(blarc, lo, pane, b'FLPA', FLPA_SIZE_Y):
|
||||
for key in keys:
|
||||
if abs(get(key + 4) - 1080) < 1e-3: put(key + 4, 1080 / k); found += 1
|
||||
if found < len(MAP_TALL): raise SystemExit(f'AppMap_00_MiniMap: {found} height keys of 1080, expected at least {len(MAP_TALL)}')
|
||||
# The large place name of a discovery holds its height (285, then 260) in flat keys; they move to the top edge.
|
||||
curves = anim_keys(blarc, anim('Location_00_IsDiscovery'), 'N_Large_00', b'FLPA', FLPA_Y)
|
||||
values = [get(key + 4) for keys in curves for key in keys]
|
||||
@@ -317,4 +418,6 @@ def apply(blarc, members, width, height, hud_aspect=None):
|
||||
have = struct.unpack_from('<f', blarc, lo + offset)[0]
|
||||
if abs(have - shipped) >= 1e-4: raise SystemExit(f'{anim} +{offset}: {have}, expected {shipped}')
|
||||
struct.pack_into('<f', blarc, lo + offset, value); changed.add(member)
|
||||
wide_anim(blarc, members, k, changed)
|
||||
loading_anim(blarc, members, k, changed)
|
||||
return sorted(changed)
|
||||
+18
-10
@@ -219,16 +219,19 @@
|
||||
# gpu_index = 0
|
||||
# gpu_name = NVIDIA
|
||||
# Game resolution: the size the game draws its picture and interface in (1280x720 to 7680x4320). Above 1920x1080 the
|
||||
# game's texture heap and memory pool grow with it. Another shape than 16:9, such as 3440x1440 on a 21:9 monitor or
|
||||
# the Steam Deck's 1280x800 (16:10), gives the camera's view that shape and lays the HUD out for it. The installer
|
||||
# prepares the UI layout for fifteen sizes: 2560x1080, 3440x1440, 3840x1600, 5120x2160 (21:9), 3840x1080, 5120x1440
|
||||
# (32:9), 1280x800, 1680x1050, 1920x1200, 2560x1600 (16:10), 1920x1280, 2160x1440, 2256x1504, 2880x1920 and 3000x2000
|
||||
# (3:2). For any other size, or a source build that has not made the layout, the game draws the largest 16:9 size that
|
||||
# fits inside it (3440x1080 gives 1920x1080) and the present adds bars; build the layout with
|
||||
# tools/make_romfs_patches.py --aspect WxH to use the full shape. Read at start. Default: 1920x1080, or on a primary
|
||||
# display of one of those shapes the smallest of its sizes at least 1080 high that fits the display (1920x1280 on a 3:2
|
||||
# laptop, 2560x1080 on a 21:9 monitor), so the picture fills the screen without black bars, with prompts = xbox or pc
|
||||
# too (on an install by an older setup, which built the Xbox prompts for 16:9 only, prompts = xbox keeps 1920x1080).
|
||||
# game's texture heap and memory pool grow with it. Another shape than 16:9, such as 3440x1440 on a 21:9 monitor or the
|
||||
# Steam Deck's 1280x800 (16:10), gives the camera's view that shape and lays the HUD out for it. Any shape from 4:3 to
|
||||
# 32:9 works: 21:9 monitors (2560x1080, 3440x1440, 3840x1600, 5120x2160), 32:9 ones (3840x1080, 5120x1440, 7680x2160;
|
||||
# hud_width below keeps the HUD in the middle), 16:10 and 3:2 screens, 4:3 (1440x1080, 2048x1536 on an iPad) and phone
|
||||
# screens streamed to (2340x1080 or 3120x1440 at 19.5:9, 2400x1080 at 20:9). The installer makes the UI layout for the
|
||||
# shapes of the connected displays and of this setting; at a shape it has none for, the game draws the largest 16:9 size
|
||||
# that fits inside it with bars and makes the layout in the background for the next start (a source build: make it with
|
||||
# tools/make_romfs_patches.py --aspect WxH). With vert_plus = 1 a shape narrower than 16:9 keeps the width of the 16:9
|
||||
# view and shows more above and below. Portrait shapes and shapes outside 4:3..32:9 draw 16:9 with bars. Read at start.
|
||||
# Default: 1920x1080, or on a primary display of 21:9, 32:9, 16:10, 3:2 or 4:3 the smallest size of that shape at least
|
||||
# 1080 high that fits the display (1920x1280 on a 3:2 laptop, 2560x1080 on a 21:9 monitor), so the picture fills the
|
||||
# screen without black bars, with prompts = xbox or pc too (on an install by an older setup, which built the Xbox
|
||||
# prompts for 16:9 only, prompts = xbox keeps 1920x1080).
|
||||
# output_res = 1920x1080
|
||||
# HUD width on a game resolution wider than 16:9: full, the default, puts the HUD at the screen's left and right edges;
|
||||
# 21:9 keeps it within the middle 21:9 of the screen and 16:9 within the middle 16:9 (the game's own HUD), so the
|
||||
@@ -263,6 +266,11 @@
|
||||
# Field of view, in percent of the game's own: 70 to 140, 100 (the default) leaves the camera as it is. Higher shows
|
||||
# more of the world around Link. Game versions 1.1.0, 1.2.1 and 1.4.3. Changes while the game runs take effect at once.
|
||||
# fov = 100
|
||||
# Vert+ at a game resolution narrower than 16:9 (16:10, 3:2, 4:3): 1 widens the camera's vertical view so the picture
|
||||
# shows as much of the world at the sides as 16:9 does, and more above and below. 0, the default: the game's own
|
||||
# vertical view at every shape, so a narrower shape shows less at the sides. No effect at 16:9 or wider. Multiplies
|
||||
# with fov. Changes while the game runs take effect at once.
|
||||
# vert_plus = 0
|
||||
# Anisotropic filtering of surface textures: game (the level the game asks for, as on the Switch) or 2, 4, 8, 16. Keeps
|
||||
# ground, roads and walls seen at a shallow angle sharp into the distance. Only filtered, mipmapped textures that tile
|
||||
# are raised; shadow maps, data maps and screen-sized buffers keep the game's setting. Read at start.
|
||||
|
||||
Reference in new issue
Block a user