- Clear colors when reading property info.
authorRob Blanckaert <rob@withpiper.com>
Sun, 22 Oct 2017 18:41:57 +0000 (11:41 -0700)
committersfan5 <sfan5@live.de>
Mon, 25 Dec 2017 14:00:25 +0000 (15:00 +0100)
- Set vertex colors on upright_sprites.

src/content_cao.cpp
src/object_properties.cpp

index 9d87c733e92d6552d1b0e7634488e0ea45df1f1b..a8b4ae2e1e830d26854d7d01bff00bab236f85f0 100644 (file)
@@ -1134,10 +1134,12 @@ void GenericCAO::updateTextures(std::string mod)
                                        buf->getMaterial().AmbientColor = m_prop.colors[1];
                                        buf->getMaterial().DiffuseColor = m_prop.colors[1];
                                        buf->getMaterial().SpecularColor = m_prop.colors[1];
+                                       setMeshColor(mesh, m_prop.colors[1]);
                                } else if (!m_prop.colors.empty()) {
                                        buf->getMaterial().AmbientColor = m_prop.colors[0];
                                        buf->getMaterial().DiffuseColor = m_prop.colors[0];
                                        buf->getMaterial().SpecularColor = m_prop.colors[0];
+                                       setMeshColor(mesh, m_prop.colors[0]);
                                }
 
                                buf->getMaterial().setFlag(video::EMF_TRILINEAR_FILTER, use_trilinear_filter);
index 26a19a08245014a1a136399f41d2e76b455c97cc..e330bc24a0dffb8ac75a7614a8c063aef2c8d32b 100644 (file)
@@ -145,6 +145,7 @@ void ObjectProperties::deSerialize(std::istream &is)
        makes_footstep_sound = readU8(is);
        automatic_rotate = readF1000(is);
        mesh = deSerializeString(is);
+       colors.clear();
        u32 color_count = readU16(is);
        for (u32 i = 0; i < color_count; i++){
                colors.push_back(readARGB8(is));