From d085675aaa6ea427fa6417745387ebc9d2e77afc Mon Sep 17 00:00:00 2001 From: xolatile Date: Mon, 21 Jul 2025 12:26:47 +0200 Subject: Removed PVS code because it will never be used... --- src/engine/water.cpp | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'src/engine/water.cpp') diff --git a/src/engine/water.cpp b/src/engine/water.cpp index 07c24c2..9ae5847 100644 --- a/src/engine/water.cpp +++ b/src/engine/water.cpp @@ -201,7 +201,7 @@ int renderwaterlod(int x, int y, int z, int size, int mat) if(subdiv2 >= size) rendervertwater(childsize, x + childsize, y, z, childsize, mat); if(subdiv3 >= size) rendervertwater(childsize, x + childsize, y + childsize, z, childsize, mat); if(subdiv4 >= size) rendervertwater(childsize, x, y + childsize, z, childsize, mat); - } + } } return minsubdiv; } @@ -316,7 +316,7 @@ void setprojtexmatrix(Reflection &ref) ref.init = false; (ref.projmat = camprojmatrix).projective(); } - + LOCALPARAM(watermatrix, ref.projmat); } @@ -395,7 +395,7 @@ void renderwater() } else SETWATERSHADER(above, waterenv); } - else if(waterrefract) + else if(waterrefract) { if(waterfade) SETWATERSHADER(above, waterfade); else SETWATERSHADER(above, waterrefract); @@ -429,7 +429,7 @@ void renderwater() } bool below = camera1->o.z < ref.height+offset; - if(below) + if(below) { if(!belowshader) continue; belowshader->set(); @@ -448,7 +448,7 @@ void renderwater() { glActiveTexture_(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, ref.refracttex); - if(waterfade) + if(waterfade) { float fadeheight = ref.height+offset+(below ? -2 : 2); LOCALPARAMF(waterheight, fadeheight); @@ -652,7 +652,7 @@ void addreflection(materialsurface &m) { if(!ref) ref = &r; } - else if(r.height==height && r.material==mat) + else if(r.height==height && r.material==mat) { r.matsurfs.add(&m); r.depth = max(r.depth, int(m.depth)); @@ -667,7 +667,7 @@ void addreflection(materialsurface &m) if(!oldest || oldest->age<0) return; ref = oldest; } - if(ref->height!=height || ref->material!=mat) + if(ref->height!=height || ref->material!=mat) { ref->material = mat; ref->height = height; @@ -699,7 +699,7 @@ static void drawmaterialquery(const materialsurface &m, float offset, float bord #define GENFACEORIENT(orient, v0, v1, v2, v3) \ case orient: v0 v1 v2 v3 break; #define GENFACEVERT(orient, vert, mx,my,mz, sx,sy,sz) \ - gle::attribf(mx sx, my sy, mz sz); + gle::attribf(mx sx, my sy, mz sz); GENFACEVERTS(x, x, y, y, z, z, - border, + csize, - border, + rsize, + offset, - offset) #undef GENFACEORIENT #undef GENFACEVERT @@ -766,24 +766,24 @@ void queryreflections() else addwaterfallrefraction(m); } } - + loopi(MAXREFLECTIONS) { Reflection &ref = reflections[i]; ++ref.age; - if(ref.height>=0 && !ref.age && ref.matsurfs.length()) - { - if(waterpvsoccluded(ref.height)) ref.matsurfs.setsize(0); - } + //~if(ref.height>=0 && !ref.age && ref.matsurfs.length()) + //~{ + //~/***/ref.matsurfs.setsize(0); + //~} } if(waterfallrefract) { Reflection &ref = waterfallrefraction; ++ref.age; - if(ref.height>=0 && !ref.age && ref.matsurfs.length()) - { - if(waterpvsoccluded(-1)) ref.matsurfs.setsize(0); - } + //~if(ref.height>=0 && !ref.age && ref.matsurfs.length()) + //~{ + //~/***/ref.matsurfs.setsize(0); + //~} } if((editmode && showmat && !drawtex) || !oqfrags || !oqwater || drawtex == DRAWTEX_MINIMAP) return; @@ -902,9 +902,9 @@ static bool calcscissorbox(Reflection &ref, int size, vec &clipmin, vec &clipmax loopi(8) { const vec4 &p = v[i]; - if(p.z >= -p.w) continue; + if(p.z >= -p.w) continue; loopj(3) - { + { const vec4 &o = v[i^(1<owner==&ref) - { + { if(!ref.prevquery || ref.prevquery->owner!=&ref || checkquery(ref.prevquery)) { if(checkquery(ref.query)) continue; } } - if(!refs) + if(!refs) { glViewport(0, 0, size, size); glBindFramebuffer_(GL_FRAMEBUFFER, reflectionfb); @@ -988,7 +988,7 @@ void drawreflections() if(scissor) glEnable(GL_SCISSOR_TEST); maskreflection(ref, offset, true); savevfcP(); - setvfcP(ref.height+offset, clipmin, clipmax); + setvfcP(ref.height+offset, clipmin, clipmax); drawreflection(ref.height+offset, false); restorevfcP(); if(scissor) glDisable(GL_SCISSOR_TEST); @@ -1007,7 +1007,7 @@ void drawreflections() restorevfcP(); } if(scissor) glDisable(GL_SCISSOR_TEST); - } + } if(refs>=maxreflect) break; } @@ -1048,7 +1048,7 @@ void drawreflections() maskreflection(ref, -0.1f, false); savevfcP(); setvfcP(-1, clipmin, clipmax); - drawreflection(-1, true); + drawreflection(-1, true); restorevfcP(); if(scissor) glDisable(GL_SCISSOR_TEST); } -- cgit v1.2.3