move terrain color computation to GPU compute shader

This commit is contained in:
scamiv
2026-01-16 21:55:50 +01:00
parent ebf0c5dc04
commit b5f1577ceb
8 changed files with 559 additions and 4 deletions
+3
View File
@@ -995,6 +995,9 @@ export class GameImpl implements Game {
tileStateView(): Uint16Array {
return this._map.tileStateView();
}
terrainDataView(): Uint8Array {
return this._map.terrainDataView();
}
numTilesWithFallout(): number {
return this._map.numTilesWithFallout();
}
+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);
+3
View File
@@ -889,6 +889,9 @@ export class GameView implements GameMap {
tileStateView(): Uint16Array {
return this._map.tileStateView();
}
terrainDataView(): Uint8Array {
return this._map.terrainDataView();
}
isBorder(ref: TileRef): boolean {
return this._map.isBorder(ref);
}