move terrain color computation to GPU compute shader

This commit is contained in:
scamiv
2026-01-20 18:55:28 +01:00
parent ebf0c5dc04
commit b5f1577ceb
8 changed files with 559 additions and 4 deletions
+5
View File
@@ -30,6 +30,7 @@ export interface GameMap {
isDefended(ref: TileRef): boolean;
setDefended(ref: TileRef, value: boolean): void;
tileStateView(): Uint16Array;
terrainDataView(): Uint8Array;
isOnEdgeOfMap(ref: TileRef): boolean;
isBorder(ref: TileRef): boolean;
neighbors(ref: TileRef): TileRef[];
@@ -231,6 +232,10 @@ export class GameMapImpl implements GameMap {
return this.state;
}
terrainDataView(): Uint8Array {
return this.terrain;
}
isOnEdgeOfMap(ref: TileRef): boolean {
const x = this.x(ref);
const y = this.y(ref);