Round 2 of inlining performance hotspots.

This commit is contained in:
UnknownShadow200 2016-04-26 23:45:25 +10:00
parent f6e5f84d57
commit 3f6b25dccb
2 changed files with 3 additions and 3 deletions

View file

@ -183,8 +183,8 @@ namespace ClassicalSharp {
// See comment in IGraphicsApi.Draw2DTexture()
v.X -= 0.5f; v.Y -= 0.5f;
Utils.RotateY( ref v.X, ref v.Z, cosY, sinY );
Utils.RotateX( ref v.Y, ref v.Z, cosX, sinX );
float t = cosY * v.X - sinY * v.Z; v.Z = sinY * v.X + cosY * v.Z; v.X = t; // Inlined RotY
t = cosX * v.Y + sinX * v.Z; v.Z = -sinX * v.Y + cosX * v.Z; v.Y = t; // Inlined RotX
}
}
}

View file

@ -211,7 +211,7 @@ namespace ClassicalSharp.Model {
void TransformVertices() {
for( int i = 0; i < index; i++ ) {
VertexP3fT2fC4b v = cache.vertices[i];
Utils.RotateY( ref v.X, ref v.Z, cosYaw, sinYaw );
float t = cosYaw * v.X - sinYaw * v.Z; v.Z = sinYaw * v.X + cosYaw * v.Z; v.X = t; // Inlined RotY
v.X += pos.X; v.Y += pos.Y; v.Z += pos.Z;
cache.vertices[i] = v;
}