From ce4b2cba82398577edf04cce8abccf95bd93ea32 Mon Sep 17 00:00:00 2001 From: tobigun Date: Fri, 15 Aug 2008 18:52:50 +0000 Subject: Race-Conditions fixed in recording stuff. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1267 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UDraw.pas | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Game/Code/Classes/UDraw.pas') diff --git a/Game/Code/Classes/UDraw.pas b/Game/Code/Classes/UDraw.pas index e405ec07..ff0920f5 100644 --- a/Game/Code/Classes/UDraw.pas +++ b/Game/Code/Classes/UDraw.pas @@ -173,13 +173,17 @@ begin; MaxX := W-1; MaxY := (H-1) / 2; + Sound.LockAnalysisBuffer(); + glBegin(GL_LINE_STRIP); - for SampleIndex := 0 to High(Sound.BufferArray) do + for SampleIndex := 0 to High(Sound.AnalysisBuffer) do begin - glVertex2f(X + MaxX * SampleIndex/High(Sound.BufferArray), - Y + MaxY * (1 - Sound.BufferArray[SampleIndex]/-Low(Smallint))); + glVertex2f(X + MaxX * SampleIndex/High(Sound.AnalysisBuffer), + Y + MaxY * (1 - Sound.AnalysisBuffer[SampleIndex]/-Low(Smallint))); end; glEnd; + + Sound.UnlockAnalysisBuffer(); end; -- cgit v1.2.3