mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 09:15:29 +01:00 
			
		
		
		
	Fix occasional black screen on startup
This commit is contained in:
		@@ -140,7 +140,8 @@ bool TextureBuffer::ensureTexture(video::ITexture **texture, const TextureDefini
 | 
			
		||||
	if (definition.valid) {
 | 
			
		||||
		if (definition.clear) {
 | 
			
		||||
			video::IImage *image = m_driver->createImage(definition.format, size);
 | 
			
		||||
			image->fill(0u);
 | 
			
		||||
			// Cannot use image->fill because it's not implemented for all formats.
 | 
			
		||||
			std::memset(image->getData(), 0, image->getDataSizeFromFormat(definition.format, size.Width, size.Height));
 | 
			
		||||
			*texture = m_driver->addTexture(definition.name.c_str(), image);
 | 
			
		||||
			image->drop();
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user