Afegides recomanacions de cppcheck
Optimitzada la funció updateBalloonSpeed() i eliminades funcions sobrants o redundants
This commit is contained in:
@@ -298,7 +298,7 @@ bool Director::initSDL()
|
||||
Uint32 flags = 0;
|
||||
if (options.video.v_sync)
|
||||
{
|
||||
flags = flags | SDL_RENDERER_PRESENTVSYNC;
|
||||
flags = SDL_RENDERER_PRESENTVSYNC;
|
||||
}
|
||||
#ifndef NO_SHADERS
|
||||
// La aceleración se activa según el define
|
||||
@@ -478,9 +478,9 @@ bool Director::setFileList()
|
||||
}
|
||||
|
||||
// Carga los parametros para configurar el juego
|
||||
void Director::loadParams(std::string filepath)
|
||||
void Director::loadParams(const std::string &file_path)
|
||||
{
|
||||
loadParamsFromFile(filepath);
|
||||
loadParamsFromFile(file_path);
|
||||
}
|
||||
|
||||
// Comprueba los parametros del programa
|
||||
@@ -503,7 +503,7 @@ void Director::checkProgramArguments(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Crea la carpeta del sistema donde guardar datos
|
||||
void Director::createSystemFolder(std::string folder)
|
||||
void Director::createSystemFolder(const std::string &folder)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
system_folder_ = std::string(getenv("APPDATA")) + "/" + folder;
|
||||
@@ -569,7 +569,7 @@ void Director::loadSounds()
|
||||
std::vector<std::string> list = Asset::get()->getListByType(AssetType::SOUND);
|
||||
sounds_.clear();
|
||||
|
||||
for (auto l : list)
|
||||
for (const auto &l : list)
|
||||
{
|
||||
const size_t lastIndex = l.find_last_of("/") + 1;
|
||||
const std::string name = l.substr(lastIndex, std::string::npos);
|
||||
@@ -587,7 +587,7 @@ void Director::loadMusics()
|
||||
std::vector<std::string> list = Asset::get()->getListByType(AssetType::MUSIC);
|
||||
musics_.clear();
|
||||
|
||||
for (auto l : list)
|
||||
for (const auto &l : list)
|
||||
{
|
||||
const size_t lastIndex = l.find_last_of("/") + 1;
|
||||
const std::string name = l.substr(lastIndex, std::string::npos);
|
||||
|
||||
Reference in New Issue
Block a user