fix terrain map generator

This commit is contained in:
evanpelle
2024-10-11 14:26:37 -07:00
parent 64d956bda4
commit 0904125b69
+2 -3
View File
@@ -1,5 +1,4 @@
import PImage from 'pureimage'; import {decodePNGFromStream} from 'pureimage'; import path from 'path';
import path from 'path';
import fs from 'fs/promises'; import fs from 'fs/promises';
import {createReadStream} from 'fs'; import {createReadStream} from 'fs';
import {fileURLToPath} from 'url'; import {fileURLToPath} from 'url';
@@ -47,7 +46,7 @@ export async function loadTerrainMap(): Promise<void> {
const imagePath = path.resolve(__dirname, '..', '..', 'resources', 'maps', mapName + '.png'); const imagePath = path.resolve(__dirname, '..', '..', 'resources', 'maps', mapName + '.png');
const readStream = createReadStream(imagePath); const readStream = createReadStream(imagePath);
const img = await PImage.decodePNGFromStream(readStream); const img = await decodePNGFromStream(readStream);
console.log('Image loaded successfully'); console.log('Image loaded successfully');
console.log('Image dimensions:', img.width, 'x', img.height); console.log('Image dimensions:', img.width, 'x', img.height);