I would like to commit the original game music to the repository under
base/music. I ripped it directly from the game CDs, using normal ogg
compression. Any objections?

The music playing patch that is attached is a quick hack, but should
work well enough.

  - Per
Index: lib/sound/playlist.c
===================================================================
--- lib/sound/playlist.c	(revision 5252)
+++ lib/sound/playlist.c	(working copy)
@@ -72,7 +72,6 @@
 {
 	PHYSFS_file* fileHandle;
 	char* path_to_music = NULL;
-
 	char fileName[PATH_MAX];
 
 	// Construct file name
@@ -82,6 +81,21 @@
 	fileHandle = PHYSFS_openRead(fileName);
 	if (fileHandle == NULL)
 	{
+		// Create default playlist file
+		fileHandle = PHYSFS_openWrite(fileName);
+		if (fileHandle)
+		{
+			const char *gamestr = "[game]\npath=music\nshuffle=yes\ntrack1.ogg\ntrack2.ogg\n\n";
+			const char *menustr = "[menu]\npath=music\nmenu.ogg\n";
+
+			PHYSFS_write(fileHandle, gamestr, strlen(gamestr), 1);
+			PHYSFS_write(fileHandle, menustr, strlen(menustr), 1);
+			PHYSFS_close(fileHandle);
+		}
+		fileHandle = PHYSFS_openRead(fileName);
+	}
+	if (fileHandle == NULL)
+	{
 		debug(LOG_NEVER, "sound_LoadTrackFromFile: PHYSFS_openRead(\"%s\") failed with error: %s\n", fileName, PHYSFS_getLastError());
 		return false;
 	}
Index: lib/netplay/netplay.c
===================================================================
--- lib/netplay/netplay.c	(revision 5252)
+++ lib/netplay/netplay.c	(working copy)
@@ -210,6 +210,7 @@
 	}
 
 	memcpy(pMsg, message, size);
+	pMsg->size = SDL_SwapBE16(message->size);
 	bs->buffer_start += size;
 	bs->bytes -= size;
 
Index: data/base/music/menu.ogg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: data/base/music/menu.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Index: data/base/music/track1.ogg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: data/base/music/track1.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Index: data/base/music/track2.ogg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: data/base/music/track2.ogg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to