Fix detection of transparent meshes.
SSurface::TriangulateInto first populates the mesh with triangles that have no color, and then paints them, which confused the code that detects if a mesh is transparent into thinking that all of them are; and that broke the "draw back faces in red" feature, since it is disabled for transparent meshes.
This commit is contained in:
parent
73844f7202
commit
9a0f2c3601
|
@ -43,6 +43,7 @@ Other new features:
|
|||
Bug fixes:
|
||||
* Do not crash when applying a symmetry constraint to two points.
|
||||
* Fix TTF font metrics again (properly this time).
|
||||
* Fix the "draw back faces in red" option.
|
||||
* Various minor crashes.
|
||||
|
||||
2.2
|
||||
|
|
|
@ -34,7 +34,8 @@ void SMesh::AddTriangle(STriMeta meta, Vector a, Vector b, Vector c) {
|
|||
AddTriangle(&t);
|
||||
}
|
||||
void SMesh::AddTriangle(const STriangle *st) {
|
||||
if(st->meta.color.alpha != 255) isTransparent = true;
|
||||
RgbaColor color = st->meta.color;
|
||||
if(!color.IsEmpty() && color.alpha != 255) isTransparent = true;
|
||||
l.Add(st);
|
||||
}
|
||||
|
||||
|
|
|
@ -424,6 +424,7 @@ void SSurface::TriangulateInto(SShell *shell, SMesh *sm) {
|
|||
for(i = start; i < sm->l.n; i++) {
|
||||
STriangle *st = &(sm->l.elem[i]);
|
||||
st->meta = meta;
|
||||
if(st->meta.color.alpha != 255) sm->isTransparent = true;
|
||||
st->an = NormalAt(st->a.x, st->a.y);
|
||||
st->bn = NormalAt(st->b.x, st->b.y);
|
||||
st->cn = NormalAt(st->c.x, st->c.y);
|
||||
|
|
Loading…
Reference in New Issue
Block a user