aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sfx
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/sfx')
-rw-r--r--engines/sci/sfx/adlib.h4
-rw-r--r--engines/sci/sfx/iterator.cpp6
-rw-r--r--engines/sci/sfx/mixer/test.cpp8
-rw-r--r--engines/sci/sfx/pcm-iterator.cpp4
-rw-r--r--engines/sci/sfx/seq/gm.cpp15
-rw-r--r--engines/sci/sfx/seq/instrument-map.cpp4
-rw-r--r--engines/sci/sfx/seq/instrument-map.h8
-rw-r--r--engines/sci/sfx/sequencer.h4
-rw-r--r--engines/sci/sfx/sfx_engine.h4
-rw-r--r--engines/sci/sfx/sfx_iterator.h32
-rw-r--r--engines/sci/sfx/sfx_iterator_internal.h31
-rw-r--r--engines/sci/sfx/sfx_pcm.h24
-rw-r--r--engines/sci/sfx/sfx_player.h4
-rw-r--r--engines/sci/sfx/sfx_songlib.h14
-rw-r--r--engines/sci/sfx/sfx_time.h4
-rw-r--r--engines/sci/sfx/sfx_timer.h4
-rw-r--r--engines/sci/sfx/softseq.h18
-rw-r--r--engines/sci/sfx/softseq/amiga.cpp20
18 files changed, 100 insertions, 108 deletions
diff --git a/engines/sci/sfx/adlib.h b/engines/sci/sfx/adlib.h
index ff2a3b2687..d6efcefb0f 100644
--- a/engines/sci/sfx/adlib.h
+++ b/engines/sci/sfx/adlib.h
@@ -33,7 +33,7 @@ namespace Sci {
#define ADLIB_VOICES 12
-typedef struct _sci_adlib_def {
+struct adlib_def {
uint8 keyscale1; /* 0-3 !*/
uint8 freqmod1; /* 0-15 !*/
uint8 feedback1; /* 0-7 !*/
@@ -62,7 +62,7 @@ typedef struct _sci_adlib_def {
uint8 algorithm2; /* 0,1 UNUSED */
uint8 waveform1; /* 0-3 !*/
uint8 waveform2; /* 0-3 !*/
-} adlib_def;
+};
typedef unsigned char adlib_instr[12];
diff --git a/engines/sci/sfx/iterator.cpp b/engines/sci/sfx/iterator.cpp
index ff4faafde2..7e04883ffc 100644
--- a/engines/sci/sfx/iterator.cpp
+++ b/engines/sci/sfx/iterator.cpp
@@ -583,7 +583,7 @@ static song_iterator_t *_sci0_handle_message(sci0_song_iterator_t *self, song_it
#ifdef DEBUG_VERBOSE
fprintf(stderr, "** CLONE INCREF for new %p from %p at %p\n", mem, self, mem->data);
#endif
- return (struct _song_iterator *) mem; /* Assume caller has another copy of this */
+ return (song_iterator_t *) mem; /* Assume caller has another copy of this */
}
case _SIMSG_BASEMSG_STOP: {
@@ -1072,7 +1072,7 @@ static int _sci1_process_next_command(sci1_song_iterator_t *self,
return retval;
}
-static struct _song_iterator *
+static song_iterator_t *
_sci1_handle_message(sci1_song_iterator_t *self,
song_iterator_message_t msg) {
if (msg.recipient == _SIMSG_BASE) { /* May extend this in the future */
@@ -1114,7 +1114,7 @@ static struct _song_iterator *
samplep = &(newsample->next);
}
- return (struct _song_iterator *) mem; /* Assume caller has another copy of this */
+ return (song_iterator_t *) mem; /* Assume caller has another copy of this */
}
case _SIMSG_BASEMSG_STOP: {
diff --git a/engines/sci/sfx/mixer/test.cpp b/engines/sci/sfx/mixer/test.cpp
index f35a546cfd..52102ba81b 100644
--- a/engines/sci/sfx/mixer/test.cpp
+++ b/engines/sci/sfx/mixer/test.cpp
@@ -153,9 +153,9 @@ int dev_output(sfx_pcm_device_t *self, byte *buf, int count) {
/* Feeds for debugging */
-typedef struct {
+struct int_struct {
int i;
-} int_struct;
+};
int feed_poll(sfx_pcm_feed_t *self, byte *dest, int size);
void feed_destroy(sfx_pcm_feed_t *self);
@@ -173,11 +173,11 @@ int_struct private_bits[10] = {
};
-typedef struct {
+struct sample_feed_t {
int start;
int samples_nr;
byte *data;
-} sample_feed_t;
+};
#define FEEDS_NR 4
diff --git a/engines/sci/sfx/pcm-iterator.cpp b/engines/sci/sfx/pcm-iterator.cpp
index 7bf9ed6a06..93514ffd51 100644
--- a/engines/sci/sfx/pcm-iterator.cpp
+++ b/engines/sci/sfx/pcm-iterator.cpp
@@ -34,11 +34,11 @@ namespace Sci {
static int pi_poll(sfx_pcm_feed_t *self, byte *dest, int size);
static void pi_destroy(sfx_pcm_feed_t *self);
-typedef struct {
+struct pcm_data_internal_t {
byte *base_data;
byte *data;
int frames_left;
-} pcm_data_internal_t;
+};
static sfx_pcm_feed_t pcm_it_prototype = {
diff --git a/engines/sci/sfx/seq/gm.cpp b/engines/sci/sfx/seq/gm.cpp
index 896c521007..ebd0b47bf6 100644
--- a/engines/sci/sfx/seq/gm.cpp
+++ b/engines/sci/sfx/seq/gm.cpp
@@ -23,17 +23,10 @@
*
*/
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <stdio.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include "../sequencer.h"
-#include "../device.h"
-#include "instrument-map.h"
-#include <resource.h>
+#include "sci/tools.h"
+#include "sci/sfx/sequencer.h"
+#include "sci/sfx/device.h"
+#include "sci/sfx/seq/instrument-map.h"
namespace Sci {
diff --git a/engines/sci/sfx/seq/instrument-map.cpp b/engines/sci/sfx/seq/instrument-map.cpp
index 8f9ee56371..40079e4d22 100644
--- a/engines/sci/sfx/seq/instrument-map.cpp
+++ b/engines/sci/sfx/seq/instrument-map.cpp
@@ -214,13 +214,13 @@ sfx_instrument_map_load_sci(byte *data, size_t size) {
#define MIDI_CHANNELS_NR 0x10
// FIXME: Replace this ugly hack with simple subclassing once converting to C++
-typedef struct decorated_midi_writer {
+struct decorated_midi_writer_t {
MIDI_WRITER_BODY
midi_writer_t *writer;
sfx_patch_map_t patches[MIDI_CHANNELS_NR];
sfx_instrument_map_t *map;
-} decorated_midi_writer_t;
+};
static void
diff --git a/engines/sci/sfx/seq/instrument-map.h b/engines/sci/sfx/seq/instrument-map.h
index deb54fd1f6..95233f9099 100644
--- a/engines/sci/sfx/seq/instrument-map.h
+++ b/engines/sci/sfx/seq/instrument-map.h
@@ -51,12 +51,12 @@ namespace Sci {
/* Maximum velocity (used for scaling) */
#define SFX_MAX_VELOCITY 128
-typedef struct {
+struct sfx_patch_map_t {
int patch; /* Native instrument, SFX_UNMAPPED or SFX_MAPPED_TO_RHYTHM */
int rhythm; /* Rhythm key when patch == SFX_MAPPED_TO_RHYTHM */
-} sfx_patch_map_t;
+};
-typedef struct {
+struct sfx_instrument_map_t {
sfx_patch_map_t patch_map[SFX_INSTRUMENTS_NR]; /* Map patch nr to which native instrument or rhythm key */
int patch_key_shift[SFX_INSTRUMENTS_NR]; /* Shift patch key by how much? */
int patch_volume_adjust[SFX_INSTRUMENTS_NR]; /* Adjust controller 7 by how much? */
@@ -73,7 +73,7 @@ typedef struct {
size_t initialisation_block_size;
byte *initialisation_block; /* Initial MIDI commands to set up the device */
-} sfx_instrument_map_t;
+};
sfx_instrument_map_t *
sfx_instrument_map_new(int velocity_maps_nr);
diff --git a/engines/sci/sfx/sequencer.h b/engines/sci/sfx/sequencer.h
index 4c25e8bd46..182e2bf771 100644
--- a/engines/sci/sfx/sequencer.h
+++ b/engines/sci/sfx/sequencer.h
@@ -37,7 +37,7 @@ namespace Sci {
#define SFX_SEQ_PATCHFILE_NONE -1
-typedef struct _sfx_sequencer {
+struct sfx_sequencer_t {
const char *name; /* Sequencer name */
const char *version; /* Sequencer version */
@@ -129,7 +129,7 @@ typedef struct _sfx_sequencer {
int min_write_ahead_ms; /* Minimal write-ahead, in milliseconds */
/* Note that write-ahead is tuned automatically; this enforces a lower limit */
-} sfx_sequencer_t;
+};
sfx_sequencer_t *sfx_find_sequencer(char *name);
diff --git a/engines/sci/sfx/sfx_engine.h b/engines/sci/sfx/sfx_engine.h
index 60893e550f..20447c69c8 100644
--- a/engines/sci/sfx/sfx_engine.h
+++ b/engines/sci/sfx/sfx_engine.h
@@ -47,7 +47,7 @@ namespace Sci {
#define SFX_DEBUG_CUES (1 << 1) /* Debug cues, loops, and
** song completions */
-typedef struct {
+struct sfx_state_t {
song_iterator_t *it; /* The song iterator at the heart of things */
unsigned int flags; /* SFX_STATE_FLAG_* */
songlib_t songlib; /* Song library */
@@ -55,7 +55,7 @@ typedef struct {
int suspended; /* Whether we are suspended */
unsigned int debug; /* Debug flags */
-} sfx_state_t;
+};
/***********/
/* General */
diff --git a/engines/sci/sfx/sfx_iterator.h b/engines/sci/sfx/sfx_iterator.h
index 623206bd20..0203159a49 100644
--- a/engines/sci/sfx/sfx_iterator.h
+++ b/engines/sci/sfx/sfx_iterator.h
@@ -44,12 +44,12 @@ namespace Sci {
#define FADE_ACTION_FADE_AND_STOP 1
#define FADE_ACTION_FADE_AND_CONT 2
-typedef struct {
+struct fade_params_t {
int ticks_per_step;
int final_volume;
int step_size;
int action;
-} fade_params_t;
+};
#define SONG_ITERATOR_MESSAGE_ARGUMENTS_NR 2
@@ -96,7 +96,7 @@ struct listener_t {
typedef unsigned long songit_id_t;
-typedef struct {
+struct song_iterator_message_t {
songit_id_t ID;
unsigned int recipient; /* Type of iterator supposed to receive this */
unsigned int type;
@@ -104,7 +104,7 @@ typedef struct {
unsigned int i;
void * p;
} args[SONG_ITERATOR_MESSAGE_ARGUMENTS_NR];
-} song_iterator_message_t;
+};
#define INHERITS_SONG_ITERATOR \
songit_id_t ID; \
@@ -115,15 +115,15 @@ typedef struct {
int (*next) (song_iterator_t *self, unsigned char *buf, int *buf_size); \
sfx_pcm_feed_t * (*get_pcm_feed) (song_iterator_t *s); \
song_iterator_t * (* handle_message)(song_iterator_t *self, song_iterator_message_t msg); \
- void (*init) (struct _song_iterator *self); \
- void (*cleanup) (struct _song_iterator *self); \
- int (*get_timepos) (struct _song_iterator *self); \
+ void (*init) (song_iterator_t *self); \
+ void (*cleanup) (song_iterator_t *self); \
+ int (*get_timepos) (song_iterator_t *self); \
listener_t death_listeners[SONGIT_MAX_LISTENERS]; \
int death_listeners_nr \
#define SONGIT_MAX_LISTENERS 2
-typedef struct _song_iterator {
+struct song_iterator_t {
songit_id_t ID;
uint16 channel_mask; /* Bitmask of all channels this iterator will use */
@@ -131,7 +131,7 @@ typedef struct _song_iterator {
unsigned int flags;
int priority;
- int (*next)(struct _song_iterator *self,
+ int (*next)(song_iterator_t *self,
unsigned char *buf, int *result);
/* Reads the next MIDI operation _or_ delta time
** Parameters: (song_iterator_t *) self
@@ -150,7 +150,7 @@ typedef struct _song_iterator {
** PCM, but this must be done before any subsequent calls to next().
*/
- sfx_pcm_feed_t * (*get_pcm_feed)(struct _song_iterator *self);
+ sfx_pcm_feed_t * (*get_pcm_feed)(song_iterator_t *self);
/* Checks for the presence of a pcm sample
** Parameters: (song_iterator_t *) self
** Returns : (sfx_pcm_feed_t *) NULL if no PCM data was found, a
@@ -158,8 +158,8 @@ typedef struct _song_iterator {
*/
- struct _song_iterator *
- (* handle_message)(struct _song_iterator *self, song_iterator_message_t msg);
+ song_iterator_t *
+ (* handle_message)(song_iterator_t *self, song_iterator_message_t msg);
/* Handles a message to the song iterator
** Parameters: (song_iterator_t *) self
** (song_iterator_messag_t) msg: The message to handle
@@ -174,20 +174,20 @@ typedef struct _song_iterator {
*/
- void (*init)(struct _song_iterator *self);
+ void (*init)(song_iterator_t *self);
/* Resets/initializes the sound iterator
** Parameters: (song_iterator_t *) self
** Returns : (void)
*/
- void (*cleanup)(struct _song_iterator *self);
+ void (*cleanup)(song_iterator_t *self);
/* Frees any content of the iterator structure
** Parameters: (song_iterator_t *) self
** Does not physically free(self) yet. May be NULL if nothing needs to be done.
** Must not recurse on its delegate.
*/
- int (*get_timepos)(struct _song_iterator *self);
+ int (*get_timepos)(song_iterator_t *self);
/* Gets the song position to store in a savegame
** Parameters: (song_iterator_t *) self
*/
@@ -199,7 +199,7 @@ typedef struct _song_iterator {
/* See songit_* for the constructor and non-virtual member functions */
-} song_iterator_t;
+};
/* Song iterator flags */
diff --git a/engines/sci/sfx/sfx_iterator_internal.h b/engines/sci/sfx/sfx_iterator_internal.h
index 4c104b5c52..ba6f79742c 100644
--- a/engines/sci/sfx/sfx_iterator_internal.h
+++ b/engines/sci/sfx/sfx_iterator_internal.h
@@ -50,7 +50,7 @@ namespace Sci {
#define SIPFX __FILE__" : "
-typedef struct {
+struct song_iterator_channel_t {
int state; /* SI_STATE_* */
int offset; /* Offset into the data chunk */
int end; /* Last allowed byte in track */
@@ -73,7 +73,7 @@ typedef struct {
int saw_notes; /* Bitmask of channels we have currently played notes on */
byte last_cmd; /* Last operation executed, for running status */
-} song_iterator_channel_t;
+};
#define INHERITS_BASE_SONG_ITERATOR \
INHERITS_SONG_ITERATOR; /* aka "extends song iterator" */ \
@@ -92,19 +92,19 @@ typedef struct {
int loops; /* Number of loops remaining */ \
int recover_delay
-typedef struct _base_song_iterator {
+struct base_song_iterator_t {
INHERITS_BASE_SONG_ITERATOR;
-} base_song_iterator_t;
+};
/********************************/
/*--------- SCI 0 --------------*/
/********************************/
-typedef struct {
+struct sci0_song_iterator_t {
INHERITS_BASE_SONG_ITERATOR;
song_iterator_channel_t channel;
int delay_remaining; /* Number of ticks that haven't been polled yet */
-} sci0_song_iterator_t;
+};
/********************************/
@@ -112,17 +112,17 @@ typedef struct {
/********************************/
-typedef struct _sci1_sample {
+struct sci1_sample_t {
int delta; /* Time left-- initially, this is 'Sample point 1'.
** After initialisation, it is 'sample point 1 minus the sample point of the previous sample' */
int size;
int announced; /* Announced for download (SI_PCM) */
sfx_pcm_config_t format;
byte *data;
- struct _sci1_sample *next;
-} sci1_sample_t;
+ sci1_sample_t *next;
+};
-typedef struct {
+struct sci1_song_iterator_t {
INHERITS_BASE_SONG_ITERATOR;
song_iterator_channel_t channels[MIDI_CHANNELS];
@@ -136,8 +136,7 @@ typedef struct {
int delay_remaining; /* Number of ticks that haven't been polled yet */
int hold;
- \
-} sci1_song_iterator_t;
+};
#define PLAYMASK_NONE 0x0
@@ -164,11 +163,11 @@ int is_cleanup_iterator(song_iterator_t *it);
/*--------- Fast Forward ---------*/
/**********************************/
-typedef struct {
+struct fast_forward_song_iterator_t {
INHERITS_SONG_ITERATOR;
song_iterator_t *delegate;
int delta; /* Remaining time */
-} fast_forward_song_iterator_t;
+};
song_iterator_t *new_fast_forward_iterator(song_iterator_t *it, int delta);
@@ -198,7 +197,7 @@ song_iterator_t *new_fast_forward_iterator(song_iterator_t *it, int delta);
#define TEE_MORPH_NONE 0 /* Not waiting to self-morph */
#define TEE_MORPH_READY 1 /* Ready to self-morph */
-typedef struct {
+struct tee_song_iterator_t {
INHERITS_SONG_ITERATOR;
int status;
@@ -217,7 +216,7 @@ typedef struct {
/* Remapping for channels */
} children[2];
-} tee_song_iterator_t;
+};
sfx_pcm_feed_t *sfx_iterator_make_feed(byte *base_data, int offset,
diff --git a/engines/sci/sfx/sfx_pcm.h b/engines/sci/sfx/sfx_pcm.h
index 726399cf6d..e40641d187 100644
--- a/engines/sci/sfx/sfx_pcm.h
+++ b/engines/sci/sfx/sfx_pcm.h
@@ -64,19 +64,19 @@ namespace Sci {
#define SFX_PCM_FRAME_SIZE(conf) ((conf).stereo? 2 : 1) * (((conf).format & SFX_PCM_FORMAT_16)? 2 : 1)
-typedef struct {
+struct sfx_pcm_config_t {
int rate; /* Sampling rate */
int stereo; /* The stereo mode used (SFX_PCM_MONO or SFX_PCM_STEREO_*) */
unsigned int format; /* Sample format (SFX_PCM_FORMAT_*) */
-} sfx_pcm_config_t;
+};
-typedef struct _sfx_pcm_device {
+struct sfx_pcm_device_t {
/* SFX devices are PCM players, i.e. output drivers for digitalised audio (sequences of audio samples).
** Implementors are (in general) allowed to export specifics of these devices and let the mixer handle
** endianness/signedness/bit size/mono-vs-stereo conversions.
*/
- int (*init)(struct _sfx_pcm_device *self);
+ int (*init)(sfx_pcm_device_t *self);
/* Initializes the device
** Parameters: (sfx_pcm_device_t *) self: Self reference
** Returns : (int) SFX_OK on success, SFX_ERROR if the device could not be
@@ -85,7 +85,7 @@ typedef struct _sfx_pcm_device {
** specified beforehand.
*/
- int (*output)(struct _sfx_pcm_device *self, byte *buf,
+ int (*output)(sfx_pcm_device_t *self, byte *buf,
int count, sfx_timestamp_t *timestamp);
/* Writes output to the device
** Parameters: (sfx_pcm_device_t *) self: Self reference
@@ -103,7 +103,7 @@ typedef struct _sfx_pcm_device {
*/
sfx_timestamp_t
- (*get_output_timestamp)(struct _sfx_pcm_device *self);
+ (*get_output_timestamp)(sfx_pcm_device_t *self);
/* Determines the timestamp for 'output'
** Parameters: (sfx_pcm_device_t *) self: Self reference
** Returns : (sfx_timestamp_t) A timestamp (with the device's conf.rate)
@@ -121,14 +121,14 @@ typedef struct _sfx_pcm_device {
** output() will block or fail, drained according
** to conf.rate */
-} sfx_pcm_device_t;
+};
#define PCM_FEED_TIMESTAMP 0 /* New timestamp available */
#define PCM_FEED_IDLE 1 /* No sound ATM, but new timestamp may be available later */
#define PCM_FEED_EMPTY 2 /* Feed is finished, can be destroyed */
-typedef struct _sfx_pcm_feed_t {
+struct sfx_pcm_feed_t {
/* PCM feeds are sources of input for the PCM mixer. Their member functions
** are invoked as callbacks on demand, to provide the mixer with input it
** (in turn) passes on to PCM output devices.
@@ -136,7 +136,7 @@ typedef struct _sfx_pcm_feed_t {
** to be considered.
*/
- int (*poll)(struct _sfx_pcm_feed_t *self, byte *dest, int size);
+ int (*poll)(sfx_pcm_feed_t *self, byte *dest, int size);
/* Asks the PCM feed to write out the next stuff it would like to have written
** Parameters: (sfx_pcm_feed_t *) self: Self reference
** (byte *) dest: The destination buffer to write to
@@ -148,14 +148,14 @@ typedef struct _sfx_pcm_feed_t {
** is available.
*/
- void (*destroy)(struct _sfx_pcm_feed_t *self);
+ void (*destroy)(sfx_pcm_feed_t *self);
/* Asks the PCM feed to free all resources it occupies
** Parameters: (sfx_pcm_feed_t *) self: Self reference
** free(self) should be part of this function, if applicable.
*/
int
- (*get_timestamp)(struct _sfx_pcm_feed_t *self, sfx_timestamp_t *timestamp);
+ (*get_timestamp)(sfx_pcm_feed_t *self, sfx_timestamp_t *timestamp);
/* Determines the timestamp of the next frame-to-read
** Returns : (sfx_timestamp_t) timestamp: The timestamp of the next frame
** (int) PCM_FEED_*
@@ -171,7 +171,7 @@ typedef struct _sfx_pcm_feed_t {
** (print in hex) */
int frame_size; /* Frame size, computed by the mixer for the feed */
-} sfx_pcm_feed_t;
+};
int sfx_pcm_available();
/* Determines whether a PCM device is available and has been initialised
diff --git a/engines/sci/sfx/sfx_player.h b/engines/sci/sfx/sfx_player.h
index b1e6695f14..9e6247b5c3 100644
--- a/engines/sci/sfx/sfx_player.h
+++ b/engines/sci/sfx/sfx_player.h
@@ -36,7 +36,7 @@ namespace Sci {
typedef void tell_synth_func(int buf_nr, byte *buf);
-typedef struct {
+struct sfx_player_t {
const char *name;
const char *version;
@@ -115,7 +115,7 @@ typedef struct {
int polyphony; /* Number of voices that can play simultaneously */
-} sfx_player_t;
+};
sfx_player_t *sfx_find_player(char *name);
/* Looks up a player by name or finds the default player
diff --git a/engines/sci/sfx/sfx_songlib.h b/engines/sci/sfx/sfx_songlib.h
index da619b3777..c1683a2f47 100644
--- a/engines/sci/sfx/sfx_songlib.h
+++ b/engines/sci/sfx/sfx_songlib.h
@@ -50,7 +50,7 @@ typedef enum {
RESTORE_BEHAVIOR_RESTART /* continue it from where it was */
} RESTORE_BEHAVIOR;
-typedef struct _song {
+struct song_t {
song_handle_t handle;
int resource_num; /* Resource number */
int priority; /* Song priority (more important if priority is higher) */
@@ -70,18 +70,18 @@ typedef struct _song {
** Playing -> time at which 'delay' has elapsed
** Suspended/Waiting -> stopping time */
- struct _song *next; /* Next song or NULL if this is the last one */
- struct _song *next_playing; /* Next playing song; used by the
+ song_t *next; /* Next song or NULL if this is the last one */
+ song_t *next_playing; /* Next playing song; used by the
** core song system */
- struct _song *next_stopping; /* Next song pending stopping; used exclusively by
+ song_t *next_stopping; /* Next song pending stopping; used exclusively by
** the core song system's _update_multi_song() */
-} song_t;
+};
-typedef struct {
+struct songlib_t {
song_t **lib;
song_t *_s;
-} songlib_t;
+};
/**************************/
/* Song library commands: */
diff --git a/engines/sci/sfx/sfx_time.h b/engines/sci/sfx/sfx_time.h
index d362dfa381..ebb6824e1d 100644
--- a/engines/sci/sfx/sfx_time.h
+++ b/engines/sci/sfx/sfx_time.h
@@ -28,13 +28,13 @@
namespace Sci {
-typedef struct {
+struct sfx_timestamp_t {
long secs;
long usecs;
int frame_rate;
int frame_offset;
/* Total time: secs + usecs + frame_offset/frame_rate */
-} sfx_timestamp_t;
+};
sfx_timestamp_t sfx_new_timestamp(long secs, long usecs, int frame_rate);
diff --git a/engines/sci/sfx/sfx_timer.h b/engines/sci/sfx/sfx_timer.h
index 581f7d1ac5..19971124e6 100644
--- a/engines/sci/sfx/sfx_timer.h
+++ b/engines/sci/sfx/sfx_timer.h
@@ -30,7 +30,7 @@
namespace Sci {
-typedef struct {
+struct sfx_timer_t {
int delay_ms; /* Approximate delay (in milliseconds) between calls */
int (*init)(void (*callback)(void *data), void *data);
@@ -49,7 +49,7 @@ typedef struct {
** All resources allocated with the timer should be freed as an effect
** of this.
*/
-} sfx_timer_t;
+};
} // End of namespace Sci
diff --git a/engines/sci/sfx/softseq.h b/engines/sci/sfx/softseq.h
index 5a2def8f41..2b0c04ac70 100644
--- a/engines/sci/sfx/softseq.h
+++ b/engines/sci/sfx/softseq.h
@@ -34,11 +34,11 @@
namespace Sci {
/* Software sequencer */
-typedef struct sfx_softseq {
+struct sfx_softseq_t {
const char *name;
const char *version;
- int (*set_option)(struct sfx_softseq *self, const char *name, const char *value);
+ int (*set_option)(sfx_softseq_t *self, const char *name, const char *value);
/* Sets an option for the sequencer
** Parameters: (sfx_softseq_t *) self: Self reference
** (const char *) name: Name of the option to set
@@ -46,7 +46,7 @@ typedef struct sfx_softseq {
** Returns : (int) GFX_OK on success, or GFX_ERROR if not supported
*/
- int (*init)(struct sfx_softseq *self, byte *res_data, int res_size,
+ int (*init)(sfx_softseq_t *self, byte *res_data, int res_size,
byte *res2_data, int res2_size);
/* Initialises the sequencer
** Parameters: (sfx_softseq_t *) self: Self reference
@@ -61,18 +61,18 @@ typedef struct sfx_softseq {
** /even if/ patch_nr is set.
*/
- void (*exit)(struct sfx_softseq *self);
+ void (*exit)(sfx_softseq_t *self);
/* Uninitialises the sequencer and frees all used resources
** Parameters: (sfx_softseq_t *) self: Self reference
*/
- void (*set_volume)(struct sfx_softseq *self, int new_volume);
+ void (*set_volume)(sfx_softseq_t *self, int new_volume);
/* Sets the sequencer volume
** Parameters: (sfx_softseq_t *) self: Self reference
** (int) new_volume: A volume, between 0 (quiet) and 127 (max)
*/
- void (*handle_command)(struct sfx_softseq *self, byte cmd, int argc, byte *argv);
+ void (*handle_command)(sfx_softseq_t *self, byte cmd, int argc, byte *argv);
/* Handle a MIDI command
** Parameters: (sfx_softseq_t *) self: Self reference
** (byte) cmd: Basic MIDI command, always includes command and channel
@@ -80,14 +80,14 @@ typedef struct sfx_softseq {
** (byte *) argv: Additional arguments to 'cmd'
*/
- void (*poll)(struct sfx_softseq *self, byte *dest, int len);
+ void (*poll)(sfx_softseq_t *self, byte *dest, int len);
/* Asks the software sequencer to fill in parts of a buffer
** Parameters: (sfx_softseq_t *) self: Self reference
** (int) len: Number of _frames_ to write
** Returns : (byte) *dest: 'len' frames must be written to this buffer
*/
- void (*allstop)(struct sfx_softseq *self);
+ void (*allstop)(sfx_softseq_t *self);
/* Stops all sound generation
** Parameters: (sfx_softseq_t *) self: Self reference
*/
@@ -111,7 +111,7 @@ typedef struct sfx_softseq {
sfx_pcm_config_t pcm_conf; /* Setup of the channel the sequencer writes to */
-} sfx_softseq_t;
+};
sfx_softseq_t *sfx_find_softseq(const char *name);
diff --git a/engines/sci/sfx/softseq/amiga.cpp b/engines/sci/sfx/softseq/amiga.cpp
index 95b82d586f..a6926b2101 100644
--- a/engines/sci/sfx/softseq/amiga.cpp
+++ b/engines/sci/sfx/softseq/amiga.cpp
@@ -48,19 +48,19 @@ namespace Sci {
/* #define DEBUG */
-typedef struct envelope {
+struct envelope_t {
/* Phase period length in samples */
int length;
/* Velocity delta per period */
int delta;
/* Target velocity */
int target;
-} envelope_t;
+};
/* Fast decay envelope */
static envelope_t env_decay = {FREQUENCY / (32 * 64), 1, 0};
-typedef struct instrument {
+struct instrument_t {
char name[30];
int mode;
/* Size of non-looping part in bytes */
@@ -73,15 +73,15 @@ typedef struct instrument {
envelope_t envelope[4];
int8 *samples;
int8 *loop;
-} instrument_t;
+};
-typedef struct bank {
+struct bank_t {
char name[30];
int size;
instrument_t *instruments[256];
-} bank_t;
+};
-typedef struct channel {
+struct channel_t {
int instrument;
int note;
int note_velocity;
@@ -94,13 +94,13 @@ typedef struct channel {
int hw_channel;
frac_t offset;
frac_t rate;
-} channel_t;
+};
-typedef struct hw_channel {
+struct hw_channel_t {
int instrument;
int volume;
int pan;
-} hw_channel_t;
+};
/* Instrument bank */
static bank_t bank;