From: <sv...@op...> - 2024-12-01 11:34:09
|
Author: sagamusix Date: Sun Dec 1 12:34:00 2024 New Revision: 22377 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22377 Log: [Imp] Allow Startrekker AM external sample check to also work for libopenmpt. Modified: trunk/OpenMPT/soundlib/Load_mod.cpp Modified: trunk/OpenMPT/soundlib/Load_mod.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp Sun Dec 1 12:25:15 2024 (r22376) +++ trunk/OpenMPT/soundlib/Load_mod.cpp Sun Dec 1 12:34:00 2024 (r22377) @@ -771,30 +771,34 @@ // This extra padding is probably present to have identical block sizes for AM and FM instruments. amData.Skip(120 - sizeof(AMInstrument)); } + } +#endif // MPT_EXTERNAL_SAMPLES || MPT_BUILD_FUZZER - if(!m_nInstruments) + if((loadFlags & loadSampleData) && isStartrekker && !m_nInstruments) + { + uint8 emptySampleReferences = 0; + for(SAMPLEINDEX smp = 1; smp <= 31; smp++) { - uint8 emptySampleReferences = 0; - for(SAMPLEINDEX smp = 1; smp <= 31; smp++) + if(referencedSamples[smp] && !Samples[smp].nLength) { - if(referencedSamples[smp] && !Samples[smp].nLength) + if(++emptySampleReferences > 1) { - if(++emptySampleReferences > 1) + mpt::ustring filenameHint; + if(file.GetOptionalFileName()) { - mpt::ustring filenameHint; - if(file.GetOptionalFileName()) - { - const auto filename = file.GetOptionalFileName()->GetFilename().ToUnicode(); - filenameHint = MPT_UFORMAT(" ({}.nt or {}.as)")(filename, filename); - } - AddToLog(LogWarning, MPT_UFORMAT("This Startrekker AM file is most likely missing its companion file{}. Synthesized instruments will not play.")(filenameHint)); - break; + const auto filename = file.GetOptionalFileName()->GetFilename().ToUnicode(); + filenameHint = MPT_UFORMAT(" ({}.nt or {}.as)")(filename, filename); } +#ifdef MPT_EXTERNAL_SAMPLES + AddToLog(LogWarning, MPT_UFORMAT("This Startrekker AM file is most likely missing its companion file{}. Synthesized instruments will not play.")(filenameHint)); +#else + AddToLog(LogWarning, U_("This appears to be a Startrekker AM file with external synthesizes instruments. External instruments are currently not supported.")); +#endif // MPT_EXTERNAL_SAMPLES + break; } } } } -#endif // MPT_EXTERNAL_SAMPLES || MPT_BUILD_FUZZER // His Master's Noise "Mupp" instrument extensions if((loadFlags & loadSampleData) && isHMNT) |