Fix PixTone sounds missing their ends

I was accidentally replicating a bug from the original code in the
wrong place. I should probably comment on that bug in the accurate
branch.
This commit is contained in:
Clownacy 2019-09-05 21:39:38 +00:00
parent 12f69e3c6c
commit 46fdc08ecd

View file

@ -248,7 +248,7 @@ int MakePixToneObject(const PIXTONEPARAMETER *ptp, int ptp_num, int no)
++ptp_pointer;
}
lpSECONDARYBUFFER[no] = AudioBackend_CreateSound(22050, ptp->size);
lpSECONDARYBUFFER[no] = AudioBackend_CreateSound(22050, sample_count);
if (lpSECONDARYBUFFER[no] == NULL)
return -1;
@ -306,7 +306,7 @@ int MakePixToneObject(const PIXTONEPARAMETER *ptp, int ptp_num, int no)
unsigned char *buffer = AudioBackend_LockSound(lpSECONDARYBUFFER[no], NULL);
memcpy(buffer, mixed_pcm_buffer, ptp->size);
memcpy(buffer, mixed_pcm_buffer, sample_count);
AudioBackend_UnlockSound(lpSECONDARYBUFFER[no]);