setBackground method

void setBackground(
  1. int x,
  2. int y,
  3. int bg
)

Sets background color at coordinates.

Implementation

void setBackground(int x, int y, int bg) {
  if (isCellValid(x, y)) {
    attributes[(y * width + x) * 3 + 1] = bg;
  }
}