Support custom zoom levels

This commit is contained in:
Paul Chote
2011-06-03 20:23:21 +12:00
parent 926b396605
commit fc783ddf80
12 changed files with 55 additions and 55 deletions

View File

@@ -73,15 +73,15 @@ namespace OpenRA.Graphics
internal IGraphicsDevice Device { get { return device; } }
public void BeginFrame(float2 scroll)
public void BeginFrame(float2 scroll, float zoom)
{
device.Clear(Color.Black);
float2 r1 = new float2(2f/Resolution.Width, -2f/Resolution.Height);
float2 r2 = new float2(-1, 1);
SetShaderParams( WorldSpriteShader, r1, r2, scroll );
SetShaderParams( WorldLineShader, r1, r2, scroll );
var zr1 = zoom*r1;
SetShaderParams( WorldSpriteShader, zr1, r2, scroll );
SetShaderParams( WorldLineShader, zr1, r2, scroll );
SetShaderParams( LineShader, r1, r2, scroll );
SetShaderParams( RgbaSpriteShader, r1, r2, scroll );
SetShaderParams( SpriteShader, r1, r2, scroll );