1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

campaign editor

This commit is contained in:
Laserlicht
2025-03-23 19:52:21 +01:00
parent e1be9af5e6
commit 28169b051e
28 changed files with 3404 additions and 98 deletions

View File

@@ -69,18 +69,20 @@ namespace BitmapHandler
it = (int)size - 256 * 3;
for(int i = 0; i < 256; i++)
{
char bytes[3];
unsigned char bytes[4];
bytes[0] = pcx[it++];
bytes[1] = pcx[it++];
bytes[2] = pcx[it++];
colorTable.append(qRgb(bytes[0], bytes[1], bytes[2]));
bytes[3] = (bytes[0] == 0 && bytes[1] == 255 && bytes[2] == 255) ? 0 : 255;
colorTable.append(qRgba(bytes[0], bytes[1], bytes[2], bytes[3]));
}
image.setColorTable(colorTable);
return image;
}
else
{
QImage image(pcx + it, width, height, width * 3, QImage::Format_RGB888);
QImage image(pcx + it, width, height, width * 3, QImage::Format_BGR888);
return image;
}
}