]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Fix nametag hiding
authorest31 <MTest31@outlook.com>
Fri, 1 Apr 2016 23:43:34 +0000 (01:43 +0200)
committerest31 <MTest31@outlook.com>
Sat, 2 Apr 2016 00:02:19 +0000 (02:02 +0200)
Commit

c3b279750ece0b5144bf8e973d55108347462223 "Move object nametags to camera"

has added a regression to still display
a shadow if their alpha got set to 0.

src/camera.cpp

index 6c0f5d5465e0b19db070ec1b69a0c506d9aa71f9..6893b8cbfde7cd9a9a88e9b2d70f3a54657ad876 100644 (file)
@@ -540,6 +540,12 @@ void Camera::drawNametags()
                        i = m_nametags.begin();
                        i != m_nametags.end(); ++i) {
                Nametag *nametag = *i;
+               if (nametag->nametag_color.getAlpha() == 0) {
+                       // Enforce hiding nametag,
+                       // because if freetype is enabled, a grey
+                       // shadow can remain.
+                       continue;
+               }
                v3f pos = nametag->parent_node->getPosition() + v3f(0.0, 1.1 * BS, 0.0);
                f32 transformed_pos[4] = { pos.X, pos.Y, pos.Z, 1.0f };
                trans.multiplyWith1x4Matrix(transformed_pos);