Mercurial > hg > dmlib
changeset 1657:2b6dbdd602b5
Split IFF chunk id string from id creation into separate function.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 30 May 2018 13:48:27 +0300 |
parents | 2de258f2eb2e |
children | c005d84e9bf8 |
files | tools/libgfx.c |
diffstat | 1 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/libgfx.c Wed May 30 13:21:14 2018 +0300 +++ b/tools/libgfx.c Wed May 30 13:48:27 2018 +0300 @@ -1498,6 +1498,16 @@ } +static void dmMakeIFFChunkIDStr(DMIFFChunk *chunk) +{ + chunk->idStr[0] = (chunk->id >> 24) & 0xff; + chunk->idStr[1] = (chunk->id >> 16) & 0xff; + chunk->idStr[2] = (chunk->id >> 8) & 0xff; + chunk->idStr[3] = (chunk->id) & 0xff; + chunk->idStr[4] = 0; +} + + static int dmReadIFFChunkHdr(DMResource *fp, DMIFFChunk *chunk) { if (!dmf_read_be32(fp, &chunk->id) || @@ -1508,11 +1518,7 @@ } else { - chunk->idStr[0] = (chunk->id >> 24) & 0xff; - chunk->idStr[1] = (chunk->id >> 16) & 0xff; - chunk->idStr[2] = (chunk->id >> 8) & 0xff; - chunk->idStr[3] = (chunk->id) & 0xff; - chunk->idStr[4] = 0; + dmMakeIFFChunkIDStr(chunk); return DMERR_OK; } }