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:
RoosterDragon
2014-06-04 01:22:47 +01:00
parent 334a210231
commit a2ed4fd5f9
11 changed files with 40 additions and 22 deletions

View File

@@ -83,7 +83,7 @@ namespace OpenRA.Mods.Cnc
loadTimer.Restart();
loadTick = ++loadTick % 8;
r.BeginFrame(float2.Zero, 1f);
r.BeginFrame(int2.Zero, 1f);
r.RgbaSpriteRenderer.DrawSprite(gdiLogo, gdiPos);
r.RgbaSpriteRenderer.DrawSprite(nodLogo, nodPos);
r.RgbaSpriteRenderer.DrawSprite(evaLogo, evaPos);