Make the minimum items per thread explicit. Found some bugs, optional arguments are evil.

This commit is contained in:
Henrik Rydgård committed 2021-06-12 21:21:28 +02:00
1 parent 0fa27ff9d7
commit 3be5c7bd9a
12 files changed
+60 -44

No files matched your search

+2 -1
View File
@@ -748,12 +748,13 @@ void ReplacedTexture::Load(int level, void *out, int rowPitch) {
int w, h, f;
uint8_t *image;
const int MIN_LINES_PER_THREAD = 4;
if (LoadZIMPtr(&zim[0], zimSize, &w, &h, &f, &image)) {
ParallelRangeLoop(&g_threadManager, [&](int l, int h) {
for (int y = l; y < h; ++y) {
memcpy((uint8_t *)out + rowPitch * y, image + w * 4 * y, w * 4);
}
}, 0, h);
}, 0, h, MIN_LINES_PER_THREAD);
free(image);
}