Skip to content

Commit 43e5a68

Browse files
committed
Remove minimap MapViewer dependency from WebGLMapRenderer.
1 parent 015f2d0 commit 43e5a68

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/mapviewer/MapViewerRenderer.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { MenuTargetType } from "../rs/MenuEntry";
1111
import { isTouchDevice } from "../util/DeviceUtil";
1212
import { InputManager } from "../util/InputManager";
1313
import { WebGLMapSquare } from "../renderer/webgl/WebGLMapSquare";
14+
import { SdMapData } from "../renderer/loader/SdMapData";
1415

1516
export class MapViewerRendererStats {
1617
frameStart: number;
@@ -256,6 +257,16 @@ export abstract class MapViewerRenderer extends RendererMainLoop {
256257
// this.mapViewer.debugText = `Frame Time Js: ${this.stats.frameTimeJs.toFixed(3)}`;
257258
}
258259

260+
onMapLoad(mapData: SdMapData) {
261+
this.mapViewer.setMapImageUrl(
262+
mapData.mapX,
263+
mapData.mapY,
264+
URL.createObjectURL(mapData.minimapBlob),
265+
true,
266+
false,
267+
);
268+
}
269+
259270
checkInteractions(interactReady: boolean, interactBuffer: Float32Array,
260271
closestInteractIndices: Map<number, number[]>): void {
261272
const frameCount = this.stats.frameCount;

src/renderer/webgl/WebGLMapRenderer.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -708,13 +708,7 @@ export class WebGLMapRenderer extends MapViewerRenderer {
708708
): void {
709709
const { mapX, mapY } = mapData;
710710

711-
this.mapViewer.setMapImageUrl(
712-
mapX,
713-
mapY,
714-
URL.createObjectURL(mapData.minimapBlob),
715-
true,
716-
false,
717-
);
711+
this.onMapLoad(mapData);
718712

719713
const frameCount = this.stats.frameCount;
720714
this.mapManager.addMap(

0 commit comments

Comments
 (0)