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

Method ValidateAndSetTextures

trinity/Sprite2d/Tr2SpriteObject.cpp:294–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294bool Tr2TexturedSpriteObject::ValidateAndSetTextures( Tr2Sprite2dScene* renderer )
295{
296 if( m_spriteEffect >= TR2_SFX_ONE_TEXTURE )
297 {
298 if( m_texturePrimary )
299 {
300 if( !m_texturePrimary->IsGood() )
301 {
302 // Don't draw if we're still loading (or failed)
303 return false;
304 }
305 m_texturePrimary->Apply( renderer, 0 );
306 }
307 else
308 {
309 // Don't draw if no texture set
310 return false;
311 }
312
313 if( m_spriteEffect >= TR2_SFX_TWO_TEXTURES )
314 {
315 if( m_textureSecondary )
316 {
317 if( !m_textureSecondary->IsGood() )
318 {
319 // Don't draw if we're still loading (or failed)
320 return false;
321 }
322 m_textureSecondary->Apply( renderer, 1 );
323 }
324 else
325 {
326 // Don't draw if no texture set
327 return false;
328 }
329 }
330 }
331
332 return true;
333}
334
335void Tr2TexturedSpriteObject::SetValidatedTextures( Tr2Sprite2dScene* renderer )
336{

Callers

nothing calls this directly

Calls 2

IsGoodMethod · 0.45
ApplyMethod · 0.45

Tested by

no test coverage detected