mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 14:41:49 +01:00
Add alot of memory leak fixes
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "Game.h"
|
||||
|
||||
#include <ostream>
|
||||
#include <algorithm>
|
||||
|
||||
#include "colors.h"
|
||||
#include "utils.h"
|
||||
@@ -26,6 +27,10 @@ void Game::Initialize() {
|
||||
}
|
||||
|
||||
void Game::Cleanup() {
|
||||
|
||||
//TODO: ask how 2 delete the TextureManager
|
||||
ScreenManager::DestroyInstance();
|
||||
TextureManager::DestroyInstance();
|
||||
}
|
||||
|
||||
void Game::Update(float elapsedSec) {
|
||||
@@ -93,7 +98,11 @@ void Game::ProcessMouseWheelEvent(const SDL_MouseWheelEvent& e) {
|
||||
scroll = Vector2f { 0, -1 };
|
||||
}
|
||||
//camera zoom
|
||||
m_Camera.SetScale((m_Camera.GetScale() - e.preciseY * 0.1f));
|
||||
float newScale = m_Camera.GetScale() - e.preciseY * 0.1f;
|
||||
if(newScale < 0.0f) {
|
||||
newScale = 0.0f;
|
||||
}
|
||||
m_Camera.SetScale(newScale);
|
||||
}
|
||||
void Game::ProcessImGui() {
|
||||
m_pCurrentLevel->ProcessImGui();
|
||||
|
||||
Reference in New Issue
Block a user