diff options
-rw-r--r-- | scumm.h | 1 | ||||
-rw-r--r-- | scummvm.cpp | 25 | ||||
-rw-r--r-- | sdl.cpp | 7 | ||||
-rw-r--r-- | x11.cpp | 16 |
4 files changed, 36 insertions, 13 deletions
@@ -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"); @@ -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 @@ -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 !"); } |