- Timestamp:
- Sep 22, 2014, 11:15:14 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/MapRendering/MapRenderBlockBuffer.cs
r189 r199 13 13 private Texture2D zoomBuffer = new Texture2D (1, 1); 14 14 private Color nullColor = new Color (0, 0, 0, 0); 15 private AllocsFixes.FileCache.MapTileCache cache; 15 16 16 public MapRenderBlockBuffer (int level )17 public MapRenderBlockBuffer (int level, AllocsFixes.FileCache.MapTileCache cache) 17 18 { 18 19 zoomLevel = level; 20 this.cache = cache; 19 21 } 20 22 … … 68 70 private void loadTextureFromFile (string _fileName) 69 71 { 70 try {71 byte[] array = File.ReadAllBytes (_fileName);72 byte[] array = cache.LoadTile (zoomLevel, _fileName); 73 if (array != null) { 72 74 blockMap.LoadImage (array); 73 } catch (Exception) { 75 } else { 76 //try { 77 //byte[] array = File.ReadAllBytes (_fileName); 78 //blockMap.LoadImage (array); 79 //} catch (Exception) { 74 80 for (int x = 0; x < Constants.MAP_BLOCK_SIZE; x++) { 75 81 for (int y = 0; y < Constants.MAP_BLOCK_SIZE; y++) { … … 82 88 private void saveTextureToFile (string _fileName) 83 89 { 84 try { 85 byte[] array = blockMap.EncodeToPNG (); 86 File.WriteAllBytes (_fileName, array); 87 } catch (Exception e) { 88 Log.Out ("Exception in MapRenderBlockBuffer.saveTextureToFile(): " + e); 89 } 90 byte[] array = blockMap.EncodeToPNG (); 91 cache.SaveTile (zoomLevel, array); 92 // try { 93 // byte[] array = blockMap.EncodeToPNG (); 94 // File.WriteAllBytes (_fileName, array); 95 // } catch (Exception e) { 96 // Log.Out ("Exception in MapRenderBlockBuffer.saveTextureToFile(): " + e); 97 // } 90 98 } 91 99
Note:
See TracChangeset
for help on using the changeset viewer.