mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-12-25 12:54:51 +01:00
00c1a3abdb
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@18 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
29 lines
925 B
C
29 lines
925 B
C
#include "nolayout.h"
|
|
#include "../vgmstream.h"
|
|
|
|
void render_vgmstream_nolayout(sample * buffer, int32_t sample_count, VGMSTREAM * vgmstream) {
|
|
int samples_written=0;
|
|
|
|
const int samples_this_block = vgmstream->num_samples;
|
|
int samples_per_frame = get_vgmstream_samples_per_frame(vgmstream);
|
|
|
|
while (samples_written<sample_count) {
|
|
int samples_to_do;
|
|
|
|
if (vgmstream->loop_flag && vgmstream_do_loop(vgmstream)) {
|
|
continue;
|
|
}
|
|
|
|
samples_to_do = vgmstream_samples_to_do(samples_this_block, samples_per_frame, vgmstream);
|
|
|
|
if (samples_written+samples_to_do > sample_count)
|
|
samples_to_do=sample_count-samples_written;
|
|
|
|
decode_vgmstream(vgmstream, samples_written, samples_to_do, buffer);
|
|
|
|
samples_written += samples_to_do;
|
|
vgmstream->current_sample += samples_to_do;
|
|
vgmstream->samples_into_block+=samples_to_do;
|
|
}
|
|
}
|