From 76b767ca9b5bd3368653413265fce9089796be3d Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Tue, 14 Jan 2014 00:22:00 -0500 Subject: [PATCH] remove ACM stuff that we don't need --- include/acm.h | 9 --------- src/sound/acm.cpp | 40 ---------------------------------------- src/sound/audiostr.cpp | 4 ---- src/sound/sound.cpp | 12 ------------ 4 files changed, 65 deletions(-) diff --git a/include/acm.h b/include/acm.h index bf0b759..3ae8b89 100644 --- a/include/acm.h +++ b/include/acm.h @@ -50,17 +50,9 @@ #ifndef __FREESPACE_ACM_H__ #define __FREESPACE_ACM_H__ -#ifndef PLAT_UNIX -#include -#include -#endif #include "pstypes.h" int ACM_convert_ADPCM_to_PCM(WAVEFORMATEX *pwfxSrc, ubyte *src, int src_len, ubyte **dest, int max_dest_bytes, int *dest_len, unsigned int *src_bytes_used, unsigned short dest_bps=16); -int ACM_init(); -void ACM_close(); -int ACM_is_inited(); - int ACM_stream_open(WAVEFORMATEX *pwfxSrc, WAVEFORMATEX *pwfxDest, void **stream, int dest_bps=16); int ACM_stream_close(void *stream); @@ -69,6 +61,5 @@ int ACM_query_dest_size(void *stream, int src_len); int ACM_convert(void *stream, ubyte *src, int src_len, ubyte *dest, int max_dest_bytes, unsigned int *dest_len, unsigned int *src_bytes_used); - #endif /* __ACM_H__ */ diff --git a/src/sound/acm.cpp b/src/sound/acm.cpp index 6bc13dd..dfa59c8 100644 --- a/src/sound/acm.cpp +++ b/src/sound/acm.cpp @@ -68,8 +68,6 @@ typedef struct acm_stream_t { // similar to BIAL_IF_MACRO in SDL_sound #define IF_ERR(a, b) if (a) { printf("IF_ERR-ACM, function: %s, line %d...\n", __FUNCTION__, __LINE__); return b; } -static int ACM_inited = 0; - /***************************************************************************** * Begin ADPCM compression handler... */ @@ -336,12 +334,6 @@ int ACM_convert_ADPCM_to_PCM(WAVEFORMATEX *pwfxSrc, ubyte *src, int src_len, uby uint rc; uint new_size = 0; - if ( ACM_inited == 0 ) { - rc = ACM_init(); - if ( rc != 0 ) - return -1; - } - // estimate size of uncompressed data // uncompressed data has: channels=pfwxScr->nChannels, bitPerSample=destbits // compressed data has: channels=pfwxScr->nChannels, bitPerSample=pwfxSrc->wBitsPerSample @@ -430,12 +422,6 @@ int ACM_stream_open(WAVEFORMATEX *pwfxSrc, WAVEFORMATEX *pwfxDest, void **stream SDL_RWops *hdr = SDL_RWFromMem(pwfxSrc, sizeof(WAVEFORMATEX) + pwfxSrc->cbSize); uint rc; - if ( ACM_inited == 0 ) { - rc = ACM_init(); - if ( rc != 0 ) - return -1; - } - adpcm_fmt_t *fmt = (adpcm_fmt_t *)malloc(sizeof(adpcm_fmt_t)); IF_ERR(fmt == NULL, -1); memset(fmt, '\0', sizeof(adpcm_fmt_t)); @@ -551,29 +537,3 @@ int ACM_convert(void *stream, ubyte *src, int src_len, ubyte *dest, int max_dest return 0; } - -// ACM_init() - decoding should always work -int ACM_init() -{ - if ( ACM_inited == 1 ) - return 0; - - ACM_inited = 1; - - return 0; -} - -// close out -void ACM_close() -{ - if ( ACM_inited == 0 ) - return; - - ACM_inited = 0; -} - -// Query if the ACM system is initialized -int ACM_is_inited() -{ - return ACM_inited; -} diff --git a/src/sound/audiostr.cpp b/src/sound/audiostr.cpp index 2ceb6c5..04f66d3 100644 --- a/src/sound/audiostr.cpp +++ b/src/sound/audiostr.cpp @@ -1318,10 +1318,6 @@ void audiostream_init() if ( Audiostream_inited == 1 ) return; - if ( !ACM_is_inited() ) { - return; - } - // Allocate memory for the buffer which holds the uncompressed wave data that is streamed from the // disk during a load/cue if ( Wavedata_load_buffer == NULL ) { diff --git a/src/sound/sound.cpp b/src/sound/sound.cpp index 89e174f..081c9e9 100644 --- a/src/sound/sound.cpp +++ b/src/sound/sound.cpp @@ -464,17 +464,6 @@ int snd_init(int use_a3d, int use_eax) } } - if ( ACM_init() == -1 ) { -#ifndef PLAT_UNIX - // Init the Audio Compression Manager - HWND hwnd = (HWND)os_get_window(); - MessageBox(hwnd, XSTR("Could not properly initialize the Microsoft ADPCM codec.\n\nPlease see the readme.txt file for detailed instructions on installing the Microsoft ADPCM codec.",972), NULL, MB_OK); -// Warning(LOCATION, "Could not properly initialize the Microsoft ADPCM codec.\nPlease see the readme.txt file for detailed instructions on installing the Microsoft ADPCM codec."); -#else - nprintf(( "Sound", "Could not initialize ADPCM codec.\n" )); -#endif - } - // Init the audio streaming stuff audiostream_init(); @@ -726,7 +715,6 @@ void snd_close(void) snd_stop_all(); if (!ds_initialized) return; snd_unload_all(); // free the sound data stored in DirectSound secondary buffers - ACM_close(); // Close the Audio Compression Manager (ACM) ds3d_close(); // Close DirectSound3D dscap_close(); // Close DirectSoundCapture ds_close(); // Close DirectSound off -- 2.39.2