Skip to content

Commit 20f5783

Browse files
committed
vtf: fix cubemap loading
1 parent d2b2028 commit 20f5783

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

materialsystem/cmaterial.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,10 @@ bool CMaterial::ShouldSkipVar( KeyValues *pVar, bool *pWasConditional )
11951195
{
11961196
bShouldSkip = !IsX360();
11971197
}
1198+
else if ( ! stricmp( pCond, "gameconsole" ) )
1199+
{
1200+
bShouldSkip = !IsGameConsole();
1201+
}
11981202
else
11991203
{
12001204
Warning( "unrecognized conditional test %s in %s\n", pVarName, GetName() );

vtf/vtf.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +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;
436-
if ( IsX360() && ( iFlags & TEXTUREFLAGS_ENVMAP ) )
437-
{
438-
// 360 has no reason to support sphere map
439-
m_nFaceCount = CUBEMAP_FACE_COUNT-1;
440-
}
435+
m_nFaceCount = (iFlags & TEXTUREFLAGS_ENVMAP) ? (CUBEMAP_FACE_COUNT-1) : 1;
441436

442437
#if defined( _X360 )
443438
m_nMipSkipCount = 0;
@@ -1073,7 +1068,7 @@ bool CVTFTexture::UnserializeEx( CUtlBuffer &buf, bool bHeaderOnly, int nForceFl
10731068
m_nFrameCount = header.numFrames;
10741069

10751070

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

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

0 commit comments

Comments
 (0)