MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / PopulateOutlinePixelsForRow

Function PopulateOutlinePixelsForRow

Source/engine/render/clx_render.cpp:249–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247OutlinePixelsCacheEntry OutlinePixelsCache;
248
249void PopulateOutlinePixelsForRow(
250 const OutlineRowSolidRuns &runs,
251 const bool *DVL_RESTRICT below,
252 bool *DVL_RESTRICT cur,
253 bool *DVL_RESTRICT above,
254 uint8_t y,
255 OutlinePixels &result)
256{
257 DVL_ASSUME(!runs.empty());
258 for (const auto &[begin, end] : runs) {
259 if (!cur[static_cast<uint8_t>(begin - 1)]) {
260 result.emplace_back(static_cast<uint8_t>(begin - 1), y);
261 cur[static_cast<uint8_t>(begin - 1)] = true;
262 }
263 if (!cur[end]) {
264 result.emplace_back(end, y);
265 cur[end] = true;
266 }
267 for (uint8_t x = begin; x < end; ++x) {
268 if (!below[x]) {
269 result.emplace_back(x, static_cast<uint8_t>(y + 1));
270 }
271 if (!above[x]) {
272 result.emplace_back(x, static_cast<uint8_t>(y - 1));
273 above[x] = true;
274 }
275 }
276 }
277}
278
279void AppendOutlineRowSolidRuns(uint8_t x, uint8_t w, OutlineRowSolidRuns &solidRuns)
280{

Callers 1

GetOutlineFunction · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected