diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-02-25 03:35:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-02-25 03:35:52 +0300 |
commit | 8478d540748edccf36dc9bda5f0c3de0aa7bf763 (patch) | |
tree | 941a08937450982abb8781e8dd4bd4bd209cf88c /src/graphicsmanager.cpp | |
parent | 6ce49efadfadd8eacb048df274979736bb04daf0 (diff) | |
download | mv-8478d540748edccf36dc9bda5f0c3de0aa7bf763.tar.gz mv-8478d540748edccf36dc9bda5f0c3de0aa7bf763.tar.bz2 mv-8478d540748edccf36dc9bda5f0c3de0aa7bf763.tar.xz mv-8478d540748edccf36dc9bda5f0c3de0aa7bf763.zip |
Improve string usage in other files.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r-- | src/graphicsmanager.cpp | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index f42aca9cb..92b481534 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -368,8 +368,8 @@ bool GraphicsManager::getAllVideoModes(StringVect &modeList) for (int i = 0; modes[i]; ++ i) { const std::string modeString = - toString(static_cast<int>(modes[i]->w)) + "x" - + toString(static_cast<int>(modes[i]->h)); + toString(static_cast<int>(modes[i]->w)).append("x") + .append(toString(static_cast<int>(modes[i]->h))); logger->log("support mode: " + modeString); modeList.push_back(modeString); } @@ -395,7 +395,7 @@ void GraphicsManager::updateExtensions() std::string str = reinterpret_cast<const char*>( mglGetStringi(GL_EXTENSIONS, f)); mExtensions.insert(str); - extList += str + " "; + extList.append(str).append(" "); } logger->log1(extList.c_str()); } @@ -898,78 +898,77 @@ static CALLBACK void debugCallback(GLenum source, GLenum type, GLuint id, switch (source) { case GL_DEBUG_SOURCE_API: - message += " API"; + message.append(" API"); break; case GL_DEBUG_SOURCE_WINDOW_SYSTEM: - message += " WM"; + message.append(" WM"); break; case GL_DEBUG_SOURCE_SHADER_COMPILER: - message += " SHADERS"; + message.append(" SHADERS"); break; case GL_DEBUG_SOURCE_THIRD_PARTY: - message += " THIRD_PARTY"; + message.append(" THIRD_PARTY"); break; case GL_DEBUG_SOURCE_APPLICATION: - message += " APP"; + message.append(" APP"); break; case GL_DEBUG_SOURCE_OTHER: - message += " OTHER"; + message.append(" OTHER"); break; default: - message += " ?" + toString(source); + message.append(" ?").append(toString(source)); break; } switch (type) { case GL_DEBUG_TYPE_ERROR: - message += " ERROR"; + message.append(" ERROR"); break; case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: - message += " DEPRECATED"; + message.append(" DEPRECATED"); break; case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: - message += " UNDEFINED"; + message.append(" UNDEFINED"); break; case GL_DEBUG_TYPE_PORTABILITY: - message += " PORTABILITY"; + message.append(" PORTABILITY"); break; case GL_DEBUG_TYPE_PERFORMANCE: - message += " PERFOMANCE"; + message.append(" PERFOMANCE"); break; case GL_DEBUG_TYPE_OTHER: - message += " OTHER"; + message.append(" OTHER"); break; case GL_DEBUG_TYPE_MARKER: - message += " MARKER"; + message.append(" MARKER"); break; default: - message += " ?" + toString(type); + message.append(" ?").append(toString(type)); break; } - message += " " + toString(id); + message.append(" ").append(toString(id)); switch (severity) { case GL_DEBUG_SEVERITY_NOTIFICATION: - message += " N"; + message.append(" N"); break; case GL_DEBUG_SEVERITY_HIGH: - message += " H"; + message.append(" H"); break; case GL_DEBUG_SEVERITY_MEDIUM: - message += " M"; + message.append(" M"); break; case GL_DEBUG_SEVERITY_LOW: - message += " L"; + message.append(" L"); break; default: - message += " ?" + toString(type); + message.append(" ?").append(toString(type)); break; } char *buf = new char[length + 1]; memcpy (buf, text, length); buf[length] = 0; - message += " "; - message += buf; + message.append(" ").append(buf); delete [] buf; logger->log(message); } |