Prevent crash in CD3D9RenderTarget::generateSurfaces when a CD3D9Texture has no IDirect3DTexture9.
Increase log-warning level from information to error when CD3D9Texture::generateRenderTarget fails to generate a IDirect3DTexture9. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5614 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
a7a90ff191
commit
609a6474f0
|
@ -236,25 +236,27 @@ namespace irr
|
|||
if (!Surface[i] && Texture[i])
|
||||
{
|
||||
IDirect3DTexture9* currentTexture = static_cast<CD3D9Texture*>(Texture[i])->getDX9Texture();
|
||||
|
||||
if ( currentTexture )
|
||||
{
|
||||
IDirect3DSurface9* currentSurface = 0;
|
||||
currentTexture->GetSurfaceLevel(0, ¤tSurface);
|
||||
|
||||
Surface[i] = currentSurface;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!DepthStencilSurface && DepthStencil)
|
||||
{
|
||||
IDirect3DTexture9* currentTexture = static_cast<CD3D9Texture*>(DepthStencil)->getDX9Texture();
|
||||
|
||||
if ( currentTexture )
|
||||
{
|
||||
IDirect3DSurface9* currentSurface = 0;
|
||||
currentTexture->GetSurfaceLevel(0, ¤tSurface);
|
||||
|
||||
DepthStencilSurface = currentSurface;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -353,13 +353,13 @@ void CD3D9Texture::generateRenderTarget()
|
|||
if (FAILED(hr))
|
||||
{
|
||||
if (D3DERR_INVALIDCALL == hr)
|
||||
os::Printer::log("Could not create render target texture", "Invalid Call");
|
||||
os::Printer::log("Could not create render target texture", "Invalid Call", irr::ELL_ERROR);
|
||||
else if (D3DERR_OUTOFVIDEOMEMORY == hr)
|
||||
os::Printer::log("Could not create render target texture", "Out of Video Memory");
|
||||
os::Printer::log("Could not create render target texture", "Out of Video Memory", irr::ELL_ERROR);
|
||||
else if (E_OUTOFMEMORY == hr)
|
||||
os::Printer::log("Could not create render target texture", "Out of Memory");
|
||||
os::Printer::log("Could not create render target texture", "Out of Memory", irr::ELL_ERROR);
|
||||
else
|
||||
os::Printer::log("Could not create render target texture");
|
||||
os::Printer::log("Could not create render target texture", irr::ELL_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue