Add Game.Zoom for remaining engine stuff.
This commit is contained in:
@@ -33,6 +33,11 @@ namespace OpenRA
|
|||||||
|
|
||||||
public static ModData modData;
|
public static ModData modData;
|
||||||
static WorldRenderer worldRenderer;
|
static WorldRenderer worldRenderer;
|
||||||
|
public static float Zoom
|
||||||
|
{
|
||||||
|
get { return worldRenderer.Viewport.Zoom; }
|
||||||
|
set { worldRenderer.Viewport.Zoom = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public static Viewport viewport;
|
public static Viewport viewport;
|
||||||
public static Settings Settings;
|
public static Settings Settings;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace OpenRA.Graphics
|
|||||||
{
|
{
|
||||||
var vb = renderer.GetTempVertexBuffer();
|
var vb = renderer.GetTempVertexBuffer();
|
||||||
vb.SetData(vertices, nv);
|
vb.SetData(vertices, nv);
|
||||||
renderer.SetLineWidth(LineWidth * Game.viewport.Zoom);
|
renderer.SetLineWidth(LineWidth * Game.Zoom);
|
||||||
renderer.DrawBatch(vb, 0, nv, PrimitiveType.LineList);
|
renderer.DrawBatch(vb, 0, nv, PrimitiveType.LineList);
|
||||||
});
|
});
|
||||||
renderer.Device.SetBlendMode(BlendMode.None);
|
renderer.Device.SetBlendMode(BlendMode.None);
|
||||||
|
|||||||
@@ -682,8 +682,9 @@ namespace OpenRA
|
|||||||
Al.alSourcei(source, Al.AL_LOOPING, looping ? Al.AL_TRUE : Al.AL_FALSE);
|
Al.alSourcei(source, Al.AL_LOOPING, looping ? Al.AL_TRUE : Al.AL_FALSE);
|
||||||
Al.alSourcei(source, Al.AL_SOURCE_RELATIVE, relative ? 1 : 0);
|
Al.alSourcei(source, Al.AL_SOURCE_RELATIVE, relative ? 1 : 0);
|
||||||
|
|
||||||
Al.alSourcef(source, Al.AL_REFERENCE_DISTANCE, Game.viewport.WorldRect.Width / 8);
|
var width = Game.Renderer.Resolution.Width / (Game.Zoom * Game.CellSize);
|
||||||
Al.alSourcef(source, Al.AL_MAX_DISTANCE, 2*Game.viewport.WorldRect.Width);
|
Al.alSourcef(source, Al.AL_REFERENCE_DISTANCE, width / 8);
|
||||||
|
Al.alSourcef(source, Al.AL_MAX_DISTANCE, 2 * width);
|
||||||
Al.alSourcePlay(source);
|
Al.alSourcePlay(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
|||||||
pixelDoubleCheckbox.OnClick = () =>
|
pixelDoubleCheckbox.OnClick = () =>
|
||||||
{
|
{
|
||||||
graphicsSettings.PixelDouble ^= true;
|
graphicsSettings.PixelDouble ^= true;
|
||||||
Game.viewport.Zoom = graphicsSettings.PixelDouble ? 2 : 1;
|
Game.Zoom = graphicsSettings.PixelDouble ? 2 : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
var showShellmapCheckbox = generalPane.Get<CheckboxWidget>("SHOW_SHELLMAP");
|
var showShellmapCheckbox = generalPane.Get<CheckboxWidget>("SHOW_SHELLMAP");
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
pixelDoubleCheckbox.OnClick = () =>
|
pixelDoubleCheckbox.OnClick = () =>
|
||||||
{
|
{
|
||||||
gs.PixelDouble ^= true;
|
gs.PixelDouble ^= true;
|
||||||
Game.viewport.Zoom = gs.PixelDouble ? 2 : 1;
|
Game.Zoom = gs.PixelDouble ? 2 : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
var capFrameRateCheckbox = display.Get<CheckboxWidget>("CAPFRAMERATE_CHECKBOX");
|
var capFrameRateCheckbox = display.Get<CheckboxWidget>("CAPFRAMERATE_CHECKBOX");
|
||||||
|
|||||||
Reference in New Issue
Block a user