Formatting tweaks

This commit is contained in:
NicknineTheEagle 2018-08-07 21:27:52 +03:00
parent 0113a56870
commit 20c729ae72

View File

@ -39,17 +39,17 @@ static STREAMFILE * setup_bao_streamfile(ubi_bao_header *bao, STREAMFILE *stream
/* .PK - packages with BAOs from Ubisoft's sound engine ("DARE") games in 2008+ */ /* .PK - packages with BAOs from Ubisoft's sound engine ("DARE") games in 2008+ */
VGMSTREAM * init_vgmstream_ubi_bao_pk(STREAMFILE *streamFile) { VGMSTREAM * init_vgmstream_ubi_bao_pk(STREAMFILE *streamFile) {
ubi_bao_header bao = {0}; ubi_bao_header bao = { 0 };
/* checks */ /* checks */
if (!check_extensions(streamFile, "pk,lpk")) if (!check_extensions(streamFile, "pk,lpk"))
goto fail; goto fail;
/* .pk+spk (or .lpk+lspk) is a database-like format, evolved from Ubi sb0/sm0+sp0. /* .pk+spk (or .lpk+lspk) is a database-like format, evolved from Ubi sb0/sm0+sp0.
* .pk has "BAO" headers pointing to internal or external .spk resources (also BAOs). */ * .pk has "BAO" headers pointing to internal or external .spk resources (also BAOs). */
/* main parse */ /* main parse */
if ( !parse_pk_header(&bao, streamFile) ) if (!parse_pk_header(&bao, streamFile))
goto fail; goto fail;
return init_vgmstream_ubi_bao_main(&bao, streamFile); return init_vgmstream_ubi_bao_main(&bao, streamFile);
@ -60,7 +60,7 @@ fail:
#if 0 #if 0
/* .BAO - files with a single BAO from Ubisoft's sound engine ("DARE") games in 2008+ */ /* .BAO - files with a single BAO from Ubisoft's sound engine ("DARE") games in 2008+ */
VGMSTREAM * init_vgmstream_ubi_bao_file(STREAMFILE *streamFile) { VGMSTREAM * init_vgmstream_ubi_bao_file(STREAMFILE *streamFile) {
ubi_bao_header bao = {0}; ubi_bao_header bao = { 0 };
/* checks */ /* checks */
if (!check_extensions(streamFile, "bao")) if (!check_extensions(streamFile, "bao"))
@ -71,8 +71,8 @@ VGMSTREAM * init_vgmstream_ubi_bao_file(STREAMFILE *streamFile) {
* The bigfile acts as index, but external files can be opened as are named after their id. * The bigfile acts as index, but external files can be opened as are named after their id.
* Extension isn't always given but is .bao in some games. */ * Extension isn't always given but is .bao in some games. */
/* main parse */ /* main parse */
if ( !parse_bao_header(&bao, streamFile) ) if (!parse_bao_header(&bao, streamFile))
goto fail; goto fail;
return init_vgmstream_ubi_bao_main(&bao, streamFile); return init_vgmstream_ubi_bao_main(&bao, streamFile);
@ -92,7 +92,7 @@ static VGMSTREAM * init_vgmstream_ubi_bao_main(ubi_bao_header * bao, STREAMFILE
if (!streamData) goto fail; if (!streamData) goto fail;
/* build the VGMSTREAM */ /* build the VGMSTREAM */
vgmstream = allocate_vgmstream(bao->channels,loop_flag); vgmstream = allocate_vgmstream(bao->channels, loop_flag);
if (!vgmstream) goto fail; if (!vgmstream) goto fail;
vgmstream->num_samples = bao->num_samples; vgmstream->num_samples = bao->num_samples;
@ -101,7 +101,7 @@ static VGMSTREAM * init_vgmstream_ubi_bao_main(ubi_bao_header * bao, STREAMFILE
vgmstream->stream_size = bao->stream_size; vgmstream->stream_size = bao->stream_size;
vgmstream->meta_type = meta_UBI_BAO; vgmstream->meta_type = meta_UBI_BAO;
switch(bao->codec) { switch (bao->codec) {
case UBI_ADPCM: { case UBI_ADPCM: {
vgmstream->coding_type = coding_UBI_IMA; vgmstream->coding_type = coding_UBI_IMA;
vgmstream->layout_type = layout_none; vgmstream->layout_type = layout_none;
@ -138,12 +138,12 @@ static VGMSTREAM * init_vgmstream_ubi_bao_main(ubi_bao_header * bao, STREAMFILE
off_t header_offset; off_t header_offset;
if (bao->version == 0x00230008) { if (bao->version == 0x00230008) {
chunk_size = 0x2c;
is_xma2_old = 1; is_xma2_old = 1;
chunk_size = 0x2c;
} }
else { else {
chunk_size = (bao->codec == RAW_XMA1) ? 0x20 : 0x34;
is_xma2_old = 0; is_xma2_old = 0;
chunk_size = (bao->codec == RAW_XMA1) ? 0x20 : 0x34;
} }
if (bao->is_external) { if (bao->is_external) {