This commit is contained in:
luboslenco
2025-03-06 20:42:54 +01:00
parent 5d2407e729
commit 118443ce2e
93 changed files with 674 additions and 825 deletions
+5 -5
View File
@@ -79,28 +79,28 @@ function material_context_create(raw: material_context_t): material_context_t {
continue;
}
let image: image_t = data_get_image(tex.file, false);
let image: kinc_g5_texture_t = data_get_image(tex.file, false);
array_push(raw._.textures, image);
// Set mipmaps
if (tex.mipmaps != null) {
let mipmaps: image_t[] = [];
let mipmaps: kinc_g5_texture_t[] = [];
while (mipmaps.length < tex.mipmaps.length) {
array_push(mipmaps, null);
}
for (let j: i32 = 0; j < tex.mipmaps.length; ++j) {
let name: string = tex.mipmaps[j];
let mipimg: image_t = data_get_image(name);
let mipimg: kinc_g5_texture_t = data_get_image(name);
mipmaps[j] = mipimg;
}
image_set_mipmaps(image, mipmaps);
iron_g4_set_mipmaps(image, mipmaps);
tex.mipmaps = null;
tex.generate_mipmaps = false;
}
else if (tex.generate_mipmaps == true && image != null) {
image_gen_mipmaps(image, 1000);
kinc_g5_texture_generate_mipmaps(image, 1000);
tex.mipmaps = null;
tex.generate_mipmaps = false;
}