mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-01 07:40:26 +02:00
Reworking IRenderTarget interface to avoid constant memory allocations.
setTexture functions for single textures (more or less the usual case) IRenderTarget no longer need memory allocations on each call. Also calling IRenderTarget::setTexture with a nullpointer no longer sets a rendertarget with an array which contains a single nullpointer but clears the array instead. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6243 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@ -395,15 +395,15 @@ CSoftwareRenderTarget2::~CSoftwareRenderTarget2()
|
||||
Textures[0]->drop();
|
||||
}
|
||||
|
||||
void CSoftwareRenderTarget2::setTexture(const core::array<ITexture*>& textures, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces)
|
||||
void CSoftwareRenderTarget2::setTextures(ITexture* const * textures, u32 numTextures, ITexture* depthStencil, const E_CUBE_SURFACE* cubeSurfaces, u32 numCubeSurfaces)
|
||||
{
|
||||
if (Textures != textures)
|
||||
if (!Textures.equals(textures, numTextures))
|
||||
{
|
||||
ITexture* prevTexture = Textures[0];
|
||||
|
||||
bool textureDetected = false;
|
||||
|
||||
for (u32 i = 0; i < textures.size(); ++i)
|
||||
for (u32 i = 0; i < numTextures; ++i)
|
||||
{
|
||||
if (textures[i] && textures[i]->getDriverType() == EDT_BURNINGSVIDEO)
|
||||
{
|
||||
|
Reference in New Issue
Block a user