Remove unnecessary parentheses
This commit is contained in:
@@ -233,7 +233,7 @@ namespace OpenRA.Graphics
|
||||
else
|
||||
Zoom = Zoom.Clamp(minZoom, maxZoom);
|
||||
|
||||
var maxSize = (1f / (unlockMinZoom ? unlockedMinZoom : minZoom) * new float2(Game.Renderer.NativeResolution));
|
||||
var maxSize = 1f / (unlockMinZoom ? unlockedMinZoom : minZoom) * new float2(Game.Renderer.NativeResolution);
|
||||
Game.Renderer.SetMaximumViewportSize(new Size((int)maxSize.X, (int)maxSize.Y));
|
||||
|
||||
foreach (var t in worldRenderer.World.WorldActor.TraitsImplementing<INotifyViewportZoomExtentsChanged>())
|
||||
@@ -296,8 +296,8 @@ namespace OpenRA.Graphics
|
||||
}
|
||||
|
||||
public int2 ViewToWorldPx(int2 view) { return (graphicSettings.UIScale / Zoom * view.ToFloat2()).ToInt2() + TopLeft; }
|
||||
public int2 WorldToViewPx(int2 world) { return ((Zoom / graphicSettings.UIScale) * (world - TopLeft).ToFloat2()).ToInt2(); }
|
||||
public int2 WorldToViewPx(in float3 world) { return ((Zoom / graphicSettings.UIScale) * (world - TopLeft).XY).ToInt2(); }
|
||||
public int2 WorldToViewPx(int2 world) { return (Zoom / graphicSettings.UIScale * (world - TopLeft).ToFloat2()).ToInt2(); }
|
||||
public int2 WorldToViewPx(in float3 world) { return (Zoom / graphicSettings.UIScale * (world - TopLeft).XY).ToInt2(); }
|
||||
|
||||
public void Center(IEnumerable<Actor> actors)
|
||||
{
|
||||
|
||||
@@ -390,7 +390,7 @@ namespace OpenRA
|
||||
|
||||
// TODO: Remember to remove this when rewriting tile variants / PickAny
|
||||
if (index == byte.MaxValue)
|
||||
index = (byte)(i % 4 + (j % 4) * 4);
|
||||
index = (byte)(i % 4 + j % 4 * 4);
|
||||
|
||||
Tiles[new MPos(i, j)] = new TerrainTile(tile, index);
|
||||
}
|
||||
|
||||
@@ -118,13 +118,13 @@ namespace OpenRA
|
||||
items.Add(t.Id, t);
|
||||
}
|
||||
|
||||
return (IReadOnlyDictionary<string, ITerrainInfo>)(new ReadOnlyDictionary<string, ITerrainInfo>(items));
|
||||
return (IReadOnlyDictionary<string, ITerrainInfo>)new ReadOnlyDictionary<string, ITerrainInfo>(items);
|
||||
});
|
||||
|
||||
defaultSequences = Exts.Lazy(() =>
|
||||
{
|
||||
var items = DefaultTerrainInfo.ToDictionary(t => t.Key, t => new SequenceProvider(DefaultFileSystem, this, t.Key, null));
|
||||
return (IReadOnlyDictionary<string, SequenceProvider>)(new ReadOnlyDictionary<string, SequenceProvider>(items));
|
||||
return (IReadOnlyDictionary<string, SequenceProvider>)new ReadOnlyDictionary<string, SequenceProvider>(items);
|
||||
});
|
||||
|
||||
initialThreadId = Environment.CurrentManagedThreadId;
|
||||
|
||||
@@ -254,7 +254,7 @@ namespace OpenRA.Network
|
||||
var clientsNode = new MiniYaml("");
|
||||
var i = 0;
|
||||
foreach (var c in Clients)
|
||||
clientsNode.Nodes.Add(new MiniYamlNode("Client@" + (i++).ToString(), FieldSaver.Save(c)));
|
||||
clientsNode.Nodes.Add(new MiniYamlNode("Client@" + i++.ToString(), FieldSaver.Save(c)));
|
||||
|
||||
root.Add(new MiniYamlNode("Clients", clientsNode));
|
||||
return new MiniYaml("", root)
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.Network
|
||||
|
||||
var currentTimestep = timestep();
|
||||
|
||||
var integralTickTimestep = (tickDelta / currentTimestep) * currentTimestep;
|
||||
var integralTickTimestep = tickDelta / currentTimestep * currentTimestep;
|
||||
lastTickTime += integralTickTimestep >= Game.TimestepJankThreshold
|
||||
? integralTickTimestep
|
||||
: currentTimestep;
|
||||
|
||||
@@ -63,8 +63,8 @@ namespace OpenRA.Traits
|
||||
float2 GetScrollOffset()
|
||||
{
|
||||
return GetMultiplier() * GetIntensity() * new float2(
|
||||
(float)Math.Sin((ticks * 2 * Math.PI) / 4),
|
||||
(float)Math.Cos((ticks * 2 * Math.PI) / 5));
|
||||
(float)Math.Sin(ticks * 2 * Math.PI / 4),
|
||||
(float)Math.Cos(ticks * 2 * Math.PI / 5));
|
||||
}
|
||||
|
||||
float2 GetMultiplier()
|
||||
|
||||
Reference in New Issue
Block a user