Wire side-view world init into Renderer reset
This commit is contained in:
parent
cd8a4ade82
commit
8909dc6390
2 changed files with 18 additions and 1 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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", () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue