diff options
| author | xolatile | 2025-08-10 00:19:46 +0200 |
|---|---|---|
| committer | xolatile | 2025-08-10 00:19:46 +0200 |
| commit | 757096e7df15c14b9b10352fa91663483f9e34f8 (patch) | |
| tree | dcad789d0abd8be76463277dc01bf32c4e6a527b /src/engine/lightmap.cpp | |
| parent | b2c89d7060e99a36c8c7ac897b7386686c74deac (diff) | |
| download | xolatile-badassbug-757096e7df15c14b9b10352fa91663483f9e34f8.tar.xz xolatile-badassbug-757096e7df15c14b9b10352fa91663483f9e34f8.tar.zst | |
all
Diffstat (limited to 'src/engine/lightmap.cpp')
| -rw-r--r-- | src/engine/lightmap.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/engine/lightmap.cpp b/src/engine/lightmap.cpp index 0a9daf1..c15e4b6 100644 --- a/src/engine/lightmap.cpp +++ b/src/engine/lightmap.cpp @@ -194,7 +194,7 @@ void show_calclight_progress() { int bpp = lm.bpp; if(tasklock) SDL_UnlockMutex(tasklock); glBindTexture(GL_TEXTURE_2D, progresstex); - glPixelStorei(GL_UNPACK_ALIGNMENT, texalign(data, LM_PACKW, bpp)); + glPixelStorei(GL_UNPACK_ALIGNMENT, texalign(LM_PACKW, bpp)); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, LM_PACKW, LM_PACKH, bpp > 3 ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE, data); } renderprogress(bar1, text1, progresstexticks ? progresstex : 0); @@ -428,7 +428,7 @@ static bool lumelsample(const vec &sample, int aasample, int stride) { return false; } -static inline void generatealpha(lightmapworker *w, float tolerance, const vec &pos, uchar &alpha) { +static inline void generatealpha(lightmapworker *w, const vec &pos, uchar &alpha) { alpha = 0; if(w->slot->layermask) { static const int sdim[] = { 1, 0, 0 }, tdim[] = { 2, 2, 1 }; @@ -664,7 +664,6 @@ static int finishlightmap(lightmapworker *w) { static int previewlightmapalpha(lightmapworker *w, float lpu, const vec &origin1, const vec &xstep1, const vec &ystep1, const vec &origin2, const vec &xstep2, const vec &ystep2, float side0, float sidestep) { extern int fullbrightlevel; - float tolerance = 0.5 / lpu; uchar *dst = w->colorbuf; uchar minalpha = 255, maxalpha = 0; float sidex = side0; @@ -674,7 +673,7 @@ static int previewlightmapalpha(lightmapworker *w, float lpu, const vec &origin1 vec(xstep1).mul(x).add(vec(ystep1).mul(y)).add(origin1) : vec(xstep2).mul(x).add(vec(ystep2).mul(y)).add(origin2); loopk(3) dst[k] = fullbrightlevel; - generatealpha(w, tolerance, u, dst[3]); + generatealpha(w, u, dst[3]); minalpha = min(minalpha, dst[3]); maxalpha = max(maxalpha, dst[3]); } @@ -771,7 +770,7 @@ const vector<int> &checklightcache(int x, int y) { return lce.lights; } -static inline void addlight(lightmapworker *w, const extentity &light, int cx, int cy, int cz, int size, const vec *v, const vec *n, int numv) { +static inline void addlight(lightmapworker *w, const extentity &light, int cx, int cy, int cz, int size, const vec *v, const vec *n) { int radius = light.attr1; if(radius > 0) { if(light.o.x + radius < cx || light.o.x - radius > cx + size || @@ -790,7 +789,7 @@ static inline void addlight(lightmapworker *w, const extentity &light, int cx, i } } -static bool findlights(lightmapworker *w, int cx, int cy, int cz, int size, const vec *v, const vec *n, int numv, const Slot &slot, const VSlot &vslot) { +static bool findlights(lightmapworker *w, int cx, int cy, int cz, int size, const vec *v, const vec *n, const VSlot &vslot) { w->lights.setsize(0); const vector<extentity *> &ents = entities::getents(); static volatile bool usinglightcache = false; @@ -800,7 +799,7 @@ static bool findlights(lightmapworker *w, int cx, int cy, int cz, int size, cons loopv(lights) { const extentity &light = *ents[lights[i]]; switch(light.type) { - case ET_LIGHT: addlight(w, light, cx, cy, cz, size, v, n, numv); break; + case ET_LIGHT: addlight(w, light, cx, cy, cz, size, v, n); break; } } if(lightlock) { usinglightcache = false; SDL_UnlockMutex(lightlock); } @@ -808,7 +807,7 @@ static bool findlights(lightmapworker *w, int cx, int cy, int cz, int size, cons else loopv(ents) { const extentity &light = *ents[i]; switch(light.type) { - case ET_LIGHT: addlight(w, light, cx, cy, cz, size, v, n, numv); break; + case ET_LIGHT: addlight(w, light, cx, cy, cz, size, v, n); break; } } if(vslot.layer) return true; @@ -1132,7 +1131,7 @@ static lightmapinfo *setupsurfaces(lightmapworker *w, lightmaptask &task) { numlitverts += numverts; } } - if(!findlights(w, mo.x, mo.y, mo.z, msz, pos, n, numverts, *vslot.slot, vslot)) { + if(!findlights(w, mo.x, mo.y, mo.z, msz, pos, n, vslot)) { if(surf.numverts&MAXFACEVERTS) surf.numverts |= LAYER_TOP; continue; } @@ -1391,6 +1390,7 @@ bool lightmapworker::setupthread() { } static Uint32 calclighttimer(Uint32 interval, void *param) { + (void) param; check_calclight_progress = true; return interval; } @@ -1683,7 +1683,7 @@ void lightent(extentity &e, float height) { } else if(e.type>=ET_GAMESPECIFIC) ambient = 0.4f; vec target(e.o.x, e.o.y, e.o.z + height); - lightreaching(target, e.light.color, e.light.dir, false, &e, ambient); + lightreaching(target, e.light.color, e.light.dir, &e, ambient); } void lightents(bool force) { @@ -1705,7 +1705,7 @@ void initlights() { shouldlightents = true; } -void lightreaching(const vec &target, vec &color, vec &dir, bool fast, extentity *t, float ambient) { +void lightreaching(const vec &target, vec &color, vec &dir, extentity *t, float ambient) { if((fullbright && editmode) || lightmaps.empty()) { color = vec(1, 1, 1); dir = vec(0, 0, 1); |
