mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Cleanup.
This commit is contained in:
parent
eecb4be9e9
commit
72a4bf0847
1 changed files with 32 additions and 28 deletions
|
@ -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)
|
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);
|
memset(mem->data, 0, mem->size);
|
||||||
if (_region.getType() == AtlasRegion::TYPE_BGRA8)
|
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);
|
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
|
void Atlas::packFaceLayerUV(uint32_t _idx, uint8_t* _vertexBuffer, uint32_t _offset, uint32_t _stride) const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue