diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index 0fe7b1e8e..112e54bfc 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -224,13 +224,11 @@ Note: All fields default to false unless mentioned otherwise. // 0 meaning that the default is to be used, 2 equalling the density of a light level of 250, and 255 equalling the density of // a light level of 0. - portal_ceil_alpha = // translucency of ceiling portal (default is 0 (not visible)) portal_ceil_blocksound = // ceiling portal blocks sound. portal_ceil_disabled = // ceiling portal disabled. portal_ceil_nopass = // ceiling portal blocks movement if true. portal_ceil_norender = // ceiling portal not rendered. portal_ceil_overlaytype = // defines translucency style, can either be "translucent" or "additive". Default is "translucent". - portal_floor_alpha = // translucency of floor portal (default is 0 (not visible)) portal_floor_blocksound = // floor portal blocks sound. portal_floor_disabled = // floor portal disabled. portal_floor_nopass = // ceiling portal blocks movement if true. diff --git a/src/gl/scene/gl_portal.cpp b/src/gl/scene/gl_portal.cpp index 02fd9b452..86ea68b39 100644 --- a/src/gl/scene/gl_portal.cpp +++ b/src/gl/scene/gl_portal.cpp @@ -777,6 +777,8 @@ void GLPlaneMirrorPortal::DrawContents() ClearScreen(); return; } + // A plane mirror needs to flip the portal exclusion logic because inside the mirror, up is down and down is up. + std::swap(instack[sector_t::floor], instack[sector_t::ceiling]); int old_pm=PlaneMirrorMode; @@ -794,6 +796,7 @@ void GLPlaneMirrorPortal::DrawContents() gl_RenderState.SetClipHeight(0.f, 0.f); PlaneMirrorFlag--; PlaneMirrorMode=old_pm; + std::swap(instack[sector_t::floor], instack[sector_t::ceiling]); } void GLPlaneMirrorPortal::PushState() diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index f79549a39..642e31c91 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -916,7 +916,7 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal) RenderStyle = LegacyRenderStyles[STYLE_Translucent]; OverrideShader = gl_fuzztype + 4; trans = 0.99f; // trans may not be 1 here - hw_styleflags |= STYLEHW_NoAlphaTest; + hw_styleflags = STYLEHW_NoAlphaTest; } else { diff --git a/src/gl/textures/gl_material.cpp b/src/gl/textures/gl_material.cpp index dd224b8e0..5aa1d75b9 100644 --- a/src/gl/textures/gl_material.cpp +++ b/src/gl/textures/gl_material.cpp @@ -187,6 +187,7 @@ unsigned char * FGLTexture::CreateTexBuffer(int translation, int & w, int & h, F { unsigned char * buffer; int W, H; + int isTransparent = -1; // Textures that are already scaled in the texture lump will not get replaced @@ -224,14 +225,16 @@ unsigned char * FGLTexture::CreateTexBuffer(int translation, int & w, int & h, F int trans = tex->CopyTrueColorPixels(&imgCreate, exx, exx); bmp.CopyPixelDataRGB(0, 0, imgCreate.GetPixels(), W, H, 4, W * 4, 0, CF_BGRA); tex->CheckTrans(buffer, W*H, trans); - bIsTransparent = tex->gl_info.mIsTransparent; + isTransparent = tex->gl_info.mIsTransparent; + if (bIsTransparent == -1) bIsTransparent = isTransparent; } } else if (translation<=0) { int trans = tex->CopyTrueColorPixels(&bmp, exx, exx); tex->CheckTrans(buffer, W*H, trans); - bIsTransparent = tex->gl_info.mIsTransparent; + isTransparent = tex->gl_info.mIsTransparent; + if (bIsTransparent == -1) bIsTransparent = isTransparent; } else { @@ -239,7 +242,8 @@ unsigned char * FGLTexture::CreateTexBuffer(int translation, int & w, int & h, F // Since FTexture's method is doing exactly that by calling GetPixels let's use that here // to do all the dirty work for us. ;) tex->FTexture::CopyTrueColorPixels(&bmp, exx, exx); - bIsTransparent = 0; + isTransparent = 0; + // This is not conclusive for setting the texture's transparency info. } // if we just want the texture for some checks there's no need for upsampling. @@ -247,7 +251,7 @@ unsigned char * FGLTexture::CreateTexBuffer(int translation, int & w, int & h, F // [BB] The hqnx upsampling (not the scaleN one) destroys partial transparency, don't upsamle textures using it. // [BB] Potentially upsample the buffer. - return gl_CreateUpsampledTextureBuffer ( tex, buffer, W, H, w, h, !!bIsTransparent); + return gl_CreateUpsampledTextureBuffer ( tex, buffer, W, H, w, h, !!isTransparent); } diff --git a/src/namedef.h b/src/namedef.h index bb9d27f40..d50f8131d 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -518,14 +518,12 @@ xx(Alphaceiling) xx(Renderstylefloor) xx(Renderstyleceiling) xx(Waterzone) -xx(portal_ceil_alpha) xx(portal_ceil_blocksound) xx(portal_ceil_disabled) xx(portal_ceil_nopass) xx(portal_ceil_norender) xx(portal_ceil_overlaytype) xx(portal_ceil_useglobaltex) -xx(portal_floor_alpha) xx(portal_floor_blocksound) xx(portal_floor_disabled) xx(portal_floor_nopass) diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index b0427045c..461feb9c8 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -1582,10 +1582,6 @@ public: tagstring = CheckString(key); break; - case NAME_portal_ceil_alpha: - sec->planes[sector_t::ceiling].alpha = CheckFloat(key); - break; - case NAME_portal_ceil_blocksound: Flag(sec->planes[sector_t::ceiling].Flags, PLANEF_BLOCKSOUND, key); break; @@ -1607,10 +1603,6 @@ public: else if (!stricmp(CheckString(key), "additive")) sec->planes[sector_t::ceiling].Flags |= PLANEF_ADDITIVE; break; - case NAME_portal_floor_alpha: - sec->planes[sector_t::floor].alpha = CheckFloat(key); - break; - case NAME_portal_floor_blocksound: Flag(sec->planes[sector_t::floor].Flags, PLANEF_BLOCKSOUND, key); break;