diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2013-05-27 22:26:44 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2013-05-27 22:29:42 +0200 |
commit | b22d852b4c4aa89e0394397a703ecfa442b0a928 (patch) | |
tree | a1e29142aabf11393eb3e0604deb4b89a6124fe7 /src/object/robotmain.cpp | |
parent | 12313fecf5a0ccad45f88575a24582b8363bd5a7 (diff) | |
download | colobot-b22d852b4c4aa89e0394397a703ecfa442b0a928.tar.gz colobot-b22d852b4c4aa89e0394397a703ecfa442b0a928.tar.bz2 colobot-b22d852b4c4aa89e0394397a703ecfa442b0a928.zip |
Fixed variable shadowing warnings
* fixed -Wshadow warnings
* refactored some constructors
Diffstat (limited to 'src/object/robotmain.cpp')
-rw-r--r-- | src/object/robotmain.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index 34f13f6..27492f3 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -4082,7 +4082,6 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) if (Cmd(line, "CacheAudio") && !resetObject && m_version >= 2) { - char filename[100]; OpString(line, "filename", filename); m_sound->CacheMusic(filename); continue; @@ -4116,9 +4115,9 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) int trackid = OpInt(line, "track", 0); if (trackid != 0) { - std::stringstream filename; - filename << "music" << std::setfill('0') << std::setw(3) << trackid << ".ogg"; - m_audioTrack = filename.str(); + std::stringstream filenameStr; + filenameStr << "music" << std::setfill('0') << std::setw(3) << trackid << ".ogg"; + m_audioTrack = filenameStr.str(); } } else @@ -4392,10 +4391,10 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) AddExt(name, ".png"); int dx = OpInt(line, "dx", 1); int dy = OpInt(line, "dy", 1); - char* op = SearchOp(line, "table"); + char* opTable = SearchOp(line, "table"); int tt[100]; for (int i = 0; i < dx*dy; i++) - tt[i] = GetInt(op, i, 0); + tt[i] = GetInt(opTable, i, 0); if (strstr(name, "%user%") != 0) CopyFileListToTemp(name, tt, dx*dy); @@ -4484,12 +4483,12 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) continue; } - char* op = SearchOp(line, "id"); + char* opId = SearchOp(line, "id"); int id[50]; int i = 0; while (i < 50) { - id[i] = GetInt(op, i, 0); + id[i] = GetInt(opId, i, 0); if (id[i++] == 0) break; } @@ -4589,9 +4588,9 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) } Math::Vector pos = OpPos(line, "pos")*g_unit; - float dir = OpFloat(line, "dir", 0.0f)*Math::PI; + float dirAngle = OpFloat(line, "dir", 0.0f)*Math::PI; bool trainer = OpInt(line, "trainer", 0); - CObject* obj = CreateObject(pos, dir, + CObject* obj = CreateObject(pos, dirAngle, OpFloat(line, "z", 1.0f), OpFloat(line, "h", 0.0f), type, |