diff --git a/src/CBot/CBotVar/CBotVarValue.h b/src/CBot/CBotVar/CBotVarValue.h index 3e184d7b..3fd15286 100644 --- a/src/CBot/CBotVar/CBotVarValue.h +++ b/src/CBot/CBotVar/CBotVarValue.h @@ -1,3 +1,22 @@ +/* + * This file is part of the Colobot: Gold Edition source code + * Copyright (C) 2001-2016, Daniel Roux, EPSITEC SA & TerranovaTeam + * http://epsitec.ch; http://colobot.info; http://github.com/colobot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://gnu.org/licenses + */ + #pragma once #include "CBot/CBotVar/CBotVar.h" diff --git a/src/graphics/engine/camera.cpp b/src/graphics/engine/camera.cpp index 5f5c254c..9f7fc40e 100644 --- a/src/graphics/engine/camera.cpp +++ b/src/graphics/engine/camera.cpp @@ -254,7 +254,7 @@ CObject* CCamera::GetControllingObject() void CCamera::SetType(CameraType type) { - if ( (m_type == CAM_TYPE_BACK) ) + if (m_type == CAM_TYPE_BACK) { for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects()) { diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index a6adbad2..27d2db70 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -3510,7 +3510,7 @@ void CEngine::Capture3DScene() // calculate 2nd mipmap int newWidth = width / 4; int newHeight = height / 4; - std::unique_ptr mipmap(new unsigned char[4 * newWidth * newHeight]); + std::unique_ptr mipmap = MakeUniqueArray(4 * newWidth * newHeight); for (int x = 0; x < newWidth; x++) { @@ -3539,7 +3539,7 @@ void CEngine::Capture3DScene() } // calculate Gaussian blur - std::unique_ptr blured(new unsigned char[4 * newWidth * newHeight]); + std::unique_ptr blured = MakeUniqueArray(4 * newWidth * newHeight); float matrix[7][7] = { diff --git a/src/level/robotmain.cpp b/src/level/robotmain.cpp index 2aab95c9..75c12f8a 100644 --- a/src/level/robotmain.cpp +++ b/src/level/robotmain.cpp @@ -5525,7 +5525,8 @@ void CRobotMain::AutosaveRotate() auto saveDirs = CResourceManager::ListDirectories(m_playerProfile->GetSaveDir()); const std::string autosavePrefix = "autosave"; std::vector autosaves; - std::copy_if(saveDirs.begin(), saveDirs.end(), std::back_inserter(autosaves), [&](const std::string &save) { + std::copy_if(saveDirs.begin(), saveDirs.end(), std::back_inserter(autosaves), [&](const std::string &save) + { return save.substr(0, autosavePrefix.length()) == autosavePrefix; });