Skip to content

Commit 4c856c8

Browse files
author
yetisyny
committed
Added Ogg Vorbis support and Ogg Vorbis music.
- For Ogg Vorbis support on Windows, you need libogg-0.dll, libvorbis-0.dll, and libvorbisfile-3.dll in the same directory as your crimesquad.exe executable. For Ogg Vorbis support on UNIX-based systems, you need libogg, libvorbis, and libvorbisfile installed on your system. Luckily none of these dependencies are needed for compiling, and they are optional at runtime, the program doens't crash if you leave them out, it just doesn't have Ogg Vorbis support and falls back to MIDI instead. - There is still MIDI support and MIDI files. It is used as a fallback if you don't have Ogg Vorbis support (don't have the necessary .DLLs or libraries) or if the .OGG files in question are missing. - The MIDI files have all been moved from the /art directory to the /art/midi directory so it's easier to deal with them and decide whether or not to include them in a distribution or on your own computer. - The Ogg Vorbis files are similarly located in the /art/ogg directory. - There are many different licenses for the Ogg Vorbis files and some related documentation, and I also put in licenses for everything else in the game, in a new file, /art/licenses.txt. Since it's in the art directory people will always get that file. Legally it needs to be included along with any distribution of the Ogg Vorbis files to cover their license requirements. And actually it's legally needed for certain libraries in the source code that also have their licenses in it too. /art/licenses.txt also has useful information on including Ogg Vorbis files, like why you can't use files with a sampling rate of 48 kHz, and how you can convert them to 44.1 kHz using Audacity so they'll work with the game (a little complicated, you have to change the sampling rate in 2 places and also adjust the speed of the music too). - Of course everything is under a Liberal license that is compatible with packaging along with a GNU GPL game for it to playback while you play it. Because the music and the game engine can be packaged separately and neither requires the other (you can play the music in a media player, and you can run the game without any music), legally they can be considered separate and not have to be under the same license. So that is where /art/licenses.txt comes in to explain what files are under what licenses. - Anyway now you can bundle the game with Ogg Vorbis music (lots of disk space but better quality sound), MIDI music (way less disk space but lower quality sound), or no music at all, and any of those options works equally well, with the same exact compiled executable. - Relocated the MIDI files in Makefile.am and added the Ogg Vorbis ones... not sure if this'll work since they're in subdirectories of /art. The makefile might just plop 'em all in /art rather than the proper subdirectories, I don't really understand makefiles quite enough to figure out whether that will happen or not, or how to fix it if it actually is a problem. - With official release versions we'll PROBABLY have one version with Ogg Vorbis music and one with MIDI music, that's what I think would be a good idea anyway (and they can both use the exact same crimesquad.exe file). - Enabled FluidSynth for people on UNIX-based systems who have it, apparently it had to be turned on, I just assumed it was on by default. - Mixer and files for it all have to be 44.1 kHz. I think the mixer was set to 48 kHz before but that didn't affect MIDI, at least on Windows, since it was played back through Windows' Midi Mapper rather than the Windows's Wave Mixer... it DOES affect Ogg Vorbis though so I needed to fix it to 44.1 kHz. - Anyway the point is now people can listen to either MIDI or Ogg Vorbis as their music, or not have music at all, and all 34 songs are implemented as both types. - The MusicClass in the source code (declared in includes.h and having its bigger functions implemented in misc.cpp) is now even more, umm, object-oriented and now extracts away SDL2 and SDL2_mixer stuff from the rest of the game completely, which simplifies the code in the main game.cpp. - Used EXIT_SUCCESS and EXIT_FAILURE as exit codes for the program instead of 0 and 1, since that's what the C++ standard recommends (it behaves identically on Windows, but might improve things on other platforms). - Some minor code cleanup. - As far as music choices go, unfortunately I did have to use some ancient recordings from the 1900s, 1910s, 1920s, or 1930s for songs where better recordings weren't available under public domain or under Liberal licenses. But for most songs I got quite good music. And for the old ones I cleaned them up a bit in Audacity to make them sound better. - All 34 Ogg Vorbis files are 44.1 kHz sampling rate and have a target bitrate of 64 kbps but actually in practice have bitrates somewhere between 54 and 60, which saves disk space. The Ogg Vorbis files also have lots of metadata (some of the licenses require it, and it's just helpful anyway). - The total filesize of all 34 Ogg Vorbis files is 56.7 MB (59,485,596 bytes). I had estimated on the forums it might be 79 megs, as a general ballpark estimate of the order of magnitude. So I am pleasantly surprised that it came in so low at only 56.7 megabytes for all 34 Ogg Vorbis files. And the sound quality is very very nice, I am amazed how good it can sound at a low bitrate, it is WAY better than MP3 at low bitrates.
1 parent 94a2342 commit 4c856c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+737
-125
lines changed

LINUX_README.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@ Microsoft Visual C++ (32-bit) and MinGW-GCC (32 bit), the 2 main
386386
compilers used on MS Windows. On other platforms such as Linux and
387387
Mac OS X you will probably need the SDL2 and SDL2_mixer libraries to
388388
link against as dependencies, in order for it to compile correctly
389-
with audio support. Currently this is used for MIDI background music.
389+
with audio support. Currently this is used for MIDI or Ogg Vorbis
390+
background music.
390391

391392
So you have a couple alternatives:
392393

@@ -423,8 +424,12 @@ and CoreMIDI, both supported natively by SDL and SDL_mixer. Well actually
423424
CoreMIDI is just on iOS but SDL and SDL_mixer support both Android and
424425
iOS.
425426

427+
3) Use Ogg Vorbis instead of MIDI if you wish. Along with SDL2 and
428+
SDL2_mixer, you should have libogg, libvorbis, and libvorbisfile installed.
429+
Ogg Vorbis has better sound quality than MIDI but larger file size.
426430

