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

Function UnsafeDrawBorder2px

Source/engine/render/primitive_render.cpp:224–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224void UnsafeDrawBorder2px(const Surface &out, Rectangle rect, uint8_t color)
225{
226 const size_t width = rect.size.width;
227 const size_t height = rect.size.height;
228 uint8_t *buf = &out[rect.position];
229 std::memset(buf, color, width);
230 buf += out.pitch();
231 std::memset(buf, color, width);
232 buf += out.pitch();
233 for (size_t i = 4; i < height; ++i) {
234 buf[0] = buf[1] = color;
235 buf[width - 2] = buf[width - 1] = color;
236 buf += out.pitch();
237 }
238 std::memset(buf, color, width);
239 buf += out.pitch();
240 std::memset(buf, color, width);
241}
242
243} // namespace devilution

Callers 2

DrawLargeSpellIconBorderFunction · 0.85
DrawSmallSpellIconBorderFunction · 0.85

Calls 1

pitchMethod · 0.80

Tested by

no test coverage detected