Avoid redundantly setting viewport parameters in BeginFrame.
- Cache the old resolution, scroll and zoom in BeginFrame, and don't bother updating the viewport parameters again until they change. - Pass around scroll as an int2 to reduce the number of back-and-forth casts.
This commit is contained in:
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Cnc
|
||||
if (r == null)
|
||||
return;
|
||||
|
||||
r.BeginFrame(float2.Zero, 1f);
|
||||
r.BeginFrame(int2.Zero, 1f);
|
||||
WidgetUtils.FillRectWithSprite(bounds, sprite);
|
||||
r.EndFrame(new NullInputHandler());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user