mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Cleanup.
This commit is contained in:
parent
0283c83c0a
commit
8109de5461
2 changed files with 13 additions and 5 deletions
|
@ -382,19 +382,24 @@ namespace bgfx
|
|||
}
|
||||
}
|
||||
|
||||
void imageCopy(uint32_t _width, uint32_t _height, uint32_t _bpp, uint32_t _srcPitch, const void* _src, void* _dst)
|
||||
void imageCopy(uint32_t _height, uint32_t _srcPitch, const void* _src, uint32_t _dstPitch, void* _dst)
|
||||
{
|
||||
const uint32_t pitch = _width*_bpp/8;
|
||||
const uint8_t* src = (uint8_t*) _src;
|
||||
const uint8_t* next = src + _srcPitch;
|
||||
const uint32_t pitch = bx::uint32_min(_srcPitch, _dstPitch);
|
||||
const uint8_t* src = (uint8_t*)_src;
|
||||
uint8_t* dst = (uint8_t*)_dst;
|
||||
|
||||
for (uint32_t yy = 0; yy < _height; ++yy, src = next, next += _srcPitch, dst += pitch)
|
||||
for (uint32_t yy = 0; yy < _height; ++yy, src += _srcPitch, dst += _dstPitch)
|
||||
{
|
||||
memcpy(dst, src, pitch);
|
||||
}
|
||||
}
|
||||
|
||||
void imageCopy(uint32_t _width, uint32_t _height, uint32_t _bpp, uint32_t _srcPitch, const void* _src, void* _dst)
|
||||
{
|
||||
const uint32_t dstPitch = _width*_bpp/8;
|
||||
imageCopy(_height, _srcPitch, _src, dstPitch, _dst);
|
||||
}
|
||||
|
||||
void imageWriteTga(bx::WriterI* _writer, uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, bool _grayscale, bool _yflip)
|
||||
{
|
||||
uint8_t type = _grayscale ? 3 : 2;
|
||||
|
|
|
@ -80,6 +80,9 @@ namespace bgfx
|
|||
///
|
||||
void imageSwizzleBgra8(uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, void* _dst);
|
||||
|
||||
///
|
||||
void imageCopy(uint32_t _height, uint32_t _srcPitch, const void* _src, uint32_t _dstPitch, void* _dst);
|
||||
|
||||
///
|
||||
void imageCopy(uint32_t _width, uint32_t _height, uint32_t _bpp, uint32_t _srcPitch, const void* _src, void* _dst);
|
||||
|
||||
|
|
Loading…
Reference in a new issue