Prepare required resources for rendering. If any of them are not ready this function returns false, otherwise it returns true and rendering can go forward.
| 2270 | // this function returns false, otherwise it returns true and rendering can |
| 2271 | // go forward. |
| 2272 | bool Tr2Sprite2dScene::PrepareResourcesForRender() |
| 2273 | { |
| 2274 | // Prepare resources if we don't have valid index or vertex buffers |
| 2275 | if( !m_indexBuffer.IsValid() || !m_vertexBuffer.IsValid() ) |
| 2276 | { |
| 2277 | PrepareResources(); |
| 2278 | // Bail out if the buffers still aren't valid |
| 2279 | if( !m_indexBuffer.IsValid() || !m_vertexBuffer.IsValid() ) |
| 2280 | { |
| 2281 | return false; |
| 2282 | } |
| 2283 | } |
| 2284 | |
| 2285 | Tr2EffectResPtr effectRes = m_uberShader2d->GetEffectRes(); |
| 2286 | if( !effectRes || effectRes->IsLoading() ) |
| 2287 | { |
| 2288 | // Effect is still loading - can't render any UI |
| 2289 | return false; |
| 2290 | } |
| 2291 | |
| 2292 | if( !effectRes->IsGood() ) |
| 2293 | { |
| 2294 | // Effect load failed - can't render any UI |
| 2295 | CCP_LOGERR( "%s: Effect used for rendering failed to load - attempting to reload", __FUNCTION__ ); |
| 2296 | effectRes->Reload(); |
| 2297 | return false; |
| 2298 | } |
| 2299 | |
| 2300 | return true; |
| 2301 | } |
| 2302 | |
| 2303 | void Tr2Sprite2dScene::SetViewportSizeToVariableStore( float displayWidth, float displayHeight ) |
| 2304 | { |
nothing calls this directly
no test coverage detected