pixelRgbaWeight function

bool pixelRgbaWeight(
  1. Pointer<SdlRenderer> renderer,
  2. double x,
  3. double y,
  4. int r,
  5. int g,
  6. int b,
  7. int a,
  8. int weight,
)

Implementation

bool pixelRgbaWeight(Pointer<SdlRenderer> renderer, double x, double y, int r,
    int g, int b, int a, int weight) {
  /*
	* Modify Alpha by weight
	*/
  int ax = a;
  ax = ((ax * weight) >> 8);
  if (ax > 255) {
    a = 255;
  } else {
    a = ax & 0x000000ff;
  }
  return pixelRgba(renderer, x, y, r, g, b, a);
}