162 |
}; |
}; |
163 |
} |
} |
164 |
|
|
|
static void |
|
|
load_oxyd_datfiles (const string &soundset) |
|
|
{ |
|
|
OxydVersion oxyd_version = OxydVersion_Invalid; |
|
|
DatFile *datfile = 0; |
|
|
|
|
|
if (soundset == "oxyd1") |
|
|
oxyd_version = OxydVersion_Oxyd1; |
|
|
else if (soundset == "peroxyd") |
|
|
oxyd_version = OxydVersion_PerOxyd; |
|
|
else if (soundset == "oxydextra") |
|
|
oxyd_version = OxydVersion_OxydExtra; |
|
|
else if (soundset == "oxydmagnum") |
|
|
oxyd_version = OxydVersion_OxydMagnum; |
|
|
else if (soundset == "magnumgold") |
|
|
oxyd_version = OxydVersion_OxydMagnumGold; |
|
|
|
|
|
// Try all oxyd version to load the levels |
|
|
for (int i=OxydVersion_First; i<=OxydVersion_Last; ++i) { |
|
|
OxydVersion ver = OxydVersion(i); |
|
|
if (oxyd::FoundOxyd (ver)) { |
|
|
oxyd::OpenDatFile (ver); |
|
|
if (LevelPack *lp = oxyd::MakeLevelPack(false)) |
|
|
enigma::LevelPacks.push_back(lp); |
|
|
if (LevelPack *lp = oxyd::MakeLevelPack(true)) |
|
|
enigma::LevelPacks.push_back(lp); |
|
|
|
|
|
// Remember the desired datfile for sounds |
|
|
if (oxyd_version == OxydVersion_Invalid || oxyd_version == ver) { |
|
|
datfile = oxyd::GetDatFile(); |
|
|
oxyd_version = ver; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (datfile && soundset != "enigma") { |
|
|
oxyd::SetDatFile( datfile, oxyd_version); |
|
|
oxyd::UseOxydSounds (true); |
|
|
} |
|
|
} |
|
165 |
|
|
166 |
static void |
static void |
167 |
init() |
init() |
221 |
sound::DisableMusic(); |
sound::DisableMusic(); |
222 |
|
|
223 |
oxyd::Init(); |
oxyd::Init(); |
224 |
|
oxyd::ChangeSoundset(options::SoundSet, 1); |
|
load_oxyd_datfiles(ap.soundset); |
|
225 |
|
|
226 |
video::Init(); |
video::Init(); |
227 |
video::SetPalette("enigma.pal"); |
video::SetPalette("enigma.pal"); |