]> git.draconx.ca Git - upkg.git/blobdiff - src/engine/texture.gob
uobject: First stab at a generic logging mechanism.
[upkg.git] / src / engine / texture.gob
index 3db176e045982b31de94268bed9031a7f63cf889..8059c3adb9503bc149b6063a93ac28d108b84873 100644 (file)
@@ -84,8 +84,10 @@ struct engine_texture_data *decode_mipmap(UObject *uo)
 
        /* 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 (uo->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);
@@ -136,6 +138,8 @@ class Engine:Texture from U:Object (dynamic)
                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]);