diff --git a/src/Functions.pbi b/src/Functions.pbi index 9523850..f29de92 100644 --- a/src/Functions.pbi +++ b/src/Functions.pbi @@ -58,30 +58,31 @@ EndProcedure ; Shadowmap Procedure CalculateShadow() Define X.i, Y.i - Define MapX.i, MapY.i, Strength.i, CentercheckX.i, CentercheckY.i + Define MapX.i, MapY.i, Strength.i, Centercheck.i, CentercheckX.i, CentercheckY.i - For X.i=0 To #SHADOW_RADIUS*2 - For Y.i=0 To #SHADOW_RADIUS*2 - MapX = (Player\X-#SHADOW_RADIUS) + X - MapY = (Player\Y-#SHADOW_RADIUS) + Y + For X.i=-#SHADOW_RADIUS To #SHADOW_RADIUS*2 + For Y.i=-#SHADOW_RADIUS To #SHADOW_RADIUS*2 + MapX = Player\X + X + MapY = Player\Y + Y - CentercheckX = X - #SHADOW_RADIUS + CentercheckX = X If CentercheckX < 0 CentercheckX * -1 EndIf - CentercheckX = 5-CentercheckX - CentercheckY = Y - #SHADOW_RADIUS + CentercheckY = Y If CentercheckY < 0 CentercheckY * -1 EndIf - CentercheckY = 5-CentercheckY If CentercheckX > CentercheckY - CentercheckX = CentercheckY + Centercheck = CentercheckX + Else + Centercheck = CentercheckY EndIf + Centercheck = #SHADOW_RADIUS - Centercheck; - Strength = (255 / #SHADOW_RADIUS) * (CentercheckX+1) + Strength = (255 / #SHADOW_RADIUS) * (Centercheck) If MapX >= 0 And MapY >= 0 If ShadowMap(MapX, MapY)\Strength < Strength