Changeset 135 for binary-improvements/7dtd-server-fixes
- Timestamp:
- Aug 27, 2014, 5:41:07 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/MapRendering/MapRendering.cs
r132 r135 47 47 Chunk c = (Chunk)o; 48 48 Vector3i cPos = c.GetWorldPos (); 49 Vector2i cPos2 = new Vector2i (cPos.x / Constants.MAP_CHUNK_SIZE, cPos.z / Constants.MAP_CHUNK_SIZE);49 Vector2i cPos2 = new Vector2i (cPos.x / Constants.MAP_CHUNK_SIZE, cPos.z / Constants.MAP_CHUNK_SIZE); 50 50 Instance.RenderChunk (c, cPos2); 51 51 Instance.chunkSaveTimer.Stop (); … … 75 75 getWorldExtent (out minChunk, out maxChunk, out minPos, out maxPos, out widthChunks, out heightChunks, out widthPix, out heightPix); 76 76 77 Log.Out (String.Format ("RenderMap: min: {0}, max: {1}, minPos: {2}, maxPos: {3}, w/h: {4}/{5}, wP/hP: {6}/{7}", 78 minChunk.ToString (), maxChunk.ToString (), 79 minPos.ToString (), maxPos.ToString (), 80 widthChunks, heightChunks, 81 widthPix, heightPix)); 82 77 83 fullMapTexture = new Texture2D (widthPix, heightPix); 78 84 … … 93 99 94 100 byte[] array = fullMapTexture.EncodeToPNG (); 95 File.WriteAllBytes (Constants.MAP_DIRECTORY + "/map.png", array);101 File.WriteAllBytes (Constants.MAP_DIRECTORY + "/map.png", array); 96 102 Texture2D.Destroy (fullMapTexture); 97 103 … … 110 116 Log.Out ("------- SaveAllBlockMaps " + ++saveCount); 111 117 for (int i = 0; i < Constants.ZOOMLEVELS; i++) { 112 zoomLevelBuffers [i].SaveBlock();118 zoomLevelBuffers [i].SaveBlock (); 113 119 } 114 120 } finally { … … 140 146 } 141 147 142 zoomLevelBuffers [Constants.ZOOMLEVELS - 1].LoadBlock(block);143 zoomLevelBuffers [Constants.ZOOMLEVELS - 1].SetPart(blockOffset, Constants.MAP_CHUNK_SIZE, chunkColors);148 zoomLevelBuffers [Constants.ZOOMLEVELS - 1].LoadBlock (block); 149 zoomLevelBuffers [Constants.ZOOMLEVELS - 1].SetPart (blockOffset, Constants.MAP_CHUNK_SIZE, chunkColors); 144 150 145 151 if (renderingFullMap) … … 160 166 if (level > 0) { 161 167 Vector2i block, blockOffset; 162 getBlockNumber (innerBlock, out block, out blockOffset, 2, Constants.MAP_BLOCK_SIZE / 2);163 164 zoomLevelBuffers [level - 1].LoadBlock(block);165 zoomLevelBuffers [level - 1].SetPart (blockOffset, Constants.MAP_BLOCK_SIZE / 2, zoomLevelBuffers[level].GetHalfScaled());168 getBlockNumber (innerBlock, out block, out blockOffset, 2, Constants.MAP_BLOCK_SIZE / 2); 169 170 zoomLevelBuffers [level - 1].LoadBlock (block); 171 zoomLevelBuffers [level - 1].SetPart (blockOffset, Constants.MAP_BLOCK_SIZE / 2, zoomLevelBuffers [level].GetHalfScaled ()); 166 172 167 173 RenderZoomLevel (level - 1, block); … … 220 226 } 221 227 222 223 228 private Color32 shortColorToColor32 (ushort col) 224 229 {
Note:
See TracChangeset
for help on using the changeset viewer.