From 1c77b2daf88c465c8f8cffddff65f8a7bca1af89 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 24 Feb 2015 00:47:21 +0200 Subject: LAB: Implement correct duration calculation for the DOS version music --- engines/lab/labmusic.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'engines/lab') diff --git a/engines/lab/labmusic.cpp b/engines/lab/labmusic.cpp index cd082700ca..4a427eded0 100644 --- a/engines/lab/labmusic.cpp +++ b/engines/lab/labmusic.cpp @@ -33,6 +33,7 @@ #include "lab/timing.h" #include "lab/mouse.h" #include "lab/vga.h" +#include "lab/lab.h" namespace Lab { @@ -470,8 +471,10 @@ byte **Music::newOpen(const char *name) { if (_musicOn) { updateMusic(); - LeftSecs = (getManyBuffersLeft() * MUSICBUFSIZE * 10) / (2 * SAMPLESPEED); // Windows (16-bit) - //LeftSecs = (getManyBuffersLeft() * MUSICBUFSIZE * 10) / SAMPLESPEED; // DOS (8-bit) - TODO + if (g_lab->getPlatform() == Common::kPlatformWindows) + LeftSecs = (getManyBuffersLeft() * MUSICBUFSIZE * 10) / (2 * SAMPLESPEED); // Windows (16-bit) + else + LeftSecs = (getManyBuffersLeft() * MUSICBUFSIZE * 10) / SAMPLESPEED; // DOS (8-bit) filelength = sizeOfFile(name) * 10; Time = 10 + /* Seek time for the music and the file */ @@ -507,8 +510,10 @@ void Music::fileCheckMusic(uint32 filelength) { updateMusic(); - LeftSecs = (getManyBuffersLeft() * MUSICBUFSIZE * 10) / (2 * SAMPLESPEED); // Windows (16-bit) - //LeftSecs = (getManyBuffersLeft() * MUSICBUFSIZE * 10) / SAMPLESPEED; // DOS (8-bit) - TODO + if (g_lab->getPlatform() == Common::kPlatformWindows) + LeftSecs = (getManyBuffersLeft() * MUSICBUFSIZE * 10) / (2 * SAMPLESPEED); // Windows (16-bit) + else + LeftSecs = (getManyBuffersLeft() * MUSICBUFSIZE * 10) / SAMPLESPEED; // DOS (8-bit) filelength *= 10; Time = 5 + /* Seek time for the music */ -- cgit v1.2.3