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

Function engine_draw_pixel

Source/engine.cpp:615–633  ·  view source on GitHub ↗

* @brief Set the value of a single pixel in the back buffer to that of gbPixelCol, checks bounds * @param sx Back buffer coordinate * @param sy Back buffer coordinate */

Source from the content-addressed store, hash-verified

613 * @param sy Back buffer coordinate
614 */
615void engine_draw_pixel(int sx, int sy)
616{
617 BYTE *dst;
618
619 assert(gpBuffer);
620
621 if (gbRotateMap) {
622 if (gbNotInView && (sx < 0 || sx >= SCREEN_HEIGHT + SCREEN_Y || sy < SCREEN_X || sy >= SCREEN_WIDTH + SCREEN_X))
623 return;
624 dst = &gpBuffer[sy + BUFFER_WIDTH * sx];
625 } else {
626 if (gbNotInView && (sy < 0 || sy >= SCREEN_HEIGHT + SCREEN_Y || sx < SCREEN_X || sx >= SCREEN_WIDTH + SCREEN_X))
627 return;
628 dst = &gpBuffer[sx + BUFFER_WIDTH * sy];
629 }
630
631 if (dst < gpBufEnd && dst > gpBufStart)
632 *dst = gbPixelCol;
633}
634
635#define GG_SWAP(A, B) \
636 { \

Callers 1

DrawLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected