Avoid initialization of graphical elements for a server.

Avoid allocating memory and resources for graphical elements that will never be drawn when starting a dedicated server. This reduces the server memory footprint by approx 17 MiB.
This commit is contained in:
RoosterDragon
2015-01-04 19:22:41 +00:00
parent 58dc61e6ed
commit 2c34358372
4 changed files with 13 additions and 8 deletions

View File

@@ -52,9 +52,12 @@ namespace OpenRA.Graphics
Device = CreateDevice(Assembly.LoadFile(rendererPath), resolution.Width, resolution.Height, graphicSettings.Mode);
TempBufferSize = graphicSettings.BatchSize;
TempBufferCount = graphicSettings.NumTempBuffers;
SheetSize = graphicSettings.SheetSize;
if (!serverSettings.Dedicated)
{
TempBufferSize = graphicSettings.BatchSize;
TempBufferCount = graphicSettings.NumTempBuffers;
SheetSize = graphicSettings.SheetSize;
}
WorldSpriteRenderer = new SpriteRenderer(this, Device.CreateShader("shp"));
WorldRgbaSpriteRenderer = new SpriteRenderer(this, Device.CreateShader("rgba"));