Add original music soundtracks. If you have a playlist already, you need to delete it

or add the music to it manually.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5261 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2008-06-17 19:32:17 +00:00
parent 0d706d02fd
commit 1c3835ce23
5 changed files with 19 additions and 5 deletions

BIN
data/base/music/menu.ogg Normal file

Binary file not shown.

BIN
data/base/music/track1.ogg Normal file

Binary file not shown.

BIN
data/base/music/track2.ogg Normal file

Binary file not shown.

View File

@ -169,10 +169,7 @@ zone 2100 Resurrection Project (http://wiki.wz2100.net/command_line_options).
3.3 Music
---------
As the original game music is part of the data that was not liberated, music is
reintroduced in a different way. A playlist-system is used that can point to any
*.ogg in your warzone-data-path. This is still experimental and we are gradually
making this more usable.
A playlist-system is used that can point to any *.ogg in your warzone-data-path.
Warzone reads the following two playlists (in the order they are mentioned) and
the first playlist found will be used:
@ -184,6 +181,8 @@ the first playlist found will be used:
* Warzone-install-path:
o <whereverwarzoneisinstalled>/music/music.wpl
If no playlist is present, one is created that plays the original game music.
Using the playlist
******************
The playlist contains two sections, [game] and [menu]. For each section you can

View File

@ -72,7 +72,6 @@ bool PlayList_Read(const char* path)
{
PHYSFS_file* fileHandle;
char* path_to_music = NULL;
char fileName[PATH_MAX];
// Construct file name
@ -81,6 +80,22 @@ bool PlayList_Read(const char* path)
// Attempt to open the playlist file
fileHandle = PHYSFS_openRead(fileName);
if (fileHandle == NULL)
{
// Create default playlist file
// This is an ugly HACK which should be FIXME'd into oblivion some other time
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;