index a5c83646ff18937ecf004e228250272b3af25b05..aa843dfba137b59c736efbd1a9537c69571e95c8 100644 (file)
e_SoundsArray: array of TSoundRec = nil;
e_ZeroPosition: array [0..2] of ALfloat = (0, 0, 0);
e_ALError: ALenum = 0;
+ e_SoundFont: string = '';
+ e_MusicLerp: Boolean = True;
implementation
e_SoundsArray[find_id].Loader := Loader;
end;
+ // the calling side won't free this, the loader will get a copy, so fuck it
+ FreeMem(pData);
ID := find_id;
Result := True;
end;
e_SoundsArray[find_id].Loader := Loader;
end;
+ // the calling side won't free this, the loader will get a copy, so fuck it
+ FreeMem(pData);
ID := find_id;
Result := True;
end;
end;
procedure AssignSound(ID: DWORD; Src: ALuint); inline;
+var
+ S: ALint;
begin
alGetError(); // reset error state
// this is a stream
// reset position
e_SoundsArray[ID].Loader.SetPosition(0);
- if CurStream <> ID then // changing streams, stop the thing just in case
- alSourceStop(Src);
+ if CurStream <> ID then // changing streams
+ begin
+ alSourceStop(Src); // this should mark all buffers as processed
+ alGetSourcei(Src, AL_BUFFERS_PROCESSED, S);
+ // unqueue all buffers
+ if S > 0 then
+ begin
+ alSourceUnqueueBuffers(Src, S, @alStreamBufs[alStreamAvail]);
+ alStreamAvail := NUM_STREAM_BUFFERS;
+ end;
+ end;
// this shit is playing now
CurStream := ID;
end
function TBasicSound.GetPan(): Single;
var
- Pos: array [0..2] of ALfloat;
+ Pos: array [0..2] of ALfloat = (0, 0, 0);
begin
Result := 0.0;
if InvalidSource() then