diff --git a/src/Renderer.ts b/src/Renderer.ts index ddab417..3fde857 100644 --- a/src/Renderer.ts +++ b/src/Renderer.ts @@ -329,6 +329,23 @@ export default class Renderer { this.renderer.setRenderTarget(this.resources.worldRenderTarget); 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( Config.worldSize, Config.worldSize, diff --git a/src/__tests__/worldInit.test.ts b/src/__tests__/worldInit.test.ts index f7498a7..8a8da14 100644 --- a/src/__tests__/worldInit.test.ts +++ b/src/__tests__/worldInit.test.ts @@ -71,7 +71,7 @@ describe("generateSideViewWorld", () => { } } // 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", () => {