From 7434f6079f57874495a6c448373c4ee81b155b28 Mon Sep 17 00:00:00 2001 From: iobyte Date: Tue, 9 Jun 2020 19:30:08 +0000 Subject: [PATCH] ac3d editor can read and write floating point material shi field even though it is an int in the standard so make accc read float but output int git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7138 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 7785d217b31cfd68250e6cb551eaf5bdff14c538 Former-commit-id: bae8ac5483f249e1f58d0fc069eebaf8e4524941 --- src/tools/accc/ac3dload.cpp | 6 +++--- src/tools/accc/accc.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tools/accc/ac3dload.cpp b/src/tools/accc/ac3dload.cpp index b1c442cc4..ba26c25f1 100644 --- a/src/tools/accc/ac3dload.cpp +++ b/src/tools/accc/ac3dload.cpp @@ -630,7 +630,7 @@ int doMaterial(char *Line, ob_t *object, mat_t *material) return (-1); } sscanf(p, - "%s rgb %lf %lf %lf amb %lf %lf %lf emis %lf %lf %lf spec %lf %lf %lf shi %d trans %lf", + "%s rgb %lf %lf %lf amb %lf %lf %lf emis %lf %lf %lf spec %lf %lf %lf shi %lf trans %lf", name, &(materialt->rgb.r), &(materialt->rgb.g), &(materialt->rgb.b), &(materialt->amb.r), &(materialt->amb.g), &(materialt->amb.b), &(materialt->emis.r), &(materialt->emis.g), &(materialt->emis.b), @@ -3085,7 +3085,7 @@ void computeSaveOBJ(char * OutputFilename, ob_t * object) tmat->emis.g, tmat->emis.b); fprintf(tfile, "Ks %lf %lf %lf\n", tmat->spec.r, tmat->spec.g, tmat->spec.b); - fprintf(tfile, "Ns %d\n", tmat->shi); + fprintf(tfile, "Ns %d\n", (int)tmat->shi); fprintf(tfile, "map_kd %s\n", tmpob->texture); break; } @@ -3638,7 +3638,7 @@ void stripifyOb(ob_t * object, int writeit) object->textarray[v0 * 2 + 1]); if (object->texture1) { - fprintf(ofile, " %.5f %.5f ", object->textarray1[v0 * 2], + fprintf(ofile, " %.5f %.5f", object->textarray1[v0 * 2], object->textarray1[v0 * 2 + 1]); } if (object->texture2) diff --git a/src/tools/accc/accc.h b/src/tools/accc/accc.h index 5c3a63ca4..c53780998 100644 --- a/src/tools/accc/accc.h +++ b/src/tools/accc/accc.h @@ -218,7 +218,7 @@ typedef struct mat color_t amb; color_t emis; color_t spec; - int shi; + double shi; double trans; struct mat * next; } mat_t;