long datalen;
buflen = upkg_export_read(f, buf, sizeof buf);
- if (uo->pkg->version >= 63) {
+ if (f->pkg->version >= 63) {
/*
* There's an offset to the end of the image data here; not
* clear why it's useful since it's implied by the very next
/* At this point, the current file offset should match the one recorded
* above. */
- if (uo->pkg->version >= 63 && end_offset != (f->base + f->offset))
+ if (f->pkg->version >= 63 && end_offset != (f->base + f->offset)) {
+ u_err(uo, "mipmap end offset does not match data size");
goto err_free;
+ }
/* Read in the remaining fields */
buflen = upkg_export_read(f, buf, 10);
private unsigned VBits;
private Engine:Palette *Palette;
+ private Engine:Texture *DetailTexture;
private struct engine_texture_data **mipmap_data;
private unsigned char mipmap_count;
for (int i = 0; i < self->_priv->mipmap_count; i++) {
data[i] = decode_mipmap(uo);
if (!data[i]) {
+ u_err(uo, "error decoding mipmap level %d", i);
+
/* Unwind the allocations. */
for (; i >= 0; i--)
free(data[i]);
, object_type = Engine:Palette
, link
);
+
+ property OBJECT DetailTexture
+ ( nick = "Detail Texture"
+ , blurb = "Reference to the corresponding detail texture."
+ , object_type = Engine:Texture
+ , link
+ );
}