Changed: Cast to CRGBA* is faster than set8888

--HG--
branch : develop
hg/feature/material-editor
kervala 9 years ago
parent 96fab4210b
commit 494ab2ce20

@ -443,14 +443,14 @@ bool CBitmap::isGrayscale() const
uint32 *data = (uint32*)_Data[0].getPtr(); uint32 *data = (uint32*)_Data[0].getPtr();
uint32 *endData = (uint32*)((uint8*)data + size); uint32 *endData = (uint32*)((uint8*)data + size);
NLMISC::CRGBA color; NLMISC::CRGBA *color = NULL;
// check if all alphas have the same value // check if all alphas have the same value
while(data < endData) while(data < endData)
{ {
color.set8888(*data); color = (NLMISC::CRGBA*)data;
if (!color.isGray()) return false; if (!color->isGray()) return false;
++data; ++data;
} }

Loading…
Cancel
Save