Switch from characters to numerical tile IDs

This commit is contained in:
Matthias Schiffer 2018-10-31 21:55:41 +01:00
parent 31c131289c
commit 1f9cd7a110
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
4 changed files with 128 additions and 137 deletions

View file

@ -1,5 +1,3 @@
import { mapValuesAsync } from '../../util';
export function loadImage(url: string): Promise<HTMLImageElement> {
return new Promise((resolve, reject) => {
const img = new Image();
@ -9,10 +7,6 @@ export function loadImage(url: string): Promise<HTMLImageElement> {
});
}
export function loadImages(urls: Map<string, string>): Promise<Map<string, HTMLImageElement>> {
return mapValuesAsync(loadImage, urls);
}
export function mkTexture(gl: WebGLRenderingContext, src: HTMLCanvasElement|HTMLImageElement): WebGLTexture {
const texture = gl.createTexture();
if (!texture)