Fix entity shadows not rendering when looking through a water block at feet

This commit is contained in:
UnknownShadow200 2017-12-12 09:37:55 +11:00
parent 14607ffeea
commit 25e15abc40
5 changed files with 15 additions and 6 deletions

View File

@ -147,11 +147,12 @@ namespace ClassicalSharp {
MapRenderer.RenderNormal(delta);
MapBordersRenderer.RenderSides(delta);
Entities.DrawShadows();
if (SelectedPos.Valid && !HideGui) {
Picking.UpdateState(SelectedPos);
Picking.Render(delta);
}
// Render water over translucent blocks when underwater for proper alpha blending
Vector3 pos = LocalPlayer.Position;
if (CurrentCameraPos.Y < World.Env.EdgeHeight
@ -165,12 +166,10 @@ namespace ClassicalSharp {
// Need to render again over top of translucent block, as the selection outline
// is drawn without writing to the depth buffer
if (SelectedPos.Valid && !HideGui
&& BlockInfo.Draw[SelectedPos.Block] == DrawType.Translucent) {
if (SelectedPos.Valid && !HideGui && BlockInfo.Draw[SelectedPos.Block] == DrawType.Translucent) {
Picking.Render(delta);
}
Entities.DrawShadows();
SelectionManager.Render(delta);
Entities.RenderHoveredNames(Graphics, delta);

View File

@ -304,6 +304,7 @@
<ClCompile Include="Physics.c" />
<ClCompile Include="PickedPosRenderer.c" />
<ClCompile Include="Picking.c" />
<ClCompile Include="Player.c" />
<ClCompile Include="Program.c" />
<ClCompile Include="Random.c" />
<ClCompile Include="Screens.c" />

View File

@ -593,5 +593,8 @@
<ClCompile Include="EntityComponents.c">
<Filter>Source Files\Entities</Filter>
</ClCompile>
<ClCompile Include="Player.c">
<Filter>Source Files\Entities</Filter>
</ClCompile>
</ItemGroup>
</Project>

1
src/Client/Player.c Normal file
View File

@ -0,0 +1 @@
#include "Player.h"

View File

@ -16,6 +16,12 @@ typedef struct Player_ {
bool FetchedSkin;
} Player;
/* Represents another entity in multiplayer */
typedef struct NetPlayer_ {
Player Base;
NetInterpComp Interp;
bool ShouldRender;
} NetPlayer;
/* Represents the user/player's own entity. */
typedef struct LocalPlayer_ {
@ -29,8 +35,7 @@ typedef struct LocalPlayer_ {
} LocalPlayer;
/* Singleton instance of the local player. */
LocalPlayer LocalPlayer_Instance;
/* Initalises the local player instance. */
void LocalPlayer_Init(void);
void NetPlayer_Init(NetPlayer* player);
#endif