diff options
Diffstat (limited to 'engines/sci/sfx')
36 files changed, 128 insertions, 1 deletions
diff --git a/engines/sci/sfx/adlib.cpp b/engines/sci/sfx/adlib.cpp index dbce4d2ad1..f1da3fbdae 100644 --- a/engines/sci/sfx/adlib.cpp +++ b/engines/sci/sfx/adlib.cpp @@ -25,6 +25,8 @@ #include "sci/sfx/adlib.h" +namespace Sci { + adlib_instr adlib_sbi[96]; void @@ -69,3 +71,5 @@ make_sbi(adlib_def *one, guint8 *buffer) { return; } + +} // End of namespace Sci diff --git a/engines/sci/sfx/adlib.h b/engines/sci/sfx/adlib.h index eeeec62a91..890f573cdf 100644 --- a/engines/sci/sfx/adlib.h +++ b/engines/sci/sfx/adlib.h @@ -29,6 +29,7 @@ #include "sci/include/resource.h" +namespace Sci { #define ADLIB_VOICES 12 @@ -70,4 +71,6 @@ extern adlib_instr adlib_sbi[96]; void make_sbi(adlib_def *one, guint8 *buffer); /* Converts a raw SCI adlib instrument into the adlib register format. */ +} // End of namespace Sci + #endif /* _SFX_ADLIB_H_ */ diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp index 6a2180d2ed..7452305dc7 100644 --- a/engines/sci/sfx/core.cpp +++ b/engines/sci/sfx/core.cpp @@ -33,6 +33,7 @@ #include "sci/include/sci_midi.h" #include "common/mutex.h" +namespace Sci { /*#define DEBUG_SONG_API*/ /*#define DEBUG_CUES*/ @@ -903,3 +904,5 @@ sfx_all_stop(sfx_state_t *self) { song_lib_free(self->songlib); _update(self); } + +} // End of namespace Sci diff --git a/engines/sci/sfx/device.h b/engines/sci/sfx/device.h index c000f7817c..fc5328e1d9 100644 --- a/engines/sci/sfx/device.h +++ b/engines/sci/sfx/device.h @@ -28,6 +28,8 @@ #ifndef _SFX_DEVICE_H #define _SFX_DEVICE_H +namespace Sci { + /* Various types of resources */ #define SFX_DEVICE_NONE 0 #define SFX_DEVICE_MIDI 1 /* midi writer */ @@ -116,4 +118,6 @@ sfx_find_device(int type, char *name); ** Returns : (void *) The device requested, or NULL if no match was found */ +} // End of namespace Sci + #endif /* !_SFX_PLAYER_H */ diff --git a/engines/sci/sfx/device/alsa-midi.cpp b/engines/sci/sfx/device/alsa-midi.cpp index 22f9fbc8d2..2528ed1aa3 100644 --- a/engines/sci/sfx/device/alsa-midi.cpp +++ b/engines/sci/sfx/device/alsa-midi.cpp @@ -29,6 +29,8 @@ #include <alsa/asoundlib.h> +namespace Sci { + #define SCI_ALSA_MIDI_VERSION "0.1" static snd_midi_event_t *parser = NULL; @@ -214,4 +216,6 @@ midi_writer_t sfx_device_midi_alsa = { amclose, }; +} // End of namespace Sci + #endif diff --git a/engines/sci/sfx/device/camd-midi.cpp b/engines/sci/sfx/device/camd-midi.cpp index c4205414cb..307e215a50 100644 --- a/engines/sci/sfx/device/camd-midi.cpp +++ b/engines/sci/sfx/device/camd-midi.cpp @@ -37,6 +37,7 @@ #include <proto/intuition.h> #include <stdio.h> +namespace Sci { #define SWAP_BYTES #define FILL_BYTES @@ -150,4 +151,6 @@ midi_writer_t sfx_device_midi_camd = { &camd_close }; +} // End of namespace Sci + #endif /* HAVE_PROTO_CAMD_H */ diff --git a/engines/sci/sfx/device/devices.cpp b/engines/sci/sfx/device/devices.cpp index 42f5a89dbb..6c4da7e50a 100644 --- a/engines/sci/sfx/device/devices.cpp +++ b/engines/sci/sfx/device/devices.cpp @@ -33,6 +33,8 @@ #include "sci/include/resource.h" +namespace Sci { + static struct _midi_device *devices_midi[] = { NULL }; @@ -84,3 +86,5 @@ sfx_find_device(int type, char *name) { return NULL; } + +} // End of namespace Sci diff --git a/engines/sci/sfx/device/unixraw-midi.cpp b/engines/sci/sfx/device/unixraw-midi.cpp index bd158622bd..501e154cb1 100644 --- a/engines/sci/sfx/device/unixraw-midi.cpp +++ b/engines/sci/sfx/device/unixraw-midi.cpp @@ -30,6 +30,8 @@ #include <sys/stat.h> #include <fcntl.h> +namespace Sci { + #define SCI_UNIXRAW_MIDI_VERSION "0.1" #ifndef O_SYNC @@ -90,3 +92,5 @@ midi_writer_t sfx_device_midi_unixraw = { &unixraw_reset_timer, &unixraw_close }; + +} // End of namespace Sci diff --git a/engines/sci/sfx/iterator.cpp b/engines/sci/sfx/iterator.cpp index ae1f2fa588..bc2d2f5a8c 100644 --- a/engines/sci/sfx/iterator.cpp +++ b/engines/sci/sfx/iterator.cpp @@ -33,6 +33,8 @@ #include "sci/include/resource.h" #include "sci/include/sci_memory.h" +namespace Sci { + static const int MIDI_cmdlen[16] = {0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 2, 0 }; @@ -2051,3 +2053,5 @@ sfx_iterator_combine(song_iterator_t *it1, song_iterator_t *it2) { /* Both are non-NULL: */ return songit_new_tee(it1, it2, 1); /* 'may destroy' */ } + +} // End of namespace Sci diff --git a/engines/sci/sfx/mixer.h b/engines/sci/sfx/mixer.h index 70aad8d483..051d50aa94 100644 --- a/engines/sci/sfx/mixer.h +++ b/engines/sci/sfx/mixer.h @@ -28,6 +28,7 @@ #include "sci/include/sfx_pcm.h" +namespace Sci { #define SFX_PCM_FEED_MODE_ALIVE 0 #define SFX_PCM_FEED_MODE_DEAD 1 @@ -124,4 +125,6 @@ extern sfx_pcm_mixer_t *mixer; /* _THE_ global pcm mixer */ sfx_pcm_mixer_t* getMixer(); +} // End of namespace Sci + #endif /* !defined(_SFX_MIXER_H_) */ diff --git a/engines/sci/sfx/mixer/soft.cpp b/engines/sci/sfx/mixer/soft.cpp index 5aa80c11ae..01f132393d 100644 --- a/engines/sci/sfx/mixer/soft.cpp +++ b/engines/sci/sfx/mixer/soft.cpp @@ -27,6 +27,8 @@ #include "../mixer.h" #include "sci/include/sci_memory.h" +namespace Sci { + /* Max. number of microseconds in difference allowed between independent audio streams */ #define TIMESTAMP_MAX_ALLOWED_DELTA 2000 @@ -970,4 +972,6 @@ sfx_pcm_mixer_t sfx_pcm_mixer_soft_linear = { NULL }; -sfx_pcm_mixer_t* getMixer() { return &sfx_pcm_mixer_soft_linear; }
\ No newline at end of file +sfx_pcm_mixer_t* getMixer() { return &sfx_pcm_mixer_soft_linear; } + +} // End of namespace Sci diff --git a/engines/sci/sfx/mixer/test.cpp b/engines/sci/sfx/mixer/test.cpp index fead1d7916..f35a546cfd 100644 --- a/engines/sci/sfx/mixer/test.cpp +++ b/engines/sci/sfx/mixer/test.cpp @@ -29,6 +29,8 @@ #include "../mixer.h" #include <time.h> +namespace Sci { + #if 0 sfx_pcm_mixer_t *mix; @@ -344,3 +346,5 @@ main(int argc, char **argv) { #else int main() {} #endif + +} // End of namespace Sci diff --git a/engines/sci/sfx/pcm-iterator.cpp b/engines/sci/sfx/pcm-iterator.cpp index cbe358b104..9507b6fd3d 100644 --- a/engines/sci/sfx/pcm-iterator.cpp +++ b/engines/sci/sfx/pcm-iterator.cpp @@ -27,6 +27,8 @@ #include "sci/include/resource.h" /* for BREAKPOINT */ #include "sci/include/sci_memory.h" +namespace Sci { + #define D ((pcm_data_internal_t *)self->internal) static int @@ -108,3 +110,5 @@ pi_destroy(sfx_pcm_feed_t *self) { free(D); free(self); } + +} // End of namespace Sci diff --git a/engines/sci/sfx/pcm_device.cpp b/engines/sci/sfx/pcm_device.cpp index 906aa69450..267dfa25e2 100644 --- a/engines/sci/sfx/pcm_device.cpp +++ b/engines/sci/sfx/pcm_device.cpp @@ -29,6 +29,7 @@ #include "sound/audiostream.h" #include "sound/mixer.h" +namespace Sci { static int pcmout_scummvm_framesize; static Audio::AppendableAudioStream * pcmout_scummvm_audiostream; @@ -74,3 +75,5 @@ sfx_pcm_device_t sfx_pcm_driver_scummvm = { {0, 0, 0}, 0 }; + +} // End of namespace Sci diff --git a/engines/sci/sfx/player/players.cpp b/engines/sci/sfx/player/players.cpp index 03b6298378..b92ce930b1 100644 --- a/engines/sci/sfx/player/players.cpp +++ b/engines/sci/sfx/player/players.cpp @@ -25,6 +25,8 @@ #include "sci/include/sfx_player.h" +namespace Sci { + extern sfx_player_t sfx_player_realtime; extern sfx_player_t sfx_player_polled; @@ -49,3 +51,5 @@ sfx_find_player(char *name) { return sfx_players[n]; } } + +} // End of namespace Sci diff --git a/engines/sci/sfx/player/polled.cpp b/engines/sci/sfx/player/polled.cpp index 2274b0003a..9d307940cb 100644 --- a/engines/sci/sfx/player/polled.cpp +++ b/engines/sci/sfx/player/polled.cpp @@ -32,6 +32,8 @@ #include "sci/sfx/softseq.h" #include "sci/sfx/mixer.h" +namespace Sci { + static song_iterator_t *play_it; static int play_paused = 0; static sfx_softseq_t *seq; @@ -315,3 +317,5 @@ sfx_player_t sfx_player_polled = { &pp_tell_synth, 0 /* polyphony */ }; + +} // End of namespace Sci diff --git a/engines/sci/sfx/player/realtime.cpp b/engines/sci/sfx/player/realtime.cpp index ab3abc1513..6aa53d60d3 100644 --- a/engines/sci/sfx/player/realtime.cpp +++ b/engines/sci/sfx/player/realtime.cpp @@ -31,6 +31,8 @@ #include "sci/include/sfx_player.h" #include "sci/sfx/sequencer.h" +namespace Sci { + static sfx_sequencer_t *seq; extern sfx_player_t sfx_player_realtime; @@ -310,3 +312,5 @@ sfx_player_t sfx_player_realtime = { &rt_tell_synth, 0 /* polyphony */ }; + +} // End of namespace Sci diff --git a/engines/sci/sfx/seq/gm.cpp b/engines/sci/sfx/seq/gm.cpp index 9ad94a54cc..13520b2eec 100644 --- a/engines/sci/sfx/seq/gm.cpp +++ b/engines/sci/sfx/seq/gm.cpp @@ -35,6 +35,8 @@ #include "instrument-map.h" #include <resource.h> +namespace Sci { + static midi_writer_t *writer = NULL; static int @@ -175,3 +177,5 @@ sfx_sequencer_t sfx_sequencer_gm = { 64, /* max polyphony */ 0 /* no write-ahead needed inherently */ }; + +} // End of namespace Sci diff --git a/engines/sci/sfx/seq/instrument-map.cpp b/engines/sci/sfx/seq/instrument-map.cpp index 2382d89003..8f9ee56371 100644 --- a/engines/sci/sfx/seq/instrument-map.cpp +++ b/engines/sci/sfx/seq/instrument-map.cpp @@ -29,6 +29,8 @@ #include "instrument-map.h" #include "sfx_engine.h" +namespace Sci { + sfx_instrument_map_t * sfx_instrument_map_new(int velocity_maps_nr) { sfx_instrument_map_t *map = (sfx_instrument_map_t *)sci_malloc(sizeof(sfx_instrument_map_t)); @@ -522,3 +524,4 @@ sfx_mapped_writer(midi_writer_t *writer, sfx_instrument_map_t *map) { return (midi_writer_t *) retval; } +} // End of namespace Sci diff --git a/engines/sci/sfx/seq/instrument-map.h b/engines/sci/sfx/seq/instrument-map.h index 45dc64262c..a18bdaff79 100644 --- a/engines/sci/sfx/seq/instrument-map.h +++ b/engines/sci/sfx/seq/instrument-map.h @@ -32,6 +32,8 @@ #include "resource.h" #include "../device.h" +namespace Sci { + #define SFX_INSTRUMENTS_NR 0x80 #define SFX_RHYTHM_NR 0x80 #define SFX_VELOCITIES_NR 0x80 @@ -126,5 +128,6 @@ sfx_mapped_writer(midi_writer_t *writer, sfx_instrument_map_t *map); ** deallocates the instrument map when the writer is closed. */ +} // End of namespace Sci #endif /* !defined(SCI_INSTRUMENT_MAP_) */ diff --git a/engines/sci/sfx/seq/map-mt32-to-gm.cpp b/engines/sci/sfx/seq/map-mt32-to-gm.cpp index 4f21f24f7a..bc472935d4 100644 --- a/engines/sci/sfx/seq/map-mt32-to-gm.cpp +++ b/engines/sci/sfx/seq/map-mt32-to-gm.cpp @@ -28,6 +28,8 @@ #include <stdarg.h> #include "instrument-map.h" +namespace Sci { + #define DEBUG_MT32_TO_GM static const char @@ -797,3 +799,4 @@ sfx_instrument_map_mt32_to_gm(byte *data, size_t size) { return map; } +} // End of namespace Sci diff --git a/engines/sci/sfx/seq/oss-adlib.cpp b/engines/sci/sfx/seq/oss-adlib.cpp index 361b0ad43c..be12033efb 100644 --- a/engines/sci/sfx/seq/oss-adlib.cpp +++ b/engines/sci/sfx/seq/oss-adlib.cpp @@ -38,6 +38,8 @@ #include <sys/soundcard.h> #include <sfx_iterator.h> /* for some MIDI information */ +namespace Sci { + #if 1 SEQ_DEFINEBUF(2048); static int seqfd; @@ -363,4 +365,6 @@ sfx_sequencer_t sfx_sequencer_oss_adlib = { 0 /* Does not require any write-ahead by its own */ }; +} // End of namespace Sci + #endif /* HAVE_SYS_SOUNDCARD_H */ diff --git a/engines/sci/sfx/seq/sequencers.cpp b/engines/sci/sfx/seq/sequencers.cpp index 2f4751b963..561f4c4cf7 100644 --- a/engines/sci/sfx/seq/sequencers.cpp +++ b/engines/sci/sfx/seq/sequencers.cpp @@ -26,6 +26,8 @@ #include "../sequencer.h" #include "sci/include/resource.h" +namespace Sci { + sfx_sequencer_t *sfx_sequencers[] = { NULL }; @@ -48,3 +50,5 @@ sfx_find_sequencer(char *name) { return sfx_sequencers[n]; } } + +} // End of namespace Sci diff --git a/engines/sci/sfx/sequencer.h b/engines/sci/sfx/sequencer.h index 4bc2a2b048..6f5a20b91e 100644 --- a/engines/sci/sfx/sequencer.h +++ b/engines/sci/sfx/sequencer.h @@ -35,6 +35,8 @@ #include "sci/sfx/device.h" #include "sci/include/scitypes.h" +namespace Sci { + #define SFX_SEQ_PATCHFILE_NONE -1 typedef struct _sfx_sequencer { @@ -142,5 +144,6 @@ sfx_find_sequencer(char *name); ** if not found */ +} // End of namespace Sci #endif /* _SFX_SEQUENCER_H_ */ diff --git a/engines/sci/sfx/softseq.h b/engines/sci/sfx/softseq.h index f5acf9d428..f37a4daecf 100644 --- a/engines/sci/sfx/softseq.h +++ b/engines/sci/sfx/softseq.h @@ -31,6 +31,7 @@ #include "sci/sfx/sequencer.h" #include "sci/include/resource.h" +namespace Sci { /* Software sequencer */ typedef struct sfx_softseq { @@ -127,4 +128,6 @@ sfx_find_softseq(const char *name); ** Returns : (sfx_softseq_t *) The requested sequencer, or NULL if not found */ +} // End of namespace Sci + #endif /* !defined(SFX_SOFTSEQ_H_) */ diff --git a/engines/sci/sfx/softseq/SN76496.cpp b/engines/sci/sfx/softseq/SN76496.cpp index 8ec8eb89e4..b341fcaa64 100644 --- a/engines/sci/sfx/softseq/SN76496.cpp +++ b/engines/sci/sfx/softseq/SN76496.cpp @@ -28,6 +28,8 @@ #include "sci/sfx/softseq.h" #include "sci/include/sci_midi.h" +namespace Sci { + #define FREQUENCY 44100 #define CHANNELS_NR 3 #define VOLUME_SHIFT 3 @@ -235,3 +237,5 @@ sfx_softseq_t sfx_softseq_SN76496 = { 3, /* # of voices */ {FREQUENCY, SFX_PCM_MONO, SFX_PCM_FORMAT_S16_NATIVE} }; + +} // End of namespace Sci diff --git a/engines/sci/sfx/softseq/amiga.cpp b/engines/sci/sfx/softseq/amiga.cpp index c45807583c..815d84f17f 100644 --- a/engines/sci/sfx/softseq/amiga.cpp +++ b/engines/sci/sfx/softseq/amiga.cpp @@ -29,6 +29,8 @@ #include "common/frac.h" +namespace Sci { + #define FREQUENCY 44100 #define CHANNELS_NR 10 #define HW_CHANNELS_NR 16 @@ -635,3 +637,5 @@ sfx_softseq_t sfx_softseq_amiga = { HW_CHANNELS_NR, /* # of voices */ {FREQUENCY, SFX_PCM_STEREO_LR, SFX_PCM_FORMAT_S16_NATIVE} }; + +} // End of namespace Sci diff --git a/engines/sci/sfx/softseq/fluidsynth.cpp b/engines/sci/sfx/softseq/fluidsynth.cpp index c3ef336f80..05e99c5738 100644 --- a/engines/sci/sfx/softseq/fluidsynth.cpp +++ b/engines/sci/sfx/softseq/fluidsynth.cpp @@ -36,6 +36,8 @@ #include "../device.h" #include "resource.h" +namespace Sci { + static sfx_sequencer_t *gmseq; static fluid_settings_t* settings; static fluid_synth_t* synth; @@ -243,4 +245,6 @@ sfx_softseq_t sfx_softseq_fluidsynth = { {SAMPLE_RATE, CHANNELS, SFX_PCM_FORMAT_S16_NATIVE} }; +} // End of namespace Sci + #endif /* HAVE_FLUIDSYNTH_H */ diff --git a/engines/sci/sfx/softseq/opl2.cpp b/engines/sci/sfx/softseq/opl2.cpp index d84a114158..29f600a634 100644 --- a/engines/sci/sfx/softseq/opl2.cpp +++ b/engines/sci/sfx/softseq/opl2.cpp @@ -50,6 +50,8 @@ #include "sound/fmopl.h" +namespace Sci { + #ifdef __DC__ #define SAMPLE_RATE 22050 #define CHANNELS SFX_PCM_MONO @@ -699,3 +701,5 @@ sfx_softseq_t sfx_softseq_opl2 = { ADLIB_VOICES, /* # of voices */ {SAMPLE_RATE, CHANNELS, SFX_PCM_FORMAT_S16_NATIVE} }; + +} // End of namespace Sci diff --git a/engines/sci/sfx/softseq/pcspeaker.cpp b/engines/sci/sfx/softseq/pcspeaker.cpp index f0685914f1..c03724524d 100644 --- a/engines/sci/sfx/softseq/pcspeaker.cpp +++ b/engines/sci/sfx/softseq/pcspeaker.cpp @@ -28,6 +28,8 @@ #include "sci/sfx/softseq.h" #include "sci/include/sci_midi.h" +namespace Sci { + #define FREQUENCY 94020 static int volume = 0x0600; @@ -172,3 +174,5 @@ sfx_softseq_t sfx_softseq_pcspeaker = { 1, /* # of voices */ {FREQUENCY, SFX_PCM_MONO, SFX_PCM_FORMAT_S16_NATIVE} }; + +} // End of namespace Sci diff --git a/engines/sci/sfx/softseq/softsequencers.cpp b/engines/sci/sfx/softseq/softsequencers.cpp index e10ef6edd2..e43e9b8cda 100644 --- a/engines/sci/sfx/softseq/softsequencers.cpp +++ b/engines/sci/sfx/softseq/softsequencers.cpp @@ -29,6 +29,8 @@ #include "../softseq.h" +namespace Sci { + extern sfx_softseq_t sfx_softseq_opl2; extern sfx_softseq_t sfx_softseq_SN76496; extern sfx_softseq_t sfx_softseq_pcspeaker; @@ -64,3 +66,5 @@ sfx_find_softseq(const char *name) { return NULL; /* Not found */ } } + +} // End of namespace Sci diff --git a/engines/sci/sfx/songlib.cpp b/engines/sci/sfx/songlib.cpp index ed83223fd6..909de98da9 100644 --- a/engines/sci/sfx/songlib.cpp +++ b/engines/sci/sfx/songlib.cpp @@ -27,6 +27,8 @@ #include "sci/include/sfx_engine.h" #include "sci/include/sci_memory.h" +namespace Sci { + #define debug_stream stderr GTimeVal @@ -264,3 +266,4 @@ song_lib_dump(songlib_t songlib, int line) { } +} // End of namespace Sci diff --git a/engines/sci/sfx/test-iterator.cpp b/engines/sci/sfx/test-iterator.cpp index 8f9a1c7913..939d8ff8d6 100644 --- a/engines/sci/sfx/test-iterator.cpp +++ b/engines/sci/sfx/test-iterator.cpp @@ -28,6 +28,8 @@ #include <stdarg.h> #include <stdio.h> +using namespace Sci; + #define ASSERT_S(x) if (!(x)) { error("Failed assertion in L%d: " #x "\n", __LINE__); return; } #define ASSERT(x) ASSERT_S(x) diff --git a/engines/sci/sfx/time.cpp b/engines/sci/sfx/time.cpp index 9e366ca4d9..15d7ea5dd5 100644 --- a/engines/sci/sfx/time.cpp +++ b/engines/sci/sfx/time.cpp @@ -27,6 +27,8 @@ #include "sci/include/sfx_time.h" #include "sci/include/resource.h" +namespace Sci { + sfx_timestamp_t sfx_new_timestamp(long secs, long usecs, int frame_rate) { sfx_timestamp_t r; @@ -120,3 +122,4 @@ sfx_timestamp_gettime(sfx_timestamp_t *timestamp, long *secs, long *usecs) { *usecs = ust; } +} // End of namespace Sci diff --git a/engines/sci/sfx/timer.cpp b/engines/sci/sfx/timer.cpp index 8edb7c2097..ba2453579d 100644 --- a/engines/sci/sfx/timer.cpp +++ b/engines/sci/sfx/timer.cpp @@ -27,6 +27,7 @@ #include "engines/engine.h" #include "sci/include/sfx_timer.h" +namespace Sci { #define FREQ 60 #define DELAY (1000000 / FREQ) @@ -72,3 +73,5 @@ sfx_timer_t sfx_timer_scummvm = { &scummvm_timer_start, &scummvm_timer_stop }; + +} // End of namespace Sci diff --git a/engines/sci/sfx/timetest.cpp b/engines/sci/sfx/timetest.cpp index 40635c260f..9b50e247b0 100644 --- a/engines/sci/sfx/timetest.cpp +++ b/engines/sci/sfx/timetest.cpp @@ -27,6 +27,8 @@ #include <sfx_time.h> #include <assert.h> +using namespace Sci; + sfx_timestamp_t a, b, c; int |