aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/client/baseanimatedtextureproxy.cpp
diff options
context:
space:
mode:
authorJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
committerJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
commit0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch)
treec831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/game/client/baseanimatedtextureproxy.cpp
parentUpdated the SDK with the latest code from the TF and HL2 branches. (diff)
downloadsource-sdk-2013-0d8dceea4310fde5706b3ce1c70609d72a38efdf.tar.xz
source-sdk-2013-0d8dceea4310fde5706b3ce1c70609d72a38efdf.zip
Updated the SDK with the latest code from the TF and HL2 branches.HEADmaster
Diffstat (limited to 'mp/src/game/client/baseanimatedtextureproxy.cpp')
-rw-r--r--mp/src/game/client/baseanimatedtextureproxy.cpp42
1 files changed, 26 insertions, 16 deletions
diff --git a/mp/src/game/client/baseanimatedtextureproxy.cpp b/mp/src/game/client/baseanimatedtextureproxy.cpp
index 4365e866..b7151114 100644
--- a/mp/src/game/client/baseanimatedtextureproxy.cpp
+++ b/mp/src/game/client/baseanimatedtextureproxy.cpp
@@ -11,6 +11,8 @@
#include "materialsystem/itexture.h"
#include "tier1/KeyValues.h"
#include "toolframework_client.h"
+#include "tier0/minidump.h"
+#include "tier0/stacktools.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@@ -39,25 +41,33 @@ CBaseAnimatedTextureProxy::~CBaseAnimatedTextureProxy()
bool CBaseAnimatedTextureProxy::Init( IMaterial *pMaterial, KeyValues *pKeyValues )
{
char const* pAnimatedTextureVarName = pKeyValues->GetString( "animatedTextureVar" );
- if( !pAnimatedTextureVarName )
- return false;
- bool foundVar;
- m_AnimatedTextureVar = pMaterial->FindVar( pAnimatedTextureVarName, &foundVar, false );
- if( !foundVar )
- return false;
-
- char const* pAnimatedTextureFrameNumVarName = pKeyValues->GetString( "animatedTextureFrameNumVar" );
- if( !pAnimatedTextureFrameNumVarName )
- return false;
+ if( pAnimatedTextureVarName )
+ {
+ bool foundVar;
- m_AnimatedTextureFrameNumVar = pMaterial->FindVar( pAnimatedTextureFrameNumVarName, &foundVar, false );
- if( !foundVar )
- return false;
+ m_AnimatedTextureVar = pMaterial->FindVar( pAnimatedTextureVarName, &foundVar, false );
+ if( foundVar )
+ {
+ char const* pAnimatedTextureFrameNumVarName = pKeyValues->GetString( "animatedTextureFrameNumVar" );
+
+ if( pAnimatedTextureFrameNumVarName )
+ {
+ m_AnimatedTextureFrameNumVar = pMaterial->FindVar( pAnimatedTextureFrameNumVarName, &foundVar, false );
+
+ if( foundVar )
+ {
+ m_FrameRate = pKeyValues->GetFloat( "animatedTextureFrameRate", 15 );
+ m_WrapAnimation = !pKeyValues->GetInt( "animationNoWrap", 0 );
+ return true;
+ }
+ }
+ }
+ }
- m_FrameRate = pKeyValues->GetFloat( "animatedTextureFrameRate", 15 );
- m_WrapAnimation = !pKeyValues->GetInt( "animationNoWrap", 0 );
- return true;
+ // Error - null out pointers.
+ Cleanup();
+ return false;
}
void CBaseAnimatedTextureProxy::Cleanup()