render3d: terrain_tiles_open_file(path, key, version, half, ox, oz) - a map's baked tiles opened for the CPU questions alone (terrain_height, _file, _smooth, terrain_ortho), with no device and no renderer booted: terrain_from_baked's opening without its coarse level on the GPU. False and nothing changed for another bake's key or version, a missing file, or a whole copy already kept (it answers first). tests/tiles_open_test: a bake written with LBAK's header answers its heights and photograph at a map origin of (300, -120), nothing on a device; the refusals leave no file open, and a bake opened after them answers. The hand-written tiles move to tests/fakes/tiles_file.ludic (payload, raw file, bake, the expected answer at an origin, the cache's snapshot), shared with height_file_test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
744a03bdfa
commit
42147937b2
5 changed files with 206 additions and 112 deletions
19
packages/ludic.render3d/terrain_tiles_open.ludic
Normal file
19
packages/ludic.render3d/terrain_tiles_open.ludic
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# terrain_tiles_open.ludic — a map's baked tiles opened for the CPU questions alone (terrain_height,
|
||||
# terrain_height_file, _smooth, terrain_ortho), with no device and no renderer booted: for a bake, a
|
||||
# migration or a test that asks the ground of a map it will never draw.
|
||||
|
||||
# the bake at `path` (its key and version as terrain_from_baked takes them) opened for reading, the map
|
||||
# `half` metres each way from (ox, oz); false (nothing changed) when it is not this bake, or when the
|
||||
# whole copy is kept - that one answers first, so opening tiles under it would be read by nothing
|
||||
@alloc_ok("a map's tiles opened once, for a bake or a test")
|
||||
export function terrain_tiles_open_file(render3d_st: mut Render3dState, path: string, key: string, version: int, half: int, ox: float, oz: float) -> bool {
|
||||
if render3d_st.ter_heights != null { return false }
|
||||
let base = ltt2_bake_base(path, key, version)
|
||||
if base < 0 { return false }
|
||||
render3d_st.TERRAIN_HALF = half
|
||||
render3d_st.ter_ox = ox
|
||||
render3d_st.ter_oz = oz
|
||||
render3d_st.ter_h_scale = 0.0
|
||||
render3d_st.ter_o_scale = 0.0
|
||||
return tt_open_ltt2(render3d_st, path, base)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue