Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix map preview generation for isometric terrain #16281

Merged
merged 2 commits into from Mar 8, 2019

Conversation

@abcdefg30
Copy link
Member

commented Mar 8, 2019

Regression from #16218.
It errors on bleed as we need to multiply dx by 4 in order to shift a cell.

@abcdefg30 abcdefg30 added this to the Tiberian Sun Public Alpha milestone Mar 8, 2019

@@ -695,16 +695,16 @@ public byte[] SavePreview()
var dx = uv.V & 1;
if (x + dx > 0)
{
var z = y * stride + 8 * x + dx - 4;
var z = y * stride + 8 * x + 4 * dx - 4;

This comment has been minimized.

Copy link
@pchote

pchote Mar 8, 2019

Member

This would be clearer as

var pxStride = 4; // Defined somewhere much further up
var z = y * stride + (2 * x + dx - 1) * pxStride;

and then pxStride used in the other places too.

minimapData[z++] = leftColor.R;
minimapData[z++] = leftColor.G;
minimapData[z++] = leftColor.B;
minimapData[z++] = leftColor.A;
}

if (2 * x + dx < stride)
if (8 * x + 4 * dx < stride)

This comment has been minimized.

Copy link
@pchote

pchote Mar 8, 2019

Member

(2 * x + dx) * pxStride < stride

{
var z = y * stride + 8 * x + dx;
var z = y * stride + 8 * x + 4 * dx;

This comment has been minimized.

Copy link
@pchote

pchote Mar 8, 2019

Member

y * stride + (2 * x + dx) * pxStride

@abcdefg30 abcdefg30 force-pushed the abcdefg30:fixPrev branch from d86267d to 82f5758 Mar 8, 2019

@MustaphaTR
Copy link
Member

left a comment

Saves TS maps properly and the preview looks correct. 👍

I would like to see this in soon if possible this is effecting RV too.

@reaperrr reaperrr merged commit 0524a59 into OpenRA:bleed Mar 8, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@abcdefg30 abcdefg30 deleted the abcdefg30:fixPrev branch Mar 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.