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

Function ENG_set_pixel

Source/engine.cpp:595–608  ·  view source on GitHub ↗

* @brief Set the value of a single pixel in the back buffer, checks bounds * @param sx Back buffer coordinate * @param sy Back buffer coordinate * @param col Color index from current palette */

Source from the content-addressed store, hash-verified

593 * @param col Color index from current palette
594 */
595void ENG_set_pixel(int sx, int sy, BYTE col)
596{
597 BYTE *dst;
598
599 assert(gpBuffer);
600
601 if (sy < 0 || sy >= SCREEN_HEIGHT + SCREEN_Y || sx < SCREEN_X || sx >= SCREEN_WIDTH + SCREEN_X)
602 return;
603
604 dst = &gpBuffer[sx + BUFFER_WIDTH * sy];
605
606 if (dst < gpBufEnd && dst > gpBufStart)
607 *dst = col;
608}
609
610/**
611 * @brief Set the value of a single pixel in the back buffer to that of gbPixelCol, checks bounds

Callers 1

DrawAutomapTileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected