Browse Source

vtf: fix cubemap loading

pull/153/head
nillerusr 2 years ago
parent
commit
20f5783225
  1. 4
      materialsystem/cmaterial.cpp
  2. 9
      vtf/vtf.cpp

4
materialsystem/cmaterial.cpp

@ -1195,6 +1195,10 @@ bool CMaterial::ShouldSkipVar( KeyValues *pVar, bool *pWasConditional ) @@ -1195,6 +1195,10 @@ bool CMaterial::ShouldSkipVar( KeyValues *pVar, bool *pWasConditional )
{
bShouldSkip = !IsX360();
}
else if ( ! stricmp( pCond, "gameconsole" ) )
{
bShouldSkip = !IsGameConsole();
}
else
{
Warning( "unrecognized conditional test %s in %s\n", pVarName, GetName() );

9
vtf/vtf.cpp

@ -432,12 +432,7 @@ bool CVTFTexture::Init( int nWidth, int nHeight, int nDepth, ImageFormat fmt, in @@ -432,12 +432,7 @@ bool CVTFTexture::Init( int nWidth, int nHeight, int nDepth, ImageFormat fmt, in
m_nFrameCount = iFrameCount;
m_nFaceCount = (iFlags & TEXTUREFLAGS_ENVMAP) ? CUBEMAP_FACE_COUNT : 1;
if ( IsX360() && ( iFlags & TEXTUREFLAGS_ENVMAP ) )
{
// 360 has no reason to support sphere map
m_nFaceCount = CUBEMAP_FACE_COUNT-1;
}
m_nFaceCount = (iFlags & TEXTUREFLAGS_ENVMAP) ? (CUBEMAP_FACE_COUNT-1) : 1;
#if defined( _X360 )
m_nMipSkipCount = 0;
@ -1073,7 +1068,7 @@ bool CVTFTexture::UnserializeEx( CUtlBuffer &buf, bool bHeaderOnly, int nForceFl @@ -1073,7 +1068,7 @@ bool CVTFTexture::UnserializeEx( CUtlBuffer &buf, bool bHeaderOnly, int nForceFl
m_nFrameCount = header.numFrames;
m_nFaceCount = (m_nFlags & TEXTUREFLAGS_ENVMAP) ? CUBEMAP_FACE_COUNT : 1;
m_nFaceCount = (m_nFlags & TEXTUREFLAGS_ENVMAP) ? (CUBEMAP_FACE_COUNT-1) : 1;
// NOTE: We're going to store space for all mip levels, even if we don't
// have data on disk for them. This is for backward compatibility

Loading…
Cancel
Save