buffer up all the audio upfront
This commit is contained in:
@@ -6,14 +6,12 @@
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
#endregion
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Widgets;
|
||||
using OpenRA.FileFormats;
|
||||
|
||||
namespace OpenRA.Widgets
|
||||
{
|
||||
@@ -37,19 +35,22 @@ namespace OpenRA.Widgets
|
||||
int lastTime;
|
||||
bool advanceNext = false;
|
||||
public override void DrawInner(World world)
|
||||
{
|
||||
if (video == null)
|
||||
LoadVideo(Video);
|
||||
{
|
||||
if (video == null)
|
||||
{
|
||||
LoadVideo(Video);
|
||||
Sound.PlayRaw(video.AudioData);
|
||||
}
|
||||
|
||||
int t = Environment.TickCount;
|
||||
int dt = t - lastTime;
|
||||
|
||||
if (advanceNext)
|
||||
{
|
||||
{
|
||||
if (video.CurrentFrame == 0)
|
||||
Sound.PlayRaw(video.AudioData);
|
||||
advanceNext = false;
|
||||
video.AdvanceFrame();
|
||||
|
||||
Sound.PlayRaw(video.AudioData);
|
||||
video.AdvanceFrame();
|
||||
}
|
||||
|
||||
if (dt > timestep)
|
||||
|
||||
Reference in New Issue
Block a user