svn-id: r47843
This commit is contained in:
Johannes Schickel 2010-02-03 09:11:55 +00:00
parent 9c1a42f9f5
commit 286786b6af
2 changed files with 7 additions and 1 deletions

View File

@ -90,6 +90,8 @@ Config::DriverId Config::detect(OplType type) {
}
// Detect the first matching emulator
drv = -1;
for (int i = 1; _drivers[i].name; ++i) {
if (_drivers[i].flags & flags) {
drv = _drivers[i].id;
@ -100,6 +102,10 @@ Config::DriverId Config::detect(OplType type) {
return drv;
}
OPL *Config::create(OplType type) {
return create(kAuto, type);
}
OPL *Config::create(DriverId driver, OplType type) {
// On invalid driver selection, we try to do some fallback detection
if (driver == -1) {

View File

@ -85,7 +85,7 @@ public:
* Wrapper to easily init an OPL chip, without specifing an emulator.
* By default it will try to initialize an OPL2 emulator, thus an AdLib card.
*/
static OPL *create(OplType type = kOpl2) { return create(detect(type), type); }
static OPL *create(OplType type = kOpl2);
private:
static const EmulatorDescription _drivers[];