Changed aspect ratio implementation
This commit is contained in:
@@ -493,7 +493,7 @@ namespace OpenRA.FileFormats
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsHqVqa { get { return (videoFlags & 0x10) == 16; } }
|
bool IsHqVqa { get { return (videoFlags & 0x10) == 16; } }
|
||||||
|
|
||||||
void WriteBlock(int blockNumber, int count, ref int x, ref int y)
|
void WriteBlock(int blockNumber, int count, ref int x, ref int y)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,12 +73,12 @@ namespace OpenRA.Widgets
|
|||||||
video.Width,
|
video.Width,
|
||||||
video.Height),
|
video.Height),
|
||||||
TextureChannel.Alpha);
|
TextureChannel.Alpha);
|
||||||
var videoDisplayHeight = video.IsHqVqa ? video.Height : video.Height * AspectRatio;
|
|
||||||
var scale = Math.Min((float)RenderBounds.Width / video.Width, (float)RenderBounds.Height / videoDisplayHeight);
|
var scale = Math.Min((float)RenderBounds.Width / video.Width, (float)RenderBounds.Height / video.Height * AspectRatio);
|
||||||
videoOrigin = new float2(RenderBounds.X + (RenderBounds.Width - scale * video.Width) / 2, RenderBounds.Y + (RenderBounds.Height - scale * videoDisplayHeight) / 2);
|
videoOrigin = new float2(RenderBounds.X + (RenderBounds.Width - scale * video.Width) / 2, RenderBounds.Y + (RenderBounds.Height - scale * video.Height * AspectRatio) / 2);
|
||||||
|
|
||||||
// Round size to integer pixels. Round up to be consistent with the scale calcuation.
|
// Round size to integer pixels. Round up to be consistent with the scale calcuation.
|
||||||
videoSize = new float2((int)Math.Ceiling(video.Width * scale), (int)Math.Ceiling(videoDisplayHeight * scale));
|
videoSize = new float2((int)Math.Ceiling(video.Width * scale), (int)Math.Ceiling(video.Height * AspectRatio * scale));
|
||||||
|
|
||||||
if (!DrawOverlay)
|
if (!DrawOverlay)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ Container@ASSETBROWSER_PANEL:
|
|||||||
VqaPlayer@PLAYER:
|
VqaPlayer@PLAYER:
|
||||||
Width: PARENT_RIGHT
|
Width: PARENT_RIGHT
|
||||||
Height: PARENT_BOTTOM
|
Height: PARENT_BOTTOM
|
||||||
|
AspectRatio: 1
|
||||||
Container@FRAME_SELECTOR:
|
Container@FRAME_SELECTOR:
|
||||||
X: 190
|
X: 190
|
||||||
Y: 395
|
Y: 395
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ Background@ASSETBROWSER_PANEL:
|
|||||||
VqaPlayer@PLAYER:
|
VqaPlayer@PLAYER:
|
||||||
Width: PARENT_RIGHT
|
Width: PARENT_RIGHT
|
||||||
Height: PARENT_BOTTOM
|
Height: PARENT_BOTTOM
|
||||||
|
AspectRatio: 1
|
||||||
Container@FRAME_SELECTOR:
|
Container@FRAME_SELECTOR:
|
||||||
X: 190
|
X: 190
|
||||||
Y: 425
|
Y: 425
|
||||||
|
|||||||
Reference in New Issue
Block a user