Debugging Insane Tile Boundary Issue
This commit is contained in:
@@ -84,6 +84,8 @@ namespace CaveGame::Core
|
||||
TileID tiles[ChunkSize][ChunkSize];
|
||||
bool tagged_for_update[ChunkSize][ChunkSize];
|
||||
bool update_buffer[ChunkSize][ChunkSize];
|
||||
bool first_pass_complete = false;
|
||||
bool second_pass_complete = false;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -157,6 +157,20 @@ namespace CaveGame::Core
|
||||
|
||||
TileID ComputeTile(int wx, int wy);
|
||||
void FirstPass(Chunk* chunk);
|
||||
void SecondPass(ITileMap* world, Chunk* chunk) {
|
||||
Vector2 real_coords = chunk->GetChunkRealCoordinates();
|
||||
|
||||
for (int x = 0; x < Chunk::ChunkSize; x++) {
|
||||
for (int y = 0; y < Chunk::ChunkSize; y++) {
|
||||
|
||||
int wx = real_coords.x + x;
|
||||
int wy = real_coords.y + y;
|
||||
|
||||
chunk->SetTile(x, y, ComputeTile(wx, wy));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint ColorMap(int range, int wx, int wy);
|
||||
|
||||
@@ -164,8 +178,6 @@ namespace CaveGame::Core
|
||||
// TODO: Implement SecondPass, the catch is, it **may** need to load an arbitrary amount of adjacent chunks to correctly place structures.
|
||||
// TODO: Expert Mode: How do we keep it threaded separately while still accomplishing the above?
|
||||
|
||||
uint PlaceTile();
|
||||
|
||||
int ModInt(int x, int mod) const {
|
||||
|
||||
x = Math::Abs(x);
|
||||
|
@@ -244,6 +244,8 @@ namespace CaveGame::Core
|
||||
chunk->SetTile(x, y, ComputeTile(wx, wy));
|
||||
}
|
||||
}
|
||||
|
||||
//chunk->SetFirstPassComplete();
|
||||
}
|
||||
|
||||
uint Generator::ColorMap(int range, int wx, int wy) {
|
||||
|
Reference in New Issue
Block a user