Is there a faster way to set all values on a 2d array to -1? I'm using it to store IDs on a 1024x1024 grid but when they all need to be reset every few seconds to -1 the FPS drops. Maybe a map or grid data stucture would be better?
Code:
//reset array
gridSize=1024;
for(var row=0;row<gridSize;row++) {
for(var column=0;column<gridSize;column++) {
myArray[row,column] = -1;
}
}