mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-04-20 09:55:38 +00:00
Merge branch 'master' into autosave
This commit is contained in:
commit
b139cf7d86
13 changed files with 499 additions and 300 deletions
|
@ -105,10 +105,33 @@
|
|||
66A5470D12E3CF8100FFA7D5 /* snd_codec.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5470A12E3CF8100FFA7D5 /* snd_codec.c */; };
|
||||
66A5470E12E3CF8100FFA7D5 /* snd_codec_wav.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5470B12E3CF8100FFA7D5 /* snd_codec_wav.c */; };
|
||||
66A5470F12E3CF8100FFA7D5 /* snd_codec_ogg.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5470C12E3CF8100FFA7D5 /* snd_codec_ogg.c */; };
|
||||
66A5487A12E3EA6900FFA7D5 /* Ogg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66A5487912E3EA6900FFA7D5 /* Ogg.framework */; };
|
||||
66A5487C12E3EA6E00FFA7D5 /* Vorbis.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66A5487B12E3EA6E00FFA7D5 /* Vorbis.framework */; };
|
||||
66A54A4F12E429B800FFA7D5 /* snd_resample.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A54A4E12E429B800FFA7D5 /* snd_resample.c */; };
|
||||
66A54ECE12E4ECA800FFA7D5 /* resample.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A54ECD12E4ECA800FFA7D5 /* resample.c */; };
|
||||
66A5568712E6D46D00FFA7D5 /* analysis.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5563812E6D46D00FFA7D5 /* analysis.c */; };
|
||||
66A5568812E6D46D00FFA7D5 /* bitrate.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5563A12E6D46D00FFA7D5 /* bitrate.c */; };
|
||||
66A5568912E6D46D00FFA7D5 /* bitwise.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5563C12E6D46D00FFA7D5 /* bitwise.c */; };
|
||||
66A5568A12E6D46D00FFA7D5 /* block.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5563D12E6D46D00FFA7D5 /* block.c */; };
|
||||
66A5568B12E6D46D00FFA7D5 /* codebook.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5564612E6D46D00FFA7D5 /* codebook.c */; };
|
||||
66A5568C12E6D46D00FFA7D5 /* COPYING in Resources */ = {isa = PBXBuildFile; fileRef = 66A5564912E6D46D00FFA7D5 /* COPYING */; };
|
||||
66A5568D12E6D46D00FFA7D5 /* envelope.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5564A12E6D46D00FFA7D5 /* envelope.c */; };
|
||||
66A5568E12E6D46D00FFA7D5 /* floor0.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5564C12E6D46D00FFA7D5 /* floor0.c */; };
|
||||
66A5568F12E6D46D00FFA7D5 /* floor1.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5564D12E6D46D00FFA7D5 /* floor1.c */; };
|
||||
66A5569012E6D46D00FFA7D5 /* framing.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5564E12E6D46D00FFA7D5 /* framing.c */; };
|
||||
66A5569112E6D46D00FFA7D5 /* info.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5565012E6D46D00FFA7D5 /* info.c */; };
|
||||
66A5569212E6D46D00FFA7D5 /* lookup.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5565112E6D46D00FFA7D5 /* lookup.c */; };
|
||||
66A5569312E6D46D00FFA7D5 /* lpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5565412E6D46D00FFA7D5 /* lpc.c */; };
|
||||
66A5569412E6D46D00FFA7D5 /* lsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5565612E6D46D00FFA7D5 /* lsp.c */; };
|
||||
66A5569512E6D46D00FFA7D5 /* mapping0.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5565812E6D46D00FFA7D5 /* mapping0.c */; };
|
||||
66A5569612E6D46D00FFA7D5 /* mdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5565A12E6D46D00FFA7D5 /* mdct.c */; };
|
||||
66A5569712E6D46D00FFA7D5 /* psy.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5567512E6D46D00FFA7D5 /* psy.c */; };
|
||||
66A5569812E6D46D00FFA7D5 /* README in Resources */ = {isa = PBXBuildFile; fileRef = 66A5567712E6D46D00FFA7D5 /* README */; };
|
||||
66A5569912E6D46D00FFA7D5 /* registry.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5567812E6D46D00FFA7D5 /* registry.c */; };
|
||||
66A5569A12E6D46D00FFA7D5 /* res0.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5567A12E6D46D00FFA7D5 /* res0.c */; };
|
||||
66A5569B12E6D46D00FFA7D5 /* sharedbook.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5567C12E6D46D00FFA7D5 /* sharedbook.c */; };
|
||||
66A5569C12E6D46D00FFA7D5 /* smallft.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5567D12E6D46D00FFA7D5 /* smallft.c */; };
|
||||
66A5569D12E6D46D00FFA7D5 /* synthesis.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5567F12E6D46D00FFA7D5 /* synthesis.c */; };
|
||||
66A5569E12E6D46D00FFA7D5 /* vorbisfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5568412E6D46D00FFA7D5 /* vorbisfile.c */; };
|
||||
66A5569F12E6D46D00FFA7D5 /* window.c in Sources */ = {isa = PBXBuildFile; fileRef = 66A5568512E6D46D00FFA7D5 /* window.c */; };
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
@ -286,11 +309,81 @@
|
|||
66A5470A12E3CF8100FFA7D5 /* snd_codec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_codec.c; path = ../Quake/snd_codec.c; sourceTree = SOURCE_ROOT; };
|
||||
66A5470B12E3CF8100FFA7D5 /* snd_codec_wav.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_codec_wav.c; path = ../Quake/snd_codec_wav.c; sourceTree = SOURCE_ROOT; };
|
||||
66A5470C12E3CF8100FFA7D5 /* snd_codec_ogg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_codec_ogg.c; path = ../Quake/snd_codec_ogg.c; sourceTree = SOURCE_ROOT; };
|
||||
66A5487912E3EA6900FFA7D5 /* Ogg.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Ogg.framework; path = Library/Frameworks/Ogg.framework; sourceTree = SDKROOT; };
|
||||
66A5487B12E3EA6E00FFA7D5 /* Vorbis.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Vorbis.framework; path = Library/Frameworks/Vorbis.framework; sourceTree = SDKROOT; };
|
||||
66A54A4E12E429B800FFA7D5 /* snd_resample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snd_resample.c; path = ../Quake/snd_resample.c; sourceTree = SOURCE_ROOT; };
|
||||
66A54ECD12E4ECA800FFA7D5 /* resample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = resample.c; path = ../Quake/resample.c; sourceTree = SOURCE_ROOT; };
|
||||
66A54ED012E4ECFB00FFA7D5 /* speex_resampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = speex_resampler.h; path = ../Quake/speex_resampler.h; sourceTree = SOURCE_ROOT; };
|
||||
66A5563812E6D46D00FFA7D5 /* analysis.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = analysis.c; sourceTree = "<group>"; };
|
||||
66A5563912E6D46D00FFA7D5 /* backends.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = backends.h; sourceTree = "<group>"; };
|
||||
66A5563A12E6D46D00FFA7D5 /* bitrate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bitrate.c; sourceTree = "<group>"; };
|
||||
66A5563B12E6D46D00FFA7D5 /* bitrate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bitrate.h; sourceTree = "<group>"; };
|
||||
66A5563C12E6D46D00FFA7D5 /* bitwise.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bitwise.c; sourceTree = "<group>"; };
|
||||
66A5563D12E6D46D00FFA7D5 /* block.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = block.c; sourceTree = "<group>"; };
|
||||
66A5564012E6D46D00FFA7D5 /* res_books_51.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = res_books_51.h; sourceTree = "<group>"; };
|
||||
66A5564112E6D46D00FFA7D5 /* res_books_stereo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = res_books_stereo.h; sourceTree = "<group>"; };
|
||||
66A5564312E6D46D00FFA7D5 /* floor_books.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = floor_books.h; sourceTree = "<group>"; };
|
||||
66A5564512E6D46D00FFA7D5 /* res_books_uncoupled.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = res_books_uncoupled.h; sourceTree = "<group>"; };
|
||||
66A5564612E6D46D00FFA7D5 /* codebook.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = codebook.c; sourceTree = "<group>"; };
|
||||
66A5564712E6D46D00FFA7D5 /* codebook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = codebook.h; sourceTree = "<group>"; };
|
||||
66A5564812E6D46D00FFA7D5 /* codec_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = codec_internal.h; sourceTree = "<group>"; };
|
||||
66A5564912E6D46D00FFA7D5 /* COPYING */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = COPYING; sourceTree = "<group>"; };
|
||||
66A5564A12E6D46D00FFA7D5 /* envelope.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = envelope.c; sourceTree = "<group>"; };
|
||||
66A5564B12E6D46D00FFA7D5 /* envelope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = envelope.h; sourceTree = "<group>"; };
|
||||
66A5564C12E6D46D00FFA7D5 /* floor0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = floor0.c; sourceTree = "<group>"; };
|
||||
66A5564D12E6D46D00FFA7D5 /* floor1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = floor1.c; sourceTree = "<group>"; };
|
||||
66A5564E12E6D46D00FFA7D5 /* framing.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = framing.c; sourceTree = "<group>"; };
|
||||
66A5564F12E6D46D00FFA7D5 /* highlevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = highlevel.h; sourceTree = "<group>"; };
|
||||
66A5565012E6D46D00FFA7D5 /* info.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = info.c; sourceTree = "<group>"; };
|
||||
66A5565112E6D46D00FFA7D5 /* lookup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lookup.c; sourceTree = "<group>"; };
|
||||
66A5565212E6D46D00FFA7D5 /* lookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lookup.h; sourceTree = "<group>"; };
|
||||
66A5565312E6D46D00FFA7D5 /* lookup_data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lookup_data.h; sourceTree = "<group>"; };
|
||||
66A5565412E6D46D00FFA7D5 /* lpc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lpc.c; sourceTree = "<group>"; };
|
||||
66A5565512E6D46D00FFA7D5 /* lpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lpc.h; sourceTree = "<group>"; };
|
||||
66A5565612E6D46D00FFA7D5 /* lsp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lsp.c; sourceTree = "<group>"; };
|
||||
66A5565712E6D46D00FFA7D5 /* lsp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lsp.h; sourceTree = "<group>"; };
|
||||
66A5565812E6D46D00FFA7D5 /* mapping0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mapping0.c; sourceTree = "<group>"; };
|
||||
66A5565912E6D46D00FFA7D5 /* masking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = masking.h; sourceTree = "<group>"; };
|
||||
66A5565A12E6D46D00FFA7D5 /* mdct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mdct.c; sourceTree = "<group>"; };
|
||||
66A5565B12E6D46D00FFA7D5 /* mdct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mdct.h; sourceTree = "<group>"; };
|
||||
66A5565C12E6D46D00FFA7D5 /* misc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = misc.h; sourceTree = "<group>"; };
|
||||
66A5565E12E6D46D00FFA7D5 /* floor_all.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = floor_all.h; sourceTree = "<group>"; };
|
||||
66A5565F12E6D46D00FFA7D5 /* psych_11.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = psych_11.h; sourceTree = "<group>"; };
|
||||
66A5566012E6D46D00FFA7D5 /* psych_16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = psych_16.h; sourceTree = "<group>"; };
|
||||
66A5566112E6D46D00FFA7D5 /* psych_44.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = psych_44.h; sourceTree = "<group>"; };
|
||||
66A5566212E6D46D00FFA7D5 /* psych_8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = psych_8.h; sourceTree = "<group>"; };
|
||||
66A5566312E6D46D00FFA7D5 /* residue_16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = residue_16.h; sourceTree = "<group>"; };
|
||||
66A5566412E6D46D00FFA7D5 /* residue_44.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = residue_44.h; sourceTree = "<group>"; };
|
||||
66A5566512E6D46D00FFA7D5 /* residue_44p51.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = residue_44p51.h; sourceTree = "<group>"; };
|
||||
66A5566612E6D46D00FFA7D5 /* residue_44u.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = residue_44u.h; sourceTree = "<group>"; };
|
||||
66A5566712E6D46D00FFA7D5 /* residue_8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = residue_8.h; sourceTree = "<group>"; };
|
||||
66A5566812E6D46D00FFA7D5 /* setup_11.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setup_11.h; sourceTree = "<group>"; };
|
||||
66A5566912E6D46D00FFA7D5 /* setup_16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setup_16.h; sourceTree = "<group>"; };
|
||||
66A5566A12E6D46D00FFA7D5 /* setup_22.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setup_22.h; sourceTree = "<group>"; };
|
||||
66A5566B12E6D46D00FFA7D5 /* setup_32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setup_32.h; sourceTree = "<group>"; };
|
||||
66A5566C12E6D46D00FFA7D5 /* setup_44.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setup_44.h; sourceTree = "<group>"; };
|
||||
66A5566D12E6D46D00FFA7D5 /* setup_44p51.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setup_44p51.h; sourceTree = "<group>"; };
|
||||
66A5566E12E6D46D00FFA7D5 /* setup_44u.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setup_44u.h; sourceTree = "<group>"; };
|
||||
66A5566F12E6D46D00FFA7D5 /* setup_8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setup_8.h; sourceTree = "<group>"; };
|
||||
66A5567012E6D46D00FFA7D5 /* setup_X.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setup_X.h; sourceTree = "<group>"; };
|
||||
66A5567212E6D46D00FFA7D5 /* ogg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ogg.h; sourceTree = "<group>"; };
|
||||
66A5567312E6D46D00FFA7D5 /* os_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = os_types.h; sourceTree = "<group>"; };
|
||||
66A5567412E6D46D00FFA7D5 /* os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = os.h; sourceTree = "<group>"; };
|
||||
66A5567512E6D46D00FFA7D5 /* psy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = psy.c; sourceTree = "<group>"; };
|
||||
66A5567612E6D46D00FFA7D5 /* psy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = psy.h; sourceTree = "<group>"; };
|
||||
66A5567712E6D46D00FFA7D5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
|
||||
66A5567812E6D46D00FFA7D5 /* registry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = registry.c; sourceTree = "<group>"; };
|
||||
66A5567912E6D46D00FFA7D5 /* registry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = registry.h; sourceTree = "<group>"; };
|
||||
66A5567A12E6D46D00FFA7D5 /* res0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = res0.c; sourceTree = "<group>"; };
|
||||
66A5567B12E6D46D00FFA7D5 /* scales.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scales.h; sourceTree = "<group>"; };
|
||||
66A5567C12E6D46D00FFA7D5 /* sharedbook.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sharedbook.c; sourceTree = "<group>"; };
|
||||
66A5567D12E6D46D00FFA7D5 /* smallft.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = smallft.c; sourceTree = "<group>"; };
|
||||
66A5567E12E6D46D00FFA7D5 /* smallft.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = smallft.h; sourceTree = "<group>"; };
|
||||
66A5567F12E6D46D00FFA7D5 /* synthesis.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = synthesis.c; sourceTree = "<group>"; };
|
||||
66A5568112E6D46D00FFA7D5 /* codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = codec.h; sourceTree = "<group>"; };
|
||||
66A5568212E6D46D00FFA7D5 /* vorbisenc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vorbisenc.h; sourceTree = "<group>"; };
|
||||
66A5568312E6D46D00FFA7D5 /* vorbisfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vorbisfile.h; sourceTree = "<group>"; };
|
||||
66A5568412E6D46D00FFA7D5 /* vorbisfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vorbisfile.c; sourceTree = "<group>"; };
|
||||
66A5568512E6D46D00FFA7D5 /* window.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = window.c; sourceTree = "<group>"; };
|
||||
66A5568612E6D46D00FFA7D5 /* window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = window.h; sourceTree = "<group>"; };
|
||||
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
8D1107320486CEB800E47090 /* QuakeSpasm.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QuakeSpasm.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
@ -305,8 +398,6 @@
|
|||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
|
||||
002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */,
|
||||
48348943120595B1004184BC /* Sparkle.framework in Frameworks */,
|
||||
66A5487A12E3EA6900FFA7D5 /* Ogg.framework in Frameworks */,
|
||||
66A5487C12E3EA6E00FFA7D5 /* Vorbis.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -347,14 +438,13 @@
|
|||
children = (
|
||||
48243B060D33ED0A00C29F8F /* MacOSX */,
|
||||
483A77D80D2EE8C500CB2E4C /* Quake */,
|
||||
66A5563712E6D46D00FFA7D5 /* OggVorbis */,
|
||||
29B97317FDCFA39411CA2CEA /* Resources */,
|
||||
4890A5EA1205D6ED00452753 /* Sparkle */,
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */,
|
||||
19C28FACFE9D520D11CA2CBB /* Products */,
|
||||
4830B79D0D464CAE00EF4498 /* Changelog.txt */,
|
||||
4830B79E0D464CAE00EF4498 /* Todo.txt */,
|
||||
66A5487912E3EA6900FFA7D5 /* Ogg.framework */,
|
||||
66A5487B12E3EA6E00FFA7D5 /* Vorbis.framework */,
|
||||
);
|
||||
name = QuakeSpasm;
|
||||
sourceTree = "<group>";
|
||||
|
@ -618,6 +708,142 @@
|
|||
name = Sparkle;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
66A5563712E6D46D00FFA7D5 /* OggVorbis */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
66A5563812E6D46D00FFA7D5 /* analysis.c */,
|
||||
66A5563912E6D46D00FFA7D5 /* backends.h */,
|
||||
66A5563A12E6D46D00FFA7D5 /* bitrate.c */,
|
||||
66A5563B12E6D46D00FFA7D5 /* bitrate.h */,
|
||||
66A5563C12E6D46D00FFA7D5 /* bitwise.c */,
|
||||
66A5563D12E6D46D00FFA7D5 /* block.c */,
|
||||
66A5563E12E6D46D00FFA7D5 /* books */,
|
||||
66A5564612E6D46D00FFA7D5 /* codebook.c */,
|
||||
66A5564712E6D46D00FFA7D5 /* codebook.h */,
|
||||
66A5564812E6D46D00FFA7D5 /* codec_internal.h */,
|
||||
66A5564912E6D46D00FFA7D5 /* COPYING */,
|
||||
66A5564A12E6D46D00FFA7D5 /* envelope.c */,
|
||||
66A5564B12E6D46D00FFA7D5 /* envelope.h */,
|
||||
66A5564C12E6D46D00FFA7D5 /* floor0.c */,
|
||||
66A5564D12E6D46D00FFA7D5 /* floor1.c */,
|
||||
66A5564E12E6D46D00FFA7D5 /* framing.c */,
|
||||
66A5564F12E6D46D00FFA7D5 /* highlevel.h */,
|
||||
66A5565012E6D46D00FFA7D5 /* info.c */,
|
||||
66A5565112E6D46D00FFA7D5 /* lookup.c */,
|
||||
66A5565212E6D46D00FFA7D5 /* lookup.h */,
|
||||
66A5565312E6D46D00FFA7D5 /* lookup_data.h */,
|
||||
66A5565412E6D46D00FFA7D5 /* lpc.c */,
|
||||
66A5565512E6D46D00FFA7D5 /* lpc.h */,
|
||||
66A5565612E6D46D00FFA7D5 /* lsp.c */,
|
||||
66A5565712E6D46D00FFA7D5 /* lsp.h */,
|
||||
66A5565812E6D46D00FFA7D5 /* mapping0.c */,
|
||||
66A5565912E6D46D00FFA7D5 /* masking.h */,
|
||||
66A5565A12E6D46D00FFA7D5 /* mdct.c */,
|
||||
66A5565B12E6D46D00FFA7D5 /* mdct.h */,
|
||||
66A5565C12E6D46D00FFA7D5 /* misc.h */,
|
||||
66A5565D12E6D46D00FFA7D5 /* modes */,
|
||||
66A5567112E6D46D00FFA7D5 /* ogg */,
|
||||
66A5567412E6D46D00FFA7D5 /* os.h */,
|
||||
66A5567512E6D46D00FFA7D5 /* psy.c */,
|
||||
66A5567612E6D46D00FFA7D5 /* psy.h */,
|
||||
66A5567712E6D46D00FFA7D5 /* README */,
|
||||
66A5567812E6D46D00FFA7D5 /* registry.c */,
|
||||
66A5567912E6D46D00FFA7D5 /* registry.h */,
|
||||
66A5567A12E6D46D00FFA7D5 /* res0.c */,
|
||||
66A5567B12E6D46D00FFA7D5 /* scales.h */,
|
||||
66A5567C12E6D46D00FFA7D5 /* sharedbook.c */,
|
||||
66A5567D12E6D46D00FFA7D5 /* smallft.c */,
|
||||
66A5567E12E6D46D00FFA7D5 /* smallft.h */,
|
||||
66A5567F12E6D46D00FFA7D5 /* synthesis.c */,
|
||||
66A5568012E6D46D00FFA7D5 /* vorbis */,
|
||||
66A5568412E6D46D00FFA7D5 /* vorbisfile.c */,
|
||||
66A5568512E6D46D00FFA7D5 /* window.c */,
|
||||
66A5568612E6D46D00FFA7D5 /* window.h */,
|
||||
);
|
||||
name = OggVorbis;
|
||||
path = ../OggVorbis;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
66A5563E12E6D46D00FFA7D5 /* books */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
66A5563F12E6D46D00FFA7D5 /* coupled */,
|
||||
66A5564212E6D46D00FFA7D5 /* floor */,
|
||||
66A5564412E6D46D00FFA7D5 /* uncoupled */,
|
||||
);
|
||||
path = books;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
66A5563F12E6D46D00FFA7D5 /* coupled */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
66A5564012E6D46D00FFA7D5 /* res_books_51.h */,
|
||||
66A5564112E6D46D00FFA7D5 /* res_books_stereo.h */,
|
||||
);
|
||||
path = coupled;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
66A5564212E6D46D00FFA7D5 /* floor */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
66A5564312E6D46D00FFA7D5 /* floor_books.h */,
|
||||
);
|
||||
path = floor;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
66A5564412E6D46D00FFA7D5 /* uncoupled */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
66A5564512E6D46D00FFA7D5 /* res_books_uncoupled.h */,
|
||||
);
|
||||
path = uncoupled;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
66A5565D12E6D46D00FFA7D5 /* modes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
66A5565E12E6D46D00FFA7D5 /* floor_all.h */,
|
||||
66A5565F12E6D46D00FFA7D5 /* psych_11.h */,
|
||||
66A5566012E6D46D00FFA7D5 /* psych_16.h */,
|
||||
66A5566112E6D46D00FFA7D5 /* psych_44.h */,
|
||||
66A5566212E6D46D00FFA7D5 /* psych_8.h */,
|
||||
66A5566312E6D46D00FFA7D5 /* residue_16.h */,
|
||||
66A5566412E6D46D00FFA7D5 /* residue_44.h */,
|
||||
66A5566512E6D46D00FFA7D5 /* residue_44p51.h */,
|
||||
66A5566612E6D46D00FFA7D5 /* residue_44u.h */,
|
||||
66A5566712E6D46D00FFA7D5 /* residue_8.h */,
|
||||
66A5566812E6D46D00FFA7D5 /* setup_11.h */,
|
||||
66A5566912E6D46D00FFA7D5 /* setup_16.h */,
|
||||
66A5566A12E6D46D00FFA7D5 /* setup_22.h */,
|
||||
66A5566B12E6D46D00FFA7D5 /* setup_32.h */,
|
||||
66A5566C12E6D46D00FFA7D5 /* setup_44.h */,
|
||||
66A5566D12E6D46D00FFA7D5 /* setup_44p51.h */,
|
||||
66A5566E12E6D46D00FFA7D5 /* setup_44u.h */,
|
||||
66A5566F12E6D46D00FFA7D5 /* setup_8.h */,
|
||||
66A5567012E6D46D00FFA7D5 /* setup_X.h */,
|
||||
);
|
||||
path = modes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
66A5567112E6D46D00FFA7D5 /* ogg */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
66A5567212E6D46D00FFA7D5 /* ogg.h */,
|
||||
66A5567312E6D46D00FFA7D5 /* os_types.h */,
|
||||
);
|
||||
path = ogg;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
66A5568012E6D46D00FFA7D5 /* vorbis */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
66A5568112E6D46D00FFA7D5 /* codec.h */,
|
||||
66A5568212E6D46D00FFA7D5 /* vorbisenc.h */,
|
||||
66A5568312E6D46D00FFA7D5 /* vorbisfile.h */,
|
||||
);
|
||||
path = vorbis;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
|
@ -674,6 +900,8 @@
|
|||
48B9E7880D340B1E0001CACF /* Launcher.nib in Resources */,
|
||||
484AA4B40D3FF6C0005D917A /* QuakeSpasm.icns in Resources */,
|
||||
48FA25B712437EAB00667668 /* dsa_pub.pem in Resources */,
|
||||
66A5568C12E6D46D00FFA7D5 /* COPYING in Resources */,
|
||||
66A5569812E6D46D00FFA7D5 /* README in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -776,6 +1004,29 @@
|
|||
66A5470F12E3CF8100FFA7D5 /* snd_codec_ogg.c in Sources */,
|
||||
66A54A4F12E429B800FFA7D5 /* snd_resample.c in Sources */,
|
||||
66A54ECE12E4ECA800FFA7D5 /* resample.c in Sources */,
|
||||
66A5568712E6D46D00FFA7D5 /* analysis.c in Sources */,
|
||||
66A5568812E6D46D00FFA7D5 /* bitrate.c in Sources */,
|
||||
66A5568912E6D46D00FFA7D5 /* bitwise.c in Sources */,
|
||||
66A5568A12E6D46D00FFA7D5 /* block.c in Sources */,
|
||||
66A5568B12E6D46D00FFA7D5 /* codebook.c in Sources */,
|
||||
66A5568D12E6D46D00FFA7D5 /* envelope.c in Sources */,
|
||||
66A5568E12E6D46D00FFA7D5 /* floor0.c in Sources */,
|
||||
66A5568F12E6D46D00FFA7D5 /* floor1.c in Sources */,
|
||||
66A5569012E6D46D00FFA7D5 /* framing.c in Sources */,
|
||||
66A5569112E6D46D00FFA7D5 /* info.c in Sources */,
|
||||
66A5569212E6D46D00FFA7D5 /* lookup.c in Sources */,
|
||||
66A5569312E6D46D00FFA7D5 /* lpc.c in Sources */,
|
||||
66A5569412E6D46D00FFA7D5 /* lsp.c in Sources */,
|
||||
66A5569512E6D46D00FFA7D5 /* mapping0.c in Sources */,
|
||||
66A5569612E6D46D00FFA7D5 /* mdct.c in Sources */,
|
||||
66A5569712E6D46D00FFA7D5 /* psy.c in Sources */,
|
||||
66A5569912E6D46D00FFA7D5 /* registry.c in Sources */,
|
||||
66A5569A12E6D46D00FFA7D5 /* res0.c in Sources */,
|
||||
66A5569B12E6D46D00FFA7D5 /* sharedbook.c in Sources */,
|
||||
66A5569C12E6D46D00FFA7D5 /* smallft.c in Sources */,
|
||||
66A5569D12E6D46D00FFA7D5 /* synthesis.c in Sources */,
|
||||
66A5569E12E6D46D00FFA7D5 /* vorbisfile.c in Sources */,
|
||||
66A5569F12E6D46D00FFA7D5 /* window.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
@ -132,7 +132,8 @@ DEFAULT_TARGET := quakespasm
|
|||
# objects
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
COMOBJ_SND := snd_dma.o snd_mix.o snd_mem.o
|
||||
OBJ_OGGVORBIS := $(patsubst %.c,%.o,$(wildcard ../OggVorbis/*.c))
|
||||
COMOBJ_SND := cd_shared.o snd_dma.o snd_mix.o snd_mem.o snd_resample.o resample.o snd_codec.o snd_codec_wav.o snd_codec_ogg.o
|
||||
SYSOBJ_SND := snd_sdl.o
|
||||
SYSOBJ_CDA := cd_sdl.o
|
||||
SYSOBJ_INPUT := in_sdl.o
|
||||
|
@ -168,6 +169,7 @@ GLOBJS = \
|
|||
gl_model.o
|
||||
|
||||
OBJS := \
|
||||
$(OBJ_OGGVORBIS) \
|
||||
$(GLOBJS) \
|
||||
$(SYSOBJ_INPUT) \
|
||||
$(COMOBJ_SND) \
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
cd_shared.c
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
Copyright (C) 2011 Eric Wasylishen
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
|
@ -46,19 +47,54 @@ static qboolean CDAudio_IsNumberedTrack(const char *trackName)
|
|||
return true;
|
||||
}
|
||||
|
||||
void CDAudio_NewMap ()
|
||||
{
|
||||
// hack copied from gl_fog.c:Fog_ParseWorldspawn()
|
||||
char key[128], value[4096];
|
||||
const char *data;
|
||||
|
||||
data = COM_Parse(cl.worldmodel->entities);
|
||||
if (!data)
|
||||
return; // error
|
||||
if (com_token[0] != '{')
|
||||
return; // error
|
||||
while (1)
|
||||
{
|
||||
data = COM_Parse(data);
|
||||
if (!data)
|
||||
return; // error
|
||||
if (com_token[0] == '}')
|
||||
break; // end of worldspawn
|
||||
if (com_token[0] == '_')
|
||||
strcpy(key, com_token + 1);
|
||||
else
|
||||
strcpy(key, com_token);
|
||||
while (key[strlen(key)-1] == ' ') // remove trailing spaces
|
||||
key[strlen(key)-1] = 0;
|
||||
data = COM_Parse(data);
|
||||
if (!data)
|
||||
return; // error
|
||||
strcpy(value, com_token);
|
||||
|
||||
if (!strcmp("sounds", key))
|
||||
{
|
||||
if (!CDAudio_IsNumberedTrack(value))
|
||||
{
|
||||
CDAudio_PlayNamed(value, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void CDAudio_FinishedCallback(void *userdata)
|
||||
{
|
||||
CDAudio_Next();
|
||||
}
|
||||
|
||||
static qboolean CDAudio_TryPlayNamed(const char *name, qboolean looping)
|
||||
{
|
||||
qboolean success = S_Base_StartBackgroundTrack(name, looping, CDAudio_FinishedCallback, NULL);
|
||||
return success;
|
||||
}
|
||||
|
||||
void CDAudio_PlayNamed(const char *name, qboolean looping)
|
||||
{
|
||||
char filename[MAX_QPATH];
|
||||
|
||||
if (!enabled)
|
||||
return;
|
||||
|
||||
|
@ -80,36 +116,10 @@ void CDAudio_PlayNamed(const char *name, qboolean looping)
|
|||
track = remap[track];
|
||||
}
|
||||
q_snprintf(playTrackName, sizeof(playTrackName), "%03d", track);
|
||||
}
|
||||
else
|
||||
{
|
||||
q_snprintf(playTrackName, sizeof(playTrackName), "%s", name);
|
||||
}
|
||||
|
||||
// First try to play a music file (path code from Darkplaces)
|
||||
|
||||
char filename[MAX_QPATH];
|
||||
|
||||
if (track > 0) // We were given a numbered track
|
||||
{
|
||||
|
||||
q_snprintf(filename, sizeof(filename), "sound/cdtracks/track%03u", track);
|
||||
if (CDAudio_TryPlayNamed(filename, looping)) return;
|
||||
|
||||
q_snprintf(filename, sizeof(filename), "sound/cdtracks/track%02u", track);
|
||||
if (CDAudio_TryPlayNamed(filename, looping)) return;
|
||||
|
||||
q_snprintf(filename, sizeof(filename), "music/cdtracks/track%03u", track);// added by motorsep
|
||||
if (CDAudio_TryPlayNamed(filename, looping)) return;
|
||||
|
||||
q_snprintf(filename, sizeof(filename), "music/cdtracks/track%02u", track);// added by motorsep
|
||||
if (CDAudio_TryPlayNamed(filename, looping)) return;
|
||||
|
||||
q_snprintf(filename, sizeof(filename), "music/track%03u", track);// added by motorsep
|
||||
if (CDAudio_TryPlayNamed(filename, looping)) return;
|
||||
|
||||
q_snprintf(filename, sizeof(filename), "music/track%02u", track);// added by motorsep
|
||||
if (CDAudio_TryPlayNamed(filename, looping)) return;
|
||||
|
||||
if (S_Base_StartBackgroundTrack(filename, looping, CDAudio_FinishedCallback, NULL)) return;
|
||||
|
||||
// No music file, so try using the hardware CD player
|
||||
|
||||
CDAudioBackend_Play(track, looping);
|
||||
|
@ -117,27 +127,21 @@ void CDAudio_PlayNamed(const char *name, qboolean looping)
|
|||
{
|
||||
usingBackend = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Printf( "WARNING: Unable to play music track %d\n", track );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// We were given a named track
|
||||
|
||||
q_snprintf(filename, sizeof(filename), "%s", playTrackName);
|
||||
if (CDAudio_TryPlayNamed(filename, looping)) return;
|
||||
|
||||
q_snprintf(filename, sizeof(filename), "sound/%s", playTrackName);
|
||||
if (CDAudio_TryPlayNamed(filename, looping)) return;
|
||||
|
||||
q_snprintf(filename, sizeof(filename), "sound/cdtracks/%s", playTrackName);
|
||||
if (CDAudio_TryPlayNamed(filename, looping)) return;
|
||||
|
||||
q_snprintf(filename, sizeof(filename), "music/%s", playTrackName);
|
||||
if (CDAudio_TryPlayNamed(filename, looping)) return;
|
||||
|
||||
q_snprintf(filename, sizeof(filename), "music/cdtracks/%s", playTrackName);
|
||||
if (CDAudio_TryPlayNamed(filename, looping)) return;
|
||||
|
||||
Con_Printf("WARNING: Couldn't find music track \"%s\"\n", playTrackName);
|
||||
else
|
||||
{
|
||||
q_snprintf(playTrackName, sizeof(playTrackName), "%s", name);
|
||||
|
||||
q_snprintf(filename, sizeof(filename), "sound/cdtracks/%s", playTrackName);
|
||||
if (S_Base_StartBackgroundTrack(filename, looping, CDAudio_FinishedCallback, NULL)) return;
|
||||
|
||||
Con_Printf("WARNING: Unable to play music track \"%s\"\n", filename);
|
||||
}
|
||||
}
|
||||
|
||||
void CDAudio_Play(byte track, qboolean looping)
|
||||
|
|
|
@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#ifndef __CDAUDIO_H
|
||||
#define __CDAUDIO_H
|
||||
|
||||
void CDAudio_NewMap ();
|
||||
int CDAudio_Init(void);
|
||||
void CDAudio_PlayNamed(const char *name, qboolean looping);
|
||||
void CDAudio_Play(byte track, qboolean looping);
|
||||
|
|
|
@ -373,7 +373,8 @@ void CL_ParseServerInfo (void)
|
|||
cl_entities[0].model = cl.worldmodel = cl.model_precache[1];
|
||||
|
||||
R_NewMap ();
|
||||
|
||||
CDAudio_NewMap ();
|
||||
|
||||
//johnfitz -- clear out string; we don't consider identical
|
||||
//messages to be duplicates if the map has changed in between
|
||||
con_lastcenterstring[0] = 0;
|
||||
|
|
|
@ -110,9 +110,7 @@ void S_CodecInit()
|
|||
{
|
||||
codecs = NULL;
|
||||
S_CodecRegister(&wav_codec);
|
||||
#ifdef USE_CODEC_VORBIS
|
||||
S_CodecRegister(&ogg_codec);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -226,6 +224,8 @@ snd_stream_t *S_CodecUtilOpen(const char *filename, snd_codec_t *codec)
|
|||
stream->codec = codec;
|
||||
stream->file = hnd;
|
||||
stream->length = length;
|
||||
stream->startpos = Sys_FileTell(hnd);
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ typedef struct snd_stream_s
|
|||
snd_info_t info;
|
||||
int length;
|
||||
int pos;
|
||||
int startpos;
|
||||
void *ptr;
|
||||
} snd_stream_t;
|
||||
|
||||
|
@ -85,12 +86,10 @@ void S_WAV_CodecCloseStream(snd_stream_t *stream);
|
|||
int S_WAV_CodecReadStream(snd_stream_t *stream, int bytes, void *buffer);
|
||||
|
||||
// Ogg Vorbis codec
|
||||
#ifdef USE_CODEC_VORBIS
|
||||
extern snd_codec_t ogg_codec;
|
||||
void *S_OGG_CodecLoad(const char *filename, snd_info_t *info);
|
||||
snd_stream_t *S_OGG_CodecOpenStream(const char *filename);
|
||||
void S_OGG_CodecCloseStream(snd_stream_t *stream);
|
||||
int S_OGG_CodecReadStream(snd_stream_t *stream, int bytes, void *buffer);
|
||||
#endif // USE_CODEC_VORBIS
|
||||
|
||||
#endif // !_SND_CODEC_H_
|
||||
|
|
|
@ -23,9 +23,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
*/
|
||||
|
||||
|
||||
// OGG support is enabled by this define
|
||||
#ifdef USE_CODEC_VORBIS
|
||||
|
||||
// includes for the Q3 sound system
|
||||
#include "quakedef.h"
|
||||
#include "snd_codec.h"
|
||||
|
@ -127,7 +124,7 @@ int S_OGG_Callback_seek(void *datasource, ogg_int64_t offset, int whence)
|
|||
{
|
||||
// set the file position in the actual file with the Q3 function
|
||||
errno = 0;
|
||||
Sys_FileSeek(stream->file, (long) offset);
|
||||
Sys_FileSeek(stream->file, (long) stream->startpos + (long) offset);
|
||||
|
||||
// something has gone wrong, so we return here
|
||||
if(errno != 0)
|
||||
|
@ -144,7 +141,7 @@ int S_OGG_Callback_seek(void *datasource, ogg_int64_t offset, int whence)
|
|||
{
|
||||
// set the file position in the actual file with the Q3 function
|
||||
errno = 0;
|
||||
Sys_FileSeek(stream->file, (long) stream->pos + (long) offset);
|
||||
Sys_FileSeek(stream->file, (long) stream->startpos + (long) stream->pos + (long) offset);
|
||||
|
||||
// something has gone wrong, so we return here
|
||||
if(errno != 0)
|
||||
|
@ -164,7 +161,7 @@ int S_OGG_Callback_seek(void *datasource, ogg_int64_t offset, int whence)
|
|||
|
||||
// set the file position in the actual file with the Q3 function
|
||||
errno = 0;
|
||||
Sys_FileSeek(stream->file, (long) stream->length + (long) offset);
|
||||
Sys_FileSeek(stream->file, (long) stream->startpos + (long) stream->length + (long) offset);
|
||||
|
||||
// something has gone wrong, so we return here
|
||||
if(errno != 0)
|
||||
|
@ -214,7 +211,7 @@ long S_OGG_Callback_tell(void *datasource)
|
|||
// snd_stream_t in the generic pointer
|
||||
stream = (snd_stream_t *) datasource;
|
||||
|
||||
return (long) Sys_FileTell(stream->file);
|
||||
return (long) Sys_FileTell(stream->file) - (long) stream->startpos;
|
||||
}
|
||||
|
||||
// the callback structure
|
||||
|
@ -446,7 +443,8 @@ void *S_OGG_CodecLoad(const char *filename, snd_info_t *info)
|
|||
info->samples = stream->info.samples;
|
||||
info->size = stream->info.size;
|
||||
info->dataofs = stream->info.dataofs;
|
||||
|
||||
info->loopstart = -1;
|
||||
|
||||
// allocate a buffer
|
||||
// this buffer must be free-ed by the caller of this function
|
||||
buffer = Z_Malloc(info->size);
|
||||
|
@ -473,5 +471,3 @@ void *S_OGG_CodecLoad(const char *filename, snd_info_t *info)
|
|||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
#endif // USE_CODEC_VORBIS
|
||||
|
|
130
Quake/snd_dma.c
130
Quake/snd_dma.c
|
@ -71,7 +71,7 @@ qboolean sound_started = false;
|
|||
|
||||
int s_rawend[MAX_RAW_STREAMS];
|
||||
portable_samplepair_t s_rawsamples[MAX_RAW_STREAMS][MAX_RAW_SAMPLES];
|
||||
|
||||
static void *s_rawresampler[MAX_RAW_STREAMS];
|
||||
|
||||
cvar_t bgmvolume = {"bgmvolume", "1", true};
|
||||
cvar_t sfxvolume = {"volume", "0.7", true};
|
||||
|
@ -182,8 +182,6 @@ void S_Init (void)
|
|||
Con_Printf ("loading all sounds as 8bit\n");
|
||||
}
|
||||
|
||||
SND_InitScaletable ();
|
||||
|
||||
known_sfx = (sfx_t *) Hunk_AllocName (MAX_SFX*sizeof(sfx_t), "sfx_t");
|
||||
num_sfx = 0;
|
||||
|
||||
|
@ -221,6 +219,13 @@ void S_Shutdown (void)
|
|||
|
||||
SNDDMA_Shutdown();
|
||||
shm = NULL;
|
||||
|
||||
int i;
|
||||
for (i = 0; i<MAX_RAW_STREAMS; i++)
|
||||
{
|
||||
if (s_rawresampler[i] != NULL)
|
||||
Snd_ResamplerClose(s_rawresampler[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -581,31 +586,6 @@ void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation)
|
|||
|
||||
//=============================================================================
|
||||
|
||||
/*
|
||||
=================
|
||||
S_ByteSwapRawSamples
|
||||
|
||||
If raw data has been loaded in little endien binary form, this must be done.
|
||||
If raw data was calculated, as with ADPCM, this should not be called.
|
||||
=================
|
||||
*/
|
||||
void S_ByteSwapRawSamples( int samples, int width, int s_channels, const byte *data ) {
|
||||
int i;
|
||||
|
||||
if ( width != 2 ) {
|
||||
return;
|
||||
}
|
||||
if ( LittleShort( 256 ) == 256 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( s_channels == 2 ) {
|
||||
samples <<= 1;
|
||||
}
|
||||
for ( i = 0 ; i < samples ; i++ ) {
|
||||
((short *)data)[i] = LittleShort( ((short *)data)[i] );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
|
@ -616,10 +596,11 @@ void S_ByteSwapRawSamples( int samples, int width, int s_channels, const byte *d
|
|||
*/
|
||||
void S_Base_RawSamples( int stream, int samples, int rate, int width, int s_channels, const byte *data, float volume ) {
|
||||
int i;
|
||||
int src, dst;
|
||||
float scale;
|
||||
int dst;
|
||||
int intVolume;
|
||||
portable_samplepair_t *rawsamples;
|
||||
void *resampler;
|
||||
int resampledNumSamples;
|
||||
|
||||
if ( !sound_started ) {
|
||||
return;
|
||||
|
@ -630,6 +611,13 @@ void S_Base_RawSamples( int stream, int samples, int rate, int width, int s_chan
|
|||
}
|
||||
rawsamples = s_rawsamples[stream];
|
||||
|
||||
// Set up resampler
|
||||
if (s_rawresampler[stream] == NULL)
|
||||
{
|
||||
s_rawresampler[stream] = Snd_ResamplerInit();
|
||||
}
|
||||
resampler = s_rawresampler[stream];
|
||||
|
||||
intVolume = 256 * volume;
|
||||
|
||||
if ( s_rawend[stream] < soundtime ) {
|
||||
|
@ -637,78 +625,39 @@ void S_Base_RawSamples( int stream, int samples, int rate, int width, int s_chan
|
|||
s_rawend[stream] = soundtime;
|
||||
}
|
||||
|
||||
scale = (float)rate / shm->speed;
|
||||
void *resampled = Snd_Resample(resampler,
|
||||
rate, width, samples, s_channels, data,
|
||||
shm->speed, 2, &resampledNumSamples);
|
||||
|
||||
// old:
|
||||
|
||||
//Con_Printf ("%i < %i < %i\n", soundtime, s_paintedtime, s_rawend[stream]);
|
||||
if (s_channels == 2 && width == 2)
|
||||
|
||||
if (s_channels == 2)
|
||||
{
|
||||
if (scale == 1.0)
|
||||
{ // optimized case
|
||||
for (i=0 ; i<samples ; i++)
|
||||
{
|
||||
dst = s_rawend[stream]&(MAX_RAW_SAMPLES-1);
|
||||
s_rawend[stream]++;
|
||||
rawsamples[dst].left = ((short *)data)[i*2] * intVolume;
|
||||
rawsamples[dst].right = ((short *)data)[i*2+1] * intVolume;
|
||||
}
|
||||
}
|
||||
else
|
||||
for (i=0 ; i<resampledNumSamples ; i++)
|
||||
{
|
||||
for (i=0 ; ; i++)
|
||||
{
|
||||
src = i*scale;
|
||||
if (src >= samples)
|
||||
break;
|
||||
dst = s_rawend[stream]&(MAX_RAW_SAMPLES-1);
|
||||
s_rawend[stream]++;
|
||||
rawsamples[dst].left = ((short *)data)[src*2] * intVolume;
|
||||
rawsamples[dst].right = ((short *)data)[src*2+1] * intVolume;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (s_channels == 1 && width == 2)
|
||||
{
|
||||
for (i=0 ; ; i++)
|
||||
{
|
||||
src = i*scale;
|
||||
if (src >= samples)
|
||||
break;
|
||||
dst = s_rawend[stream]&(MAX_RAW_SAMPLES-1);
|
||||
s_rawend[stream]++;
|
||||
rawsamples[dst].left = ((short *)data)[src] * intVolume;
|
||||
rawsamples[dst].right = ((short *)data)[src] * intVolume;
|
||||
rawsamples[dst].left = ((short *)resampled)[i*2] * intVolume;
|
||||
rawsamples[dst].right = ((short *)resampled)[i*2+1] * intVolume;
|
||||
}
|
||||
}
|
||||
else if (s_channels == 2 && width == 1)
|
||||
else if (s_channels == 1)
|
||||
{
|
||||
intVolume *= 256;
|
||||
|
||||
for (i=0 ; ; i++)
|
||||
for (i=0 ; i<resampledNumSamples; i++)
|
||||
{
|
||||
src = i*scale;
|
||||
if (src >= samples)
|
||||
break;
|
||||
dst = s_rawend[stream]&(MAX_RAW_SAMPLES-1);
|
||||
s_rawend[stream]++;
|
||||
rawsamples[dst].left = ((char *)data)[src*2] * intVolume;
|
||||
rawsamples[dst].right = ((char *)data)[src*2+1] * intVolume;
|
||||
rawsamples[dst].left = ((short *)resampled)[i] * intVolume;
|
||||
rawsamples[dst].right = ((short *)resampled)[i] * intVolume;
|
||||
}
|
||||
}
|
||||
else if (s_channels == 1 && width == 1)
|
||||
else
|
||||
{
|
||||
intVolume *= 256;
|
||||
|
||||
for (i=0 ; ; i++)
|
||||
{
|
||||
src = i*scale;
|
||||
if (src >= samples)
|
||||
break;
|
||||
dst = s_rawend[stream]&(MAX_RAW_SAMPLES-1);
|
||||
s_rawend[stream]++;
|
||||
rawsamples[dst].left = (((byte *)data)[src]-128) * intVolume;
|
||||
rawsamples[dst].right = (((byte *)data)[src]-128) * intVolume;
|
||||
}
|
||||
Con_Printf( "S_Base_RawSamples: unsupported number of channels %d\n", s_channels );
|
||||
}
|
||||
|
||||
|
||||
if ( s_rawend[stream] > soundtime + MAX_RAW_SAMPLES ) {
|
||||
Con_DPrintf( "S_Base_RawSamples: overflowed %i > %i\n", s_rawend[stream], soundtime );
|
||||
|
@ -956,6 +905,7 @@ void S_Update_(void)
|
|||
===============================================================================
|
||||
|
||||
background music functions
|
||||
from ioquake3
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
@ -1198,13 +1148,7 @@ void S_Play (void)
|
|||
i = 1;
|
||||
while (i < Cmd_Argc())
|
||||
{
|
||||
if (!Q_strrchr(Cmd_Argv(i), '.'))
|
||||
{
|
||||
Q_strcpy(name, Cmd_Argv(i));
|
||||
Q_strcat(name, ".wav");
|
||||
}
|
||||
else
|
||||
Q_strcpy(name, Cmd_Argv(i));
|
||||
Q_strcpy(name, Cmd_Argv(i));
|
||||
sfx = S_PrecacheSound(name);
|
||||
S_StartSound(hash++, 0, sfx, listener_origin, 1.0, 1.0);
|
||||
i++;
|
||||
|
|
|
@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "quakedef.h"
|
||||
#include "snd_codec.h"
|
||||
|
||||
static void *resampler = NULL;
|
||||
|
||||
/*
|
||||
==============
|
||||
S_LoadSound
|
||||
|
@ -62,17 +64,25 @@ sfxcache_t *S_LoadSound (sfx_t *s)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int resampledNumSamples;
|
||||
void *resampled = Snd_Resample(info.rate, info.width, info.samples, info.channels, data, shm->speed, shm->samplebits/8, &resampledNumSamples);
|
||||
|
||||
if (info.rate == shm->speed && info.width == shm->samplebits/8)
|
||||
// set up the resampler
|
||||
if (resampler == NULL)
|
||||
{
|
||||
if (resampledNumSamples != info.samples) exit(5);
|
||||
if (0 != memcmp(data, resampled, (info.width * info.samples * info.channels))) exit(6);
|
||||
resampler = Snd_ResamplerInit();
|
||||
}
|
||||
else
|
||||
{
|
||||
Snd_ResamplerReset(resampler);
|
||||
}
|
||||
|
||||
int resampledNumSamples;
|
||||
void *resampled = Snd_Resample(resampler,
|
||||
info.rate, info.width, info.samples, info.channels, data,
|
||||
shm->speed, shm->samplebits/8, &resampledNumSamples);
|
||||
|
||||
len = resampledNumSamples * (shm->samplebits/8) * info.channels;
|
||||
|
||||
// set up the sample struct
|
||||
|
||||
sc = (sfxcache_t *) Cache_Alloc ( &s->cache, len + sizeof(sfxcache_t), s->name);
|
||||
if (!sc)
|
||||
return NULL;
|
||||
|
|
|
@ -237,29 +237,10 @@ void S_PaintChannels (int endtime)
|
|||
}
|
||||
}
|
||||
|
||||
void SND_InitScaletable (void)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
for (j = 0; j < 256; j++)
|
||||
/* When compiling with gcc-4.1.0 at optimisations O1 and
|
||||
higher, the tricky signed char type conversion is not
|
||||
guaranteed. Therefore we explicity calculate the signed
|
||||
value from the index as required. From Kevin Shanahan.
|
||||
See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26719
|
||||
*/
|
||||
// snd_scaletable[i][j] = ((signed char)j) * i * 8;
|
||||
snd_scaletable[i][j] = ((j < 128) ? j : j - 0xff) * i * 8;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SND_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count)
|
||||
{
|
||||
int data;
|
||||
int *lscale, *rscale;
|
||||
unsigned char *sfx;
|
||||
int i;
|
||||
|
||||
|
@ -268,15 +249,13 @@ void SND_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count)
|
|||
if (ch->rightvol > 255)
|
||||
ch->rightvol = 255;
|
||||
|
||||
lscale = snd_scaletable[ch->leftvol >> 3];
|
||||
rscale = snd_scaletable[ch->rightvol >> 3];
|
||||
sfx = (unsigned char *) ((signed char *)sc->data + ch->pos);
|
||||
sfx = (unsigned char *) ((unsigned char *)sc->data + ch->pos);
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
data = sfx[i];
|
||||
paintbuffer[i].left += lscale[data] * snd_vol;
|
||||
paintbuffer[i].right += rscale[data] * snd_vol;
|
||||
data = (sfx[i] - 128) * snd_vol;
|
||||
paintbuffer[i].left += data * ch->leftvol;
|
||||
paintbuffer[i].right += data * ch->rightvol;
|
||||
}
|
||||
|
||||
ch->pos += count;
|
||||
|
@ -301,21 +280,11 @@ void SND_PaintChannelFrom16 (channel_t *ch, sfxcache_t *sc, int count)
|
|||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
if ((ch->pos + i) >= sc->length)
|
||||
{
|
||||
Con_Printf("Overran Sample!\n");
|
||||
}
|
||||
|
||||
data = sfx[i];
|
||||
left = (data * leftvol) >> 8;
|
||||
right = (data * rightvol) >> 8;
|
||||
paintbuffer[i].left += left;
|
||||
paintbuffer[i].right += right;
|
||||
|
||||
if (paintbuffer[i].left > (1 << 24))
|
||||
{
|
||||
Con_Printf("Clipping!\n");
|
||||
}
|
||||
}
|
||||
|
||||
ch->pos += count;
|
||||
|
|
|
@ -1,16 +1,72 @@
|
|||
/*
|
||||
Copyright (C) 2011 Eric Wasylishen
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include "quakedef.h"
|
||||
#include "sound.h"
|
||||
#include "speex_resampler.h"
|
||||
|
||||
void *Snd_Resample(int inrate, int inwidth, int innumsamples, int channels, const void *indata,
|
||||
int outrate, int outwidth, int *outnumsamples)
|
||||
#define Snd_ResamplerQuality 0
|
||||
|
||||
struct resampler {
|
||||
int channels;
|
||||
SpeexResamplerState *st;
|
||||
};
|
||||
|
||||
void *Snd_ResamplerInit()
|
||||
{
|
||||
struct resampler *data = malloc(sizeof(struct resampler));
|
||||
data->channels = 1;
|
||||
data->st = speex_resampler_init(1, 44100, 44100, Snd_ResamplerQuality, NULL);
|
||||
return data;
|
||||
}
|
||||
|
||||
void Snd_ResamplerClose(void *handle)
|
||||
{
|
||||
struct resampler *data = (struct resampler *)handle;
|
||||
speex_resampler_destroy(data->st);
|
||||
free(data);
|
||||
}
|
||||
|
||||
void Snd_ResamplerReset(void *handle)
|
||||
{
|
||||
struct resampler *data = (struct resampler *)handle;
|
||||
speex_resampler_reset_mem(data->st);
|
||||
}
|
||||
|
||||
void *Snd_Resample(void *handle,
|
||||
int inrate, int inwidth, int innumsamples, int channels, const void *indata,
|
||||
int outrate, int outwidth, int *outnumsamples)
|
||||
{
|
||||
// check params
|
||||
if ( !(inwidth == 1 || inwidth == 2) || !(outwidth == 1 || outwidth == 2) )
|
||||
{
|
||||
Sys_Error("Snd_ResampleStream only supports 1 or 2 bytes per sample");
|
||||
}
|
||||
|
||||
const float frac = ((float)inrate) / ((float)outrate);
|
||||
const int maxsamples = (innumsamples / frac) + 10;
|
||||
short *outdata = malloc(maxsamples * channels * outwidth);
|
||||
|
||||
// Convert input to 16-bit if necessary
|
||||
short *in16bit;
|
||||
short *out16bit = malloc(maxsamples * channels * 2);
|
||||
|
||||
// Convert input to 16-bit if necessary
|
||||
|
||||
if (inwidth == 2)
|
||||
{
|
||||
in16bit = (short*)indata;
|
||||
|
@ -22,104 +78,75 @@ void *Snd_Resample(int inrate, int inwidth, int innumsamples, int channels, cons
|
|||
for (i=0; i<innumsamples; i++)
|
||||
{
|
||||
unsigned char sample = ((unsigned char *)indata)[i];
|
||||
|
||||
if (sample == 255)
|
||||
{
|
||||
//Con_Printf("8-bit clipping\n");
|
||||
}
|
||||
|
||||
in16bit[i] = (((short)sample) - 128) << 8;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
exit(5);
|
||||
}
|
||||
|
||||
// See if we need to resample
|
||||
// Call the resampler
|
||||
|
||||
if (inrate == outrate)
|
||||
{
|
||||
memcpy(outdata, in16bit, innumsamples * channels * 2);
|
||||
memcpy(out16bit, in16bit, innumsamples * channels * 2);
|
||||
*outnumsamples = innumsamples;
|
||||
}
|
||||
else
|
||||
{
|
||||
struct resampler *data = (struct resampler *)handle;
|
||||
|
||||
// Call the resampler
|
||||
static SpeexResamplerState *st = NULL;
|
||||
if (st == NULL)
|
||||
unsigned int old_inrate, old_outrate;
|
||||
speex_resampler_get_rate(data->st, &old_inrate, &old_outrate);
|
||||
if (data->channels != channels)
|
||||
{
|
||||
st = speex_resampler_init(channels, inrate, outrate, 0, NULL);
|
||||
speex_resampler_destroy(data->st);
|
||||
data->st = speex_resampler_init(channels, inrate, outrate, Snd_ResamplerQuality, NULL);
|
||||
data->channels = channels;
|
||||
}
|
||||
else
|
||||
{
|
||||
speex_resampler_reset_mem(st);
|
||||
speex_resampler_set_rate(data->st, inrate, outrate);
|
||||
}
|
||||
speex_resampler_set_rate(st, inrate, outrate);
|
||||
|
||||
*outnumsamples = 0;
|
||||
|
||||
unsigned int consumedtotal = 0;
|
||||
unsigned int outputtotal = 0;
|
||||
unsigned int loops = 0;
|
||||
unsigned int consumed, output;
|
||||
|
||||
while (consumedtotal < innumsamples)
|
||||
{
|
||||
int roomToConsume, roomToOutput;
|
||||
|
||||
consumed = innumsamples - consumedtotal;
|
||||
output = maxsamples - outputtotal;
|
||||
|
||||
roomToConsume = consumed;
|
||||
roomToOutput = output;
|
||||
|
||||
speex_resampler_process_interleaved_int(st, in16bit + consumedtotal, &consumed, outdata + outputtotal, &output);
|
||||
unsigned int consumed = innumsamples - consumedtotal;
|
||||
unsigned int output = maxsamples - outputtotal;
|
||||
speex_resampler_process_interleaved_int(data->st, in16bit + consumedtotal, &consumed, out16bit + outputtotal, &output);
|
||||
consumedtotal += consumed;
|
||||
outputtotal += output;
|
||||
|
||||
loops++;
|
||||
if (loops > 100)
|
||||
{
|
||||
Con_Printf("Infinite loop\n");
|
||||
}
|
||||
}
|
||||
|
||||
*outnumsamples = outputtotal;
|
||||
|
||||
if (*outnumsamples != (innumsamples / frac))
|
||||
{
|
||||
Con_Printf("Output %d, predicted %d\n", *outnumsamples, (innumsamples / frac));
|
||||
}
|
||||
//speex_resampler_destroy(resampler);
|
||||
}
|
||||
|
||||
// Check for clipping.
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<*outnumsamples; i++)
|
||||
{
|
||||
short sample = outdata[i];
|
||||
|
||||
if (sample == 32767)
|
||||
{
|
||||
//Con_Printf("16-bit clipping\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare to return
|
||||
|
||||
if (in16bit != indata)
|
||||
{
|
||||
free(in16bit);
|
||||
}
|
||||
|
||||
if(outwidth != 2) exit(5);
|
||||
|
||||
void *outdata;
|
||||
if (outwidth == 2)
|
||||
{
|
||||
outdata = out16bit;
|
||||
}
|
||||
else // (outputwidth == 1)
|
||||
{
|
||||
int i;
|
||||
int len = (*outnumsamples) * channels;
|
||||
outdata = malloc(len);
|
||||
for (i = 0; i<len; i++)
|
||||
{
|
||||
int s16sample = out16bit[i];
|
||||
unsigned char u8sample = ((s16sample + 32768) >> 8);
|
||||
((unsigned char *)outdata)[i] = u8sample;
|
||||
}
|
||||
free(out16bit);
|
||||
}
|
||||
|
||||
return outdata;
|
||||
}
|
||||
|
||||
void *Snd_ResamplerInit(int inrate, int inwidth, int outrate, int outwidth, int channels) { return NULL; }
|
||||
|
||||
void Snd_ResamplerClose(void *resampler) {}
|
||||
|
||||
void Snd_ResampleStream(void *resampler,
|
||||
int *innumsamples, void *indata,
|
||||
int *outnumsamples, void *outdata) {}
|
||||
}
|
|
@ -151,23 +151,21 @@ qboolean S_BackgroundTrackIsPlaying( void );
|
|||
qboolean S_BackgroundTrackIsPaused( void );
|
||||
qboolean S_BackgroundTrackIsLooping( void );
|
||||
|
||||
/* resamples a whole file. return value must be freed with free() */
|
||||
void *Snd_Resample(int inrate, int inwidth, int innumsamples, int channels, const void *indata,
|
||||
int outrate, int outwidth, int *outnumsamples);
|
||||
|
||||
/* creates a new stream resampler for the specified rates and number of channels. returns a handle */
|
||||
void *Snd_ResamplerInit(int inrate, int inwidth, int outrate, int outwidth, int channels);
|
||||
/* creates a new stream resampler. returns a handle */
|
||||
void *Snd_ResamplerInit();
|
||||
|
||||
/* closes a resampler handle */
|
||||
void Snd_ResamplerClose(void *resampler);
|
||||
|
||||
/* performs resampling on samples in the given channel. numinsamples takes
|
||||
the number of samples to process, and returns the number actually processed.
|
||||
*/
|
||||
void Snd_ResampleStream(void *resampler,
|
||||
int *innumsamples, void *indata,
|
||||
int *outnumsamples, void *outdata);
|
||||
/* prepare resampler for processing an unrelated sound */
|
||||
void Snd_ResamplerReset(void *resampler);
|
||||
|
||||
/* performs resampling on samples in the given channel.
|
||||
return value must be freed with free()
|
||||
*/
|
||||
void *Snd_Resample(void *resampler,
|
||||
int inrate, int inwidth, int innumsamples, int channels, const void *indata,
|
||||
int outrate, int outwidth, int *outnumsamples);
|
||||
|
||||
// ====================================================================
|
||||
// User-setable variables
|
||||
|
@ -217,9 +215,6 @@ extern int snd_blocked;
|
|||
void S_LocalSound (const char *s);
|
||||
sfxcache_t *S_LoadSound (sfx_t *s);
|
||||
|
||||
wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength);
|
||||
|
||||
void SND_InitScaletable (void);
|
||||
|
||||
void S_AmbientOff (void);
|
||||
void S_AmbientOn (void);
|
||||
|
|
Loading…
Reference in a new issue