Skip to content

Commit 787cd15

Browse files
basicersfan5
authored andcommittedDec 25, 2017
- Clear colors when reading property info.
- Set vertex colors on upright_sprites.
1 parent 8037eda commit 787cd15

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
 

‎src/content_cao.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1134,10 +1134,12 @@ void GenericCAO::updateTextures(std::string mod)
11341134
buf->getMaterial().AmbientColor = m_prop.colors[1];
11351135
buf->getMaterial().DiffuseColor = m_prop.colors[1];
11361136
buf->getMaterial().SpecularColor = m_prop.colors[1];
1137+
setMeshColor(mesh, m_prop.colors[1]);
11371138
} else if (!m_prop.colors.empty()) {
11381139
buf->getMaterial().AmbientColor = m_prop.colors[0];
11391140
buf->getMaterial().DiffuseColor = m_prop.colors[0];
11401141
buf->getMaterial().SpecularColor = m_prop.colors[0];
1142+
setMeshColor(mesh, m_prop.colors[0]);
11411143
}
11421144

11431145
buf->getMaterial().setFlag(video::EMF_TRILINEAR_FILTER, use_trilinear_filter);

‎src/object_properties.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ void ObjectProperties::deSerialize(std::istream &is)
145145
makes_footstep_sound = readU8(is);
146146
automatic_rotate = readF1000(is);
147147
mesh = deSerializeString(is);
148+
colors.clear();
148149
u32 color_count = readU16(is);
149150
for (u32 i = 0; i < color_count; i++){
150151
colors.push_back(readARGB8(is));

0 commit comments

Comments
 (0)
Please sign in to comment.