- Timestamp:
- Jan 27, 2023, 7:28:00 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/MapRendering/src/MapRenderBlockBuffer.cs
r391 r402 1 1 using System; 2 2 using System.IO; 3 using AllocsFixes.FileCache;4 3 using Unity.Collections; 5 4 using UnityEngine; … … 21 20 zoomLevel = _level; 22 21 cache = _cache; 23 folderBase = Constants.MapDirectory + "/" + zoomLevel + "/";22 folderBase = $"{Constants.MapDirectory}/{zoomLevel}/"; 24 23 25 24 { … … 52 51 saveTextureToFile (); 53 52 } catch (Exception e) { 54 Log.Warning ( "Exception in MapRenderBlockBuffer.SaveBlock(): " + e);53 Log.Warning ($"Exception in MapRenderBlockBuffer.SaveBlock(): {e}"); 55 54 } 56 55 Profiler.EndSample (); … … 64 63 string folder; 65 64 if (currentBlockMapPos.x != _block.x) { 66 folder = folderBase + _block.x + '/';65 folder = $"{folderBase}{_block.x}/"; 67 66 68 67 Profiler.BeginSample ("LoadBlock.Directory"); … … 73 72 } 74 73 75 string fileName = folder + _block.y + ".png";74 string fileName = $"{folder}{_block.y}.png"; 76 75 Profiler.EndSample (); 77 76 … … 105 104 public Color32[] GetHalfScaled () { 106 105 Profiler.BeginSample ("HalfScaled.ResizeBuffer"); 107 zoomBuffer.Re size (Constants.MapBlockSize, Constants.MapBlockSize);106 zoomBuffer.Reinitialize (Constants.MapBlockSize, Constants.MapBlockSize); 108 107 Profiler.EndSample (); 109 108 … … 156 155 Profiler.BeginSample ("HalfScaledNative.ResizeBuffer"); 157 156 if (zoomBuffer.format != blockMap.format || zoomBuffer.height != Constants.MapBlockSize / 2 || zoomBuffer.width != Constants.MapBlockSize / 2) { 158 zoomBuffer.Re size (Constants.MapBlockSize / 2, Constants.MapBlockSize / 2, blockMap.format, false);157 zoomBuffer.Reinitialize (Constants.MapBlockSize / 2, Constants.MapBlockSize / 2, blockMap.format, false); 159 158 } 160 159 Profiler.EndSample (); … … 206 205 207 206 if (array != null) { 208 Log.Error ( "Map image tile " + _fileName + "has been corrupted, recreating tile");207 Log.Error ($"Map image tile {_fileName} has been corrupted, recreating tile"); 209 208 } 210 209 211 210 if (blockMap.format != Constants.DefaultTextureFormat || blockMap.height != Constants.MapBlockSize || 212 211 blockMap.width != Constants.MapBlockSize) { 213 blockMap.Re size (Constants.MapBlockSize, Constants.MapBlockSize, Constants.DefaultTextureFormat,212 blockMap.Reinitialize (Constants.MapBlockSize, Constants.MapBlockSize, Constants.DefaultTextureFormat, 214 213 false); 215 214 }
Note:
See TracChangeset
for help on using the changeset viewer.