float *ptr=array.append();
for(const unsigned char *c=array.get_format().begin(); c!=array.get_format().end(); ++c)
{
- uint size=(*c&3)+1;
- uint type=*c>>2;
+ unsigned size=(*c&3)+1;
+ unsigned type=*c>>2;
switch(type)
{
case 0:
case 3:
if(size==1)
{
- union { ubyte c[4]; float f; } u;
- u.c[0]=static_cast<ubyte>(cr*255);
- u.c[1]=static_cast<ubyte>(cg*255);
- u.c[2]=static_cast<ubyte>(cb*255);
- u.c[3]=static_cast<ubyte>(ca*255);
+ union { unsigned char c[4]; float f; } u;
+ u.c[0]=static_cast<unsigned char>(cr*255);
+ u.c[1]=static_cast<unsigned char>(cg*255);
+ u.c[2]=static_cast<unsigned char>(cb*255);
+ u.c[3]=static_cast<unsigned char>(ca*255);
*ptr++=u.f;
}
else