Skip to content

Commit 3bd4900

Browse files
fix for cubemaps triggering an assertion
1 parent 04d1fdf commit 3bd4900

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bsa/fo4.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,13 +738,14 @@ namespace bsa::fo4
738738
detail::ostream_t& a_out,
739739
compression_format a_format) const
740740
{
741+
const bool isCubemap = (this->header.flags & 1u) != 0;
741742
const DirectX::TexMetadata meta{
742743
.width = this->header.width,
743744
.height = this->header.height,
744745
.depth = 1,
745-
.arraySize = 1,
746+
.arraySize = isCubemap ? 6 : 1,
746747
.mipLevels = this->header.mip_count,
747-
.miscFlags = (this->header.flags & 1u) != 0 ? std::uint32_t{ DirectX::TEX_MISC_FLAG::TEX_MISC_TEXTURECUBE } : 0u,
748+
.miscFlags = isCubemap ? std::uint32_t{ DirectX::TEX_MISC_FLAG::TEX_MISC_TEXTURECUBE } : 0u,
748749
.miscFlags2 = 0,
749750
.format = static_cast<::DXGI_FORMAT>(this->header.format),
750751
.dimension = DirectX::TEX_DIMENSION_TEXTURE2D,

0 commit comments

Comments
 (0)