MCPcopy Create free account
hub / github.com/diasurgical/devilution / trans_rect

Function trans_rect

Source/render.cpp:294–306  ·  view source on GitHub ↗

* Draws a half-transparent rectangle by blacking out odd pixels on odd lines, * even pixels on even lines. * @brief Render a transparent black rectangle * @param sx Screen coordinate * @param sy Screen coordinate * @param width Rectangle width * @param height Rectangle height */

Source from the content-addressed store, hash-verified

292 * @param height Rectangle height
293 */
294void trans_rect(int sx, int sy, int width, int height)
295{
296 int row, col;
297 BYTE *pix = &gpBuffer[SCREENXY(sx, sy)];
298 for (row = 0; row < height; row++) {
299 for (col = 0; col < width; col++) {
300 if ((row & 1 && col & 1) || (!(row & 1) && !(col & 1)))
301 *pix = 0;
302 pix++;
303 }
304 pix += BUFFER_WIDTH - width;
305 }
306}
307
308DEVILUTION_END_NAMESPACE

Callers 4

DrawSTextBackFunction · 0.85
DrawQTextBackFunction · 0.85
DrawDiabloMsgFunction · 0.85
DrawUTextBackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected