From e2b09a5e5b8995aca72889338738539af7450df6 Mon Sep 17 00:00:00 2001 From: Tazpn <tazpn@users.sourceforge.net> Date: Tue, 27 Jan 2009 02:31:54 +0000 Subject: [PATCH] niflib: Dont throw exception on inquiry. --- src/obj/NiTexturingProperty.cpp | 41 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/obj/NiTexturingProperty.cpp b/src/obj/NiTexturingProperty.cpp index 2207071e..525e8654 100644 --- a/src/obj/NiTexturingProperty.cpp +++ b/src/obj/NiTexturingProperty.cpp @@ -1666,34 +1666,35 @@ void NiTexturingProperty::SetShaderTexture( int n, TexDesc & new_val ) { } bool NiTexturingProperty::HasTexture( int n ) const { - switch (n) { - case BASE_MAP: - return hasBaseTexture; - case DARK_MAP: - return hasDarkTexture; - case DETAIL_MAP: - return hasDetailTexture; - case GLOSS_MAP: - return hasGlossTexture; - case GLOW_MAP: - return hasGlowTexture; - case BUMP_MAP: - return hasBumpMapTexture; + switch (n) { + case BASE_MAP: + return hasBaseTexture; + case DARK_MAP: + return hasDarkTexture; + case DETAIL_MAP: + return hasDetailTexture; + case GLOSS_MAP: + return hasGlossTexture; + case GLOW_MAP: + return hasGlowTexture; + case BUMP_MAP: + return hasBumpMapTexture; case NORMAL_MAP: return hasNormalTexture; case UNKNOWN2_MAP: return hasUnknown2Texture; - case DECAL_0_MAP: - return hasDecal0Texture; - case DECAL_1_MAP: - return hasDecal1Texture; + case DECAL_0_MAP: + return hasDecal0Texture; + case DECAL_1_MAP: + return hasDecal1Texture; case DECAL_2_MAP: return hasDecal2Texture; case DECAL_3_MAP: return hasDecal3Texture; - default: - throw runtime_error("You have specified an invalid texture type."); - }; + default: + return false; + //throw runtime_error("You have specified an invalid texture type."); + }; } void NiTexturingProperty::ClearTexture( int n ) { -- GitLab