add possibility to skip minimap load

This commit is contained in:
in0finite 2021-01-31 03:21:02 +01:00
parent 6692eaec18
commit c6dea949cf
2 changed files with 7 additions and 2 deletions

View file

@ -41,6 +41,8 @@
"dontLoadTextures": false,
"skip_minimap_load": false,
"server_name": "San Andreas Unity Server",
"RCON_enabled": false,

View file

@ -111,6 +111,9 @@ namespace SanAndreasUnity.Behaviours
{
MapTexture = new Texture2D(mapSize, mapSize, TextureFormat.ARGB32, false, true);
if (Config.Get<bool>("skip_minimap_load"))
return;
TextureLoadParams textureLoadParams = new TextureLoadParams() { makeNoLongerReadable = false };
for (int i = 0; i < tileCount; i++)
@ -125,8 +128,8 @@ namespace SanAndreasUnity.Behaviours
Texture2D tex = texDict.GetDiffuse(name, textureLoadParams).Texture;
for (int ii = 0; ii < texSize; ++ii)
for (int jj = 0; jj < texSize; ++jj)
MapTexture.SetPixel(x + ii, texSize - (y + jj) - 1, tex.GetPixel(ii, jj));
for (int jj = 0; jj < texSize; ++jj)
MapTexture.SetPixel(x + ii, texSize - (y + jj) - 1, tex.GetPixel(ii, jj));
// unload the texture (don't destroy it, because it can be a dummy texture)