Skip to content

Commit

Permalink
Update camera in main loop
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalkah committed Aug 12, 2024
1 parent 3de664d commit 3eb9505
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions src/Core/src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ void Game::Run() {
CheckEvent();
time_manager_->CalculateDeltaTime();
scene_->Update(time_manager_->GetDeltaTime());
camera_->Update(map_);
switch (render_type_) {
case RenderType::TEXTURE:
renderer_->RenderScene(scene_, camera_);
Expand Down
2 changes: 0 additions & 2 deletions src/Graphics/src/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ void Renderer::RenderBackground() {
void Renderer::RenderWalls(const std::shared_ptr<Map>& map_ptr,
const std::shared_ptr<Camera2D>& camera_ptr,
RenderQueue& render_queue) {
camera_ptr->Update(map_ptr);
const auto rays = camera_ptr->GetRays();

int horizontal_slice = 0;
Expand Down Expand Up @@ -219,7 +218,6 @@ void Renderer::ClearScreen() {

void Renderer::RenderScene2D(const std::shared_ptr<Scene>& scene_ptr,
const std::shared_ptr<Camera2D>& camera_ptr) {
camera_ptr->Update(scene_ptr->GetMap());
ClearScreen();
RenderMap(scene_ptr->GetMap());
RenderObjects(scene_ptr->GetObjects(), camera_ptr);
Expand Down

0 comments on commit 3eb9505

Please sign in to comment.