diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/sfx/device/devices.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/engines/sci/sfx/device/devices.cpp b/engines/sci/sfx/device/devices.cpp index a2d2cd58b3..c4a9f4808f 100644 --- a/engines/sci/sfx/device/devices.cpp +++ b/engines/sci/sfx/device/devices.cpp @@ -47,23 +47,21 @@ struct _midi_device **devices[] = { devices_opl2, }; -static struct _midi_device *find_dev(int type, char *name) { +void *sfx_find_device(int type, char *name) { + struct _midi_device *dev = NULL; int i = 0; if (!type) return NULL; - if (!name) - return devices[type][0]; - - while (devices[type][i] && !strcmp(name, devices[type][i]->name)) - ++i; + if (!name) { + dev = devices[type][0]; + } else { + while (devices[type][i] && !strcmp(name, devices[type][i]->name)) + ++i; - return devices[type][i]; -} - -void *sfx_find_device(int type, char *name) { - struct _midi_device *dev = find_dev(type, name); + dev = devices[type][i]; + } if (dev) { if (dev->init(dev)) { |