mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 11:35:08 -04:00
Skip drawing sprite groups we can never see.
This commit is contained in:
parent
8391d0ae79
commit
c80781045d
@ -145,8 +145,16 @@ namespace ClassicalSharp.Renderers {
|
|||||||
DrawPart( info, ref part );
|
DrawPart( info, ref part );
|
||||||
|
|
||||||
if( part.SpriteCount > 0 ) {
|
if( part.SpriteCount > 0 ) {
|
||||||
|
int groupCount = part.SpriteCount / 4;
|
||||||
api.FaceCulling = true;
|
api.FaceCulling = true;
|
||||||
api.DrawIndexedVb_TrisT2fC4b( part.SpriteCount, 0 );
|
if( info.DrawRight || info.DrawFront )
|
||||||
|
api.DrawIndexedVb_TrisT2fC4b( groupCount, 0 );
|
||||||
|
if( info.DrawLeft || info.DrawBack )
|
||||||
|
api.DrawIndexedVb_TrisT2fC4b( groupCount, groupCount );
|
||||||
|
if( info.DrawLeft || info.DrawFront )
|
||||||
|
api.DrawIndexedVb_TrisT2fC4b( groupCount, groupCount * 2 );
|
||||||
|
if( info.DrawRight || info.DrawBack )
|
||||||
|
api.DrawIndexedVb_TrisT2fC4b( groupCount, groupCount * 3 );
|
||||||
api.FaceCulling = false;
|
api.FaceCulling = false;
|
||||||
}
|
}
|
||||||
game.Vertices += part.IndicesCount;
|
game.Vertices += part.IndicesCount;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user