From: <sv...@op...> - 2024-12-01 11:34:43
|
Author: sagamusix Date: Sun Dec 1 12:34:21 2024 New Revision: 22378 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22378 Log: Merged revision(s) 22377 from trunk/OpenMPT: [Imp] Allow Startrekker AM external sample check to also work for libopenmpt. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Load_mod.cpp Modified: branches/OpenMPT-1.31/soundlib/Load_mod.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Load_mod.cpp Sun Dec 1 12:34:00 2024 (r22377) +++ branches/OpenMPT-1.31/soundlib/Load_mod.cpp Sun Dec 1 12:34:21 2024 (r22378) @@ -1343,30 +1343,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 // Fix VBlank MODs. Arbitrary threshold: 8 minutes (enough for "frame of mind" by Dascon...). // Basically, this just converts all tempo commands into speed commands |