aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Marshall <trap15@raidenii.net>2010-08-19 22:32:19 -0700
committerAlex Marshall <trap15@raidenii.net>2010-08-19 22:32:19 -0700
commit77030871c6e58c7b4e2bfc655f344dd0061f2544 (patch)
tree7bd306380255ee29fc4afb1376de0e7c37eec879
parent73b4e1f509ab872ef8bde7db7124fee2e2e91998 (diff)
Fixed multi-tpl building (for both BMP and PNG)
-rw-r--r--zetsubou/tpl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/zetsubou/tpl.c b/zetsubou/tpl.c
index 8057424..893ad3b 100644
--- a/zetsubou/tpl.c
+++ b/zetsubou/tpl.c
@@ -888,6 +888,7 @@ int TPL_ConvertFromGDs(const u32 count, char *gds[], char outname[], u32 format,
}
u8* imagedatas[256];
u32 imagesizes[256];
+ u32 curoff = 0;
for(i = 0; i < count; i++) {
printf("Handling %d/%d\n", i + 1, count);
FILE* gdfp = fopen(gds[i], "rb");
@@ -975,7 +976,8 @@ int TPL_ConvertFromGDs(const u32 count, char *gds[], char outname[], u32 format,
memset(&h, 0, sizeof(TPL_header));
fflush(stdout);
h.format = be32(format);
- h.offs = be32(12 + (8 * count) + (36 * count));
+ h.offs = be32(12 + (8 * count) + (36 * count) + curoff);
+ curoff += ret;
printf("Dimensions: %dx%d\n", width, height);
h.width = be16(width);
h.height = be16(height);
@@ -1197,6 +1199,7 @@ int TPL_ConvertFromBMPs(const u32 count, char *bmps[], char outname[], u32 forma
}
u8* imagedatas[256];
u32 imagesizes[256];
+ u32 curoff = 0;
for(i = 0; i < count; i++) {
printf("Handling %d/%d\n", i + 1, count);
FILE* bmpfp = fopen(bmps[i], "rb");
@@ -1316,7 +1319,8 @@ int TPL_ConvertFromBMPs(const u32 count, char *bmps[], char outname[], u32 forma
memset(&h, 0, sizeof(TPL_header));
fflush(stdout);
h.format = be32(format);
- h.offs = be32(12 + (8 * count) + (36 * count));
+ h.offs = be32(12 + (8 * count) + (36 * count) + curoff);
+ curoff += ret;
printf("Dimensions: %dx%d\n", bi.width, bi.height);
h.width = be16(bi.width);
h.height = be16(bi.height);