diff options
| author | aleksav013 <aleksav013@gmail.com> | 2021-06-06 15:35:16 +0200 |
|---|---|---|
| committer | aleksav013 <aleksav013@gmail.com> | 2021-06-06 15:35:16 +0200 |
| commit | 3270c2bcd37d23c68f281fedc60d71106e9926e7 (patch) | |
| tree | 64b7cb8f8b6e27ce8809507797f6116d7d200340 /src/Game.cpp | |
| parent | 3fdf53f3c1fbf58e67ab9570f035756469b99424 (diff) | |
Fixing memory leak
Diffstat (limited to 'src/Game.cpp')
| -rw-r--r-- | src/Game.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Game.cpp b/src/Game.cpp index 2fadf1c..c0bad0e 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -75,10 +75,10 @@ void Game::inittex() void Game::initent() { igrac = Player(sf::Vector2f(sirina/2.0,visina/2.0),sf::Vector2f(100.0f,100.0f),sf::Color::White); - for(size_t i=0;i<20;i++) nep1.push_back(Enemy1(sf::Vector2f(Global::rng()%sirina,Global::rng()%visina),sf::Vector2f(50.0f,50.0f),sf::Color::Red)); - for(size_t i=0;i<7;i++) nep2.push_back(Enemy2(sf::Vector2f(Global::rng()%sirina,Global::rng()%visina),sf::Vector2f(50.0f,50.0f),sf::Color::Cyan));//(253,106,2))); - for(size_t i=0;i<4;i++) nep3.push_back(Enemy3(sf::Vector2f(Global::rng()%sirina,Global::rng()%visina),sf::Vector2f(50.0f,50.0f),sf::Color::Yellow)); - pow.push_back(Powerup(sf::Vector2f(Global::rng()%sirina,Global::rng()%visina),sf::Vector2f(50.0f,50.0f),sf::Color::White,Global::rng()%3+1)); + for(size_t i=0;i<20;i++) nep1.emplace_back(sf::Vector2f(Global::rng()%sirina,Global::rng()%visina),sf::Vector2f(50.0f,50.0f),sf::Color::Red); + for(size_t i=0;i<7;i++) nep2.emplace_back(sf::Vector2f(Global::rng()%sirina,Global::rng()%visina),sf::Vector2f(50.0f,50.0f),sf::Color::Cyan); + for(size_t i=0;i<4;i++) nep3.emplace_back(sf::Vector2f(Global::rng()%sirina,Global::rng()%visina),sf::Vector2f(50.0f,50.0f),sf::Color::Yellow); + pow.emplace_back(sf::Vector2f(Global::rng()%sirina,Global::rng()%visina),sf::Vector2f(50.0f,50.0f),sf::Color::White,Global::rng()%3+1); } void Game::updatewin() { |
