Fix particles being shaded wrongly. (Thanks CyberToon)

This commit is contained in:
UnknownShadow200 2017-10-25 17:36:58 +11:00
parent f84c96ad28
commit 98a08a3f3a
5 changed files with 7 additions and 6 deletions

View File

@ -95,7 +95,7 @@ namespace ClassicalSharp.Map {
}
public override int LightCol_ZSide(int x, int y, int z) {
return y > GetLightHeight(x, z) ? OutsideZSide : shadowZSide;
return y > GetLightHeight(x, z) ? OutsideXSide : shadowXSide;
}

View File

@ -42,7 +42,8 @@ namespace ClassicalSharp.Map {
public abstract int LightCol(int x, int y, int z);
/// <summary> Returns the light colour of the block at the given coordinates. </summary>
/// <remarks> *** Does NOT check that the coordinates are inside the map. *** </remarks>
/// <remarks> *** Does NOT check that the coordinates are inside the map. ***
/// NOTE: This actually returns X shaded colour, but is called ZSide to avoid breaking compatibility. </remarks>
public abstract int LightCol_ZSide(int x, int y, int z);

View File

@ -61,8 +61,8 @@ PackedCol Lighting_Col(Int32 x, Int32 y, Int32 z) {
return y > Lighting_GetLightHeight(x, z) ? Lighting_Outside : shadow;
}
PackedCol Lighting_Col_ZSide(Int32 x, Int32 y, Int32 z) {
return y > Lighting_GetLightHeight(x, z) ? Lighting_OutsideZSide : shadowZSide;
PackedCol Lighting_Col_XSide(Int32 x, Int32 y, Int32 z) {
return y > Lighting_GetLightHeight(x, z) ? Lighting_OutsideXSide : shadowXSide;
}
PackedCol Lighting_Col_Sprite_Fast(Int32 x, Int32 y, Int32 z) {

View File

@ -36,7 +36,7 @@ NOTE: Does ***NOT*** check that the coordinates are inside the map. */
PackedCol Lighting_Col(Int32 x, Int32 y, Int32 z);
/* Returns the light colour of the block at the given coordinates.
NOTE: Does ***NOT*** check that the coordinates are inside the map. */
PackedCol Lighting_Col_ZSide(Int32 x, Int32 y, Int32 z);
PackedCol Lighting_Col_XSide(Int32 x, Int32 y, Int32 z);
PackedCol Lighting_Col_Sprite_Fast(Int32 x, Int32 y, Int32 z);
PackedCol Lighting_Col_YTop_Fast(Int32 x, Int32 y, Int32 z);

View File

@ -150,7 +150,7 @@ void TerrainParticle_Render(TerrainParticle* p, Real32 t, VertexP3fT2fC4b** vert
PackedCol col = PACKEDCOL_WHITE;
if (!Block_FullBright[p->Block]) {
Int32 x = Math_Floor(pos.X), y = Math_Floor(pos.Y), z = Math_Floor(pos.Z);
col = World_IsValidPos(x, y, z) ? Lighting_Col_ZSide(x, y, z) : Lighting_OutsideZSide;
col = World_IsValidPos(x, y, z) ? Lighting_Col_XSide(x, y, z) : Lighting_OutsideXSide;
}
if (Block_Tinted[p->Block]) {