aboutsummaryrefslogtreecommitdiff
path: root/base/main.cpp
diff options
context:
space:
mode:
authorMax Horn2003-11-07 14:17:34 +0000
committerMax Horn2003-11-07 14:17:34 +0000
commit496d19d46176200c3d8486a202382b7016591f5c (patch)
tree9064eb95274605b4dc09d66b37870e278947e0d8 /base/main.cpp
parente9eb92e201f8a4d214b2923243199142bff903bf (diff)
downloadscummvm-rg350-496d19d46176200c3d8486a202382b7016591f5c.tar.gz
scummvm-rg350-496d19d46176200c3d8486a202382b7016591f5c.tar.bz2
scummvm-rg350-496d19d46176200c3d8486a202382b7016591f5c.zip
err, *strnlen(,,3)* used to check for empty strings? I think not :-)
svn-id: r11190
Diffstat (limited to 'base/main.cpp')
-rw-r--r--base/main.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/base/main.cpp b/base/main.cpp
index bfc54b2106..4c335eef7e 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -258,17 +258,15 @@ int main(int argc, char *argv[]) {
if (detector.detectMain()) {
// Set the window caption to the game name
- prop.caption = ConfMan.get("description", detector._targetName).c_str();
- if (strnlen(prop.caption, 3) == 0)
- prop.caption = detector._game.description;
- if (strnlen(prop.caption, 3) == 0)
- prop.caption = detector._targetName.c_str();
- if (strnlen(prop.caption, 3) != 0)
+ Common::String caption(ConfMan.get("description", detector._targetName));
+ if (caption.isEmpty() && detector._game.description)
+ caption = detector._game.description;
+ if (caption.isEmpty())
+ caption = detector._targetName;
+ if (!caption.isEmpty()) {
+ prop.caption = caption.c_str();
system->property(OSystem::PROP_SET_WINDOW_CAPTION, &prop);
-
- // FIXME: It seem not logical that we first might set the gfx mode to
- // 1x, and then immediately after might override it again. We probably
- // should combine both checks into one.
+ }
// See if the game should default to 1x scaler
if (!ConfMan.hasKey("gfx_mode", detector._targetName) &&