mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 03:55:19 -04:00
Fix block break animation only beginning to play after switching back to first person camera, if block was broken with third person camera. (Thanks Cybertoon)
This commit is contained in:
parent
b4cebaca0f
commit
caf6de6792
@ -43,7 +43,7 @@ namespace ClassicalSharp.Renderers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Render(double delta) {
|
public void Render(double delta) {
|
||||||
if (game.Camera.IsThirdPerson || !game.ShowBlockInHand) return;
|
if (!game.ShowBlockInHand) return;
|
||||||
|
|
||||||
float lastSwingY = swingY; swingY = 0;
|
float lastSwingY = swingY; swingY = 0;
|
||||||
block = game.Inventory.Selected;
|
block = game.Inventory.Selected;
|
||||||
@ -56,7 +56,15 @@ namespace ClassicalSharp.Renderers {
|
|||||||
ResetHeldState();
|
ResetHeldState();
|
||||||
DoAnimation(delta, lastSwingY);
|
DoAnimation(delta, lastSwingY);
|
||||||
SetBaseOffset();
|
SetBaseOffset();
|
||||||
|
if (!game.Camera.IsThirdPerson) RenderModel();
|
||||||
|
|
||||||
|
game.Graphics.LoadMatrix(ref game.View);
|
||||||
|
game.Graphics.SetMatrixMode(MatrixType.Projection);
|
||||||
|
game.Graphics.LoadMatrix(ref game.Projection);
|
||||||
|
game.Graphics.SetMatrixMode(MatrixType.Modelview);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RenderModel() {
|
||||||
game.Graphics.FaceCulling = true;
|
game.Graphics.FaceCulling = true;
|
||||||
game.Graphics.Texturing = true;
|
game.Graphics.Texturing = true;
|
||||||
game.Graphics.SetupAlphaState(BlockInfo.Draw[block]);
|
game.Graphics.SetupAlphaState(BlockInfo.Draw[block]);
|
||||||
@ -76,11 +84,6 @@ namespace ClassicalSharp.Renderers {
|
|||||||
game.Graphics.RestoreAlphaState(BlockInfo.Draw[block]);
|
game.Graphics.RestoreAlphaState(BlockInfo.Draw[block]);
|
||||||
game.Graphics.DepthTest = true;
|
game.Graphics.DepthTest = true;
|
||||||
game.Graphics.FaceCulling = false;
|
game.Graphics.FaceCulling = false;
|
||||||
|
|
||||||
game.Graphics.LoadMatrix(ref game.View);
|
|
||||||
game.Graphics.SetMatrixMode(MatrixType.Projection);
|
|
||||||
game.Graphics.LoadMatrix(ref game.Projection);
|
|
||||||
game.Graphics.SetMatrixMode(MatrixType.Modelview);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Vector3 nOffset = new Vector3(0.56f, -0.72f, -0.72f);
|
static Vector3 nOffset = new Vector3(0.56f, -0.72f, -0.72f);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user