[Scummvm-cvs-logs] CVS: scummvm scumm.h,1.88,1.89 x11.cpp,1.4,1.5 sdl.cpp,1.44,1.45 scummvm.cpp,1.86,1.87

Lionel Ulmer bbrox at users.sourceforge.net
Sun Mar 17 05:01:08 CET 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv15177

Modified Files:
	scumm.h x11.cpp sdl.cpp scummvm.cpp 
Log Message:
Fixed the 'window title' problem for the SDL and X11 ports. Other 'porters' should fix their front-ends (sorry :-) ).



Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.88
retrieving revision 1.89
diff -C2 -d -r1.88 -r1.89
*** scumm.h	17 Mar 2002 12:10:41 -0000	1.88
--- scumm.h	17 Mar 2002 13:00:10 -0000	1.89
***************
*** 2328,2331 ****
--- 2328,2332 ----
  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);

Index: x11.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/x11.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** x11.cpp	17 Mar 2002 11:09:04 -0000	1.4
--- x11.cpp	17 Mar 2002 13:00:11 -0000	1.5
***************
*** 209,213 ****
    char *name = (char *) &buf;
    
! 	scale = scaleFactor;  // not implemented yet! ignored.
  
    /* For the window title */
--- 209,213 ----
    char *name = (char *) &buf;
    
!   scale = scaleFactor;  // not implemented yet! ignored.
  
    /* For the window title */
***************
*** 277,280 ****
--- 277,294 ----
    /* Initialize the 'local' frame buffer */
    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 */ );  
  }
  

Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sdl.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** sdl.cpp	16 Mar 2002 05:33:25 -0000	1.44
--- sdl.cpp	17 Mar 2002 13:00:11 -0000	1.45
***************
*** 845,848 ****
--- 845,855 ----
  }
  
+ 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__)

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.86
retrieving revision 1.87
diff -C2 -d -r1.86 -r1.87
*** scummvm.cpp	17 Mar 2002 12:07:33 -0000	1.86
--- scummvm.cpp	17 Mar 2002 13:00:11 -0000	1.87
***************
*** 212,222 ****
  	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
  	
  	/* Init graphics and create a primary virtual screen */
--- 212,224 ----
  	parseCommandLine(argc, argv);
  
! 	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 */
***************
*** 225,232 ****
  	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 (!detectGame()) {
--- 227,234 ----
  	initVirtScreen(0, 0, 200, false, false);	
  
! 	if (_exe_name==NULL) {
! 	  launcherLoop();
! 	  setWindowName(this);
! 	}
  
  	if (!detectGame()) {
***************
*** 234,238 ****
  		_features = GF_DEFAULT;
  	}
- #endif
  
  	if (!_gameDataPath) {
--- 236,239 ----





More information about the Scummvm-git-logs mailing list