mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-24 02:36:27 +00:00
XEEN: Properly convert script CD times to ScummVM CD frames
This commit is contained in:
parent
057fb9bc6e
commit
856b6a08f1
@ -1473,15 +1473,28 @@ bool Scripts::cmdFlipWorld(ParamsIterator ¶ms) {
|
||||
|
||||
bool Scripts::cmdPlayCD(ParamsIterator ¶ms) {
|
||||
int trackNum = params.readByte();
|
||||
int start = params.readUint16LE() * 60 / 75;
|
||||
int finish = params.readUint16LE() * 60 / 75;
|
||||
int start = params.readUint16LE();
|
||||
int finish = params.readUint16LE();
|
||||
|
||||
if (_vm->_files->_ccNum)
|
||||
trackNum += 30;
|
||||
assert(trackNum <= 60);
|
||||
|
||||
start = convertCDTime(start);
|
||||
finish = convertCDTime(finish);
|
||||
|
||||
g_system->getAudioCDManager()->play(trackNum, 1, start, finish - start, false, Audio::Mixer::kSpeechSoundType);
|
||||
return true;
|
||||
}
|
||||
|
||||
#define CD_FRAME_RATE 75
|
||||
uint Scripts::convertCDTime(uint srcTime) {
|
||||
// Times are encoded as MMSSCC - MM=Minutes, SS=Seconds, CC=Centiseconds (1/100th second)
|
||||
uint mins = srcTime / 10000;
|
||||
uint csec = srcTime % 10000;
|
||||
return (mins * 6000 + csec) * CD_FRAME_RATE / 100;
|
||||
}
|
||||
|
||||
void Scripts::doCloudsEnding() {
|
||||
g_vm->_party->_cloudsCompleted = true;
|
||||
doEnding("ENDGAME");
|
||||
|
@ -544,6 +544,11 @@ private:
|
||||
* Displays a message
|
||||
*/
|
||||
void display(bool justifyFlag, int var46);
|
||||
|
||||
/**
|
||||
* Convert a CD time from the World of Xeen playCD opcodes to ScummVM CD frame number (which is at 75Hz)
|
||||
*/
|
||||
uint convertCDTime(uint srcTime);
|
||||
public:
|
||||
int _animCounter;
|
||||
bool _eventSkipped;
|
||||
|
Loading…
Reference in New Issue
Block a user