70#pragma function(strcmp)
77 if (strcmp(entry->
name, name) == 0)
96 while (entry != 0 && entry != target) {
153 while (entry != 0 && entry != target) {
207 if (waveEntry != 0) {
215#pragma function(memcmp, strcpy, strlen)
217void playWAVE(
const char *filename,
int looping,
int volume)
223 unsigned char *fileData;
226 if (memcmp(filename,
"sfx16.wav", 9) == 0) {
256 fd = _open(filename, 0x8000);
258 sprintf(errorMsg,
"playWAVE Unable to open file '%s'", filename);
259 MessageBoxA(0, errorMsg,
"Error", MB_ICONHAND);
262 size = filelength(fd);
263 fileData = (
unsigned char *)malloc((
unsigned int)size);
264 _read(fd, fileData, (
unsigned int)size);
284 wave->
name = (
char *)malloc(strlen(filename) + 1);
285 strcpy(wave->
name, filename);
298 for (index = 0; index < (int)size; index++) {
299 ((
unsigned char *)buffer)[index] =
300 (
unsigned char)(((
unsigned char *)buffer)[index] + 0x80);
303 "Playing RAW with length of %d stop=%d\n", size, interrupt);
306 if (interrupt != 0) {
315 buffer, size, 0x29ab, 8, 1);
322 (
char *)malloc(strlen(
"RAW") + 1);
349 unsigned char *fileData;
357 file = _open(
"sfx22.wav", 0x8000);
360 "playWAVE Unable to open file 'sfx23",
361 "Notice", MB_ICONHAND);
364 size = filelength(file);
365 fileData = (
unsigned char *)malloc((
unsigned int)size);
366 _read(file, fileData, (
unsigned int)size);
379 (
char *)malloc(strlen(
"SNOW") + 1);
422 LPBYTE data, DWORD size)
424 return RegQueryValueExA(key, name, 0, &type, data, &size);
429 const BYTE *data, DWORD size)
431 RegSetValueExA(key, name, 0, type, data, size);
444 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
445 "Software\\Origin Systems\\WC: Kilrathi Saga",
446 0, KEY_ALL_ACCESS, &key) == ERROR_SUCCESS) {
475 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
476 "Software\\Origin Systems\\WC: Kilrathi Saga",
477 0, KEY_ALL_ACCESS, &key) == ERROR_SUCCESS) {
void ix_system_set_master_volume(unsigned short volume)
void ix_system_delete_all_samples(void)
void LoadVolumeSettingsFromRegistry(void)
void SaveVolumeSettingsToRegistry(void)
ActiveSoundEntry * AllocateActiveSoundEntry(void)
void __fastcall ix_sound_stop(IxSound *sound)
void ServiceAudioStream(void)
void RemoveWaveTableEntry(WaveTableEntry *entry)
void RemoveActiveSoundEntry(ActiveSoundEntry *entry)
void PlaySnowStaticSound(void)
void playWAVE(const char *filename, int looping, int volume)
IxSample *__fastcall ix_sound_get_sample(IxSound *sound)
int __fastcall ix_sound_is_playing(IxSound *sound)
WaveTableEntry * AllocateWaveTableEntry(void)
void SoundDebugPrintf(const char *fmt,...)
IxSound * ix_system_new_sound(IxSample *sample)
WaveTableEntry * FindWaveTableEntryByName(const char *name)
void ix_system_shutdown(void)
void stop_all_sounds(void)
void ix_system_configure(int option, void *value)
ActiveSoundEntry * FindActiveSoundEntryBySample(IxSample *sample)
void ServiceSoundSystem(void)
LONG RegistryQueryValue(HKEY key, LPCSTR name, DWORD type, LPBYTE data, DWORD size)
void InitializeAudioSystem(HWND window)
void ix_system_set_voice_count(int voiceCount)
void PlayRawSpeechBuffer(void *buffer, size_t size, int interrupt)
void ix_system_delete_all_sounds(void)
void ReleaseFinishedSoundEntries(void)
IxSample * ix_system_new_sample(void)
void StopSoundsUsingWave(const char *name)
void __fastcall ix_sound_start(IxSound *sound)
void ix_system_delete_sound(IxSound *sound)
void SetCinematicFrameTiming(float frameRate)
void __fastcall ix_sound_release(IxSound *sound)
void SetSoundEffectsVolume(int volume)
void ix_system_service_sounds(void)
void RegistryStoreValue(HKEY key, LPCSTR name, DWORD type, const BYTE *data, DWORD size)
Shared Win32 declarations, types and library interfaces.
IxSound * g_9_pSnowStaticAudio
int g_1_bSpaceFlightActive
WaveTableEntry * g_pSnowStaticClip
ActiveSoundEntry * g_pActiveSoundHead
int g_9_nNextSfx16PlaybackFrame
WaveTableEntry * g_pWaveTableHead
int g_bSpeechPlaybackDone
WaveTableEntry * g_1_pVoiceWav
ActiveSoundEntry * g_pActiveSoundTail
int g_bAudioSystemInitialized
WaveTableEntry * g_pWaveTableTail
int g_nMusicVolumeSetting
int g_16_nSpeechCompletionDelay
static char g_szMusicVolumeValueName[]
static char g_szSfxVolumeValueName[]
struct ActiveSoundEntry * next
void ix_sample_set_looping(int enabled)
int ix_sample_load_wav(void *data, int bytes)
int ix_sample_load_raw(void *data, int bytes, int frequency, int bitsPerSample, int channels)
void ix_system_sound_set_volume(unsigned short volume)
void ix_sound_set_delete_on_stop(int enabled)
struct WaveTableEntry * next