From a82675b7d581421fa80d5d5c53253cf1d5c1a26d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 12 Mar 2014 15:33:41 -0400 Subject: Kill off some usages of c_str. Also changes some function params, but this is ok. Some simplifications were also able to be made (ie. killing off strcmps with ==, etc). --- Source/Core/VideoBackends/Software/SWmain.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Source/Core/VideoBackends/Software/SWmain.cpp') diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp index 60ab61300e..c0736c883a 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -2,10 +2,13 @@ // Licensed under GPLv2 // Refer to the license.txt file included. +#include + #include "Common/Atomic.h" #include "Common/Common.h" #include "Common/FileUtil.h" #include "Common/LogManager.h" +#include "Common/StringUtil.h" #include "Core/ConfigManager.h" #include "Core/Core.h" @@ -284,9 +287,9 @@ u32 VideoSoftware::Video_GetQueryResult(PerfQueryType type) return 0; } -bool VideoSoftware::Video_Screenshot(const char *_szFilename) +bool VideoSoftware::Video_Screenshot(const std::string& filename) { - SWRenderer::SetScreenshot(_szFilename); + SWRenderer::SetScreenshot(filename.c_str()); return true; } @@ -336,7 +339,7 @@ void VideoSoftware::Video_ExitLoop() // TODO : could use the OSD class in video common, we would need to implement the Renderer class // however most of it is useless for the SW backend so we could as well move it to its own class -void VideoSoftware::Video_AddMessage(const char* pstr, u32 milliseconds) +void VideoSoftware::Video_AddMessage(const std::string& msg, u32 milliseconds) { } void VideoSoftware::Video_ClearMessages() @@ -385,11 +388,9 @@ unsigned int VideoSoftware::PeekMessages() } // Show the current FPS -void VideoSoftware::UpdateFPSDisplay(const char *text) +void VideoSoftware::UpdateFPSDisplay(const std::string& text) { - char temp[100]; - snprintf(temp, sizeof temp, "%s | Software | %s", scm_rev_str, text); - GLInterface->UpdateFPSDisplay(temp); + GLInterface->UpdateFPSDisplay(StringFromFormat("%s | Software | %s", scm_rev_str, text.c_str())); } } -- cgit v1.2.3