From 379491c1e9271d239721976ba4436d7baac5ae67 Mon Sep 17 00:00:00 2001 From: Dust765 Date: Mon, 20 Sep 2021 14:35:36 +0200 Subject: [PATCH] REBASE_FIXES --- src/Dust765/Dust765/CombatCollection.cs | 2 +- src/Game/Scenes/GameSceneDrawingSorting.cs | 55 +++++++++++--------- src/Game/UI/Gumps/WorldMapGump.cs | 60 +++++++++++----------- 3 files changed, 63 insertions(+), 54 deletions(-) diff --git a/src/Dust765/Dust765/CombatCollection.cs b/src/Dust765/Dust765/CombatCollection.cs index 5ab86f94e..e0a1230be 100644 --- a/src/Dust765/Dust765/CombatCollection.cs +++ b/src/Dust765/Dust765/CombatCollection.cs @@ -369,7 +369,7 @@ out int height p1.X = (int) (mobile.RealScreenPosition.X + mobile.Offset.X + 22); p1.Y = (int) (mobile.RealScreenPosition.Y + (mobile.Offset.Y - mobile.Offset.Z) - (height + centerY + 8 + 22) + (mobile.IsGargoyle && mobile.IsFlying ? -22 : !mobile.IsMounted ? 22 : 0)); - if (mobile.ObjectHandlesOpened) + if (mobile.ObjectHandlesStatus == ObjectHandlesStatus.DISPLAYING) { p1.Y -= Constants.OBJECT_HANDLES_GUMP_HEIGHT + 5; } diff --git a/src/Game/Scenes/GameSceneDrawingSorting.cs b/src/Game/Scenes/GameSceneDrawingSorting.cs index 306a1d783..fcb46f5b8 100644 --- a/src/Game/Scenes/GameSceneDrawingSorting.cs +++ b/src/Game/Scenes/GameSceneDrawingSorting.cs @@ -585,6 +585,13 @@ private unsafe bool AddTileToRenderList(GameObject obj, int worldX, int worldY, { ref var itemData = ref staticc.ItemData; + // ## BEGIN - END ## // ART / HUE CHANGES + if (obj is Static st) + { + st = CombatCollection.GSDSFilters(st); + } + // ## BEGIN - END ## // ART / HUE CHANGES + if (itemData.IsInternal) { continue; @@ -601,7 +608,11 @@ private unsafe bool AddTileToRenderList(GameObject obj, int worldX, int worldY, } //we avoid to hide impassable foliage or bushes, if present... - if (itemData.IsFoliage && ProfileManager.CurrentProfile.TreeToStumps) + // ## BEGIN - END ## // ART / HUE CHANGES + //if (itemData.IsFoliage && ProfileManager.CurrentProfile.TreeToStumps) + // ## BEGIN - END ## // ART / HUE CHANGES + if (itemData.IsFoliage && ProfileManager.CurrentProfile.TreeType != 0) + // ## BEGIN - END ## // ART / HUE CHANGES { continue; } @@ -652,7 +663,11 @@ private unsafe bool AddTileToRenderList(GameObject obj, int worldX, int worldY, if (!itemData.IsMultiMovable) { - if (itemData.IsFoliage && ProfileManager.CurrentProfile.TreeToStumps) + // ## BEGIN - END ## // ART / HUE CHANGES + //if (itemData.IsFoliage && ProfileManager.CurrentProfile.TreeToStumps) + // ## BEGIN - END ## // ART / HUE CHANGES + if (itemData.IsFoliage && ProfileManager.CurrentProfile.TreeType != 0) + // ## BEGIN - END ## // ART / HUE CHANGES { continue; } @@ -663,24 +678,6 @@ private unsafe bool AddTileToRenderList(GameObject obj, int worldX, int worldY, } } - //we avoid to hide impassable foliage or bushes, if present... - - // ## BEGIN - END ## // ART / HUE CHANGES - /* - if (ProfileManager.CurrentProfile.TreeToStumps && itemData.IsFoliage && !itemData.IsMultiMovable && !(obj is Multi) || ProfileManager.CurrentProfile.HideVegetation && (obj is Multi mm && mm.IsVegetation || obj is Static st && st.IsVegetation)) - { - continue; - } - */ - // ## BEGIN - END ## // ART / HUE CHANGES - if (obj is Static st) - { - st = CombatCollection.GSDSFilters(st); - } - if ((ProfileManager.CurrentProfile.TreeType != 0 && itemData.IsFoliage && !itemData.IsMultiMovable && !(obj is Multi)) || - (ProfileManager.CurrentProfile.HideVegetation && ((obj is Multi mm && mm.IsVegetation) || (obj is Static sta && sta.IsVegetation)))) - continue; - // ## BEGIN - END ## // ART / HUE CHANGES byte height = 0; if (obj.AllowedToDraw) @@ -762,7 +759,11 @@ private unsafe bool AddTileToRenderList(GameObject obj, int worldX, int worldY, continue; } - if (!itemData.IsMultiMovable && itemData.IsFoliage && ProfileManager.CurrentProfile.TreeToStumps) + // ## BEGIN - END ## // ART / HUE CHANGES + //if (!itemData.IsMultiMovable && itemData.IsFoliage && ProfileManager.CurrentProfile.TreeToStumps) + // ## BEGIN - END ## // ART / HUE CHANGES + if (!itemData.IsMultiMovable && itemData.IsFoliage && ProfileManager.CurrentProfile.TreeType != 0) + // ## BEGIN - END ## // ART / HUE CHANGES { continue; } @@ -876,7 +877,11 @@ private unsafe bool AddTileToRenderList(GameObject obj, int worldX, int worldY, } //we avoid to hide impassable foliage or bushes, if present... - if (itemData.IsFoliage && ProfileManager.CurrentProfile.TreeToStumps) + // ## BEGIN - END ## // ART / HUE CHANGES + //if (itemData.IsFoliage && ProfileManager.CurrentProfile.TreeToStumps) + // ## BEGIN - END ## // ART / HUE CHANGES + if (itemData.IsFoliage && ProfileManager.CurrentProfile.TreeType != 0) + // ## BEGIN - END ## // ART / HUE CHANGES { continue; } @@ -1022,7 +1027,11 @@ private unsafe bool AddTileToRenderList(GameObject obj, int worldX, int worldY, continue; } - if (itemData.IsFoliage && ProfileManager.CurrentProfile.TreeToStumps) + // ## BEGIN - END ## // ART / HUE CHANGES + //if (itemData.IsFoliage && ProfileManager.CurrentProfile.TreeToStumps) + // ## BEGIN - END ## // ART / HUE CHANGES + if (itemData.IsFoliage && ProfileManager.CurrentProfile.TreeType != 0) + // ## BEGIN - END ## // ART / HUE CHANGES { continue; } diff --git a/src/Game/UI/Gumps/WorldMapGump.cs b/src/Game/UI/Gumps/WorldMapGump.cs index cf04a0aba..e8644b7c5 100644 --- a/src/Game/UI/Gumps/WorldMapGump.cs +++ b/src/Game/UI/Gumps/WorldMapGump.cs @@ -1785,10 +1785,10 @@ private void DrawAll(UltimaBatcher2D batcher, int gX, int gY, int halfWidth, int int sx = World.Player.DeathX - _center.X; int sy = World.Player.DeathY - _center.Y; - (int rotX, int rotY) = RotatePoint(sx, sy, Zoom, 1, _flipMap ? 45f : 0f); + Point pdrot = RotatePoint(sx, sy, Zoom, 1, _flipMap ? 45f : 0f); - rotX += gX + halfWidth; - rotY += gY + halfHeight; + pdrot.X += gX + halfWidth; + pdrot.Y += gY + halfHeight; const int DOT_SIZE = 4; const int DOT_SIZE_HALF = DOT_SIZE >> 1; @@ -1802,7 +1802,7 @@ private void DrawAll(UltimaBatcher2D batcher, int gX, int gY, int halfWidth, int batcher.Draw2D ( - SolidColorTextureCache.GetTexture(Color.YellowGreen), rotX - DOT_SIZE_HALF, rotY - DOT_SIZE_HALF, DOT_SIZE, + SolidColorTextureCache.GetTexture(Color.YellowGreen), pdrot.X - DOT_SIZE_HALF, pdrot.Y - DOT_SIZE_HALF, DOT_SIZE, DOT_SIZE, ref HueVector ); @@ -1810,14 +1810,14 @@ private void DrawAll(UltimaBatcher2D batcher, int gX, int gY, int halfWidth, int int psx = World.Player.X - _center.X; int psy = World.Player.Y - _center.Y; - (int protX, int protY) = RotatePoint(psx, psy, Zoom, 1, _flipMap ? 45f : 0f); + Point prot = RotatePoint(psx, psy, Zoom, 1, _flipMap ? 45f : 0f); - protX += gX + halfWidth; - protY += gY + halfHeight; + prot.X += gX + halfWidth; + prot.Y += gY + halfHeight; - int ox = (rotX - DOT_SIZE_HALF + protX - DOT_SIZE_HALF) / 2; - int oy = (rotY - DOT_SIZE_HALF + protY - DOT_SIZE_HALF) / 2; - batcher.DrawLine(SolidColorTextureCache.GetTexture(Color.YellowGreen), rotX - DOT_SIZE_HALF, rotY - DOT_SIZE_HALF, protX - DOT_SIZE_HALF, protY - DOT_SIZE_HALF, ox, oy); + int ox = (prot.X - DOT_SIZE_HALF + prot.X - DOT_SIZE_HALF) / 2; + int oy = (prot.Y - DOT_SIZE_HALF + prot.Y - DOT_SIZE_HALF) / 2; + batcher.DrawLine(SolidColorTextureCache.GetTexture(Color.YellowGreen), prot.X - DOT_SIZE_HALF, prot.Y - DOT_SIZE_HALF, prot.X - DOT_SIZE_HALF, prot.Y - DOT_SIZE_HALF, ox, oy); } } // ## BEGIN - END ## // MISC2 @@ -1829,17 +1829,17 @@ private void DrawAll(UltimaBatcher2D batcher, int gX, int gY, int halfWidth, int int sx = _tempTmapX - _center.X; int sy = _tempTmapY - _center.Y; - (int rotX, int rotY) = RotatePoint(sx, sy, Zoom, 1, _flipMap ? 45f : 0f); + Point trot = RotatePoint(sx, sy, Zoom, 1, _flipMap ? 45f : 0f); - rotX += gX + halfWidth; - rotY += gY + halfHeight; + trot.X += gX + halfWidth; + trot.Y += gY + halfHeight; const int DOT_SIZE = 4; const int DOT_SIZE_HALF = DOT_SIZE >> 1; batcher.Draw2D ( - SolidColorTextureCache.GetTexture(Color.Orange), rotX - DOT_SIZE_HALF, rotY - DOT_SIZE_HALF, DOT_SIZE, + SolidColorTextureCache.GetTexture(Color.Orange), trot.X - DOT_SIZE_HALF, trot.Y - DOT_SIZE_HALF, DOT_SIZE, DOT_SIZE, ref HueVector ); @@ -1847,14 +1847,14 @@ private void DrawAll(UltimaBatcher2D batcher, int gX, int gY, int halfWidth, int int psx = World.Player.X - _center.X; int psy = World.Player.Y - _center.Y; - (int protX, int protY) = RotatePoint(psx, psy, Zoom, 1, _flipMap ? 45f : 0f); + Point prot = RotatePoint(psx, psy, Zoom, 1, _flipMap ? 45f : 0f); - protX += gX + halfWidth; - protY += gY + halfHeight; + prot.X += gX + halfWidth; + prot.Y += gY + halfHeight; - int ox = (rotX - DOT_SIZE_HALF + protX - DOT_SIZE_HALF) / 2; - int oy = (rotY - DOT_SIZE_HALF + protY - DOT_SIZE_HALF) / 2; - batcher.DrawLine(SolidColorTextureCache.GetTexture(Color.DarkRed), rotX - DOT_SIZE_HALF, rotY - DOT_SIZE_HALF, protX - DOT_SIZE_HALF, protY - DOT_SIZE_HALF, ox, oy); + int ox = (prot.X - DOT_SIZE_HALF + prot.X - DOT_SIZE_HALF) / 2; + int oy = (prot.Y - DOT_SIZE_HALF + prot.Y - DOT_SIZE_HALF) / 2; + batcher.DrawLine(SolidColorTextureCache.GetTexture(Color.DarkRed), prot.X - DOT_SIZE_HALF, prot.Y - DOT_SIZE_HALF, prot.X - DOT_SIZE_HALF, prot.Y - DOT_SIZE_HALF, ox, oy); } //COMMAND @@ -1864,17 +1864,17 @@ private void DrawAll(UltimaBatcher2D batcher, int gX, int gY, int halfWidth, int int sx = _tempX - _center.X; int sy = _tempY - _center.Y; - (int rotX, int rotY) = RotatePoint(sx, sy, Zoom, 1, _flipMap ? 45f : 0f); + Point dprot = RotatePoint(sx, sy, Zoom, 1, _flipMap ? 45f : 0f); - rotX += gX + halfWidth; - rotY += gY + halfHeight; + dprot.X += gX + halfWidth; + dprot.Y += gY + halfHeight; const int DOT_SIZE = 4; const int DOT_SIZE_HALF = DOT_SIZE >> 1; batcher.Draw2D ( - SolidColorTextureCache.GetTexture(Color.Orange), rotX - DOT_SIZE_HALF, rotY - DOT_SIZE_HALF, DOT_SIZE, + SolidColorTextureCache.GetTexture(Color.Orange), dprot.X - DOT_SIZE_HALF, dprot.Y - DOT_SIZE_HALF, DOT_SIZE, DOT_SIZE, ref HueVector ); @@ -1882,14 +1882,14 @@ private void DrawAll(UltimaBatcher2D batcher, int gX, int gY, int halfWidth, int int psx = World.Player.X - _center.X; int psy = World.Player.Y - _center.Y; - (int protX, int protY) = RotatePoint(psx, psy, Zoom, 1, _flipMap ? 45f : 0f); + Point prot = RotatePoint(psx, psy, Zoom, 1, _flipMap ? 45f : 0f); - protX += gX + halfWidth; - protY += gY + halfHeight; + prot.X += gX + halfWidth; + prot.Y += gY + halfHeight; - int ox = (rotX - DOT_SIZE_HALF + protX - DOT_SIZE_HALF) / 2; - int oy = (rotY - DOT_SIZE_HALF + protY - DOT_SIZE_HALF) / 2; - batcher.DrawLine(SolidColorTextureCache.GetTexture(Color.DarkRed), rotX - DOT_SIZE_HALF, rotY - DOT_SIZE_HALF, protX - DOT_SIZE_HALF, protY - DOT_SIZE_HALF, ox, oy); + int ox = (prot.X - DOT_SIZE_HALF + prot.X - DOT_SIZE_HALF) / 2; + int oy = (prot.Y - DOT_SIZE_HALF + prot.Y - DOT_SIZE_HALF) / 2; + batcher.DrawLine(SolidColorTextureCache.GetTexture(Color.DarkRed), prot.X - DOT_SIZE_HALF, prot.Y - DOT_SIZE_HALF, prot.X - DOT_SIZE_HALF, prot.Y - DOT_SIZE_HALF, ox, oy); } // ## BEGIN - END ## // AUTOMATIONS