MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / setPixel

Method setPixel

src/Engine/Surface.h:140–147  ·  view source on GitHub ↗

* Changes the color of a pixel in the surface, relative to * the top-left corner of the surface. * @param x X position of the pixel. * @param y Y position of the pixel. * @param pixel New color for the pixel. */

Source from the content-addressed store, hash-verified

138 * @param pixel New color for the pixel.
139 */
140 void setPixel(int x, int y, Uint8 pixel)
141 {
142 if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight())
143 {
144 return;
145 }
146 ((Uint8 *)_surface->pixels)[y * _surface->pitch + x * _surface->format->BytesPerPixel] = pixel;
147 }
148 /**
149 * Changes the color of a pixel in the surface and returns the
150 * next pixel position. Useful when changing a lot of pixels in

Callers 12

initMethod · 0.80
XcomResourcePackMethod · 0.80
GlobeMethod · 0.80
XuLineMethod · 0.80
DogfightStateMethod · 0.80
drawCraftDamageMethod · 0.80
animateMethod · 0.80
drawUfoMethod · 0.80
drawProjectileMethod · 0.80
NumberTextMethod · 0.80
drawThumbMethod · 0.80
drawMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected