@@ -371,10 +371,10 @@ struct MeshBufListList
371
371
372
372
void add (scene::IMeshBuffer *buf)
373
373
{
374
+ const video::SMaterial &m = buf->getMaterial ();
374
375
for (std::vector<MeshBufList>::iterator i = lists.begin ();
375
376
i != lists.end (); ++i){
376
377
MeshBufList &l = *i;
377
- video::SMaterial &m = buf->getMaterial ();
378
378
379
379
// comparing a full material is quite expensive so we don't do it if
380
380
// not even first texture is equal
@@ -387,7 +387,7 @@ struct MeshBufListList
387
387
}
388
388
}
389
389
MeshBufList l;
390
- l.m = buf-> getMaterial () ;
390
+ l.m = m ;
391
391
l.bufs .push_back (buf);
392
392
lists.push_back (l);
393
393
}
@@ -508,19 +508,20 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
508
508
{
509
509
scene::IMeshBuffer *buf = mesh->getMeshBuffer (i);
510
510
511
- buf->getMaterial ().setFlag (video::EMF_TRILINEAR_FILTER, m_cache_trilinear_filter);
512
- buf->getMaterial ().setFlag (video::EMF_BILINEAR_FILTER, m_cache_bilinear_filter);
513
- buf->getMaterial ().setFlag (video::EMF_ANISOTROPIC_FILTER, m_cache_anistropic_filter);
514
- buf->getMaterial ().setFlag (video::EMF_WIREFRAME, m_control.show_wireframe );
515
-
516
- const video::SMaterial& material = buf->getMaterial ();
511
+ video::SMaterial& material = buf->getMaterial ();
517
512
video::IMaterialRenderer* rnd =
518
513
driver->getMaterialRenderer (material.MaterialType );
519
514
bool transparent = (rnd && rnd->isTransparent ());
520
515
if (transparent == is_transparent_pass) {
521
516
if (buf->getVertexCount () == 0 )
522
517
errorstream << " Block [" << analyze_block (block)
523
518
<< " ] contains an empty meshbuf" << std::endl;
519
+
520
+ material.setFlag (video::EMF_TRILINEAR_FILTER, m_cache_trilinear_filter);
521
+ material.setFlag (video::EMF_BILINEAR_FILTER, m_cache_bilinear_filter);
522
+ material.setFlag (video::EMF_ANISOTROPIC_FILTER, m_cache_anistropic_filter);
523
+ material.setFlag (video::EMF_WIREFRAME, m_control.show_wireframe );
524
+
524
525
drawbufs.add (buf);
525
526
}
526
527
}
0 commit comments