Cleanup.
This commit is contained in:
parent
eecb4be9e9
commit
72a4bf0847
@ -405,7 +405,10 @@ uint16_t Atlas::addRegion(uint16_t _width, uint16_t _height, const uint8_t* _bit
|
||||
|
||||
void Atlas::updateRegion(const AtlasRegion& _region, const uint8_t* _bitmapBuffer)
|
||||
{
|
||||
const bgfx::Memory* mem = bgfx::alloc(_region.width * _region.height * 4);
|
||||
uint32_t size = _region.width * _region.height * 4;
|
||||
if (0 < size)
|
||||
{
|
||||
const bgfx::Memory* mem = bgfx::alloc(size);
|
||||
memset(mem->data, 0, mem->size);
|
||||
if (_region.getType() == AtlasRegion::TYPE_BGRA8)
|
||||
{
|
||||
@ -442,6 +445,7 @@ void Atlas::updateRegion(const AtlasRegion& _region, const uint8_t* _bitmapBuffe
|
||||
|
||||
bgfx::updateTextureCube(m_textureHandle, (uint8_t)_region.getFaceIndex(), 0, _region.x, _region.y, _region.width, _region.height, mem);
|
||||
}
|
||||
}
|
||||
|
||||
void Atlas::packFaceLayerUV(uint32_t _idx, uint8_t* _vertexBuffer, uint32_t _offset, uint32_t _stride) const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user