"@move_object called moving object 0",
"@move_object called moving into object 0",
"@remove_object called with object 0",
- "@get_next_prop called with object 0"
+ "@get_next_prop called with object 0",
+ "@play_sound called without SOUND_FLAG or OLD_SOUND_FLAG set"
};
static void print_long (unsigned long value, int base);
#define ERR_MOVE_OBJECT_TO_0 30 /* @move_object called moving into object 0 */
#define ERR_REMOVE_OBJECT_0 31 /* @remove_object called with object 0 */
#define ERR_GET_NEXT_PROP_0 32 /* @get_next_prop called with object 0 */
-#define ERR_NUM_ERRORS (32)
-
+#define ERR_PLAY_SOUND 33 /* @play_sound called without SOUND_FLAG or OLD_SOUND_FLAG set */
+#define ERR_NUM_ERRORS (33)
+
/* There are four error reporting modes: never report errors;
report only the first time a given error type occurs; report
every time an error occurs; or treat all errors as fatal
int expand_abbreviations;
int script_cols;
int sound;
+ int sound_flag;
int err_report_mode;
char *story_file;
*/
void init_sound (void)
{
- locked = FALSE;
- playing = FALSE;
-
- os_init_sound();
+ if ((h_flags & SOUND_FLAG) || (h_flags & OLD_SOUND_FLAG)) {
+ f_setup.sound_flag = TRUE;
+ locked = FALSE;
+ playing = FALSE;
+ os_init_sound();
+ } else
+ f_setup.sound_flag = FALSE;
} /* init_sound */
if (zargc < 3)
volume = 8;
+ if (!f_setup.sound_flag) {
+ runtime_error(ERR_PLAY_SOUND);
+ return;
+ }
+
if (number >= 3 || number == 0) {
locked = TRUE;
#include "../blorb/blorb.h"
#include "../blorb/blorblow.h"
+#include "ux_frotz.h"
#include "ux_audio.h"
+f_setup_t f_setup;
+
#ifndef NO_SOUND
#include <ao/ao.h>
int err;
static pthread_attr_t attr;
+ if (!f_setup.sound_flag) return;
+
/*Initialize sound engine*/
/*audio_log = fopen("audio_log.txt", "w");*/
/*fprintf(audio_log, "os_init_sound...\n");*/
const float vol = volume_factor(volume);
sound_stream_t *s = 0;
+ if (!f_setup.sound_flag) return;
/*Load resource from BLORB data*/
if(blorb_map == NULL) return;
void os_stop_sample(int id)
{
/*fprintf(audio_log, "os_stop_sample(%d)...\n", id);*/
+ if (!f_setup.sound_flag) return;
sound_stop_id(id);
}