This commit is contained in:
Rachael Alexanderson 2016-12-29 13:57:50 -05:00
commit 308e768903
6 changed files with 12 additions and 17 deletions

View file

@ -224,13 +224,11 @@ Note: All <bool> 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 = <float> // translucency of ceiling portal (default is 0 (not visible))
portal_ceil_blocksound = <bool> // ceiling portal blocks sound.
portal_ceil_disabled = <bool> // ceiling portal disabled.
portal_ceil_nopass = <bool> // ceiling portal blocks movement if true.
portal_ceil_norender = <bool> // ceiling portal not rendered.
portal_ceil_overlaytype = <string> // defines translucency style, can either be "translucent" or "additive". Default is "translucent".
portal_floor_alpha = <float> // translucency of floor portal (default is 0 (not visible))
portal_floor_blocksound = <bool> // floor portal blocks sound.
portal_floor_disabled = <bool> // floor portal disabled.
portal_floor_nopass = <bool> // ceiling portal blocks movement if true.

View file

@ -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()

View file

@ -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
{

View file

@ -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);
}

View file

@ -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)

View file

@ -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;