[Scummvm-cvs-logs] SF.net SVN: scummvm:[41585] scummvm/branches/gsoc2009-mods/engines/scumm/ player_v4a.cpp

nolange at users.sourceforge.net nolange at users.sourceforge.net
Tue Jun 16 16:12:53 CEST 2009


Revision: 41585
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41585&view=rev
Author:   nolange
Date:     2009-06-16 14:12:53 +0000 (Tue, 16 Jun 2009)

Log Message:
-----------
changed musictiming again, using a 25/70 seconds as counter. 

Modified Paths:
--------------
    scummvm/branches/gsoc2009-mods/engines/scumm/player_v4a.cpp

Modified: scummvm/branches/gsoc2009-mods/engines/scumm/player_v4a.cpp
===================================================================
--- scummvm/branches/gsoc2009-mods/engines/scumm/player_v4a.cpp	2009-06-16 12:25:53 UTC (rev 41584)
+++ scummvm/branches/gsoc2009-mods/engines/scumm/player_v4a.cpp	2009-06-16 14:12:53 UTC (rev 41585)
@@ -93,12 +93,8 @@
 	byte *ptr = _vm->getResourceAddress(rtSound, nr);
 	assert(ptr);
 
-	char buf[22];
-	sprintf(buf,"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", ptr[0], ptr[1], ptr[2], ptr[3], 
-		ptr[4], ptr[5], ptr[6], ptr[7], ptr[8], ptr[9] );
-	debug("%s", buf);
+	Common::hexdump(ptr, 16);
 
-
 	static const int8 monkeyCommands[52] = {
 		 -1,  -2,  -3,  -4,  -5,  -6,  -7,  -8,
 		 -9, -10, -11, -12, -13, -14,  18,  17,
@@ -125,16 +121,20 @@
 
 		_tfmxPlay->doSong(index);
 		_musicId = nr;
-		_musicLastTicks = _tfmxPlay->getTicks();
-
+		
 		_mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle, _tfmxPlay, -1, Audio::Mixer::kMaxChannelVolume, 0, false, false);
+		_musicLastTicks = g_system->getMillis();
 	}
 }
 
 
 int Player_V4A::getMusicTimer() const {
 	if (_musicId) {
-		return (_tfmxPlay->getTicks() - _musicLastTicks) / 25;
+		// TODO: The titlesong is running with ~70 ticks per second and the scale seems to be based on that. 
+		// Other songs dont and I have no clue if this scalevalue is anything close to correct for them.
+		// The Amiga-Game doesnt counts the ticks of the song, but has an own timer and I hope thespeed is constant through the game
+		const int magicScale = 359; // ~ 1000 * 25 * (10173 / 709379.0)
+		return (_mixer->getSoundElapsedTime(_musicHandle)) / magicScale;
 	} else
 		return 0;
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list