mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 20:15:35 -04:00
Fix particles being shaded wrongly. (Thanks CyberToon)
This commit is contained in:
parent
f84c96ad28
commit
98a08a3f3a
@ -95,7 +95,7 @@ namespace ClassicalSharp.Map {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override int LightCol_ZSide(int x, int y, int z) {
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,7 +42,8 @@ namespace ClassicalSharp.Map {
|
|||||||
public abstract int LightCol(int x, int y, int z);
|
public abstract int LightCol(int x, int y, int z);
|
||||||
|
|
||||||
/// <summary> Returns the light colour of the block at the given coordinates. </summary>
|
/// <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);
|
public abstract int LightCol_ZSide(int x, int y, int z);
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,8 +61,8 @@ PackedCol Lighting_Col(Int32 x, Int32 y, Int32 z) {
|
|||||||
return y > Lighting_GetLightHeight(x, z) ? Lighting_Outside : shadow;
|
return y > Lighting_GetLightHeight(x, z) ? Lighting_Outside : shadow;
|
||||||
}
|
}
|
||||||
|
|
||||||
PackedCol Lighting_Col_ZSide(Int32 x, Int32 y, Int32 z) {
|
PackedCol Lighting_Col_XSide(Int32 x, Int32 y, Int32 z) {
|
||||||
return y > Lighting_GetLightHeight(x, z) ? Lighting_OutsideZSide : shadowZSide;
|
return y > Lighting_GetLightHeight(x, z) ? Lighting_OutsideXSide : shadowXSide;
|
||||||
}
|
}
|
||||||
|
|
||||||
PackedCol Lighting_Col_Sprite_Fast(Int32 x, Int32 y, Int32 z) {
|
PackedCol Lighting_Col_Sprite_Fast(Int32 x, Int32 y, Int32 z) {
|
||||||
|
@ -36,7 +36,7 @@ NOTE: Does ***NOT*** check that the coordinates are inside the map. */
|
|||||||
PackedCol Lighting_Col(Int32 x, Int32 y, Int32 z);
|
PackedCol Lighting_Col(Int32 x, Int32 y, Int32 z);
|
||||||
/* Returns the light colour of the block at the given coordinates.
|
/* Returns the light colour of the block at the given coordinates.
|
||||||
NOTE: Does ***NOT*** check that the coordinates are inside the map. */
|
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_Sprite_Fast(Int32 x, Int32 y, Int32 z);
|
||||||
PackedCol Lighting_Col_YTop_Fast(Int32 x, Int32 y, Int32 z);
|
PackedCol Lighting_Col_YTop_Fast(Int32 x, Int32 y, Int32 z);
|
||||||
|
@ -150,7 +150,7 @@ void TerrainParticle_Render(TerrainParticle* p, Real32 t, VertexP3fT2fC4b** vert
|
|||||||
PackedCol col = PACKEDCOL_WHITE;
|
PackedCol col = PACKEDCOL_WHITE;
|
||||||
if (!Block_FullBright[p->Block]) {
|
if (!Block_FullBright[p->Block]) {
|
||||||
Int32 x = Math_Floor(pos.X), y = Math_Floor(pos.Y), z = Math_Floor(pos.Z);
|
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]) {
|
if (Block_Tinted[p->Block]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user