I have terrain[height][width] and what I'm doing is drawing differently colored squares on the screen depending on the material at terrain[y][x]. This is working well but because of the size of the array, it's pretty slow. The size is specifically 72 on the y and 128 on the x axis. I want to have stuff which changes when you click it but the time it takes to start going from the top to when it reaches that point is a few seconds, which is a bit too long for me. I have disabled vsync so it is still much quicker than 60fps but not quick enough. Currently I'm using a couple of for cycles to go through the whole array element by element. What can I do to improve the speed?
terrain[height][width]
terrain[y][x]
for
1.4m articles
1.4m replys
5 comments
57.0k users