mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-25 18:48:51 -04:00
Triforce v0.8.0
Evil HD (SMAA Ultra, 16x filtering, full textures, ambient occlusion with bounce light, sunlight shafts, foliage drawn 4x as far, the remastered texture pack's loader and the launcher's download of it), FSR 3.1 frame generation for every GPU, Intel XeSS, FSR 4 model choice, ReShade presets, Auto (this PC), HUD placement, the options menu in 13 languages, a second input for every control, hold to toggle, DualSense speaker and haptics, NFC from the player's own dumps, the above-60 fps game fixes, the Debug tab's flight and Inventory fixes, the launcher's full settings, and over 250 fixes.
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
"""(issue 1197) A lifted C file rewritten in place (the patches, the chunk split) is written beside it and moved over it: a run
|
||||
stopped mid-write (the builder closed, a second build stopping the first, a full disk) leaves the old file whole, never the first
|
||||
megabytes of the new one, which the compile then stopped on at every try ("g_module_b" where g_module_base was)."""
|
||||
megabytes of the new one, which the compile then stopped on at every try ("g_module_b" where g_module_base was).
|
||||
|
||||
The move only covers a process that stops: a PC that goes down (power, a crash) can keep the move and lose the data that was still
|
||||
in memory, and Windows then shows the file at its size full of null bytes. sync=True writes the data to the disk before the move,
|
||||
for a small file that later runs read back (chunks.txt). The lifted C is not synced (a gigabyte, every lift)."""
|
||||
import os
|
||||
import time
|
||||
|
||||
|
||||
def write_whole(path, text, newline="\n"):
|
||||
def write_whole(path, text, newline="\n", sync=False):
|
||||
tmp = path + ".part"
|
||||
with open(tmp, "w", encoding="utf-8", newline=newline) as f:
|
||||
f.write(text)
|
||||
if sync:
|
||||
f.flush()
|
||||
os.fsync(f.fileno())
|
||||
for attempt in range(20): # (an antivirus reading the file holds it a moment: Windows refuses the move until it lets go)
|
||||
try:
|
||||
os.replace(tmp, path)
|
||||
|
||||
Reference in New Issue
Block a user