CNullDriver: store real size for dummy textures

This commit is contained in:
sfan5 2021-04-21 18:09:49 +02:00
parent 688debb643
commit 3152a6cc46
2 changed files with 5 additions and 1 deletions

@ -725,7 +725,9 @@ video::ITexture* CNullDriver::findTexture(const io::path& filename)
ITexture* CNullDriver::createDeviceDependentTexture(const io::path& name, IImage* image)
{
return new SDummyTexture(name, ETT_2D);
SDummyTexture* dummy = new SDummyTexture(name, ETT_2D);
dummy->setSize(image->getDimension());
return dummy;
}
ITexture* CNullDriver::createDeviceDependentTextureCubemap(const io::path& name, const core::array<IImage*>& image)

@ -783,6 +783,8 @@ namespace video
{
SDummyTexture(const io::path& name, E_TEXTURE_TYPE type) : ITexture(name, type) {};
void setSize(const core::dimension2d<u32>& size) { Size = OriginalSize = size; }
virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 mipmapLevel=0, u32 layer = 0, E_TEXTURE_LOCK_FLAGS lockFlags = ETLF_FLIP_Y_UP_RTT) _IRR_OVERRIDE_ { return 0; }
virtual void unlock()_IRR_OVERRIDE_ {}
virtual void regenerateMipMapLevels(void* data = 0, u32 layer = 0) _IRR_OVERRIDE_ {}