From: Tobias Markus Date: Sun, 23 Nov 2014 20:53:20 +0000 (+0100) Subject: [cppcheck] Part 3: More perf fixes that were missed during non-verbose run for whatev... X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=59d76147a1b09fca2d2b4a1780ab47509c1e47ff;p=supertux.git [cppcheck] Part 3: More perf fixes that were missed during non-verbose run for whatever reason --- diff --git a/src/scripting/floating_image.cpp b/src/scripting/floating_image.cpp index 2264d0d66..77fe80bcb 100644 --- a/src/scripting/floating_image.cpp +++ b/src/scripting/floating_image.cpp @@ -24,11 +24,10 @@ namespace scripting { FloatingImage::FloatingImage(const std::string& spritefile) : - floating_image() + floating_image(std::make_shared<_FloatingImage>(spritefile)) { using namespace worldmap; - floating_image = std::make_shared<_FloatingImage>(spritefile); if(Sector::current() != NULL) { Sector::current()->add_object(floating_image); } else if(WorldMap::current() != NULL) { diff --git a/src/worldmap/tux.cpp b/src/worldmap/tux.cpp index d54c650cf..2ea454b37 100644 --- a/src/worldmap/tux.cpp +++ b/src/worldmap/tux.cpp @@ -34,7 +34,7 @@ static const float map_message_TIME = 2.8f; Tux::Tux(WorldMap* worldmap_) : back_direction(), worldmap(worldmap_), - sprite(), + sprite(SpriteManager::current()->create("images/worldmap/common/tux.sprite")), controller(), input_direction(), direction(), @@ -43,8 +43,6 @@ Tux::Tux(WorldMap* worldmap_) : moving(), ghost_mode() { - sprite = SpriteManager::current()->create("images/worldmap/common/tux.sprite"); - offset = 0; moving = false; direction = D_NONE;