///////////////////////////////////////////////////////////////////// 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. ////////////////////////////////////////////////////////
| 1939 | // On success, EndCapture must be called to finalize the display list. |
| 1940 | ////////////////////////////////////////////////////////////////////////// |
| 1941 | bool 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 | |
| 1974 | Tr2Sprite2dDisplayList* Tr2Sprite2dScene::EndCapture( Tr2Sprite2dDisplayList* previousDisplayList ) |
| 1975 | { |
no test coverage detected