From 430d56af5f3f1b34fd4377c2746df536601e240e Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 17 Nov 2021 11:11:34 -0800 Subject: [PATCH] rtx: enable partial texture overrides in materials --- ref_vk/vk_materials.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ref_vk/vk_materials.c b/ref_vk/vk_materials.c index 7b6b7483..426ff33a 100644 --- a/ref_vk/vk_materials.c +++ b/ref_vk/vk_materials.c @@ -86,7 +86,9 @@ static void loadMaterialsFromFile( const char *filename ) { } if (key[0] == '}') { - if (current_material_index >= 0 && current_material.base_color >= 0) { + if (current_material_index >= 0) { + if (current_material.base_color == -1) + current_material.base_color = current_material_index; g_materials.materials[current_material_index] = current_material; } continue; @@ -132,7 +134,7 @@ void XVK_ReloadMaterials( void ) { if (!tex) { mat->base_color = -1; - continue; + break; } mat->base_color = i;