diff options
Diffstat (limited to 'engines/sci/sfx')
-rw-r--r-- | engines/sci/sfx/core.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sfx/iterator.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sfx/seq/gm.cpp | 4 | ||||
-rw-r--r-- | engines/sci/sfx/seq/instrument-map.cpp | 12 | ||||
-rw-r--r-- | engines/sci/sfx/test-iterator.cpp | 4 |
5 files changed, 13 insertions, 11 deletions
diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp index 818cc05eb4..5030cde77e 100644 --- a/engines/sci/sfx/core.cpp +++ b/engines/sci/sfx/core.cpp @@ -778,7 +778,7 @@ int SfxState::sfx_add_song(SongIterator *it, int priority, song_handle_t handle, fprintf(stderr, "[sfx-core] Adding song: %08lx at %d, it=%p\n", handle, priority, it); #endif if (!it) { - fprintf(stderr, "[SFX] Attempt to add empty song with handle %08lx\n", handle); + warning("[SFX] Attempt to add empty song with handle %08lx", handle); return -1; } diff --git a/engines/sci/sfx/iterator.cpp b/engines/sci/sfx/iterator.cpp index 9e3af14cf3..173c4ab160 100644 --- a/engines/sci/sfx/iterator.cpp +++ b/engines/sci/sfx/iterator.cpp @@ -163,7 +163,7 @@ static int _parse_sci_midi_command(BaseSongIterator *self, byte *buf, } if (cmd == 0xfe) { - fprintf(stderr, "song iterator subsystem: Corrupted sound resource detected.\n"); + warning("song iterator subsystem: Corrupted sound resource detected."); return SI_FINISHED; } diff --git a/engines/sci/sfx/seq/gm.cpp b/engines/sci/sfx/seq/gm.cpp index f63f47fab1..40f6a602b8 100644 --- a/engines/sci/sfx/seq/gm.cpp +++ b/engines/sci/sfx/seq/gm.cpp @@ -23,6 +23,8 @@ * */ +#include "common/util.h" + #include "sci/tools.h" #include "sci/sfx/sequencer.h" #include "sci/sfx/device.h" @@ -36,7 +38,7 @@ static Common::Error midi_gm_open(int patch_len, byte *data, int patch2_len, byt sfx_instrument_map_t *instrument_map = sfx_instrument_map_load_sci(data, patch_len); if (!instrument_map) { - fprintf(stderr, "[GM] No GM instrument map found, trying MT-32 instrument map..\n"); + warning("[GM] No GM instrument map found, trying MT-32 instrument map.."); instrument_map = sfx_instrument_map_mt32_to_gm(data2, patch2_len); } diff --git a/engines/sci/sfx/seq/instrument-map.cpp b/engines/sci/sfx/seq/instrument-map.cpp index d9218d8a5b..2246d517db 100644 --- a/engines/sci/sfx/seq/instrument-map.cpp +++ b/engines/sci/sfx/seq/instrument-map.cpp @@ -151,7 +151,7 @@ sfx_instrument_map_t *sfx_instrument_map_load_sci(byte *data, size_t size) { return NULL; if (size < PATCH_MIN_SIZE) { - fprintf(stderr, "[instrument-map] Instrument map too small: %d of %d\n", (int) size, PATCH_MIN_SIZE); + warning("[instrument-map] Instrument map too small: %d of %d", (int) size, PATCH_MIN_SIZE); return NULL; } @@ -161,12 +161,12 @@ sfx_instrument_map_t *sfx_instrument_map_load_sci(byte *data, size_t size) { map->initialisation_block_size = (int16)READ_LE_UINT16(data + PATCH_INIT_DATA_SIZE_LE); if (map->initialisation_block_size) { if (size < PATCH_MIN_SIZE + map->initialisation_block_size) { - fprintf(stderr, "[instrument-map] Instrument map too small for initialisation block: %d of %d\n", (int) size, PATCH_MIN_SIZE); + warning("[instrument-map] Instrument map too small for initialisation block: %d of %d", (int) size, PATCH_MIN_SIZE); return NULL; } if (size > PATCH_MIN_SIZE + map->initialisation_block_size) - fprintf(stderr, "[instrument-map] Instrument larger than required by initialisation block: %d of %d\n", (int) size, PATCH_MIN_SIZE); + warning("[instrument-map] Instrument larger than required by initialisation block: %d of %d", (int) size, PATCH_MIN_SIZE); if (map->initialisation_block_size != 0) { map->initialisation_block = (byte *)malloc(map->initialisation_block_size); @@ -254,7 +254,7 @@ static void close_decorated(decorated_midi_writer_t *self) { static int bound_hard_127(int i, const char *descr) { int r = BOUND_127(i); if (r != i) - fprintf(stderr, "[instrument-map] Hard-clipping %02x to %02x in %s\n", i, r, descr); + warning("[instrument-map] Hard-clipping %02x to %02x in %s", i, r, descr); return r; } @@ -423,7 +423,7 @@ static void init(midi_writer_t *writer, byte *data, size_t len) { byte *find = (byte *) memchr(data + offset, 0xf7, len - offset); if (!find) { - fprintf(stderr, "[instrument-map] Failed to find end of sysex message\n"); + warning("[instrument-map] Failed to find end of sysex message"); return; } @@ -455,7 +455,7 @@ static void init(midi_writer_t *writer, byte *data, size_t len) { } if (args + offset > len) { - fprintf(stderr, "[instrument-map] Insufficient bytes remaining for MIDI command %02x\n", op); + warning("[instrument-map] Insufficient bytes remaining for MIDI command %02x", op); return; } diff --git a/engines/sci/sfx/test-iterator.cpp b/engines/sci/sfx/test-iterator.cpp index d4626b5fcb..a2dce5d088 100644 --- a/engines/sci/sfx/test-iterator.cpp +++ b/engines/sci/sfx/test-iterator.cpp @@ -176,7 +176,7 @@ void test_simple_it() { ASSERT_NEXT(4); ASSERT_CUE(2); ASSERT_SIT; -// fprintf(stderr, "XXX => %d\n", songit_next(&it, data, &result, IT_READER_MASK_ALL)); +// warning("XXX => %d", songit_next(&it, data, &result, IT_READER_MASK_ALL)); ASSERT_NEXT(35); ASSERT_NEXT(SI_FINISHED); ASSERT_SIT; @@ -418,6 +418,6 @@ int main(int argc, char **argv) { test_iterator_sci0_loop(); test_iterator_sci0_mark_loop(); if (errors != 0) - fprintf(stderr, "[ERROR] %d errors total.\n", errors); + warning("[ERROR] %d errors total.", errors); return (errors != 0); } |