model: add mutable MapState (empty for now)
This commit is contained in:
parent
ebc56db63c
commit
bc6d79b088
5 changed files with 25 additions and 17 deletions
|
@ -1,6 +1,6 @@
|
|||
import {mapValues, mapValuesAsync, nextPowerOf2} from '../util';
|
||||
|
||||
import MapData from '../model/MapData';
|
||||
import MapState from '../model/state/MapState';
|
||||
import MapView from './MapView';
|
||||
import Renderer from './renderer/Renderer';
|
||||
|
||||
|
@ -54,9 +54,9 @@ function mkTileTexture(gl: WebGLRenderingContext, tiles: Map<string, HTMLImageEl
|
|||
return [mkTexture(gl, canvas), ret];
|
||||
}
|
||||
|
||||
export async function loadMap(r: Renderer, mapData: MapData): Promise<MapView> {
|
||||
const tiles = await loadTiles(mapData.tiles);
|
||||
export async function loadMap(r: Renderer, map: MapState): Promise<MapView> {
|
||||
const tiles = await loadTiles(map.data.tiles);
|
||||
const [tileTexture, tileMap] = mkTileTexture(r.getContext(), tiles);
|
||||
|
||||
return new MapView(r, mapData, tileTexture, tileMap);
|
||||
return new MapView(r, map, tileTexture, tileMap);
|
||||
}
|
||||
|
|
Reference in a new issue