[Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Src games.cpp,1.6,1.7 games.h,1.5,1.6

Chris Apers chrilith at users.sourceforge.net
Sun Sep 12 06:33:14 CEST 2004


Update of /cvsroot/scummvm/scummvm/backends/PalmOS/Src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9005

Modified Files:
	games.cpp games.h 
Log Message:
- Music and sound options can now be defined for each games
- updated games config

Index: games.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/games.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- games.cpp	5 Feb 2004 13:46:28 -0000	1.6
+++ games.cpp	12 Sep 2004 13:32:27 -0000	1.7
@@ -64,8 +64,39 @@
 				FrmDrawForm(frmP);
 				SysTaskDelay(200);
 
-				if (version == itemVersion_2) {
-					// need conversion from V2 -> V2.5
+				MemSet(&gitCur, sizeof(GameInfoType), 0);
+
+				if (version == itemVersion_27 ||
+					version == itemVersion_26 ||
+					version == itemVersion_25) {
+
+					for (index = 0; index < numRecs; index++) {
+						
+						// get old data
+						tmpH = DmQueryRecord(gameDB, index);
+						tmpP = MemHandleLock(tmpH);
+						MemMove(&gitCur, tmpP, MemHandleSize(tmpH));
+						MemHandleUnlock(tmpH);
+						
+						gitCur.musicInfo.volume.master = 192;
+						gitCur.musicInfo.volume.music = 192;
+						gitCur.musicInfo.volume.sfx = 192;
+						gitCur.musicInfo.volume.speech = 192;
+						gitCur.musicInfo.volume.audiocd = 50;
+						
+						gitCur.musicInfo.sound.tempo = 100;
+						gitCur.musicInfo.sound.defaultTrackLength = 10;
+						gitCur.musicInfo.sound.firstTrack = 1;
+
+						// simply resize the old record
+						tmpH = DmResizeRecord(gameDB, index, sizeof(GameInfoType));	// TODO : check error on resize tmpH==NULL
+						tmpP = MemHandleLock(tmpH);
+						DmWrite(tmpP, 0, &gitCur, sizeof(GameInfoType));
+						MemPtrUnlock(tmpP);
+					}
+					
+				} else if (version == itemVersion_20) {
+					// need conversion from V2 -> V2.7
 					GameInfoTypeV2 git0;
 
 					for (index = 0; index < numRecs; index++) {
@@ -96,14 +127,24 @@
 						gitCur.talkValue = git0.talkValue;
 						gitCur.platform = git0.platform;
 						gitCur.language = git0.language;
+
+						gitCur.musicInfo.volume.master = 192;
+						gitCur.musicInfo.volume.music = 192;
+						gitCur.musicInfo.volume.sfx = 192;
+						gitCur.musicInfo.volume.speech = 192;
+						gitCur.musicInfo.volume.audiocd = 50;
 						
+						gitCur.musicInfo.sound.tempo = 100;
+						gitCur.musicInfo.sound.defaultTrackLength = 10;
+						gitCur.musicInfo.sound.firstTrack = 1;
+
 						tmpH = DmResizeRecord(gameDB, index, sizeof(GameInfoType));	// TODO : check error on resize tmpH==NULL
 						tmpP = MemHandleLock(tmpH);
 						DmWrite(tmpP, 0, &gitCur, sizeof(GameInfoType));
 						MemPtrUnlock(tmpP);
 					}
 				} else {
-					// need conversion from V0 -> V2.5
+					// need conversion from V0 -> V2.7
 					GameInfoTypeV0 git0;
 
 					for (index = 0; index < numRecs; index++) {
@@ -134,7 +175,17 @@
 						gitCur.talkValue = git0.talkValue;
 						gitCur.platform = 0;	// default to amiga
 						gitCur.language = git0.language;
+
+						gitCur.musicInfo.volume.master = 192;
+						gitCur.musicInfo.volume.music = 192;
+						gitCur.musicInfo.volume.sfx = 192;
+						gitCur.musicInfo.volume.speech = 192;
+						gitCur.musicInfo.volume.audiocd = 50;
 						
+						gitCur.musicInfo.sound.tempo = 100;
+						gitCur.musicInfo.sound.defaultTrackLength = 10;
+						gitCur.musicInfo.sound.firstTrack = 1;
+
 						tmpH = DmResizeRecord(gameDB, index, sizeof(GameInfoType));	// TODO : check error on resize tmpH==NULL
 						tmpP = MemHandleLock(tmpH);
 						DmWrite(tmpP, 0, &gitCur, sizeof(GameInfoType));

Index: games.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/games.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- games.h	20 Jan 2004 14:03:50 -0000	1.5
+++ games.h	12 Sep 2004 13:32:27 -0000	1.6
@@ -70,8 +70,35 @@
 
 } GameInfoTypeV2;
 
+
 // Current config
 typedef struct {
+	struct {
+		UInt16 master;
+		UInt16 music;
+		UInt16 sfx;
+		UInt16 speech;
+		UInt16 audiocd;
+	} volume;
+	
+	struct {
+		// midi
+		Boolean multiMidi;
+		Boolean music;
+		UInt8 drvMusic;
+		UInt8 tempo;
+		// sound FX
+		Boolean sfx;
+		UInt8 rate;
+		// CD audio
+		Boolean CD;
+		UInt8 drvCD, frtCD;
+		UInt16 defaultTrackLength;
+		UInt16 firstTrack;
+	} sound;
+} MusicInfoType;
+
+typedef struct {
 	UInt32	version;
 	UInt16	icnID;			// icon to display on the list
 	Boolean	selected;
@@ -91,7 +118,13 @@
 	UInt16 bootValue;
 	UInt16 talkValue;
 	UInt8 platform;
-	UInt8 language;
+	UInt8 language;			// |- 	v2.5
+	
+	Boolean filter;			// 		v2.6
+	Boolean fullscreen;		// |
+	Boolean aspectRatio;	// |-	v2.7
+	
+	MusicInfoType musicInfo;// 		v3.0
 
 } GameInfoType;
 





More information about the Scummvm-git-logs mailing list