[Scummvm-cvs-logs] SF.net SVN: scummvm:[46958] scummvm/trunk

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Jan 3 23:41:35 CET 2010


Revision: 46958
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46958&view=rev
Author:   lordhoto
Date:     2010-01-03 22:41:35 +0000 (Sun, 03 Jan 2010)

Log Message:
-----------
- Remove unsafe default constructor of Audio::Timestamp.
- Add an assert which prevents the _frameRate from being 0 in the Audio::Timestamp constructor.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/sfx/iterator/core.cpp
    scummvm/trunk/engines/sci/sfx/iterator/songlib.cpp
    scummvm/trunk/sound/timestamp.cpp
    scummvm/trunk/sound/timestamp.h

Modified: scummvm/trunk/engines/sci/sfx/iterator/core.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator/core.cpp	2010-01-03 22:11:08 UTC (rev 46957)
+++ scummvm/trunk/engines/sci/sfx/iterator/core.cpp	2010-01-03 22:41:35 UTC (rev 46958)
@@ -140,7 +140,7 @@
 };
 
 SfxPlayer::SfxPlayer(SciVersion soundVersion)
-	: _soundVersion(soundVersion) {
+	: _soundVersion(soundVersion), _wakeupTime(0, SFX_TICKS_PER_SEC), _currentTime(0, 1)  {
 	_polyphony = 0;
 
 	_mididrv = 0;

Modified: scummvm/trunk/engines/sci/sfx/iterator/songlib.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator/songlib.cpp	2010-01-03 22:11:08 UTC (rev 46957)
+++ scummvm/trunk/engines/sci/sfx/iterator/songlib.cpp	2010-01-03 22:41:35 UTC (rev 46958)
@@ -33,7 +33,7 @@
 
 #define debug_stream stderr
 
-Song::Song() {
+Song::Song() : _wakeupTime(0, SFX_TICKS_PER_SEC) {
 	_handle = 0;
 	_resourceNum = 0;
 	_priority = 0;
@@ -53,7 +53,7 @@
 	_nextStopping = NULL;
 }
 
-Song::Song(SongHandle handle, SongIterator *it, int priority) {
+Song::Song(SongHandle handle, SongIterator *it, int priority) : _wakeupTime(0, SFX_TICKS_PER_SEC) {
 	_handle = handle;
 	_resourceNum = 0;
 	_priority = priority;

Modified: scummvm/trunk/sound/timestamp.cpp
===================================================================
--- scummvm/trunk/sound/timestamp.cpp	2010-01-03 22:11:08 UTC (rev 46957)
+++ scummvm/trunk/sound/timestamp.cpp	2010-01-03 22:41:35 UTC (rev 46958)
@@ -27,12 +27,9 @@
 
 namespace Audio {
 
-Timestamp::Timestamp() :
-	_msecs(0), _frameRate(0), _frameOffset(0) {
-}
-
 Timestamp::Timestamp(uint32 m, int frameRate) :
 	_msecs(m), _frameRate(frameRate), _frameOffset(0) {
+	assert(_frameRate > 0);
 }
 
 

Modified: scummvm/trunk/sound/timestamp.h
===================================================================
--- scummvm/trunk/sound/timestamp.h	2010-01-03 22:11:08 UTC (rev 46957)
+++ scummvm/trunk/sound/timestamp.h	2010-01-03 22:41:35 UTC (rev 46958)
@@ -44,12 +44,10 @@
 	/* Total time: msecs + frame_offset/frame_rate */
 
 public:
-	Timestamp();
-
 	/**
 	 * Set up a timestamp with a given time and framerate.
-	 * @param msecs		staring time in milliseconds
-	 * @param frameRate	number of frames per second
+	 * @param msecs     staring time in milliseconds
+	 * @param frameRate number of frames per second (must be > 0)
 	 */
 	Timestamp(uint32 msecs, int frameRate);
 


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