From 59d76147a1b09fca2d2b4a1780ab47509c1e47ff Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Sun, 23 Nov 2014 21:53:20 +0100 Subject: [PATCH] [cppcheck] Part 3: More perf fixes that were missed during non-verbose run for whatever reason --- src/scripting/floating_image.cpp | 3 +-- src/worldmap/tux.cpp | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) 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; -- 2.11.0