| 1048 | GSoundScene->Reset(); |
| 1049 | } |
| 1050 | |
| 1051 | void World::AdjustSubdivisionGrid(float gridSize) |
| 1052 | { |
| 1053 | const float invLog2 = 1 / log(2); |
| 1054 | float coefLog = log(LandGrid / gridSize) * invLog2; |
| 1055 | int coefLogInt = toInt(coefLog); |
| 1056 | saturate(coefLogInt, 0, 8); |
| 1057 | LOG_DEBUG(World, "Terrain subdivision wanted: {} ({:.3f})", coefLogInt, coefLog); |
| 1058 | int currentLog = TerrainRangeLog - LandRangeLog; |
| 1059 | int terrainChange = coefLogInt - currentLog; |
| 1060 | |
| 1061 | if (terrainChange > 0) |
| 1062 | { |
| 1063 | if (!GLandscape->LoadSubdivCache(coefLogInt)) |
| 1064 | { |
| 1065 | GLandscape->SubdivideTerrain(terrainChange); |
| 1066 | GLandscape->SaveSubdivCache(coefLogInt); |
| 1067 | } |
| 1068 | } |
| 1069 | else if (terrainChange < 0) |
| 1070 | { |
| 1071 | GLandscape->ResampleTerrain(-terrainChange); |
| 1072 | } |
| 1073 | } |
| 1074 | |
| 1075 | void World::AdjustSubdivision(GameMode mode) |
no test coverage detected