Skip to content

Commit 678c481

Browse files
WeylonSantanapandinocoder
authored andcommitted
reusing position logic
1 parent d475e78 commit 678c481

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Intersect.Editor/Core/Graphics.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,9 @@ bool alternate
13841384
continue;
13851385
}
13861386

1387+
float xpos = x * tileWidth + xoffset;
1388+
float ypos = y * tileHeight + yoffset;
1389+
13871390
if (tmpMap.Attributes[x, y].Type == MapAttributeType.Resource && !upper && !alternate)
13881391
{
13891392
var resource = ResourceDescriptor.Get(((MapResourceAttribute) tmpMap.Attributes[x, y]).ResourceId);
@@ -1406,9 +1409,6 @@ bool alternate
14061409
continue;
14071410
}
14081411

1409-
float xpos = x * tileWidth + xoffset;
1410-
float ypos = y * tileHeight + yoffset;
1411-
14121412
// we have the graphic, now lets build based on type
14131413
switch (resourceGraphic.TextureType)
14141414
{
@@ -1526,8 +1526,9 @@ bool alternate
15261526

15271527
if (animation != null)
15281528
{
1529-
float xpos = x * tileWidth + xoffset + tileWidth / 2;
1530-
float ypos = y * tileHeight + yoffset + tileHeight / 2;
1529+
xpos += tileWidth / 2f;
1530+
ypos += tileHeight / 2f;
1531+
15311532
if (tmpMap.Attributes[x, y] != null)
15321533
{
15331534
var animInstance = tmpMap.GetAttributeAnimation(tmpMap.Attributes[x, y], animation.Id);

0 commit comments

Comments
 (0)