vgmstream/src/layout/wsi_blocked.c
halleyscometsw 98e0469264 add .wsi support
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@260 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
2008-06-29 01:30:13 +00:00

24 lines
845 B
C

#include "layout.h"
#include "../vgmstream.h"
/* set up for the block at the given offset */
void wsi_block_update(off_t block_offset, VGMSTREAM * vgmstream) {
int i;
/* assume that all channels have the same size for this block */
vgmstream->current_block_offset = block_offset;
/* current_block_size is the data size in this block, so subtract header */
vgmstream->current_block_size = read_32bitBE(
vgmstream->current_block_offset,
vgmstream->ch[0].streamfile) - 0x10;
vgmstream->next_block_offset =
vgmstream->current_block_offset +
(vgmstream->current_block_size + 0x10) * vgmstream->channels;
for (i=0;i<vgmstream->channels;i++) {
vgmstream->ch[i].offset = vgmstream->current_block_offset +
0x10 + (vgmstream->current_block_size+0x10)*i;
}
}