MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / BattleTileView

Method BattleTileView

game/ui/tileview/battletileview.cpp:95–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95BattleTileView::BattleTileView(TileMap &map, Vec3<int> isoTileSize, Vec2<int> stratTileSize,
96 TileViewMode initialMode, Vec3<float> screenCenterTile,
97 GameState &gameState)
98 : TileView(map, isoTileSize, stratTileSize, initialMode),
99 hiddenForm(ui().getForm("battle/hidden")), state(gameState),
100 battle(*gameState.current_battle),
101 palette(fw().data->loadPalette("xcom3/tacdata/tactical.pal"))
102{
103 pal = palette;
104
105 for (int j = 0; j <= 15; j++)
106 {
107 colorCurrent = j;
108 auto newPal = mksp<Palette>();
109
110 for (int i = 0; i < 255 - 4; i++)
111 {
112 newPal->setColour(i, palette->getColour(i));
113 }
114 // Lift color, pulsates from (0r 3/8g 5/8b) to (0r 8/8g 4/8b)
115 newPal->setColour(255 - 4, Colour(0, (colorCurrent * 16 * 5 + 255 * 3) / 8,
116 (colorCurrent * 16 * -1 + 255 * 5) / 8));
117 // Yellow color, for owned indicators, pulsates from (3/8r 3/8g 0b) to (8/8r 8/8g 0b)
118 newPal->setColour(255 - 3, Colour((colorCurrent * 16 * 5 + 255 * 3) / 8,
119 (colorCurrent * 16 * 5 + 255 * 3) / 8, 0));
120 // Red color, for enemy indicators, pulsates from (3/8r 0g 0b) to (8/8r 0g 0b)
121 newPal->setColour(255 - 2, Colour((colorCurrent * 16 * 5 + 255 * 3) / 8, 0, 0));
122 // Pink color, for neutral indicators, pulsates from (3/8r 0g 3/8b) to (8/8r 0g 8/8b)
123 newPal->setColour(255 - 1, Colour((colorCurrent * 16 * 5 + 255 * 3) / 8, 0,
124 (colorCurrent * 16 * 5 + 255 * 3) / 8));
125 // Blue color, for misc. indicators, pulsates from (0r 3/8g 3/8b) to (0r 8/8g 8/8b)
126 newPal->setColour(255 - 0, Colour(0, (colorCurrent * 16 * 5 + 255 * 3) / 8,
127 (colorCurrent * 16 * 5 + 255 * 3) / 8));
128
129 modPalette.push_back(newPal);
130 }
131
132 layerDrawingMode = LayerDrawingMode::UpToCurrentLevel;
133 targetTacticalThisLevel =
134
135 fw().data->loadImage(format("PCKSTRAT:xcom3/tacdata/stratico.pck:xcom3/tacdata/"
136 "stratico.tab:%d",
137 482));
138 targetTacticalOtherLevel =
139 fw().data->loadImage(format("PCKSTRAT:xcom3/tacdata/stratico.pck:xcom3/tacdata/"
140 "stratico.tab:%d",
141 483));
142 selectedTileEmptyImageBack =
143 fw().data->loadImage(format("PCK:xcom3/tacdata/icons.pck:xcom3/tacdata/"
144 "icons.tab:%d:xcom3/tacdata/tactical.pal",
145 182));
146 selectedTileEmptyImageFront =
147 fw().data->loadImage(format("PCK:xcom3/tacdata/icons.pck:xcom3/tacdata/"
148 "icons.tab:%d:xcom3/tacdata/tactical.pal",
149 183));
150 selectedTileFilledImageBack =
151 fw().data->loadImage(format("PCK:xcom3/tacdata/icons.pck:xcom3/tacdata/"
152 "icons.tab:%d:xcom3/tacdata/tactical.pal",

Callers

nothing calls this directly

Calls 10

ColourClass · 0.85
formatFunction · 0.85
trFunction · 0.85
loadPaletteMethod · 0.80
setColourMethod · 0.80
getFormMethod · 0.45
loadImageMethod · 0.45
getFontMethod · 0.45
getStringMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected