pixelRgbaWeight function

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

Implementation

int pixelRgbaWeight(Pointer<SdlRenderer> renderer, int x, int 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);
}