Allow for textures that aren't 16x16

This commit is contained in:
2026-09-28 16:20:37 -03:00
parent 52ef4e5ca6
commit fe149bb9ad
18 changed files with 268 additions and 136 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ import {
validate_recipe,
} from "$/common/mod_data.ts";
import { check_references, load_order, type LoadedMod, type ModReport } from "$/common/mod_check.ts";
import { png_size } from "$/common/bmod.ts";
import { png_size, texture_size_problem } from "$/common/bmod.ts";
export { load_order, type LoadedMod, type ModReport };
@@ -140,8 +140,8 @@ function load_mod(mods_dir: string, id: string): LoadedMod {
const size = png_size(Deno.readFileSync(`${dir}/textures/${file}`));
if (!size) {
error(`textures/${file}: isn't a png`);
} else if (size.width !== 16 || size.height !== 16) {
error(`textures/${file}: is ${size.width}×${size.height}, textures must be 16×16`);
} else if (texture_size_problem(size)) {
error(`textures/${file}: ${texture_size_problem(size)}`);
}
}