* Checks for the position of block passed in. * If the block position is out of the chunks bounds * (see the if statements) * It will correct the position to be within a neighbouring chunks bounds * It also takes in "change", which says which direction the neighbouring chunk * is located. */
| 18 | * is located. |
| 19 | */ |
| 20 | void checkBound(int& pos, int& change) |
| 21 | { |
| 22 | if (pos > CHUNK_SIZE - 1) |
| 23 | { |
| 24 | change = 1; |
| 25 | pos -= CHUNK_SIZE; |
| 26 | } |
| 27 | else if (pos < 0) |
| 28 | { |
| 29 | change = -1; |
| 30 | pos += CHUNK_SIZE; |
| 31 | } |
| 32 | } |
| 33 | } |
| 34 | /* |
| 35 | * Tries to get a get chunk section based on the block position relative to the "default chunk" |
no outgoing calls
no test coverage detected