summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-09-28 11:53:19 +0000
committerrodri <rgl@antares-labs.eu>2024-09-28 11:53:19 +0000
commitb82c104fddd692f82baeb370a3b8e6d058fe3d2b (patch)
treeeec02d342f8ef3ead2ad01fc61e075f184c0a6ee /marshal.c
parentcdfd05b4e5b4ffedae1a4fffa46f1217a88d09ee (diff)
downloadlibgraphics-b82c104fddd692f82baeb370a3b8e6d058fe3d2b.tar.gz
libgraphics-b82c104fddd692f82baeb370a3b8e6d058fe3d2b.tar.bz2
libgraphics-b82c104fddd692f82baeb370a3b8e6d058fe3d2b.zip
marshal: don't die if textures can't be written. show a warning and move on.
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/marshal.c b/marshal.c
index 7bc23c6..924206d 100644
--- a/marshal.c
+++ b/marshal.c
@@ -789,7 +789,6 @@ Bprintprim(Biobuf *b, Wireprim *p)
return n;
}
-/* TODO how do we deal with textures? embedded? keep a path? */
static int
Bprintmtl(Biobuf *b, Material *m)
{
@@ -968,7 +967,7 @@ exportmodel(char *path, Model *m)
sysfatal(Esmallbuf);
if(exporttexture(buf, mtl->diffusemap) < 0)
- return -1;
+ fprint(2, "warning: %r\n");
// if(mtl->diffusemap->file == nil)
mtl->diffusemap->file = estrdup(strrchr(buf, '/')+1);
@@ -979,7 +978,7 @@ exportmodel(char *path, Model *m)
sysfatal(Esmallbuf);
if(exporttexture(buf, mtl->specularmap) < 0)
- return -1;
+ fprint(2, "warning: %r\n");
// if(mtl->specularmap->file == nil)
mtl->specularmap->file = estrdup(strrchr(buf, '/')+1);
@@ -990,7 +989,7 @@ exportmodel(char *path, Model *m)
sysfatal(Esmallbuf);
if(exporttexture(buf, mtl->normalmap) < 0)
- return -1;
+ fprint(2, "warning: %r\n");
// if(mtl->normalmap->file == nil)
mtl->normalmap->file = estrdup(strrchr(buf, '/')+1);