Skip to content
This repository has been archived by the owner on Nov 28, 2021. It is now read-only.

Commit

Permalink
The old chunk loading list was not very multi-Z-friendly. It only req…
Browse files Browse the repository at this point in the history
…uired that 11 chunks be loaded at a time. Now 27 chunks are explicity demanded at any one time :D
  • Loading branch information
danopia committed Apr 21, 2011
1 parent 000e4f4 commit 70e8ada
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions src/common/terrain.cpp
Expand Up @@ -221,17 +221,34 @@ void Terrain::HandleRequests(Vector3 Pos) {

// TODO: lol.
RequestChunk(CurrentChunk);
RequestChunk(CurrentChunk + Vector3(-1, 0, 0));
RequestChunk(CurrentChunk + Vector3(-1, -1, 0));
RequestChunk(CurrentChunk + Vector3(0, -1, 0));
RequestChunk(CurrentChunk + Vector3(1, -1, 0));
RequestChunk(CurrentChunk + Vector3(1, 0, 0));
RequestChunk(CurrentChunk + Vector3(1, 1, 0));
RequestChunk(CurrentChunk + Vector3(0, 1, 0));
RequestChunk(CurrentChunk + Vector3(-1, 1, 0));

RequestChunk(CurrentChunk + Vector3(0, 0, 1));
RequestChunk(CurrentChunk + Vector3(0, 0, -1));
RequestChunk(CurrentChunk + Vector3(-1, 0, 0));
RequestChunk(CurrentChunk + Vector3(-1, -1, 0));
RequestChunk(CurrentChunk + Vector3( 0, -1, 0));
RequestChunk(CurrentChunk + Vector3( 1, -1, 0));
RequestChunk(CurrentChunk + Vector3( 1, 0, 0));
RequestChunk(CurrentChunk + Vector3( 1, 1, 0));
RequestChunk(CurrentChunk + Vector3( 0, 1, 0));
RequestChunk(CurrentChunk + Vector3(-1, 1, 0));

RequestChunk(CurrentChunk + Vector3( 0, 0, 1));
RequestChunk(CurrentChunk + Vector3(-1, 0, 1));
RequestChunk(CurrentChunk + Vector3(-1, -1, 1));
RequestChunk(CurrentChunk + Vector3( 0, -1, 1));
RequestChunk(CurrentChunk + Vector3( 1, -1, 1));
RequestChunk(CurrentChunk + Vector3( 1, 0, 1));
RequestChunk(CurrentChunk + Vector3( 1, 1, 1));
RequestChunk(CurrentChunk + Vector3( 0, 1, 1));
RequestChunk(CurrentChunk + Vector3(-1, 1, 1));

RequestChunk(CurrentChunk + Vector3( 0, 0, -1));
RequestChunk(CurrentChunk + Vector3(-1, 0, -1));
RequestChunk(CurrentChunk + Vector3(-1, -1, -1));
RequestChunk(CurrentChunk + Vector3( 0, -1, -1));
RequestChunk(CurrentChunk + Vector3( 1, -1, -1));
RequestChunk(CurrentChunk + Vector3( 1, 0, -1));
RequestChunk(CurrentChunk + Vector3( 1, 1, -1));
RequestChunk(CurrentChunk + Vector3( 0, 1, -1));
RequestChunk(CurrentChunk + Vector3(-1, 1, -1));
}

void Terrain::RequestChunk(Vector3 index) {
Expand Down

0 comments on commit 70e8ada

Please sign in to comment.