From: David Griffith Date: Mon, 6 Jan 2014 09:09:24 +0000 (-0800) Subject: Attempting to get threads really working. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=a8f91dc80ad2d789f8fee286fa8a2c03160985d9;p=liskon_frotz.git Attempting to get threads really working. --- diff --git a/src/curses/ux_audio.c b/src/curses/ux_audio.c index d58e9a5..ab2daeb 100644 --- a/src/curses/ux_audio.c +++ b/src/curses/ux_audio.c @@ -56,6 +56,7 @@ typedef struct { int repeats; } EFFECT; +static void paiff(void *); static int playaiff(EFFECT); static int playmod(EFFECT); static int playogg(EFFECT); @@ -74,10 +75,6 @@ static sem_t audio_empty; int bleep_playing = 0; -//ao_device *device; -//int default_driver; -//ao_sample_format format; - float *musicbuffer; float *bleepbuffer; @@ -176,8 +173,9 @@ void os_start_sample (int number, int volume, int repeats, zword eos) myeffect.repeats = repeats; if (blorb_map->chunks[resource.chunknum].type == bb_make_id('F','O','R','M')) { - playaiff(myeffect); - +// playaiff(myeffect); + pthread_create(&playaiff_id, NULL, (void *) paiff, (void *) &myeffect); +// pthread_join(playaiff_id, NULL); } else if (blorb_map->chunks[resource.chunknum].type == bb_make_id('M','O','D',' ')) { playmod(myeffect); @@ -335,6 +333,14 @@ static int mypower(int base, int exp) { } } +static void paiff(void *pass_arg) +{ + EFFECT *foobar = pass_arg; + + playaiff(*foobar); + + return; +} /* * playaiff *