| 1164 | } |
| 1165 | |
| 1166 | void Tr2Sprite2dScene::SubmitGeometry( Tr2RenderContext& renderContext ) |
| 1167 | { |
| 1168 | CCP_STATS_ZONE( __FUNCTION__ ); |
| 1169 | |
| 1170 | // Error checking is done in IssueDrawCall - we won't get here unless the effect |
| 1171 | // is valid, as well as the constant table and transforms handle. |
| 1172 | Matrix transposedMatrixes[TR2_SS_MAX_TRANSFORM_COUNT]; |
| 1173 | for( unsigned i = 0; i < TR2_SS_MAX_TRANSFORM_COUNT; ++i ) |
| 1174 | { |
| 1175 | transposedMatrixes[i] = Transpose( m_transformArray[i] ); |
| 1176 | } |
| 1177 | |
| 1178 | bool result = FillAndSetConstants( |
| 1179 | m_uiTransformsCb, |
| 1180 | transposedMatrixes, |
| 1181 | sizeof( transposedMatrixes[0] ) * TR2_SS_MAX_TRANSFORM_COUNT, |
| 1182 | VERTEX_SHADER, |
| 1183 | Tr2Renderer::GetPerObjectVSGUIStartRegister(), |
| 1184 | renderContext ); |
| 1185 | |
| 1186 | if( !result ) |
| 1187 | { |
| 1188 | CCP_LOGWARN( "Tr2Sprite2dScene::SubmitGeometry - couldn't set VS constant" ); |
| 1189 | } |
| 1190 | |
| 1191 | renderContext.SetTopology( TOP_TRIANGLES ); |
| 1192 | HRESULT hr = renderContext.DrawIndexedPrimitive( m_indexCount, m_drawCallStartIndex, m_indexCount / 3 ); |
| 1193 | if( FAILED( hr ) ) |
| 1194 | { |
| 1195 | CCP_LOGWARN( "Tr2Sprite2dScene::SubmitGeometry - DrawIndexedPrimitive failed (0x%x)", hr ); |
| 1196 | } |
| 1197 | } |
| 1198 | |
| 1199 | void Tr2Sprite2dScene::ReleaseResources( TriStorage s ) |
| 1200 | { |
no test coverage detected