early-access version 1667

This commit is contained in:
pineappleEA
2021-05-09 11:30:38 +02:00
parent 5e268d25d7
commit 5dbb928ff2
1069 changed files with 38272 additions and 14437 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -33,20 +33,20 @@ callback_data cbd[64];
void SDLCALL
play_through_once(void *arg, Uint8 * stream, int len)
{
callback_data *cbd = (callback_data *) arg;
Uint8 *waveptr = sound + cbd->soundpos;
int waveleft = soundlen - cbd->soundpos;
callback_data *cbdata = (callback_data *) arg;
Uint8 *waveptr = sound + cbdata->soundpos;
int waveleft = soundlen - cbdata->soundpos;
int cpy = len;
if (cpy > waveleft)
cpy = waveleft;
SDL_memcpy(stream, waveptr, cpy);
len -= cpy;
cbd->soundpos += cpy;
cbdata->soundpos += cpy;
if (len > 0) {
stream += cpy;
SDL_memset(stream, spec.silence, len);
SDL_AtomicSet(&cbd->done, 1);
SDL_AtomicSet(&cbdata->done, 1);
}
}