427-
3) If all else fails, uncomment the line that says #define DONT_INCLUDE_SDL
431+
432+
4) If all else fails, uncomment the line that says #define DONT_INCLUDE_SDL
428433
in common.h. This will disable SDL, SDL_mixer, and audio, and let
429434
you compile and build Liberal Crime Squad without any SDL dependencies.
430435
The only downside to this is you don't get any audio.

Makefile.am

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dist_art_DATA = art/abort.cmv art/anchor.cmv art/glamshow.cmv art/lacops.cmv\
1212
art/deptstore.xml art/loot.xml art/masks.xml art/oubliette.xml\
1313
art/pawnshop.xml art/vehicles.xml art/weapons.xml\
1414
\
15-
art/sitemaps.txt\
15+
art/licenses.txt art/sitemaps.txt\
1616
\
1717
art/mapCSV_Bank_Specials.csv art/mapCSV_Bank_Tiles.csv\
1818
art/mapCSV_BarAndGrill_Specials.csv art/mapCSV_BarAndGrill_Tiles.csv\
@@ -24,15 +24,25 @@ dist_art_DATA = art/abort.cmv art/anchor.cmv art/glamshow.cmv art/lacops.cmv\
2424
art/mapCSV_WhiteHouse2_Specials.csv art/mapCSV_WhiteHouse2_Tiles.csv\
2525
art/mapCSV_WhiteHouse3_Specials.csv art/mapCSV_WhiteHouse3_Tiles.csv\
2626
\
27-
art/abort.mid art/activate.mid art/alarmed.mid art/anchor.mid\
28-
art/basemode.mid art/carchase.mid art/cartheft.mid art/dating.mid\
29-
art/defeat.mid art/disbanded.mid art/elections.mid art/finances.mid\
30-
art/footchase.mid art/glamshow.mid art/heavycombat.mid art/interrogation.mid\
31-
art/lacops.mid art/liberalagenda.mid art/newgame.mid art/newscast.mid\
32-
art/newspaper.mid art/reaganified.mid art/recruiting.mid art/reviewmode.mid\
33-
art/shopping.mid art/siege.mid art/sitemode.mid art/sleepers.mid\
34-
art/stalinized.mid art/stopevil.mid art/suspicious.mid art/titlemode.mid\
35-
art/trial.mid art/victory.mid
27+
art/midi/abort.mid art/midi/activate.mid art/midi/alarmed.mid art/midi/anchor.mid\
28+
art/midi/basemode.mid art/midi/carchase.mid art/midi/cartheft.mid art/midi/dating.mid\
29+
art/midi/defeat.mid art/midi/disbanded.mid art/midi/elections.mid art/midi/finances.mid\
30+
art/midi/footchase.mid art/midi/glamshow.mid art/midi/heavycombat.mid art/midi/interrogation.mid\
31+
art/midi/lacops.mid art/midi/liberalagenda.mid art/midi/newgame.mid art/midi/newscast.mid\
32+
art/midi/newspaper.mid art/midi/reaganified.mid art/midi/recruiting.mid art/midi/reviewmode.mid\
33+
art/midi/shopping.mid art/midi/siege.mid art/midi/sitemode.mid art/midi/sleepers.mid\
34+
art/midi/stalinized.mid art/midi/stopevil.mid art/midi/suspicious.mid art/midi/titlemode.mid\
35+
art/midi/trial.mid art/midi/victory.mid\
36+
\
37+
art/ogg/abort.ogg art/ogg/activate.ogg art/ogg/alarmed.ogg art/ogg/anchor.ogg\
38+
art/ogg/basemode.ogg art/ogg/carchase.ogg art/ogg/cartheft.ogg art/ogg/dating.ogg\
39+
art/ogg/defeat.ogg art/ogg/disbanded.ogg art/ogg/elections.ogg art/ogg/finances.ogg\
40+
art/ogg/footchase.ogg art/ogg/glamshow.ogg art/ogg/heavycombat.ogg art/ogg/interrogation.ogg\
41+
art/ogg/lacops.ogg art/ogg/liberalagenda.ogg art/ogg/newgame.ogg art/ogg/newscast.ogg\
42+
art/ogg/newspaper.ogg art/ogg/reaganified.ogg art/ogg/recruiting.ogg art/ogg/reviewmode.ogg\
43+
art/ogg/shopping.ogg art/ogg/siege.ogg art/ogg/sitemode.ogg art/ogg/sleepers.ogg\
44+
art/ogg/stalinized.ogg art/ogg/stopevil.ogg art/ogg/suspicious.ogg art/ogg/titlemode.ogg\
45+
art/ogg/trial.ogg art/ogg/victory.ogg
3646

