aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm.h1
-rw-r--r--scummvm.cpp25
-rw-r--r--sdl.cpp7
-rw-r--r--x11.cpp16
4 files changed, 36 insertions, 13 deletions
diff --git a/scumm.h b/scumm.h
index 13d5a66872..605468b6ed 100644
--- a/scumm.h
+++ b/scumm.h
@@ -2327,5 +2327,6 @@ void playSfxSound(void *sound, uint32 size, uint rate);
bool isSfxFinished();
void waitForTimer(Scumm *s, int msec_delay);
void setShakePos(Scumm *s, int shake_pos);
+void setWindowName(Scumm *s);
uint16 newTag2Old(uint32 oldTag);
void cd_playtrack(int track, int offset, int delay);
diff --git a/scummvm.cpp b/scummvm.cpp
index df731b246c..1f9b2d7a7a 100644
--- a/scummvm.cpp
+++ b/scummvm.cpp
@@ -211,29 +211,30 @@ void Scumm::scummMain(int argc, char **argv) {
#endif
parseCommandLine(argc, argv);
- #ifdef __MORPHOS__
- // I need to know the game name in initGraphics()
- if (!detectGame()) {
- warning("Game detection failed. Using default settings");
- _features = GF_DEFAULT;
- }
- #endif
+ if (_exe_name != NULL) {
+ /* No game selection menu */
+ if (!detectGame()) {
+ warning("Game detection failed. Using default settings");
+ _features = GF_DEFAULT;
+ }
+ } else {
+ _gameText = "Please choose a game";
+ }
/* Init graphics and create a primary virtual screen */
initGraphics(this, _fullScreen, _scale);
allocResTypeData(rtBuffer, MKID('NONE'),10,"buffer", 0);
initVirtScreen(0, 0, 200, false, false);
- #if !defined(__MORPHOS__) && !defined(__APPLE__CW)
- if (_exe_name==NULL)
- //error("Specify the name of the game to start on the command line");
- launcherLoop();
+ if (_exe_name==NULL) {
+ launcherLoop();
+ setWindowName(this);
+ }
if (!detectGame()) {
warning("Game detection failed. Using default settings");
_features = GF_DEFAULT;
}
-#endif
if (!_gameDataPath) {
warning("No path was provided. Assuming that data file are in the current directory");
diff --git a/sdl.cpp b/sdl.cpp
index 4535e85f27..25e1659502 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -844,6 +844,13 @@ void initGraphics(Scumm *s, bool fullScreen, unsigned int scaleFactor) {
);
}
+void setWindowName(Scumm *s) {
+ char buf[512], *gameName;
+
+ sprintf(buf, "ScummVM - %s", gameName = s->getGameName());
+ free(gameName);
+ SDL_WM_SetCaption(buf,buf);
+}
#if !defined(__APPLE__)
#undef main
diff --git a/x11.cpp b/x11.cpp
index ecb60fad4b..af8f5192fd 100644
--- a/x11.cpp
+++ b/x11.cpp
@@ -208,7 +208,7 @@ void initGraphics(Scumm *s, bool fullScreen, unsigned int scaleFactor) {
XTextProperty window_name;
char *name = (char *) &buf;
- scale = scaleFactor; // not implemented yet! ignored.
+ scale = scaleFactor; // not implemented yet! ignored.
/* For the window title */
sprintf(buf, "ScummVM - %s", gameName = s->getGameName());
@@ -278,6 +278,20 @@ void initGraphics(Scumm *s, bool fullScreen, unsigned int scaleFactor) {
local_fb = (unsigned char *) malloc(320 * 200 * sizeof(unsigned char));
}
+void setWindowName(Scumm *s) {
+ char buf[512], *gameName;
+ XTextProperty window_name;
+ char *name = (char *) &buf;
+
+ /* For the window title */
+ sprintf(buf, "ScummVM - %s", gameName = s->getGameName());
+ free(gameName);
+
+ XStringListToTextProperty( &name, 1, &window_name );
+ XSetWMProperties(display, window, &window_name, &window_name,
+ NULL /* argv */, 0 /* argc */, NULL /* size hints */, NULL /* WM hints */, NULL /* class hints */ );
+}
+
void setShakePos(Scumm *s, int shake_pos) {
warning("Unimplemented shaking !");
}