diff options
Diffstat (limited to 'draw.c')
-rw-r--r-- | draw.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -41,7 +41,8 @@ add_obj(const char *path, Point off) int pc = 0; int a, b, c; float mult = 1; - unsigned int col; + unsigned int col, defcol; + defcol = 0x808080ff; if ((f = fopen(path, "r")) == NULL) { printf("%s:%d add_obj(...): Error opening file %s\n", __FILE__, __LINE__, path); @@ -62,7 +63,7 @@ add_obj(const char *path, Point off) break; case 'f': sscanf(s, "%*c %d%d%d", &a, &b, &c); - add_triangle(v[a-1], v[b-1], v[c-1], 0x808080ff); + add_triangle(v[a-1], v[b-1], v[c-1], defcol); t[0] = v[a-1]; t[0].y = 0; t[1] = v[b-1]; t[1].y = 0; t[2] = v[c-1]; t[2].y = 0; @@ -70,6 +71,9 @@ add_obj(const char *path, Point off) add_triangle(t[0], t[1], t[2], shadowcol); #endif break; + case 'C': + sscanf(s, "%*c %x", &defcol); + break; case 'F': sscanf(s, "%*c %d%d%d%x", &a, &b, &c, &col); add_triangle(v[a-1], v[b-1], v[c-1], col); |