Skip to content

Commit

Permalink
REBASE_FIXES
Browse files Browse the repository at this point in the history
  • Loading branch information
dust765 committed Sep 20, 2021
1 parent 395fb93 commit 379491c
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 54 deletions.
2 changes: 1 addition & 1 deletion src/Dust765/Dust765/CombatCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
55 changes: 32 additions & 23 deletions src/Game/Scenes/GameSceneDrawingSorting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
60 changes: 30 additions & 30 deletions src/Game/UI/Gumps/WorldMapGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -1802,22 +1802,22 @@ 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
);

//PLAYER
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
Expand All @@ -1829,32 +1829,32 @@ 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
);

//PLAYER
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
Expand All @@ -1864,32 +1864,32 @@ 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
);

//PLAYER
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

Expand Down

0 comments on commit 379491c

Please sign in to comment.