mirror of
https://github.com/ZDoom/ZDRay.git
synced 2024-11-22 03:51:26 +00:00
- make the LIGHTMAP_MAX_SIZE define actually work if someone changes it
This commit is contained in:
parent
ed983935ec
commit
0f6da0df5d
2 changed files with 6 additions and 5 deletions
|
@ -463,7 +463,7 @@ void kexLightmapBuilder::TraceSurface(surface_t *surface)
|
|||
}
|
||||
|
||||
kexMath::Clamp(c, 0, 1);
|
||||
colorSamples[i * 1024 + j] = c;
|
||||
colorSamples[i * LIGHTMAP_MAX_SIZE + j] = c;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -525,9 +525,9 @@ void kexLightmapBuilder::TraceSurface(surface_t *surface)
|
|||
int offs = (((textureWidth * (i + surface->lightmapOffs[1])) + surface->lightmapOffs[0]) * 3);
|
||||
|
||||
// convert RGB to bytes
|
||||
currentTexture[offs + j * 3 + 0] = floatToHalf(colorSamples[i * 1024 + j].x);
|
||||
currentTexture[offs + j * 3 + 1] = floatToHalf(colorSamples[i * 1024 + j].y);
|
||||
currentTexture[offs + j * 3 + 2] = floatToHalf(colorSamples[i * 1024 + j].z);
|
||||
currentTexture[offs + j * 3 + 0] = floatToHalf(colorSamples[i * LIGHTMAP_MAX_SIZE + j].x);
|
||||
currentTexture[offs + j * 3 + 1] = floatToHalf(colorSamples[i * LIGHTMAP_MAX_SIZE + j].y);
|
||||
currentTexture[offs + j * 3 + 2] = floatToHalf(colorSamples[i * LIGHTMAP_MAX_SIZE + j].z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
#include "worker.h"
|
||||
#include "math/mathlib.h"
|
||||
#include "lightmap.h"
|
||||
#include <vector>
|
||||
#include <thread>
|
||||
#include <algorithm>
|
||||
|
@ -24,7 +25,7 @@ void kexWorker::RunJob(int count, std::function<void(int)> callback)
|
|||
{
|
||||
threads.push_back(std::thread([=]() {
|
||||
|
||||
std::vector<kexVec3> samples(1024 * 1024);
|
||||
std::vector<kexVec3> samples(LIGHTMAP_MAX_SIZE * LIGHTMAP_MAX_SIZE);
|
||||
colorSamples = samples.data();
|
||||
|
||||
int start = threadIndex * count / numThreads;
|
||||
|
|
Loading…
Reference in a new issue