mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Added building faction colors.
This commit is contained in:
@@ -472,6 +472,17 @@ void BuildingClass::Draw_It(int x, int y, WindowNumberType window) const
|
||||
PaletteClass globalPal = CCPalette;
|
||||
if(Class->CustomTheatrePalette[LastTheater] != NULL) {
|
||||
CCGlobalOveridePalette = (void *)Class->CustomTheatrePalette[LastTheater];
|
||||
HouseTypeClass* houseType = House->Class;
|
||||
|
||||
if (houseType->House >= HOUSE_MULTI1) {
|
||||
CCPaletteHouseColor = House->RemapColor;
|
||||
}
|
||||
else if (houseType->House <= HOUSE_TURKEY) {
|
||||
CCPaletteHouseColor = houseType->House;
|
||||
}
|
||||
else {
|
||||
CCPaletteHouseColor = 0;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -322,6 +322,8 @@ extern int ScenarioInit;
|
||||
extern HouseClass * PlayerPtr;
|
||||
extern PaletteClass CCPalette;
|
||||
extern void* CCGlobalOveridePalette;
|
||||
extern int CCPaletteHouseColor;
|
||||
extern float HouseRGBColors[8][3];
|
||||
extern PaletteClass BlackPalette;
|
||||
extern PaletteClass WhitePalette;
|
||||
extern PaletteClass GamePalette;
|
||||
|
||||
@@ -551,6 +551,7 @@ HouseClass * PlayerPtr;
|
||||
*/
|
||||
PaletteClass CCPalette;
|
||||
void* CCGlobalOveridePalette = NULL;
|
||||
int CCPaletteHouseColor = 0;
|
||||
PaletteClass GamePalette;
|
||||
//PaletteClass InGamePalette;
|
||||
PaletteClass BlackPalette(RGBClass(0, 0, 0));
|
||||
@@ -558,6 +559,17 @@ PaletteClass WhitePalette(RGBClass(RGBClass::MAX_VALUE, RGBClass::MAX_VALUE, RGB
|
||||
PaletteClass OriginalPalette;
|
||||
PaletteClass ScorePalette;
|
||||
|
||||
float HouseRGBColors[8][3] = {
|
||||
{ 255.0f, 223.0f, 94.0f },
|
||||
{160,164,200 }, // Allies Blue
|
||||
{255.0f, 20.0f, 20.0f },
|
||||
{140, 244, 140 }, // Green
|
||||
{255.0f, 155.0f, 0.0f},
|
||||
{92, 192, 164},
|
||||
{204, 184, 176},
|
||||
{170, 93, 71}
|
||||
};
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** These are the event queues. One is for holding events until they are ready to be
|
||||
|
||||
@@ -504,14 +504,44 @@ Image_t* Image_CreateImageFrom8Bit(const char* name, int Width, int Height, unsi
|
||||
|
||||
for (int i = 0; i < Width * Height; i++) {
|
||||
unsigned char c = data[i];
|
||||
if (remap) {
|
||||
|
||||
unsigned char r = 0;
|
||||
unsigned char g = 0;
|
||||
unsigned char b = 0;
|
||||
unsigned char a = 0;
|
||||
|
||||
if (CCGlobalOveridePalette && remap) {
|
||||
r = ccpalete[(c * 3) + 0] << 2;
|
||||
g = ccpalete[(c * 3) + 1] << 2;
|
||||
b = ccpalete[(c * 3) + 2] << 2;
|
||||
a = 0;
|
||||
|
||||
// Assume we are loading TS palettes.
|
||||
if (c >= 0x10 && c <= 0x1f) {
|
||||
float greyscale = r / 255.0f;
|
||||
|
||||
r = HouseRGBColors[CCPaletteHouseColor][0] * greyscale;
|
||||
g = HouseRGBColors[CCPaletteHouseColor][1] * greyscale;
|
||||
b = HouseRGBColors[CCPaletteHouseColor][2] * greyscale;
|
||||
a = 0;
|
||||
}
|
||||
}
|
||||
else if (remap) {
|
||||
c = remap[c];
|
||||
r = ccpalete[(c * 3) + 0] << 2;
|
||||
g = ccpalete[(c * 3) + 1] << 2;
|
||||
b = ccpalete[(c * 3) + 2] << 2;
|
||||
a = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
r = ccpalete[(c * 3) + 0] << 2;
|
||||
g = ccpalete[(c * 3) + 1] << 2;
|
||||
b = ccpalete[(c * 3) + 2] << 2;
|
||||
a = 0;
|
||||
}
|
||||
|
||||
unsigned char r = ccpalete[(c * 3) + 0] << 2;
|
||||
unsigned char g = ccpalete[(c * 3) + 1] << 2;
|
||||
unsigned char b = ccpalete[(c * 3) + 2] << 2;
|
||||
unsigned char a = 0;
|
||||
|
||||
|
||||
if ((r == 84 && g == 252 && b == 84) || (r == 0 && g == 168 && b == 0)) {
|
||||
r = 0;
|
||||
|
||||
Reference in New Issue
Block a user