From 983d62c240314c9625fd6f7e6a69dc962b1b81d7 Mon Sep 17 00:00:00 2001 From: assiduous Date: Fri, 27 Sep 2024 22:36:05 -0700 Subject: [PATCH] GLTF::Material::TextureShaderAttribs: added GetUVSelector, GetWrapUMode, and GetWrapVMode methods --- AssetLoader/interface/GLTFLoader.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/AssetLoader/interface/GLTFLoader.hpp b/AssetLoader/interface/GLTFLoader.hpp index d27f8417..a3b9d811 100644 --- a/AssetLoader/interface/GLTFLoader.hpp +++ b/AssetLoader/interface/GLTFLoader.hpp @@ -270,6 +270,10 @@ struct Material PackedProps &= ~UVSelectorShiftedMask; PackedProps |= (static_cast(Selector) & UVSelectorMask) << UVSelectorShift; } + int GetUVSelector() const + { + return static_cast((PackedProps >> UVSelectorShift) & UVSelectorMask) - 1; + } static_assert(TEXTURE_ADDRESS_WRAP == 1, "TEXTURE_ADDRESS_WRAP must be 1"); static_assert(TEXTURE_ADDRESS_MIRROR == 2, "TEXTURE_ADDRESS_MIRROR must be 2"); @@ -286,6 +290,14 @@ struct Material PackedProps &= ~WrapVShiftedMask; PackedProps |= (((std::max)(static_cast(AddressMode), 1u) - 1u) & WrapVMask) << WrapVShift; } + TEXTURE_ADDRESS_MODE GetWrapUMode() const + { + return static_cast(((PackedProps >> WrapUShift) & WrapUMask) + 1u); + } + TEXTURE_ADDRESS_MODE GetWrapVMode() const + { + return static_cast(((PackedProps >> WrapVShift) & WrapVMask) + 1u); + } }; static_assert(sizeof(TextureShaderAttribs) % 16 == 0, "TextureShaderAttribs struct must be 16-byte aligned");