This commit is contained in:
bkaradzic 2013-12-07 22:01:55 -08:00
parent 5b4d4b37fa
commit d595f34c0a

View file

@ -1673,17 +1673,14 @@ namespace bgfx
data = temp; data = temp;
} }
if (srcpitch == dstpitch)
{
memcpy(bits, data, srcpitch*_rect.m_height);
}
else
{ {
uint8_t* src = data;
uint8_t* dst = bits;
for (uint32_t yy = 0, height = _rect.m_height; yy < height; ++yy) for (uint32_t yy = 0, height = _rect.m_height; yy < height; ++yy)
{ {
uint8_t* src = &data[yy*srcpitch]; memcpy(dst, src, rectpitch);
uint8_t* dst = &bits[yy*dstpitch]; src += srcpitch;
memcpy(dst, src, srcpitch); dst += dstpitch;
} }
} }