From 6c5ba07bdba2de9d903e42f264be488661975855 Mon Sep 17 00:00:00 2001 From: quou Date: Tue, 1 Oct 2024 23:12:46 +1000 Subject: Pad asset files to align properly. --- convcom.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 convcom.c (limited to 'convcom.c') diff --git a/convcom.c b/convcom.c new file mode 100644 index 0000000..b3818c9 --- /dev/null +++ b/convcom.c @@ -0,0 +1,14 @@ +#include "config.h" + +int align_size(int s, int a) { + return (s + (a - 1)) & -a; +} + +void pad_file(int size, FILE* outfile) { + const char n = 0; + int as = align_size(size, allocation_default_alignment); + int i = as - size; + for (; i; i--) + fwrite(&n, 1, 1, outfile); +} + -- cgit v1.2.3-54-g00ecf