[Scummvm-cvs-logs] CVS: scummvm main.cpp,1.14,1.15 scummvm.cpp,1.135,1.136 sdl.cpp,1.112,1.113 sound.cpp,1.73,1.74 system.h,1.17,1.18 x11.cpp,1.23,1.24

Lionel Ulmer bbrox at users.sourceforge.net
Sat May 4 02:56:02 CEST 2002


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

Modified Files:
	main.cpp scummvm.cpp sdl.cpp sound.cpp system.h x11.cpp 
Log Message:
Change the 'poperty' call to be 64-bits clean.

Porters, please check that I did not break anything while updating
your ports. Thanks :-)



Index: main.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/main.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- main.cpp	3 May 2002 18:24:16 -0000	1.14
+++ main.cpp	4 May 2002 09:55:10 -0000	1.15
@@ -81,7 +81,7 @@
 	signal(SIGBUS, handle_errors);
 	signal(SIGABRT, handle_errors);
 	signal(SIGSEGV, handle_errors);
-	if (*((int *) ((char *) test + 1)) != value) {
+	if (*((unsigned int *) ((char *) test + 1)) != value) {
 		error("Your system does not support unaligned memory accesses. Please rebuild with SCUMM_NEED_ALIGNMENT ");
 	}
 	signal(SIGBUS, SIG_DFL);
@@ -148,7 +148,10 @@
 
 	{
 		char *s = detector.getGameName();
-		system->property(OSystem::PROP_SET_WINDOW_CAPTION, (long)s);
+		OSystem::Property prop;
+
+		prop.caption = s;
+		system->property(OSystem::PROP_SET_WINDOW_CAPTION, &prop);
 		free(s);
 	}
 

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- scummvm.cpp	4 May 2002 00:20:39 -0000	1.135
+++ scummvm.cpp	4 May 2002 09:55:10 -0000	1.136
@@ -1300,8 +1300,8 @@
 	else
 		OF_OWNER_ROOM = 0x0F;
 
-//  if (_gameId==GID_MONKEY2 && _bootParam == 0)
-//    _bootParam = 10001;
+	// if (_gameId==GID_MONKEY2 && _bootParam == 0)
+	//	_bootParam = 10001;
 
 	if (_gameId == GID_INDY4 && _bootParam == 0) {
 		_bootParam = -7873;
@@ -1336,6 +1336,7 @@
 Scumm *Scumm::createFromDetector(GameDetector *detector, OSystem *syst)
 {
 	Scumm *scumm;
+	OSystem::Property prop;
 
 	if (detector->_features & GF_OLD256)
 		scumm = new Scumm_v3;
@@ -1352,7 +1353,8 @@
 
 	/* This initializes SDL */
 	syst->init_size(320,200);
-	syst->property(OSystem::PROP_OPEN_CD, detector->_cdrom);
+	prop.cd_num = detector->_cdrom;
+	syst->property(OSystem::PROP_OPEN_CD, &prop);
 
 	/* bind the mixer to the system => mixer will be invoked
 	 * automatically when samples need to be generated */	

Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sdl.cpp,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- sdl.cpp	4 May 2002 01:16:06 -0000	1.112
+++ sdl.cpp	4 May 2002 09:55:10 -0000	1.113
@@ -94,7 +94,7 @@
 	void quit();
 
 	// Set a parameter
-	uint32 property(int param, uint32 value);
+	uint32 property(int param, Property *value);
 
 	static OSystem *create(int gfx_mode, bool full_screen);
 
@@ -733,7 +733,7 @@
 
 				/* internal keypress? */				
 				if (b == KBD_ALT && ev.key.keysym.sym==SDLK_RETURN) {
-					property(PROP_TOGGLE_FULLSCREEN, 0);
+					property(PROP_TOGGLE_FULLSCREEN, NULL);
 					break;
 				}
 
@@ -743,8 +743,10 @@
 				}
 
 				if (b == (KBD_CTRL|KBD_ALT) && 
-						ev.key.keysym.sym>='1' && ev.key.keysym.sym<='7') {
-					property(PROP_SET_GFX_MODE, ev.key.keysym.sym - '1');
+				    (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='7')) {
+					Property prop;
+					prop.gfx_mode = ev.key.keysym.sym - '1';
+					property(PROP_SET_GFX_MODE, &prop);
 					break;
 				}
 
@@ -855,7 +857,7 @@
 	OSystem_SDL::update_screen();
 }
 
-uint32 OSystem_SDL::property(int param, uint32 value) {
+uint32 OSystem_SDL::property(int param, Property *value) {
 	switch(param) {
 
 	case PROP_TOGGLE_FULLSCREEN:
@@ -869,14 +871,14 @@
 		return 1;
 
 	case PROP_SET_WINDOW_CAPTION:
-		SDL_WM_SetCaption((char*)value, (char*)value);
+		SDL_WM_SetCaption(value->caption, value->caption);
 		return 1;
 
 	case PROP_OPEN_CD:
 		if (SDL_InitSubSystem(SDL_INIT_CDROM) == -1)
 			cdrom = NULL;
 		else {
-			cdrom = SDL_CDOpen(value);
+			cdrom = SDL_CDOpen(value->cd_num);
 			/* Did if open? Check if cdrom is NULL */
 			if (!cdrom) {
 				warning("Couldn't open drive: %s\n", SDL_GetError());
@@ -885,16 +887,16 @@
 		break;
 
 	case PROP_SET_GFX_MODE:
-		if (value >= 7)
+		if (value->gfx_mode >= 7)
 			return 0;
 
-		_mode = value;
+		_mode = value->gfx_mode;
 		hotswap_gfx_mode();
 
 		return 1;
 
 	case PROP_SHOW_DEFAULT_CURSOR:
-		SDL_ShowCursor(value ? SDL_ENABLE : SDL_DISABLE);		
+		SDL_ShowCursor(value->show_cursor ? SDL_ENABLE : SDL_DISABLE);		
 		break;
 
 	case PROP_GET_SAMPLE_RATE:
@@ -1116,7 +1118,7 @@
 	bool poll_event(Event *event) { return false; }
 	bool set_sound_proc(void *param, SoundProc *proc, byte sound) {}
 	void quit() { exit(1); }
-	uint32 property(int param, uint32 value) { return 0; }
+	uint32 property(int param, Property *value) { return 0; }
 	static OSystem *create(int gfx_mode, bool full_screen);
 private:
 

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- sound.cpp	3 May 2002 21:37:49 -0000	1.73
+++ sound.cpp	4 May 2002 09:55:10 -0000	1.74
@@ -748,6 +748,7 @@
 
 			default:
 				printf("Unknown codec %d!\n", table[i].codec);
+				outputSize = 0;
 			break;
 		}
 		

Index: system.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/system.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- system.h	26 Apr 2002 13:39:01 -0000	1.17
+++ system.h	4 May 2002 09:55:10 -0000	1.18
@@ -63,7 +63,13 @@
 		PROP_SHOW_DEFAULT_CURSOR = 5,
 		PROP_GET_SAMPLE_RATE = 6,
 	};
-
+	union Property {
+		char *caption;
+		int cd_num;
+		int gfx_mode;
+		bool show_cursor;
+	};
+	
 	enum {
 		SOUND_8BIT = 0,
 		SOUND_16BIT = 1,
@@ -114,7 +120,7 @@
 	virtual bool set_sound_proc(void *param, SoundProc *proc, byte format) = 0;
 	
 	// Get or set a property
-	virtual uint32 property(int param, uint32 value) = 0;
+	virtual uint32 property(int param, Property *value) = 0;
 		
 	// Poll cdrom status
 	// Returns true if cd audio is playing

Index: x11.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/x11.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- x11.cpp	1 May 2002 09:41:54 -0000	1.23
+++ x11.cpp	4 May 2002 09:55:10 -0000	1.24
@@ -111,7 +111,7 @@
 	void quit();
 
 	// Set a parameter
-	uint32 property(int param, uint32 value);
+	uint32 property(int param, Property *value);
 
 	static OSystem *create(int gfx_mode, bool full_screen);
 
@@ -703,13 +703,13 @@
 		return thread;
 }
 
-uint32 OSystem_X11::property(int param, uint32 value) {
+uint32 OSystem_X11::property(int param, Property *value) {
 	switch (param) 
 	{
 		case PROP_GET_SAMPLE_RATE:
 			return 22050;
 	}
-	warning("Property not implemented yet (%d, 0x%08X) ", param, value);
+	warning("Property not implemented yet (%d) ", param);
 	return 0;
 }
 





More information about the Scummvm-git-logs mailing list