render3d: terrain_height_file - terrain_height's exact bilinear that never pages: a resident tile is read in place, any other from tt_file into four tiles of scratch of its own (in the state's defaults, forgotten when the file closes), so no slot is taken and no recency bumped - a sweep at boot no longer changes which tiles the cache holds, and so what is drawn from it. With the whole copy it is terrain_height. tests/height_file_test: equal to terrain_height over a grid across many tiles, resident and not, at tile corners and past the edge; a whole-map sweep leaves slot_of, tile_in, ref, the heights, the hand and the read counts unchanged
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
12553edb26
commit
c2fc8f78f2
5 changed files with 187 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ function terrain_tiles_cut(render3d_st: mut Render3dState) -> void {
|
|||
# the last map's file let go (a world swap, or the map made again)
|
||||
function tt_close(render3d_st: mut Render3dState) -> void {
|
||||
if render3d_st.tt_file != null { file_close(render3d_st.tt_file); render3d_st.tt_file = null }
|
||||
tf_forget(render3d_st)
|
||||
}
|
||||
|
||||
function tt_say_no_file(path: string) -> void { print(`r3d: terrain: cannot write {path}; the whole height field stays in memory`) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue