- unsigned char* lightmap = new unsigned char[Width * Height * 4];
- for(int iX = 0; iX < (Width * 4); iX += 4)
- {
- for(int iY = 0; iY < Height; iY += 1)
- {
- lightmap[iX + iY * Height * 4] = (char)lumelcolor[iX / 4][iY][0]; // Red
- lightmap[iX + iY * Height * 4 + 1] = (char)lumelcolor[iX / 4][iY][1]; // Green
- lightmap[iX + iY * Height * 4 + 2] = (char)lumelcolor[iX / 4][iY][2]; // Blue
- lightmap[iX + iY * Height * 4 + 3] = 255; // Alpha
- }
- }