Implement shared draw phase buffer and time base in game rendering

- Added support for a shared draw phase buffer in the ClientGameRunner and TerritoryWebGLRenderer to manage tile rendering phases.
- Introduced time base management to synchronize rendering updates based on the game state.
- Updated relevant classes and methods to accommodate the new shared draw phase and time base, enhancing the rendering pipeline.
This commit is contained in:
scamiv
2025-12-05 17:59:55 +01:00
parent 6000a3fa3b
commit c6dde7a021
7 changed files with 182 additions and 11 deletions
+4
View File
@@ -26,6 +26,8 @@ export class WorkerClient {
private sharedTileRingBuffers?: SharedTileRingBuffers,
private sharedStateBuffer?: SharedArrayBuffer,
private sharedDirtyBuffer?: SharedArrayBuffer,
private sharedDrawPhaseBuffer?: SharedArrayBuffer,
private timeBaseMs?: number,
) {
this.worker = new Worker(new URL("./Worker.worker.ts", import.meta.url));
this.messageHandlers = new Map();
@@ -78,6 +80,8 @@ export class WorkerClient {
sharedTileRingData: this.sharedTileRingBuffers?.data,
sharedStateBuffer: this.sharedStateBuffer,
sharedDirtyBuffer: this.sharedDirtyBuffer,
sharedDrawPhaseBuffer: this.sharedDrawPhaseBuffer,
timeBaseMs: this.timeBaseMs,
});
// Add timeout for initialization