/***********************************************************
* Artsoft Retro-Game Library *
*----------------------------------------------------------*
-* (c) 1994-2002 Artsoft Entertainment *
+* (c) 1994-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
unsigned long str_size4 = strlen(ti->basepath) + 1;
unsigned long str_size5 = strlen(ti->fullpath) + 1;
boolean override_level_artwork = (type == SND_CTRL_RELOAD_SOUNDS ?
- setup.override_level_sounds :
- setup.override_level_music);
+ gfx.override_level_sounds :
+ gfx.override_level_music);
if (IS_CHILD_PROCESS())
return;
if (leveldir_current == NULL) /* should never happen */
Error(ERR_EXIT, "leveldir_current == NULL");
- memset(&snd_ctrl, 0, sizeof(SoundControl)); /* to make valgrind happy */
+ clear_mem(&snd_ctrl, sizeof(SoundControl)); /* to make valgrind happy */
snd_ctrl.active = FALSE;
snd_ctrl.state = type;
unsigned long str_size1, str_size2, str_size3, str_size4, str_size5;
static char *set_identifier = NULL;
boolean *override_level_artwork = (snd_ctrl->state & SND_CTRL_RELOAD_SOUNDS ?
- &setup.override_level_sounds :
- &setup.override_level_music);
+ &gfx.override_level_sounds :
+ &gfx.override_level_music);
checked_free(set_identifier);
{
if (!mixer[i].active)
{
- Error(ERR_RETURN, "Mixer_InsertSound: Channel %d inactive", i);
- Error(ERR_RETURN, "Mixer_InsertSound: This should never happen!");
+ Error(ERR_INFO, "Mixer_InsertSound: Channel %d inactive", i);
+ Error(ERR_INFO, "Mixer_InsertSound: This should never happen!");
mixer_active_channels--;
}
/* print some debugging information about audio channel usage */
for (i = audio.first_sound_channel; i < audio.num_channels; i++)
{
- Error(ERR_RETURN, "Mixer_InsertSound: %d [%d]: %ld (%ld)",
+ Error(ERR_INFO, "Mixer_InsertSound: %d [%d]: %ld (%ld)",
i, mixer[i].active, mixer[i].data_len, (long)mixer[i].data_ptr);
}
#endif
max_sample_size = fragment_size / (num_output_channels * sample_bytes);
/* first clear the last premixing buffer */
- memset(premix_last_buffer, 0,
- max_sample_size * num_output_channels * sizeof(long));
+ clear_mem(premix_last_buffer,
+ max_sample_size * num_output_channels * sizeof(long));
for (i = 0; i < audio.num_channels; i++)
{
#else /* AUDIO_UNIX_NATIVE */
+ clear_mem(&header, sizeof(struct SoundHeader_WAV)); /* to make gcc happy */
+
if ((file = fopen(filename, MODE_READ)) == NULL)
{
Error(ERR_WARN, "cannot open sound file '%s'", filename);
/* read chunk id "RIFF" */
getFileChunkLE(file, chunk_name, &chunk_size);
- if (strcmp(chunk_name, "RIFF") != 0)
+ if (!strEqual(chunk_name, "RIFF"))
{
Error(ERR_WARN, "missing 'RIFF' chunk of sound file '%s'", filename);
fclose(file);
/* read "RIFF" type id "WAVE" */
getFileChunkLE(file, chunk_name, NULL);
- if (strcmp(chunk_name, "WAVE") != 0)
+ if (!strEqual(chunk_name, "WAVE"))
{
Error(ERR_WARN, "missing 'WAVE' type ID of sound file '%s'", filename);
fclose(file);
while (getFileChunkLE(file, chunk_name, &chunk_size))
{
- if (strcmp(chunk_name, "fmt ") == 0)
+ if (strEqual(chunk_name, "fmt "))
{
if (chunk_size < WAV_HEADER_SIZE)
{
printf(" Significant bits per sample: %d'\n", header.bits_per_sample);
#endif
}
- else if (strcmp(chunk_name, "data") == 0)
+ else if (strEqual(chunk_name, "data"))
{
data_byte_len = chunk_size;
return;
if (last_music_directory != NULL &&
- strcmp(last_music_directory, music_directory) == 0)
+ strEqual(last_music_directory, music_directory))
return; /* old and new music directory are the same */
if (last_music_directory != NULL)
}
if (draw_init_text)
- DrawInitText("Loading music:", 120, FC_GREEN);
+ DrawInitText("Loading music", 120, FC_GREEN);
while ((dir_entry = readdir(dir)) != NULL) /* loop until last dir entry */
{
{
struct FileInfo *music = getMusicListEntry(i);
- if (strcmp(basename, music->filename) == 0)
+ if (strEqual(basename, music->filename))
{
music_already_used = TRUE;
break;
else if (stereo_position > SOUND_MAX_RIGHT)
stereo_position = SOUND_MAX_RIGHT;
- memset(&snd_ctrl, 0, sizeof(SoundControl)); /* to make valgrind happy */
+ clear_mem(&snd_ctrl, sizeof(SoundControl)); /* to make valgrind happy */
snd_ctrl.active = TRUE;
snd_ctrl.nr = nr;
if (!audio.sound_available)
return;
- memset(&snd_ctrl, 0, sizeof(SoundControl)); /* to make valgrind happy */
+ clear_mem(&snd_ctrl, sizeof(SoundControl)); /* to make valgrind happy */
snd_ctrl.active = FALSE;
snd_ctrl.nr = nr;