diff --git a/data/base/palette.txt b/data/base/palette.txt index 52a7541a3..b6bb5b5a5 100644 --- a/data/base/palette.txt +++ b/data/base/palette.txt @@ -86,3 +86,4 @@ E0,E0,E0,ff // team11 - white 32,4b,a0,ff // blueprint planned by ally ff,80,40,ff // construction bar text 00,ff,00,ff // power queue bar text +80,c0,00,ff // WZCOL_MAP_PREVIEW_BARREL diff --git a/lib/ivis_opengl/piepalette.h b/lib/ivis_opengl/piepalette.h index 095a6717c..b6cff1a8d 100644 --- a/lib/ivis_opengl/piepalette.h +++ b/lib/ivis_opengl/piepalette.h @@ -110,8 +110,9 @@ #define WZCOL_BLUEPRINT_PLANNED_BY_ALLY psPalette[85] #define WZCOL_CONSTRUCTION_BARTEXT psPalette[86] #define WZCOL_POWERQUEUE_BARTEXT psPalette[87] +#define WZCOL_MAP_PREVIEW_BARREL psPalette[88] -#define WZCOL_MAX 88 +#define WZCOL_MAX 89 //************************************************************************* diff --git a/src/game.cpp b/src/game.cpp index e843e48ef..7082cebf1 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -6579,7 +6579,8 @@ static void plotFeature(char *backDropSprite) UDWORD sizeOfSaveFeature = 0; char *pFileData = NULL; char aFileName[256]; - const PIELIGHT color = WZCOL_MAP_PREVIEW_OIL; + const PIELIGHT colourOil = WZCOL_MAP_PREVIEW_OIL; + const PIELIGHT colourBarrel = WZCOL_MAP_PREVIEW_BARREL; psLevel = levFindDataSet(game.map); strcpy(aFileName, psLevel->apDataFiles[0]); @@ -6604,14 +6605,23 @@ static void plotFeature(char *backDropSprite) Position pos = ini.vector3i("position"); // we only care about oil + PIELIGHT const *colour = NULL; if (name.startsWith("OilResource")) + { + colour = &colourOil; + } + else if (name.startsWith("OilDrum")) + { + colour = &colourBarrel; + } + if (colour != NULL) { // and now we blit the color to the texture xx = map_coord(pos.x); yy = map_coord(pos.y); - backDropSprite[3 * ((yy * BACKDROP_HACK_WIDTH) + xx)] = color.byte.r; - backDropSprite[3 * ((yy * BACKDROP_HACK_WIDTH) + xx) + 1] = color.byte.g; - backDropSprite[3 * ((yy * BACKDROP_HACK_WIDTH) + xx) + 2] = color.byte.b; + backDropSprite[3 * ((yy * BACKDROP_HACK_WIDTH) + xx)] = colour->byte.r; + backDropSprite[3 * ((yy * BACKDROP_HACK_WIDTH) + xx) + 1] = colour->byte.g; + backDropSprite[3 * ((yy * BACKDROP_HACK_WIDTH) + xx) + 2] = colour->byte.b; } ini.endGroup(); } @@ -6655,20 +6665,26 @@ static void plotFeature(char *backDropSprite) psSaveFeature = (SAVE_FEATURE_V2*) pFileData; // we only care about oil + PIELIGHT const *colour = NULL; if (strncmp(psSaveFeature->name, "OilResource", 11) == 0) { - endian_udword(&psSaveFeature->x); - endian_udword(&psSaveFeature->y); - xx = map_coord(psSaveFeature->x); - yy = map_coord(psSaveFeature->y); + colour = &colourOil; + } + else if (strncmp(psSaveFeature->name, "OilDrum", 7) == 0) + { + colour = &colourBarrel; } else { continue; } + endian_udword(&psSaveFeature->x); + endian_udword(&psSaveFeature->y); + xx = map_coord(psSaveFeature->x); + yy = map_coord(psSaveFeature->y); // and now we blit the color to the texture - backDropSprite[3 * ((yy * BACKDROP_HACK_WIDTH) + xx)] = color.byte.r; - backDropSprite[3 * ((yy * BACKDROP_HACK_WIDTH) + xx) + 1] = color.byte.g; - backDropSprite[3 * ((yy * BACKDROP_HACK_WIDTH) + xx) + 2] = color.byte.b; + backDropSprite[3 * ((yy * BACKDROP_HACK_WIDTH) + xx)] = colour->byte.r; + backDropSprite[3 * ((yy * BACKDROP_HACK_WIDTH) + xx) + 1] = colour->byte.g; + backDropSprite[3 * ((yy * BACKDROP_HACK_WIDTH) + xx) + 2] = colour->byte.b; } }