| 26 | namespace OpenApoc |
| 27 | { |
| 28 | CityTileView::CityTileView(TileMap &map, Vec3<int> isoTileSize, Vec2<int> stratTileSize, |
| 29 | TileViewMode initialMode, Vec3<float> screenCenterTile, |
| 30 | GameState &gameState) |
| 31 | : TileView(map, isoTileSize, stratTileSize, initialMode), |
| 32 | day_palette(fw().data->loadPalette("xcom3/ufodata/pal_01.dat")), |
| 33 | twilight_palette(fw().data->loadPalette("xcom3/ufodata/pal_02.dat")), |
| 34 | night_palette(fw().data->loadPalette("xcom3/ufodata/pal_03.dat")), state(gameState) |
| 35 | { |
| 36 | std::vector<sp<Palette>> newPal; |
| 37 | newPal.resize(3); |
| 38 | for (int j = 0; j <= 15; j++) |
| 39 | { |
| 40 | colorCurrent = j; |
| 41 | newPal[0] = mksp<Palette>(); |
| 42 | newPal[1] = mksp<Palette>(); |
| 43 | newPal[2] = mksp<Palette>(); |
| 44 | |
| 45 | for (int i = 0; i < 255 - 4; i++) |
| 46 | { |
| 47 | newPal[0]->setColour(i, day_palette->getColour(i)); |
| 48 | newPal[1]->setColour(i, twilight_palette->getColour(i)); |
| 49 | newPal[2]->setColour(i, night_palette->getColour(i)); |
| 50 | } |
| 51 | for (int i = 0; i < 3; i++) |
| 52 | { |
| 53 | // Yellow color, for owned indicators, pulsates from (3/8r 3/8g 0b) to (8/8r 8/8g 0b) |
| 54 | newPal[i]->setColour(255 - 3, Colour((colorCurrent * 16 * 5 + 255 * 3) / 8, |
| 55 | (colorCurrent * 16 * 5 + 255 * 3) / 8, 0)); |
| 56 | // Red color, for enemy indicators, pulsates from (3/8r 0g 0b) to (8/8r 0g 0b) |
| 57 | newPal[i]->setColour(255 - 2, Colour((colorCurrent * 16 * 5 + 255 * 3) / 8, 0, 0)); |
| 58 | // Pink color, for neutral indicators, pulsates from (3/8r 0g 3/8b) to (8/8r 0g 8/8b) |
| 59 | newPal[i]->setColour(255 - 1, Colour((colorCurrent * 16 * 5 + 255 * 3) / 8, 0, |
| 60 | (colorCurrent * 16 * 5 + 255 * 3) / 8)); |
| 61 | // Blue color, for misc. indicators, pulsates from (0r 3/8g 3/8b) to (0r 8/8g 8/8b) |
| 62 | newPal[i]->setColour(255 - 0, Colour(0, (colorCurrent * 16 * 5 + 255 * 3) / 8, |
| 63 | (colorCurrent * 16 * 5 + 255 * 3) / 8)); |
| 64 | } |
| 65 | |
| 66 | mod_day_palette.push_back(newPal[0]); |
| 67 | mod_twilight_palette.push_back(newPal[1]); |
| 68 | mod_night_palette.push_back(newPal[2]); |
| 69 | mod_interpolated_palette.push_back(mksp<Palette>()); |
| 70 | interpolated_palette_minute.push_back(0); |
| 71 | } |
| 72 | |
| 73 | selectedTileImageBack = fw().data->loadImage("city/selected-citytile-back.png"); |
| 74 | selectedTileImageFront = fw().data->loadImage("city/selected-citytile-front.png"); |
| 75 | selectedTileImageOffset = {32, 16}; |
| 76 | pal = fw().data->loadPalette("xcom3/ufodata/pal_01.dat"); |
| 77 | alertImage = fw().data->loadImage("city/building-circle-red.png"); |
| 78 | cargoImage = fw().data->loadImage("city/building-circle-yellow.png"); |
| 79 | |
| 80 | selectionBrackets.resize(4); |
| 81 | for (int i = 72; i < 76; i++) |
| 82 | { |
| 83 | selectionBrackets[0].push_back(fw().data->loadImage(format( |
| 84 | "PCK:xcom3/ufodata/vs_icon.pck:xcom3/ufodata/vs_icon.tab:%d:xcom3/ufodata/pal_01.dat", |
| 85 | i))); |
nothing calls this directly
no test coverage detected