diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-06-28 16:18:57 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-06-28 16:18:57 +0000 |
| commit | b84bff8313853e965d78a1c954c9f360a2ce2968 (patch) | |
| tree | 063e02cc1e2499809f6038d7baf00392e7e14eba /AssetLoader/src/GLTFLoader.cpp | |
| parent | Added comment to VERSION file in libtiff (diff) | |
| download | DiligentTools-b84bff8313853e965d78a1c954c9f360a2ce2968.tar.gz DiligentTools-b84bff8313853e965d78a1c954c9f360a2ce2968.zip | |
Updated ImageDesc struct to use VALUE_TYPE ComponentType instead of BitsPerPixel
Diffstat (limited to 'AssetLoader/src/GLTFLoader.cpp')
| -rw-r--r-- | AssetLoader/src/GLTFLoader.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/AssetLoader/src/GLTFLoader.cpp b/AssetLoader/src/GLTFLoader.cpp index 5cb6a24..95fd50b 100644 --- a/AssetLoader/src/GLTFLoader.cpp +++ b/AssetLoader/src/GLTFLoader.cpp @@ -32,6 +32,7 @@ #include "Image.h" #include "FileSystem.h" #include "FileWrapper.h" +#include "GraphicsAccessories.h" #define TINYGLTF_IMPLEMENTATION #define TINYGLTF_NO_STB_IMAGE @@ -911,7 +912,7 @@ bool LoadImageData(tinygltf::Image* gltf_image, gltf_image->width = ImgDesc.Width; gltf_image->height = ImgDesc.Height; gltf_image->component = 4; - gltf_image->bits = ImgDesc.BitsPerPixel / ImgDesc.NumComponents; + gltf_image->bits = GetValueSize(ImgDesc.ComponentType) * 8; gltf_image->pixel_type = TINYGLTF_COMPONENT_TYPE_UNSIGNED_BYTE; auto DstRowSize = gltf_image->width * gltf_image->component * (gltf_image->bits / 8); gltf_image->image.resize(static_cast<size_t>(gltf_image->height * DstRowSize)); |
