diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2014-03-15 00:57:56 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2014-03-15 00:57:56 +0100 |
| commit | 8d679e76d299956a1521bc14502466be8d8b2df8 (patch) | |
| tree | 97db9ad6a45a8e5d711d7763199579e400a65bc8 /Source/Core/VideoBackends/Software | |
| parent | 12c2e345a35a571aadc842e30c38b3b4d8f70dce (diff) | |
| parent | a82675b7d581421fa80d5d5c53253cf1d5c1a26d (diff) | |
Merge pull request #164 from lioncash/cstr-cull
Kill off some usages of c_str.
Diffstat (limited to 'Source/Core/VideoBackends/Software')
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWmain.cpp | 15 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/Software/VideoBackend.h | 7 |
2 files changed, 12 insertions, 10 deletions
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 <string> + #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())); } } diff --git a/Source/Core/VideoBackends/Software/VideoBackend.h b/Source/Core/VideoBackends/Software/VideoBackend.h index 1559427599..a9de97d816 100644 --- a/Source/Core/VideoBackends/Software/VideoBackend.h +++ b/Source/Core/VideoBackends/Software/VideoBackend.h @@ -1,5 +1,6 @@ #pragma once +#include <string> #include "VideoCommon/VideoBackendBase.h" namespace MMIO { class Mapping; } @@ -31,9 +32,9 @@ class VideoSoftware : public VideoBackend u32 Video_AccessEFB(EFBAccessType, u32, u32, u32) override; u32 Video_GetQueryResult(PerfQueryType type) override; - void Video_AddMessage(const char* pstr, unsigned int milliseconds) override; + void Video_AddMessage(const std::string& msg, unsigned int milliseconds) override; void Video_ClearMessages() override; - bool Video_Screenshot(const char* filename) override; + bool Video_Screenshot(const std::string& filename) override; int Video_LoadTexture(char *imagedata, u32 width, u32 height); void Video_DeleteTexture(int texID); @@ -49,7 +50,7 @@ class VideoSoftware : public VideoBackend void RegisterCPMMIO(MMIO::Mapping* mmio, u32 base) override; void RegisterPEMMIO(MMIO::Mapping* mmio, u32 base) override; - void UpdateFPSDisplay(const char*) override; + void UpdateFPSDisplay(const std::string&) override; unsigned int PeekMessages() override; void PauseAndLock(bool doLock, bool unpauseOnUnlock=true) override; |
