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

Function world_draw_black_tile

Source/render.cpp:261–283  ·  view source on GitHub ↗

* @brief Render a black tile * @param sx Back buffer coordinate * @param sy Back buffer coordinate */

Source from the content-addressed store, hash-verified

259 * @param sy Back buffer coordinate
260 */
261void world_draw_black_tile(int sx, int sy)
262{
263 int i, j, k;
264 BYTE *dst;
265
266 if (sx >= SCREEN_X + SCREEN_WIDTH || sy >= SCREEN_Y + VIEWPORT_HEIGHT + 32)
267 return;
268
269 if (sx < SCREEN_X - 60 || sy < SCREEN_Y)
270 return;
271
272 dst = &gpBuffer[sx + BUFFER_WIDTH * sy] + 30;
273
274 for (i = 30, j = 1; i >= 0; i -= 2, j++, dst -= BUFFER_WIDTH + 2) {
275 if (dst < gpBufEnd)
276 memset(dst, 0, 4 * j);
277 }
278 dst += 4;
279 for (i = 2, j = 15; i != 32; i += 2, j--, dst -= BUFFER_WIDTH - 2) {
280 if (dst < gpBufEnd)
281 memset(dst, 0, 4 * j);
282 }
283}
284
285/**
286 * Draws a half-transparent rectangle by blacking out odd pixels on odd lines,

Callers 1

scrollrt_drawFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected