set_pixel_color
public c v1 · immutablevoid set_pixel_color(SDL_Surface *s, int x, int y, unsigned int c){ int bpp; int byte; unsigned char *data; bpp = s->format->BytesPerPixel; data = (unsigned char *)(s->pixels) + y * s->pitch + x * bpp; byte = 0;#if SDL_BYTEORDER == SDL_BIG_ENDIAN while (byte < bpp) { data[byte] = c >> ((bpp - 1 - byte) * 8); byte++; }#else while (byte < bpp) { data[byte] = c >> (byte * 8); byte++; }#endif return ;}