Skip to content

Commit

Permalink
qol things
Browse files Browse the repository at this point in the history
  • Loading branch information
Kade-github committed May 18, 2024
1 parent f84f935 commit 26a589a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Game/Objects/Base/Chunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1262,11 +1262,13 @@ void Chunk::UpdateChunk(int tick)
if (subChunks.size() == 0)
return;

for (int i = 0; i < subChunks.size(); i++)
chunkMutex.lock();
std::deque<subChunk> copy = subChunks;
chunkMutex.unlock();

for (int i = 0; i < copy.size(); i++)
{
chunkMutex.lock();
subChunk& sbc = subChunks[i];
chunkMutex.unlock();
subChunk& sbc = copy[i];

if (sbc.y == -1)
continue;
Expand Down
13 changes: 13 additions & 0 deletions src/Game/Objects/Base/Hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <Game.h>
#include <Helpers/Collision2D.h>
#include "../../MusicManager.h"
#include "../../LightingManager.h"
#include "../../WorldManager.h"

#include "../../Scenes/MainMenu.h"
Expand Down Expand Up @@ -556,8 +557,20 @@ void Hud::Draw()
pauseHeader->position.y = resume->position.y + resume->height + 100;
}

Game::instance->shader->Bind();

Game::instance->shader->SetUniform1f("lightLevel", player->lightLevel);

Game::instance->shader->Unbind();

hand->Draw();

Game::instance->shader->Bind();

Game::instance->shader->SetUniform1f("lightLevel", 10.0f);

Game::instance->shader->Unbind();

crosshair->position = glm::vec3((c2d->_w / 2) - crosshair->width / 2, (c2d->_h / 2) - crosshair->height / 2, 0);

Camera* cam = Game::instance->GetCamera();
Expand Down

0 comments on commit 26a589a

Please sign in to comment.