/*
* 2ooM: The Master of Orion II Reverse Engineering Project
* Library for working with LBX image files.
- * Copyright © 2006-2011, 2013 Nick Bowler
+ * Copyright © 2006-2011, 2013-2014 Nick Bowler
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
struct lbx_image pub;
unsigned short wtf, flags;
- unsigned char wtf2, leadin;
+ unsigned char wtf2;
unsigned short palstart, palcount;
const struct lbx_file_ops *fops;
.wtf = unpack_16_le(hdr+4),
.pub.frames = hdr[6],
.wtf2 = hdr[7],
- .leadin = hdr[8],
+ .pub.leadin = hdr[8],
.pub.chunk = hdr[9],
.flags = unpack_16_le(hdr+10),
.currentframe = -1,
};
+ if (img->flags & FLAG_OVERWRITE)
+ img->pub.chunk = 1;
+
+ if (img->flags & FLAG_LOOPING)
+ img->pub.leadin = 0;
+
return img;
}
*/
_lbx_assert(img->wtf == 0); /* version? */
_lbx_assert(img->wtf2 == 0); /* very likely is simply reserved. */
- _lbx_assert(img->pub.frames > img->leadin);
+ _lbx_assert(img->pub.frames > img->pub.leadin);
_lbx_assert(!(img->flags & ~FLAG_ALL));
/* Read all offsets. Should be merged with identical code in lbx.c */
if (img->flags & FLAG_LOOPING) {
info->loopstart = 0;
info->looping = 1;
- } else if (img->leadin != pub->frames - 1) {
- info->loopstart = img->leadin;
+ } else if (img->pub.leadin != pub->frames - 1) {
+ info->loopstart = img->pub.leadin;
info->looping = 1;
}
}