| 475 | |
| 476 | |
| 477 | void cDistortedHeightmap::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap & a_HeightMap) |
| 478 | { |
| 479 | PrepareState(a_ChunkX, a_ChunkZ); |
| 480 | for (int z = 0; z < cChunkDef::Width; z++) |
| 481 | { |
| 482 | for (int x = 0; x < cChunkDef::Width; x++) |
| 483 | { |
| 484 | int NoiseArrayIdx = x + 17 * 257 * z; |
| 485 | cChunkDef::SetHeight(a_HeightMap, x, z, m_SeaLevel - 1); |
| 486 | for (int y = cChunkDef::Height - 1; y > m_SeaLevel - 1; y--) |
| 487 | { |
| 488 | int HeightMapHeight = (int)m_DistortedHeightmap[NoiseArrayIdx + 17 * y]; |
| 489 | if (y < HeightMapHeight) |
| 490 | { |
| 491 | cChunkDef::SetHeight(a_HeightMap, x, z, y); |
| 492 | break; |
| 493 | } |
| 494 | } // for y |
| 495 | } // for x |
| 496 | } // for z |
| 497 | } |
| 498 | |
| 499 | |
| 500 |
no outgoing calls
no test coverage detected