/// \fn VRSDProfilingInformation(const char* pFunctionName, const char* pFileName, int iLineDefined, /// uint64 uiTimeTaken) /// /// \brief Default Constructor. /// /// \param [in] pFunctionName Name of the function. /// \param [in] pFileName Filename of the file. /// \param iLineDefined The line defined. /// \param uiTimeTaken The time taken by the first sample. /// VRSDProfilingInformation(const char* pFunctionName, const char* pFileName, int iLineDefined, uint64 uiTimeTaken) : m_iCalls(1), m_iLineDefined(iLineDefined), m_uiTotalTime(uiTimeTaken), m_uiMinTime(uiTimeTaken), m_uiMaxTime(uiTimeTaken), m_pFunctionName(NULL), m_pFileName(NULL) { VASSERT(pFunctionName); m_pFunctionName = vStrDup(pFunctionName); VASSERT(pFileName); m_pFileName = vStrDup(pFileName); }
// copy constructor VStrRef( const VStrRef& src ) { m_bOwnString = src.m_bOwnString; if( m_bOwnString ) m_pStr = vStrDup( src.m_pStr ); else m_pStr = src.m_pStr; }
// Sets the string for this reference object. // // This method sets the string to be referenced by this reference object. // // \param pStr // string to reference // // \param bOwn // if true then this object will create and keep copy of the input string, if false then // just reference (pointer) to the input string will be kept. void SetString( const char* pStr, bool bOwn = true ) { FreeString(); m_bOwnString = bOwn; if( m_bOwnString ) m_pStr = vStrDup( pStr ); else m_pStr = pStr; }
// assignment operator VStrRef& operator = ( const VStrRef& src ) { FreeString(); m_bOwnString = src.m_bOwnString; if( m_bOwnString ) m_pStr = vStrDup( src.m_pStr ); else m_pStr = src.m_pStr; return *this; }
void VSequenceSet::SerializeX( VArchive &ar ) { char iLocalVersion = TRANSITION_TABLE_VERSION_CURRENT; VASSERT(m_pTransitionTable); if (ar.IsLoading()) { ar >> iLocalVersion; VASSERT(iLocalVersion <= TRANSITION_TABLE_VERSION_CURRENT); // Read animation filename char szFilename[1024]; ar.ReadStringBinary(szFilename, 1024); m_szFilename = vStrDup(szFilename); char szFilepath[FS_MAX_PATH]; char szFullAnimFilePath[FS_MAX_PATH]; if (iLocalVersion >= TRANSITION_TABLE_VERSION_2) // Load anim files from the same folder as the transition file if(m_pTransitionTable->GetFilename()) VFileHelper::GetFileDir(m_pTransitionTable->GetFilename(), szFilepath); else VFileHelper::GetFileDir(m_pTransitionTable->GetMesh()->GetFilename(), szFilepath); else if (iLocalVersion <= TRANSITION_TABLE_VERSION_1) // Load anim files from the same folder as the model file VFileHelper::GetFileDir(m_pTransitionTable->GetMesh()->GetFilename(), szFilepath); // Set the filename VFileHelper::CombineDirAndFile(szFullAnimFilePath, szFilepath, m_szFilename); // Read loaded state ar >> m_bLoaded; // Load sequence set when specified if (m_bLoaded) Load(m_pTransitionTable->GetMesh(), szFullAnimFilePath); }
inline void SetSymbolContent(const char* szSymbolContent) { vStrFree(m_szSymbolContent); m_szSymbolContent = vStrDup(szSymbolContent); }
inline void SetSymbolName(const char* szSymbolName) { vStrFree(m_szSymbolName); m_szSymbolName = vStrDup(szSymbolName); }
/// /// \brief /// Initializes the members variables of this sequence set. /// /// \param szFilename /// Filename of the animation file of this sequence set. /// /// \param pTable /// Transition table this sequence set belongs to /// /// \param bLoaded /// Specifies whether the respective sequence set should be loaded at initialization. /// inline void Init(const char* szFilename, VTransitionTable* pTable, bool bLoaded) { m_szFilename = vStrDup(szFilename); m_pTransitionTable = pTable; m_bLoaded = bLoaded; }
inline void vStrDupOver(char*& dst, const char* src) {vStrFree(dst); if(src) dst=vStrDup(src); else dst=NULL;}