Wire side-view world init into Renderer reset

This commit is contained in:
Jared Miller 2026-03-11 14:27:53 -04:00
parent cd8a4ade82
commit 8909dc6390
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C
2 changed files with 18 additions and 1 deletions

View file

@ -329,6 +329,23 @@ export default class Renderer {
this.renderer.setRenderTarget(this.resources.worldRenderTarget); this.renderer.setRenderTarget(this.resources.worldRenderTarget);
this.renderer.clear(); this.renderer.clear();
if (Config.viewMode === "side") {
const data = generateSideViewWorld(Config.worldSize);
const initTexture = new THREE.DataTexture(
data,
Config.worldSize,
Config.worldSize,
THREE.RGBAFormat,
THREE.FloatType,
);
initTexture.needsUpdate = true;
this.renderer.copyTextureToTexture(
initTexture,
this.resources.worldRenderTarget.texture,
);
initTexture.dispose();
}
this.resources.worldRenderTargetCopy.setSize( this.resources.worldRenderTargetCopy.setSize(
Config.worldSize, Config.worldSize,
Config.worldSize, Config.worldSize,

View file

@ -71,7 +71,7 @@ describe("generateSideViewWorld", () => {
} }
} }
// if we reach here, home wasn't on the surface row // if we reach here, home wasn't on the surface row
expect("home not on surface row").toBe(false); throw new Error("home not on surface row");
}); });
test("some cells have R = MAT_FOOD on the surface row", () => { test("some cells have R = MAT_FOOD on the surface row", () => {