MCPcopy Create free account
hub / github.com/DFHack/dfhack / paintScreenWarmDamp

Function paintScreenWarmDamp

plugins/dig.cpp:2160–2295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2158}
2159
2160static void paintScreenWarmDamp(bool aquifer_mode = false, bool show_damp = false) {
2161 TRACE(log).print("entering paintScreenDampWarm aquifer_mode={}, show_damp={}\n", aquifer_mode, show_damp);
2162
2163 static Screen::Pen empty_pen;
2164
2165 int warm_texpos = 0, damp_texpos = 0;
2166 Screen::findGraphicsTile("MINING_INDICATORS", 1, 0, &warm_texpos);
2167 Screen::findGraphicsTile("MINING_INDICATORS", 0, 0, &damp_texpos);
2168 Screen::Pen warm_pen, damp_pen;
2169 warm_pen.tile = warm_texpos;
2170 damp_pen.tile = damp_texpos;
2171
2172 long warm_dig_texpos = Textures::getTexposByHandle(textures[3]);
2173 long damp_dig_texpos = Textures::getTexposByHandle(textures[2]);
2174 long light_aq_texpos = Textures::getTexposByHandle(textures[0]);
2175 long heavy_aq_texpos = Textures::getTexposByHandle(textures[1]);
2176 Screen::Pen warm_dig_pen, damp_dig_pen, light_aq_pen, heavy_aq_pen;
2177 warm_dig_pen.tile = warm_dig_texpos;
2178 damp_dig_pen.tile = damp_dig_texpos;
2179 light_aq_pen.tile = light_aq_texpos;
2180 heavy_aq_pen.tile = heavy_aq_texpos;
2181
2182 auto dims = Gui::getDwarfmodeViewDims().map();
2183 for (int y = dims.first.y; y <= dims.second.y; ++y) {
2184 for (int x = dims.first.x; x <= dims.second.x; ++x) {
2185 df::coord pos(*window_x + x, *window_y + y, *window_z);
2186
2187 auto block = Maps::getTileBlock(pos);
2188 if (!block)
2189 continue;
2190
2191 if (!aquifer_mode && Screen::inGraphicsMode()) {
2192 if (auto warm_mask = World::getPersistentTilemask(warm_config, block)) {
2193 if (warm_mask->getassignment(pos))
2194 bump_layers(warm_dig_pen, x, y);
2195 }
2196 if (auto damp_mask = World::getPersistentTilemask(damp_config, block)) {
2197 if (damp_mask->getassignment(pos))
2198 bump_layers(damp_dig_pen, x, y);
2199 }
2200 }
2201
2202 if (!aquifer_mode && !Maps::isTileVisible(pos) && !Maps::isTileVisible(pos-1)) {
2203 TRACE(log).print("skipping hidden tile\n");
2204 continue;
2205 }
2206
2207 if (Screen::inGraphicsMode()) {
2208 Screen::Pen *pen = NULL;
2209 if (!aquifer_mode && is_warm(pos) && is_wall(pos)) {
2210 pen = &warm_pen;
2211 } else if (is_aquifer(pos)) {
2212 pen = is_heavy_aquifer(pos, block) ? &heavy_aq_pen : &light_aq_pen;
2213 } else if ((!aquifer_mode || show_damp) && is_wall(pos) && is_damp(pos)) {
2214 pen = &damp_pen;
2215 }
2216 if (pen) {
2217 int existing_tile = Screen::readTile(x, y, true).tile;

Callers

nothing calls this directly

Calls 14

getTileBlockFunction · 0.85
bump_layersFunction · 0.85
isTileVisibleFunction · 0.85
is_warmFunction · 0.85
is_aquiferFunction · 0.85
is_heavy_aquiferFunction · 0.85
is_dampFunction · 0.85
paintTileFunction · 0.85
getTileDesignationFunction · 0.85
blinkFunction · 0.85
mapMethod · 0.80
validMethod · 0.80

Tested by

no test coverage detected