Skip to content

Commit f63849b

Browse files
committed
vtf: fix cubemap loading for vtf versions less than 7.5
1 parent 7ca36e7 commit f63849b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vtf/vtf.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ bool CVTFTexture::Init( int nWidth, int nHeight, int nDepth, ImageFormat fmt, in
432432

433433
m_nFrameCount = iFrameCount;
434434

435-
m_nFaceCount = (iFlags & TEXTUREFLAGS_ENVMAP) ? (CUBEMAP_FACE_COUNT-1) : 1;
435+
m_nFaceCount = (iFlags & TEXTUREFLAGS_ENVMAP) ? CUBEMAP_FACE_COUNT : 1;
436436

437437
#if defined( _X360 )
438438
m_nMipSkipCount = 0;
@@ -601,7 +601,7 @@ void CVTFTexture::ImageFileInfo( int nFrame, int nFace, int nMipLevel, int *pSta
601601
int nFacesToRead = m_nFaceCount;
602602
if ( IsCubeMap() )
603603
{
604-
if ((m_nVersion[0] == 7) && (m_nVersion[1] < 1))
604+
if ((m_nVersion[0] == 7) && (m_nVersion[1] < 1 || m_nVersion[1] > 4))
605605
{
606606
nFacesToRead = 6;
607607
if (nFace == CUBEMAP_FACE_SPHEREMAP)
@@ -1068,7 +1068,7 @@ bool CVTFTexture::UnserializeEx( CUtlBuffer &buf, bool bHeaderOnly, int nForceFl
10681068
m_nFrameCount = header.numFrames;
10691069

10701070

1071-
m_nFaceCount = (m_nFlags & TEXTUREFLAGS_ENVMAP) ? (CUBEMAP_FACE_COUNT-1) : 1;
1071+
m_nFaceCount = (m_nFlags & TEXTUREFLAGS_ENVMAP) ? CUBEMAP_FACE_COUNT : 1;
10721072

10731073
// NOTE: We're going to store space for all mip levels, even if we don't
10741074
// have data on disk for them. This is for backward compatibility

0 commit comments

Comments
 (0)