* 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. */
| 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 |
no outgoing calls
no test coverage detected