#undef _CHECK_WRITE
+void raster_draw_model(raster_t* p, const model_t* model)
+{
+#if VERBOSITY >= 4
+#define PROGRESS_FMT "\033[80D\033[2K %s\t %9d / %d"
+ int tri;
+#endif
+
+ model_transformation(model, &p->model);
+ p->dirty = true;
+ raster_material(p, model_specular(model), model_shininess(model));
+ IF_RENDER_PROGRESS(tri = 0);
+ for (const list_t* ti = model_geometry(model); ti; ti = ti->link) {
+#if VERBOSITY >= 4
+ if (++tri % 100 == 0) {
+ printf(PROGRESS_FMT, model_name(model), tri, model_size(model));
+ fflush(stdout);
+ }
+#endif
+ raster_draw_tri(p, (tri_t*)ti->val);
+ }
+#if VERBOSITY >= 4
+ printf(PROGRESS_FMT"\n", model_name(model), tri, model_size(model));
+#endif
+}
+
+
/*
* See if the triangle is at all visible in the viewport. Also, minimize the
* rectangle around the area that includes the triangle.
#if LIGHTING >= 1
tri_t tl = tri_transform(*triangle, p->model);
-#if !PRE_NORMALS
- tl.a.n = tl.b.n = tl.c.n = vec_normalize(tri_normal(tl));
-#endif
#endif
#if LIGHTING == 1