Changeset 269
- Timestamp:
- Apr 28, 2016, 1:58:34 PM (9 years ago)
- Location:
- binary-improvements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/FileCache/MapTileCache.cs
r199 r269 17 17 private CurrentZoomFile[] cache; 18 18 19 public MapTileCache () 19 private byte[] transparentTile; 20 21 public MapTileCache (int _tileSize) 20 22 { 23 UnityEngine.Texture2D tex = new UnityEngine.Texture2D (_tileSize, _tileSize); 24 UnityEngine.Color nullColor = new UnityEngine.Color (0, 0, 0, 0); 25 for (int x = 0; x < _tileSize; x++) { 26 for (int y = 0; y < _tileSize; y++) { 27 tex.SetPixel (x, y, nullColor); 28 } 29 } 30 transparentTile = tex.EncodeToPNG (); 31 UnityEngine.Object.Destroy (tex); 21 32 } 22 33 … … 72 83 73 84 if (!File.Exists (filename)) { 74 return null;85 return transparentTile; 75 86 } 76 87 return File.ReadAllBytes (filename); -
binary-improvements/MapRendering/MapRendering/MapRendering.cs
r238 r269 29 29 public static bool renderingEnabled = true; 30 30 private MicroStopwatch msw = new MicroStopwatch (); 31 private AllocsFixes.FileCache.MapTileCache cache = new AllocsFixes.FileCache.MapTileCache ( );31 private AllocsFixes.FileCache.MapTileCache cache = new AllocsFixes.FileCache.MapTileCache (Constants.MAP_BLOCK_SIZE); 32 32 33 33 public static AllocsFixes.FileCache.MapTileCache GetTileCache() {
Note:
See TracChangeset
for help on using the changeset viewer.