int i, j, p, r, g, b;
qbyte skyupperlayerpixels[128*128*4], skylowerlayerpixels[128*128*4];
unsigned trans[128*128], transpix, *rgba;
+ union
+ {
+ int i;
+ qbyte b[4];
+ }
+ transpixunion;
skyavailable_quake = true;
if (bytesperpixel == 4)
{
+ transpixunion.i = 0;
for (i = 0;i < 128;i++)
for (j = 0;j < 128;j++)
trans[(i*128) + j] = ((unsigned *)src)[i*256+j+128];
}
}
- ((qbyte *)&transpix)[0] = r/(128*128);
- ((qbyte *)&transpix)[1] = g/(128*128);
- ((qbyte *)&transpix)[2] = b/(128*128);
- ((qbyte *)&transpix)[3] = 0;
+ transpixunion.i = 0;
+ transpixunion.b[0] = r/(128*128);
+ transpixunion.b[1] = g/(128*128);
+ transpixunion.b[2] = b/(128*128);
+ transpixunion.b[3] = 0;
}
+ transpix = transpixunion.i;
memcpy(skyupperlayerpixels, trans, 128*128*4);