MCPcopy Create free account
hub / github.com/carbonengine/trinity / StartCapture

Method StartCapture

trinity/Sprite2d/Tr2Sprite2dScene.cpp:1941–1972  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////// Description: Starts a display list capture for the given owner. Arguments: owner - the owner of the display list. It will be queried for number of vertices in the display list. Returns: Success or failure On success, EndCapture must be called to finalize the display list. ////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1939// On success, EndCapture must be called to finalize the display list.
1940//////////////////////////////////////////////////////////////////////////
1941bool Tr2Sprite2dScene::StartCapture( ITr2SpriteObject* owner )
1942{
1943 CCP_STATS_ZONE( __FUNCTION__ );
1944 CCP_STATS_INC( spriteSceneDisplayListsCreated );
1945
1946 CCP_ASSERT( !m_captureDisplayList );
1947
1948 IssueDrawCall();
1949
1950 if( !m_captureVertexData || !m_captureIndexData )
1951 {
1952 CCP_LOGERR( "%s failed to allocate vertex or index data", __FUNCTION__ );
1953 return false;
1954 }
1955
1956 m_captureDisplayList = CCP_NEW( "Tr2Sprite2dScene/m_captureDisplayList" ) Tr2Sprite2dDisplayList( owner );
1957
1958 m_captureVertexDataSize = 0;
1959 m_captureIndexDataSize = 0;
1960
1961 CCP_ASSERT( m_currentVertexData );
1962 m_preCaptureVertexData = m_currentVertexData;
1963 m_currentVertexData = reinterpret_cast<Tr2Sprite2dD3DVertex*>( m_captureVertexData.get() );
1964
1965 CCP_ASSERT( m_currentIndexData );
1966 m_preCaptureIndexData = m_currentIndexData;
1967 m_currentIndexData = reinterpret_cast<unsigned int*>( m_captureIndexData.get() );
1968
1969 m_captureStartIndex = 0;
1970
1971 return true;
1972}
1973
1974Tr2Sprite2dDisplayList* Tr2Sprite2dScene::EndCapture( Tr2Sprite2dDisplayList* previousDisplayList )
1975{

Callers 1

GatherSpritesMethod · 0.80

Calls 2

getMethod · 0.80

Tested by

no test coverage detected