Eliminate VLAs for the benefit of MSVC.

This commit is contained in:
Arthur O'Dwyer committed 2018-06-29 14:13:59 -07:00
1 parent 6753cc2e39
commit 62db7ee250
7 files changed
+21 -22

No files matched your search

+3 -3
View File
@@ -201,9 +201,9 @@ void polylineColor(SDL_Surface *s, int *x, int *y, int polyi, int col) {
}
void filledPolygonColorI(SDL_Surface *s, int* px, int *py, int polyi, int col) {
Sint16 spx[polyi], spy[polyi];
for(int i=0; i<polyi; i++) spx[i] = px[i], spy[i] = py[i];
filledPolygonColor(s, spx, spy, polyi, col);
std::vector<Sint16> spx(px, px + polyi);
std::vector<Sint16> spy(py, py + polyi);
filledPolygonColor(s, spx.data(), spy.data(), polyi, col);
}
#endif