Fix texture mirroring on alpha blend/test shaders. See #2167

This commit is contained in:
auria.mg 2016-10-17 19:46:21 -04:00
parent 9d1b115e59
commit 8c0fe53ff2

View File

@ -740,6 +740,26 @@ void Material::setMaterialProperties(video::SMaterial *m, scene::IMeshBuffer* m
m->setTexture(7, colorization_mask_tex);
}
if (race_manager->getReverseTrack() &&
m_mirror_axis_when_reverse != ' ')
{
if (m_mirrorred_mesh_buffers.find((void*)mb) == m_mirrorred_mesh_buffers.end())
{
m_mirrorred_mesh_buffers[(void*)mb] = true;
//irr::video::S3DVertex* mbVertices = (video::S3DVertex*)mb->getVertices();
for (unsigned int i = 0; i < mb->getVertexCount(); i++)
{
core::vector2df &tc = mb->getTCoords(i);
if (m_mirror_axis_when_reverse == 'V')
tc.Y = 1 - tc.Y;
else
tc.X = 1 - tc.X;
}
}
} // reverse track and texture needs mirroring
switch (m_shader_type)
{
case SHADERTYPE_SOLID_UNLIT:
@ -986,25 +1006,6 @@ void Material::setMaterialProperties(video::SMaterial *m, scene::IMeshBuffer* m
}
#endif
if (race_manager->getReverseTrack() &&
m_mirror_axis_when_reverse != ' ')
{
if (m_mirrorred_mesh_buffers.find((void*)mb) == m_mirrorred_mesh_buffers.end())
{
m_mirrorred_mesh_buffers[(void*)mb] = true;
//irr::video::S3DVertex* mbVertices = (video::S3DVertex*)mb->getVertices();
for (unsigned int i = 0; i < mb->getVertexCount(); i++)
{
core::vector2df &tc = mb->getTCoords(i);
if (m_mirror_axis_when_reverse == 'V')
tc.Y = 1 - tc.Y;
else
tc.X = 1 - tc.X;
}
}
} // reverse track and texture needs mirroring
} // setMaterialProperties
//-----------------------------------------------------------------------------