Skip to content

Commit 3a2902f

Browse files
committed
Revert noise map generation
MSVC doesnt like this
1 parent 9bde384 commit 3a2902f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/graphics/opengl/renderer.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,12 @@ Renderer::Renderer(Platform::Window &window, const std::string &shaderDirectory)
247247
// Initialize noise map
248248
//
249249
std::mt19937 mt(std::chrono::system_clock::now().time_since_epoch().count());
250-
std::uniform_int_distribution<uint8_t> dist;
250+
std::uniform_int_distribution dist(0, 0xff);
251251

252252
auto noiseSurface = Surface(32, 32, 64, kRGBA8);
253253
auto noiseSurfaceSpan = noiseSurface.getData<glm::u8vec4>();
254254
for (int i = 0; i < 32 * 32 * 64; ++i) {
255-
const auto date = dist(mt);
256-
noiseSurfaceSpan[i] = glm::u8vec4{date};
255+
noiseSurfaceSpan[i] = glm::u8vec4{static_cast<uint8_t>(dist(mt))};
257256
}
258257

259258
_noiseMap = std::make_unique<Texture>(_loadingTasks, GL_TEXTURE_3D, "noise_map");

0 commit comments

Comments
 (0)