aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/openglsdl
diff options
context:
space:
mode:
authorJohannes Schickel2011-06-19 18:31:34 +0200
committerJohannes Schickel2011-06-19 18:31:34 +0200
commit735604c2fdc8a6e8dc2874c49413715555dc692b (patch)
treeb097f0684446e0c7d358db2706414f272c47e47b /backends/graphics/openglsdl
parentd316099f35c2b3ea351d39cf7be588c31ca9be48 (diff)
downloadscummvm-rg350-735604c2fdc8a6e8dc2874c49413715555dc692b.tar.gz
scummvm-rg350-735604c2fdc8a6e8dc2874c49413715555dc692b.tar.bz2
scummvm-rg350-735604c2fdc8a6e8dc2874c49413715555dc692b.zip
OPENGLSDL: Use String::format instead of sprintf.
Diffstat (limited to 'backends/graphics/openglsdl')
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 00352689c1..0fcee18605 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -394,27 +394,27 @@ void OpenGLSdlGraphicsManager::displayModeChangedMsg() {
if (newModeName) {
const int scaleFactor = getScale();
- char buffer[128];
- sprintf(buffer, "%s: %s\n%d x %d -> %d x %d",
+ Common::String osdMessage = Common::String::format(
+ "%s: %s\n%d x %d -> %d x %d",
_("Current display mode"),
newModeName,
_videoMode.screenWidth * scaleFactor,
_videoMode.screenHeight * scaleFactor,
_hwscreen->w, _hwscreen->h
);
- displayMessageOnOSD(buffer);
+ displayMessageOnOSD(osdMessage.c_str());
}
}
void OpenGLSdlGraphicsManager::displayScaleChangedMsg() {
- char buffer[128];
const int scaleFactor = getScale();
- sprintf(buffer, "%s: x%d\n%d x %d -> %d x %d",
+ Common::String osdMessage = Common::String::format(
+ "%s: x%d\n%d x %d -> %d x %d",
_("Current scale"),
scaleFactor,
_videoMode.screenWidth, _videoMode.screenHeight,
_videoMode.overlayWidth, _videoMode.overlayHeight
);
- displayMessageOnOSD(buffer);
+ displayMessageOnOSD(osdMessage.c_str());
}
#endif
@@ -450,18 +450,18 @@ void OpenGLSdlGraphicsManager::toggleFullScreen(int loop) {
_ignoreResizeFrames = 10;
#ifdef USE_OSD
- char buffer[128];
+ Common::String osdMessage;
if (getFullscreenMode())
- sprintf(buffer, "%s\n%d x %d",
+ osdMessage = Common::String::format("%s\n%d x %d",
_("Fullscreen mode"),
_hwscreen->w, _hwscreen->h
);
else
- sprintf(buffer, "%s\n%d x %d",
+ osdMessage = Common::String::format("%s\n%d x %d",
_("Windowed mode"),
_hwscreen->w, _hwscreen->h
);
- displayMessageOnOSD(buffer);
+ displayMessageOnOSD(osdMessage.c_str());
#endif
}
@@ -478,19 +478,19 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
// Alt-S create a screenshot
if (event.kbd.keycode == 's') {
- char filename[20];
+ Common::String filename;
for (int n = 0;; n++) {
SDL_RWops *file;
- sprintf(filename, "scummvm%05d.bmp", n);
- file = SDL_RWFromFile(filename, "r");
+ filename = Common::String::format("scummvm%05d.bmp", n);
+ file = SDL_RWFromFile(filename.c_str(), "r");
if (!file)
break;
SDL_RWclose(file);
}
- if (saveScreenshot(filename))
- debug("Saved screenshot '%s'", filename);
+ if (saveScreenshot(filename.c_str()))
+ debug("Saved screenshot '%s'", filename.c_str());
else
warning("Could not save screenshot");
return true;
@@ -511,18 +511,18 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
setFeatureState(OSystem::kFeatureAspectRatioCorrection, !getFeatureState(OSystem::kFeatureAspectRatioCorrection));
endGFXTransaction();
#ifdef USE_OSD
- char buffer[128];
+ Common::String osdMessage;
if (getFeatureState(OSystem::kFeatureAspectRatioCorrection))
- sprintf(buffer, "%s\n%d x %d -> %d x %d",
- _("Enabled aspect ratio correction"),
+ osdMessage = Common::String::format("%s\n%d x %d -> %d x %d",
+ _("Enabled aspect ratio correction"),
_videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h);
else
- sprintf(buffer, "%s\n%d x %d -> %d x %d",
- _("Disabled aspect ratio correction"),
+ osdMessage = Common::String::format("%s\n%d x %d -> %d x %d",
+ _("Disabled aspect ratio correction"),
_videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h);
- displayMessageOnOSD(buffer);
+ displayMessageOnOSD(osdMessage.c_str());
#endif
internUpdateScreen();
return true;