3747

3848
dist_app_DATA = crimesquad.desktop

README

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,39 @@ Windows easy mode compilation
66
Easiest way is using the workspaces provided in the 'workspaces' folder. Project files are provided for:
77

88
* VisualStudio
9+
910
* Code::Blocks
1011

1112

1213
Files to include in Windows distributions of Liberal Crime Squad
1314
----------------------------------------------------------------
15+
1416
* The LCS executable: on Windows this is "crimesquad.exe" in either
1517
"workspaces\Debug" for a debug build or "workspaces\Release" for a release
1618
build. Of course you should compile a new executable from the latest code.
19+
1720
* The curses library: on Windows this is "pdcurses.dll".
21+
1822
* If it was compiled with SDL for music, also include SDL2.dll and SDL2_mixer.dll.
1923
You might or might not need these SDL dll files depending on how it was compiled.
20-
* The "art" directory and all the files in it.
24+
25+
* If you are using SDL for music and want to have support for Ogg Vorbis, also add
26+
libogg-0.dll, libvorbis-0.dll, and libvorbisfile-3.dll. Otherwise it will fall
27+
back to playing MIDI music instead of Ogg Vorbis. You don't need those 3 files if
28+
you are using MIDI and not Ogg Vorbis music, though. And you don't need them if
29+
you aren't using music at all, either. You just need them if you want to use Ogg
30+
Vorbis music with the game.
31+
32+
* The "art" directory and all the files in it, with an exception regarding music:
33+
You can leave out either the "midi" subdirectory or the "ogg" subdirectory, or
34+
even leave out both. If you want to listen to Ogg Vorbis music which is higher
35+
quality but takes up more disk space, you can leave out the "midi" subdirectory.
36+
If you want to listen to MIDI music which is lower quality but takes up much
37+
less disk space, you can leave out the "ogg" subdirectory. If you either compiled
38+
the game without music support or you don't want music, you can leave out both
39+
the "ogg" and "midi" directories.
40+
2141
* The "init.txt" configuration file.
42+
2243
* The "CrimeSquadManual.txt" documentation file from the "docs" directory.
2344

0 commit comments

Comments
 (0)