Collaborative edits
This commit is contained in:
@@ -288,9 +288,11 @@ namespace CaveGame::Client {
|
||||
}
|
||||
}
|
||||
|
||||
//void LocalWorld::LookForChunksNeedLoading()
|
||||
void LocalWorld::LookForChunksNeedLoading()
|
||||
{
|
||||
|
||||
|
||||
// TODO: Make sure an extra layer of chunks beyond the viewport is generated.
|
||||
// This will limit the amount of "pop-in" the player will notice.
|
||||
|
||||
@@ -307,6 +309,7 @@ namespace CaveGame::Client {
|
||||
{
|
||||
for (int y = lower_bound_v; y <= upper_bound_v; y++)
|
||||
{
|
||||
//Logs::Debug("dickballs");
|
||||
Vector2 cell = Vector2(x,y);
|
||||
if (!HasChunkAtCell(cell) || !AwaitingChunkAtCell(cell))
|
||||
RequestChunk(cell);
|
||||
@@ -326,6 +329,7 @@ namespace CaveGame::Client {
|
||||
check_chunks_timer = 0.f;
|
||||
LookForChunksNeedUnloading();
|
||||
LookForChunksNeedLoading();
|
||||
//auto a1 = std::async(&LocalWorld::LookForChunksNeedLoading, this);
|
||||
|
||||
// TODO: Unload chunks once they're offscreen for a certain time threshold.
|
||||
|
||||
|
@@ -94,7 +94,7 @@ namespace CaveGame::Core
|
||||
|
||||
bool HasChunkOnFile(const Vector2 &cell) const;
|
||||
|
||||
bool AwaitingChunkAtCell(const Vector2 &cell);
|
||||
bool AwaitingChunkAtCell(const Vector2 &cell) const;
|
||||
|
||||
void ChunkServerThread();
|
||||
|
||||
|
@@ -278,9 +278,9 @@ namespace CaveGame::Core
|
||||
}
|
||||
}
|
||||
|
||||
bool World::AwaitingChunkAtCell(const Vector2& cell)
|
||||
bool World::AwaitingChunkAtCell(const Vector2& cell) const
|
||||
{
|
||||
int cnt = std::count(chunks_in_waiting.begin(), chunks_in_waiting.end(), cell);
|
||||
int cnt = std::ranges::count(chunks_in_waiting, cell);
|
||||
|
||||
if (cnt > 1)
|
||||
{
|
||||
|
Reference in New Issue
Block a user