aapolygonRgba function
Implementation
bool aapolygonRgba(Pointer<SdlRenderer> renderer, Pointer<Int16> vx,
Pointer<Int16> vy, int n, int r, int g, int b, int a) {
bool result = true;
int i;
/*
* Vertex array NULL check
*/
if (vx == nullptr) {
return false;
}
if (vy == nullptr) {
return false;
}
/*
* Sanity check
*/
if (n < 3) {
return false;
}
/*
* Pointer setup
*/
/*
* Draw
*/
result = true;
for (i = 1; i < n; i++) {
if (result) {
result = _aalineRgba(renderer, vx[i - 1].toDouble(), vy[i - 1].toDouble(),
vx[i].toDouble(), vy[i].toDouble(), r, g, b, a, 0);
}
}
if (result) {
result = _aalineRgba(renderer, vx[n - 1].toDouble(), vy[n - 1].toDouble(),
vx[0].toDouble(), vy[0].toDouble(), r, g, b, a, 0);
}
return result;
}