mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-20 01:43:50 +00:00
Merge branch 'blentran-update' into udmf-full
# Conflicts: # src/lua_maplib.c # src/p_setup.c # src/p_spec.c
This commit is contained in:
commit
913731b4bc
22 changed files with 703 additions and 219 deletions
|
@ -3316,6 +3316,192 @@ linedeftypes
|
|||
title = "Fog Wall";
|
||||
prefix = "(909)";
|
||||
}
|
||||
|
||||
910
|
||||
{
|
||||
title = "100% Additive";
|
||||
prefix = "(910)";
|
||||
}
|
||||
|
||||
911
|
||||
{
|
||||
title = "90% Additive";
|
||||
prefix = "(911)";
|
||||
}
|
||||
|
||||
912
|
||||
{
|
||||
title = "80% Additive";
|
||||
prefix = "(912)";
|
||||
}
|
||||
|
||||
913
|
||||
{
|
||||
title = "70% Additive";
|
||||
prefix = "(913)";
|
||||
}
|
||||
|
||||
914
|
||||
{
|
||||
title = "60% Additive";
|
||||
prefix = "(914)";
|
||||
}
|
||||
|
||||
915
|
||||
{
|
||||
title = "50% Additive";
|
||||
prefix = "(915)";
|
||||
}
|
||||
|
||||
916
|
||||
{
|
||||
title = "40% Additive";
|
||||
prefix = "(916)";
|
||||
}
|
||||
|
||||
917
|
||||
{
|
||||
title = "30% Additive";
|
||||
prefix = "(917)";
|
||||
}
|
||||
|
||||
918
|
||||
{
|
||||
title = "20% Additive";
|
||||
prefix = "(918)";
|
||||
}
|
||||
|
||||
919
|
||||
{
|
||||
title = "10% Additive";
|
||||
prefix = "(919)";
|
||||
}
|
||||
|
||||
920
|
||||
{
|
||||
title = "100% Subtractive";
|
||||
prefix = "(920)";
|
||||
}
|
||||
|
||||
921
|
||||
{
|
||||
title = "90% Subtractive";
|
||||
prefix = "(921)";
|
||||
}
|
||||
|
||||
922
|
||||
{
|
||||
title = "80% Subtractive";
|
||||
prefix = "(922)";
|
||||
}
|
||||
|
||||
923
|
||||
{
|
||||
title = "70% Subtractive";
|
||||
prefix = "(923)";
|
||||
}
|
||||
|
||||
924
|
||||
{
|
||||
title = "60% Subtractive";
|
||||
prefix = "(924)";
|
||||
}
|
||||
|
||||
925
|
||||
{
|
||||
title = "50% Subtractive";
|
||||
prefix = "(925)";
|
||||
}
|
||||
|
||||
926
|
||||
{
|
||||
title = "40% Subtractive";
|
||||
prefix = "(926)";
|
||||
}
|
||||
|
||||
927
|
||||
{
|
||||
title = "30% Subtractive";
|
||||
prefix = "(927)";
|
||||
}
|
||||
|
||||
928
|
||||
{
|
||||
title = "20% Subtractive";
|
||||
prefix = "(928)";
|
||||
}
|
||||
|
||||
929
|
||||
{
|
||||
title = "10% Subtractive";
|
||||
prefix = "(929)";
|
||||
}
|
||||
|
||||
930
|
||||
{
|
||||
title = "100% Reverse Subtractive";
|
||||
prefix = "(930)";
|
||||
}
|
||||
|
||||
931
|
||||
{
|
||||
title = "90% Reverse Subtractive";
|
||||
prefix = "(931)";
|
||||
}
|
||||
|
||||
932
|
||||
{
|
||||
title = "80% Reverse Subtractive";
|
||||
prefix = "(932)";
|
||||
}
|
||||
|
||||
933
|
||||
{
|
||||
title = "70% Reverse Subtractive";
|
||||
prefix = "(933)";
|
||||
}
|
||||
|
||||
934
|
||||
{
|
||||
title = "60% Reverse Subtractive";
|
||||
prefix = "(934)";
|
||||
}
|
||||
|
||||
935
|
||||
{
|
||||
title = "50% Reverse Subtractive";
|
||||
prefix = "(935)";
|
||||
}
|
||||
|
||||
936
|
||||
{
|
||||
title = "40% Reverse Subtractive";
|
||||
prefix = "(936)";
|
||||
}
|
||||
|
||||
937
|
||||
{
|
||||
title = "30% Reverse Subtractive";
|
||||
prefix = "(937)";
|
||||
}
|
||||
|
||||
938
|
||||
{
|
||||
title = "20% Reverse Subtractive";
|
||||
prefix = "(938)";
|
||||
}
|
||||
|
||||
939
|
||||
{
|
||||
title = "10% Reverse Subtractive";
|
||||
prefix = "(939)";
|
||||
}
|
||||
|
||||
940
|
||||
{
|
||||
title = "Modulate";
|
||||
prefix = "(940)";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -260,10 +260,10 @@ mapformat_udmf
|
|||
}
|
||||
|
||||
// LINEDEF RENDERSTYLES
|
||||
/*linedefrenderstyles
|
||||
linedefrenderstyles
|
||||
{
|
||||
include("SRB222_misc.cfg", "linedefrenderstyles");
|
||||
}*/
|
||||
}
|
||||
|
||||
// THING FLAGS
|
||||
thingflags
|
||||
|
|
|
@ -1570,6 +1570,161 @@ doom
|
|||
title = "Fog Wall";
|
||||
prefix = "(909)";
|
||||
}
|
||||
910
|
||||
{
|
||||
title = "100% Additive";
|
||||
prefix = "(910)";
|
||||
}
|
||||
911
|
||||
{
|
||||
title = "90% Additive";
|
||||
prefix = "(911)";
|
||||
}
|
||||
912
|
||||
{
|
||||
title = "80% Additive";
|
||||
prefix = "(912)";
|
||||
}
|
||||
913
|
||||
{
|
||||
title = "70% Additive";
|
||||
prefix = "(913)";
|
||||
}
|
||||
914
|
||||
{
|
||||
title = "60% Additive";
|
||||
prefix = "(914)";
|
||||
}
|
||||
915
|
||||
{
|
||||
title = "50% Additive";
|
||||
prefix = "(915)";
|
||||
}
|
||||
916
|
||||
{
|
||||
title = "40% Additive";
|
||||
prefix = "(916)";
|
||||
}
|
||||
917
|
||||
{
|
||||
title = "30% Additive";
|
||||
prefix = "(917)";
|
||||
}
|
||||
918
|
||||
{
|
||||
title = "20% Additive";
|
||||
prefix = "(918)";
|
||||
}
|
||||
919
|
||||
{
|
||||
title = "10% Additive";
|
||||
prefix = "(919)";
|
||||
}
|
||||
920
|
||||
{
|
||||
title = "100% Subtractive";
|
||||
prefix = "(920)";
|
||||
}
|
||||
921
|
||||
{
|
||||
title = "90% Subtractive";
|
||||
prefix = "(921)";
|
||||
}
|
||||
922
|
||||
{
|
||||
title = "80% Subtractive";
|
||||
prefix = "(922)";
|
||||
}
|
||||
923
|
||||
{
|
||||
title = "70% Subtractive";
|
||||
prefix = "(923)";
|
||||
}
|
||||
924
|
||||
{
|
||||
title = "60% Subtractive";
|
||||
prefix = "(924)";
|
||||
}
|
||||
925
|
||||
{
|
||||
title = "50% Subtractive";
|
||||
prefix = "(925)";
|
||||
}
|
||||
926
|
||||
{
|
||||
title = "40% Subtractive";
|
||||
prefix = "(926)";
|
||||
}
|
||||
927
|
||||
{
|
||||
title = "30% Subtractive";
|
||||
prefix = "(927)";
|
||||
}
|
||||
928
|
||||
{
|
||||
title = "20% Subtractive";
|
||||
prefix = "(928)";
|
||||
}
|
||||
929
|
||||
{
|
||||
title = "10% Subtractive";
|
||||
prefix = "(929)";
|
||||
}
|
||||
930
|
||||
{
|
||||
title = "100% Reverse Subtractive";
|
||||
prefix = "(930)";
|
||||
}
|
||||
931
|
||||
{
|
||||
title = "90% Reverse Subtractive";
|
||||
prefix = "(931)";
|
||||
}
|
||||
932
|
||||
{
|
||||
title = "80% Reverse Subtractive";
|
||||
prefix = "(932)";
|
||||
}
|
||||
933
|
||||
{
|
||||
title = "70% Reverse Subtractive";
|
||||
prefix = "(933)";
|
||||
}
|
||||
934
|
||||
{
|
||||
title = "60% Reverse Subtractive";
|
||||
prefix = "(934)";
|
||||
}
|
||||
935
|
||||
{
|
||||
title = "50% Reverse Subtractive";
|
||||
prefix = "(935)";
|
||||
}
|
||||
936
|
||||
{
|
||||
title = "40% Reverse Subtractive";
|
||||
prefix = "(936)";
|
||||
}
|
||||
937
|
||||
{
|
||||
title = "30% Reverse Subtractive";
|
||||
prefix = "(937)";
|
||||
}
|
||||
938
|
||||
{
|
||||
title = "20% Reverse Subtractive";
|
||||
prefix = "(938)";
|
||||
}
|
||||
939
|
||||
{
|
||||
title = "10% Reverse Subtractive";
|
||||
prefix = "(939)";
|
||||
}
|
||||
940
|
||||
{
|
||||
title = "Modulate";
|
||||
prefix = "(940)";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -63,11 +63,15 @@ linedefflags_udmf
|
|||
transfer = "Transfer Line";
|
||||
}
|
||||
|
||||
/*linedefrenderstyles
|
||||
linedefrenderstyles
|
||||
{
|
||||
translucent = "Translucent";
|
||||
add = "Add";
|
||||
subtract = "Subtract";
|
||||
reversesubtract = "Reverse subtract";
|
||||
modulate = "Modulate";
|
||||
fog = "Fog";
|
||||
}*/
|
||||
}
|
||||
|
||||
sectorflags
|
||||
{
|
||||
|
|
|
@ -4895,9 +4895,18 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"FF_RANDOMANIM",FF_RANDOMANIM},
|
||||
{"FF_GLOBALANIM",FF_GLOBALANIM},
|
||||
{"FF_FULLBRIGHT",FF_FULLBRIGHT},
|
||||
{"FF_SEMIBRIGHT",FF_SEMIBRIGHT},
|
||||
{"FF_FULLDARK",FF_FULLDARK},
|
||||
{"FF_VERTICALFLIP",FF_VERTICALFLIP},
|
||||
{"FF_HORIZONTALFLIP",FF_HORIZONTALFLIP},
|
||||
{"FF_PAPERSPRITE",FF_PAPERSPRITE},
|
||||
{"FF_FLOORSPRITE",FF_FLOORSPRITE},
|
||||
{"FF_BLENDMASK",FF_BLENDMASK},
|
||||
{"FF_BLENDSHIFT",FF_BLENDSHIFT},
|
||||
{"FF_ADD",FF_ADD},
|
||||
{"FF_SUBTRACT",FF_SUBTRACT},
|
||||
{"FF_REVERSESUBTRACT",FF_REVERSESUBTRACT},
|
||||
{"FF_MODULATE",FF_MODULATE},
|
||||
{"FF_TRANSMASK",FF_TRANSMASK},
|
||||
{"FF_TRANSSHIFT",FF_TRANSSHIFT},
|
||||
// new preshifted translucency (used in source)
|
||||
|
@ -4941,6 +4950,7 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"AST_REVERSESUBTRACT",AST_REVERSESUBTRACT},
|
||||
{"AST_MODULATE",AST_MODULATE},
|
||||
{"AST_OVERLAY",AST_OVERLAY},
|
||||
{"AST_FOG",AST_FOG},
|
||||
|
||||
// Render flags
|
||||
{"RF_HORIZONTALFLIP",RF_HORIZONTALFLIP},
|
||||
|
@ -4952,9 +4962,10 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"RF_OBJECTSLOPESPLAT",RF_OBJECTSLOPESPLAT},
|
||||
{"RF_NOSPLATBILLBOARD",RF_NOSPLATBILLBOARD},
|
||||
{"RF_NOSPLATROLLANGLE",RF_NOSPLATROLLANGLE},
|
||||
{"RF_BLENDMASK",RF_BLENDMASK},
|
||||
{"RF_BRIGHTMASK",RF_BRIGHTMASK},
|
||||
{"RF_FULLBRIGHT",RF_FULLBRIGHT},
|
||||
{"RF_FULLDARK",RF_FULLDARK},
|
||||
{"RF_SEMIBRIGHT",RF_SEMIBRIGHT},
|
||||
{"RF_NOCOLORMAPS",RF_NOCOLORMAPS},
|
||||
{"RF_SPRITETYPEMASK",RF_SPRITETYPEMASK},
|
||||
{"RF_PAPERSPRITE",RF_PAPERSPRITE},
|
||||
|
@ -5452,9 +5463,12 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"V_HUDTRANSHALF",V_HUDTRANSHALF},
|
||||
{"V_HUDTRANS",V_HUDTRANS},
|
||||
{"V_HUDTRANSDOUBLE",V_HUDTRANSDOUBLE},
|
||||
{"V_AUTOFADEOUT",V_AUTOFADEOUT},
|
||||
{"V_RETURN8",V_RETURN8},
|
||||
{"V_OFFSET",V_OFFSET},
|
||||
{"V_BLENDSHIFT",V_BLENDSHIFT},
|
||||
{"V_BLENDMASK",V_BLENDMASK},
|
||||
{"V_ADD",V_ADD},
|
||||
{"V_SUBTRACT",V_SUBTRACT},
|
||||
{"V_REVERSESUBTRACT",V_REVERSESUBTRACT},
|
||||
{"V_MODULATE",V_MODULATE},
|
||||
{"V_ALLOWLOWERCASE",V_ALLOWLOWERCASE},
|
||||
{"V_FLIP",V_FLIP},
|
||||
{"V_CENTERNAMETAG",V_CENTERNAMETAG},
|
||||
|
@ -5462,8 +5476,8 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"V_SNAPTOBOTTOM",V_SNAPTOBOTTOM},
|
||||
{"V_SNAPTOLEFT",V_SNAPTOLEFT},
|
||||
{"V_SNAPTORIGHT",V_SNAPTORIGHT},
|
||||
{"V_WRAPX",V_WRAPX},
|
||||
{"V_WRAPY",V_WRAPY},
|
||||
{"V_AUTOFADEOUT",V_AUTOFADEOUT},
|
||||
{"V_RETURN8",V_RETURN8},
|
||||
{"V_NOSCALESTART",V_NOSCALESTART},
|
||||
{"V_PERPLAYER",V_PERPLAYER},
|
||||
|
||||
|
|
|
@ -119,11 +119,6 @@ void HWR_DrawPatch(patch_t *gpatch, INT32 x, INT32 y, INT32 option)
|
|||
|
||||
flags = PF_Translucent|PF_NoDepthTest;
|
||||
|
||||
if (option & V_WRAPX)
|
||||
flags |= PF_ForceWrapX;
|
||||
if (option & V_WRAPY)
|
||||
flags |= PF_ForceWrapY;
|
||||
|
||||
// clip it since it is used for bunny scroll in doom I
|
||||
HWD.pfnDrawPolygon(NULL, v, 4, flags);
|
||||
}
|
||||
|
@ -135,6 +130,7 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
|||
float cx = FIXED_TO_FLOAT(x);
|
||||
float cy = FIXED_TO_FLOAT(y);
|
||||
UINT8 alphalevel = ((option & V_ALPHAMASK) >> V_ALPHASHIFT);
|
||||
UINT8 blendmode = ((option & V_BLENDMASK) >> V_BLENDSHIFT);
|
||||
GLPatch_t *hwrPatch;
|
||||
|
||||
// 3--2
|
||||
|
@ -145,9 +141,6 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
|||
|
||||
UINT8 perplayershuffle = 0;
|
||||
|
||||
if (alphalevel >= 10 && alphalevel < 13)
|
||||
return;
|
||||
|
||||
// make patch ready in hardware cache
|
||||
if (!colormap)
|
||||
HWR_GetPatch(gpatch);
|
||||
|
@ -191,15 +184,9 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
|||
offsetx = (float)(gpatch->leftoffset) * fscalew;
|
||||
|
||||
// top offset
|
||||
// TODO: make some kind of vertical version of V_FLIP, maybe by deprecating V_OFFSET in future?!?
|
||||
// TODO: make some kind of vertical version of V_FLIP
|
||||
offsety = (float)(gpatch->topoffset) * fscaleh;
|
||||
|
||||
if ((option & (V_NOSCALESTART|V_OFFSET)) == (V_NOSCALESTART|V_OFFSET)) // Multiply by dupx/dupy for crosshairs
|
||||
{
|
||||
offsetx *= dupx;
|
||||
offsety *= dupy;
|
||||
}
|
||||
|
||||
cx -= offsetx;
|
||||
cy -= offsety;
|
||||
}
|
||||
|
@ -359,21 +346,20 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p
|
|||
v[0].t = v[1].t = 0.0f;
|
||||
v[2].t = v[3].t = hwrPatch->max_t;
|
||||
|
||||
flags = PF_Translucent|PF_NoDepthTest;
|
||||
|
||||
if (option & V_WRAPX)
|
||||
flags |= PF_ForceWrapX;
|
||||
if (option & V_WRAPY)
|
||||
flags |= PF_ForceWrapY;
|
||||
|
||||
// clip it since it is used for bunny scroll in doom I
|
||||
if (blendmode)
|
||||
flags = HWR_GetBlendModeFlag(blendmode+1)|PF_NoDepthTest;
|
||||
else
|
||||
flags = PF_Translucent|PF_NoDepthTest;
|
||||
|
||||
if (alphalevel)
|
||||
{
|
||||
FSurfaceInfo Surf;
|
||||
Surf.PolyColor.s.red = Surf.PolyColor.s.green = Surf.PolyColor.s.blue = 0xff;
|
||||
if (alphalevel == 13) Surf.PolyColor.s.alpha = softwaretranstogl_lo[st_translucency];
|
||||
else if (alphalevel == 14) Surf.PolyColor.s.alpha = softwaretranstogl[st_translucency];
|
||||
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[st_translucency];
|
||||
|
||||
if (alphalevel == 10) Surf.PolyColor.s.alpha = softwaretranstogl_lo[st_translucency];
|
||||
else if (alphalevel == 11) Surf.PolyColor.s.alpha = softwaretranstogl[st_translucency];
|
||||
else if (alphalevel == 12) Surf.PolyColor.s.alpha = softwaretranstogl_hi[st_translucency];
|
||||
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||
flags |= PF_Modulated;
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
|
||||
|
@ -389,6 +375,7 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
float cx = FIXED_TO_FLOAT(x);
|
||||
float cy = FIXED_TO_FLOAT(y);
|
||||
UINT8 alphalevel = ((option & V_ALPHAMASK) >> V_ALPHASHIFT);
|
||||
UINT8 blendmode = ((option & V_BLENDMASK) >> V_BLENDSHIFT);
|
||||
GLPatch_t *hwrPatch;
|
||||
|
||||
// 3--2
|
||||
|
@ -399,9 +386,6 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
|
||||
UINT8 perplayershuffle = 0;
|
||||
|
||||
if (alphalevel >= 10 && alphalevel < 13)
|
||||
return;
|
||||
|
||||
// make patch ready in hardware cache
|
||||
if (!colormap)
|
||||
HWR_GetPatch(gpatch);
|
||||
|
@ -589,13 +573,6 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
else
|
||||
v[2].t = v[3].t = (FIXED_TO_FLOAT(sy+h)/(float)(gpatch->height))*hwrPatch->max_t;
|
||||
|
||||
flags = PF_Translucent|PF_NoDepthTest;
|
||||
|
||||
if (option & V_WRAPX)
|
||||
flags |= PF_ForceWrapX;
|
||||
if (option & V_WRAPY)
|
||||
flags |= PF_ForceWrapY;
|
||||
|
||||
// Auto-crop at splitscreen borders!
|
||||
if (splitscreen && (option & V_PERPLAYER))
|
||||
{
|
||||
|
@ -667,14 +644,21 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
}
|
||||
|
||||
// clip it since it is used for bunny scroll in doom I
|
||||
if (blendmode)
|
||||
flags = HWR_GetBlendModeFlag(blendmode+1)|PF_NoDepthTest;
|
||||
else
|
||||
flags = PF_Translucent|PF_NoDepthTest;
|
||||
|
||||
if (alphalevel)
|
||||
{
|
||||
FSurfaceInfo Surf;
|
||||
Surf.PolyColor.s.red = Surf.PolyColor.s.green = Surf.PolyColor.s.blue = 0xff;
|
||||
if (alphalevel == 13) Surf.PolyColor.s.alpha = softwaretranstogl_lo[st_translucency];
|
||||
else if (alphalevel == 14) Surf.PolyColor.s.alpha = softwaretranstogl[st_translucency];
|
||||
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[st_translucency];
|
||||
|
||||
if (alphalevel == 10) Surf.PolyColor.s.alpha = softwaretranstogl_lo[st_translucency];
|
||||
else if (alphalevel == 11) Surf.PolyColor.s.alpha = softwaretranstogl[st_translucency];
|
||||
else if (alphalevel == 12) Surf.PolyColor.s.alpha = softwaretranstogl_hi[st_translucency];
|
||||
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||
|
||||
flags |= PF_Modulated;
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
|
||||
}
|
||||
|
|
|
@ -556,7 +556,7 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
|||
|
||||
HWR_Lighting(&Surf, lightlevel, planecolormap);
|
||||
|
||||
if (PolyFlags & (PF_Translucent|PF_Fog))
|
||||
if (PolyFlags & (PF_Translucent|PF_Fog|PF_Additive|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative|PF_Environment))
|
||||
{
|
||||
Surf.PolyColor.s.alpha = (UINT8)alpha;
|
||||
PolyFlags |= PF_Modulated;
|
||||
|
@ -980,8 +980,8 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
|||
|
||||
if (cutflag & FF_FOG)
|
||||
HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture|polyflags, true, lightnum, colormap);
|
||||
else if (cutflag & FF_TRANSLUCENT)
|
||||
HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Translucent|polyflags, false, lightnum, colormap);
|
||||
else if (polyflags & (PF_Translucent|PF_Additive|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative|PF_Environment))
|
||||
HWR_AddTransparentWall(wallVerts, Surf, texnum, polyflags, false, lightnum, colormap);
|
||||
else
|
||||
HWR_ProjectWall(wallVerts, Surf, PF_Masked|polyflags, lightnum, colormap);
|
||||
|
||||
|
@ -1009,8 +1009,8 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
|
|||
|
||||
if (cutflag & FF_FOG)
|
||||
HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture|polyflags, true, lightnum, colormap);
|
||||
else if (cutflag & FF_TRANSLUCENT)
|
||||
HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Translucent|polyflags, false, lightnum, colormap);
|
||||
else if (polyflags & (PF_Translucent|PF_Additive|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative|PF_Environment))
|
||||
HWR_AddTransparentWall(wallVerts, Surf, texnum, polyflags, false, lightnum, colormap);
|
||||
else
|
||||
HWR_ProjectWall(wallVerts, Surf, PF_Masked|polyflags, lightnum, colormap);
|
||||
}
|
||||
|
@ -1264,6 +1264,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||
else
|
||||
HWR_ProjectWall(wallVerts, &Surf, PF_Masked, lightnum, colormap);
|
||||
}
|
||||
|
||||
gl_midtexture = R_GetTextureNum(gl_sidedef->midtexture);
|
||||
if (gl_midtexture)
|
||||
{
|
||||
|
@ -1453,10 +1454,20 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||
case 221:
|
||||
case 253:
|
||||
case 256:
|
||||
blendmode = PF_Translucent;
|
||||
if (gl_linedef->blendmode != AST_FOG)
|
||||
blendmode = HWR_SurfaceBlend(gl_linedef->blendmode, R_GetLinedefTransTable(gl_linedef->alpha), &Surf);
|
||||
else
|
||||
blendmode = PF_Translucent;
|
||||
break;
|
||||
default:
|
||||
if (gl_linedef->alpha >= 0 && gl_linedef->alpha < FRACUNIT)
|
||||
if (gl_linedef->blendmode != AST_FOG)
|
||||
{
|
||||
if (gl_linedef->alpha >= 0 && gl_linedef->alpha < FRACUNIT)
|
||||
blendmode = HWR_SurfaceBlend(gl_linedef->blendmode, R_GetLinedefTransTable(gl_linedef->alpha), &Surf);
|
||||
else
|
||||
blendmode = HWR_GetBlendModeFlag(gl_linedef->blendmode);
|
||||
}
|
||||
else if (gl_linedef->alpha >= 0 && gl_linedef->alpha < FRACUNIT)
|
||||
blendmode = HWR_TranstableToAlpha(R_GetLinedefTransTable(gl_linedef->alpha), &Surf);
|
||||
else
|
||||
blendmode = PF_Masked;
|
||||
|
@ -1481,11 +1492,9 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||
if (gl_frontsector->numlights)
|
||||
{
|
||||
if (!(blendmode & PF_Masked))
|
||||
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_TRANSLUCENT, NULL, PF_Decal);
|
||||
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_TRANSLUCENT, NULL, blendmode);
|
||||
else
|
||||
{
|
||||
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_CUTLEVEL, NULL, PF_Decal);
|
||||
}
|
||||
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_CUTLEVEL, NULL, blendmode);
|
||||
}
|
||||
else if (!(blendmode & PF_Masked))
|
||||
HWR_AddTransparentWall(wallVerts, &Surf, gl_midtexture, blendmode, false, lightnum, colormap);
|
||||
|
@ -1745,7 +1754,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
|
||||
|
||||
if (gl_frontsector->numlights)
|
||||
HWR_SplitWall(gl_frontsector, wallVerts, 0, &Surf, rover->flags, rover, 0);
|
||||
HWR_SplitWall(gl_frontsector, wallVerts, 0, &Surf, rover->flags, rover, blendmode);
|
||||
else
|
||||
HWR_AddTransparentWall(wallVerts, &Surf, 0, blendmode, true, lightnum, colormap);
|
||||
}
|
||||
|
@ -1753,14 +1762,14 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||
{
|
||||
FBITFIELD blendmode = PF_Masked;
|
||||
|
||||
if (rover->flags & FF_TRANSLUCENT && rover->alpha < 256)
|
||||
if ((rover->flags & FF_TRANSLUCENT && rover->alpha < 256) || rover->blend)
|
||||
{
|
||||
blendmode = PF_Translucent;
|
||||
blendmode = rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent;
|
||||
Surf.PolyColor.s.alpha = (UINT8)rover->alpha-1 > 255 ? 255 : rover->alpha-1;
|
||||
}
|
||||
|
||||
if (gl_frontsector->numlights)
|
||||
HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, rover->flags, rover, 0);
|
||||
HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, rover->flags, rover, blendmode);
|
||||
else
|
||||
{
|
||||
if (blendmode != PF_Masked)
|
||||
|
@ -1868,7 +1877,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
|
||||
|
||||
if (gl_backsector->numlights)
|
||||
HWR_SplitWall(gl_backsector, wallVerts, 0, &Surf, rover->flags, rover, 0);
|
||||
HWR_SplitWall(gl_backsector, wallVerts, 0, &Surf, rover->flags, rover, blendmode);
|
||||
else
|
||||
HWR_AddTransparentWall(wallVerts, &Surf, 0, blendmode, true, lightnum, colormap);
|
||||
}
|
||||
|
@ -1876,14 +1885,14 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||
{
|
||||
FBITFIELD blendmode = PF_Masked;
|
||||
|
||||
if (rover->flags & FF_TRANSLUCENT && rover->alpha < 256)
|
||||
if ((rover->flags & FF_TRANSLUCENT && rover->alpha < 256) || rover->blend)
|
||||
{
|
||||
blendmode = PF_Translucent;
|
||||
blendmode = rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent;
|
||||
Surf.PolyColor.s.alpha = (UINT8)rover->alpha-1 > 255 ? 255 : rover->alpha-1;
|
||||
}
|
||||
|
||||
if (gl_backsector->numlights)
|
||||
HWR_SplitWall(gl_backsector, wallVerts, texnum, &Surf, rover->flags, rover, 0);
|
||||
HWR_SplitWall(gl_backsector, wallVerts, texnum, &Surf, rover->flags, rover, blendmode);
|
||||
else
|
||||
{
|
||||
if (blendmode != PF_Masked)
|
||||
|
@ -2960,6 +2969,13 @@ static void HWR_AddPolyObjectPlanes(void)
|
|||
}
|
||||
}
|
||||
|
||||
static FBITFIELD HWR_RippleBlend(sector_t *sector, ffloor_t *rover, boolean ceiling)
|
||||
{
|
||||
(void)sector;
|
||||
(void)ceiling;
|
||||
return /*R_IsRipplePlane(sector, rover, ceiling)*/ (rover->flags & FF_RIPPLE) ? PF_Ripple : 0;
|
||||
}
|
||||
|
||||
// -----------------+
|
||||
// HWR_Subsector : Determine floor/ceiling planes.
|
||||
// : Add sprites of things in sector.
|
||||
|
@ -3150,7 +3166,7 @@ static void HWR_Subsector(size_t num)
|
|||
alpha, rover->master->frontsector, PF_Fog|PF_NoTexture,
|
||||
true, rover->master->frontsector->extra_colormap);
|
||||
}
|
||||
else if (rover->flags & FF_TRANSLUCENT && rover->alpha < 256) // SoM: Flags are more efficient
|
||||
else if ((rover->flags & FF_TRANSLUCENT && rover->alpha < 256) || rover->blend) // SoM: Flags are more efficient
|
||||
{
|
||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false);
|
||||
|
||||
|
@ -3159,14 +3175,15 @@ static void HWR_Subsector(size_t num)
|
|||
false,
|
||||
*rover->bottomheight,
|
||||
*gl_frontsector->lightlist[light].lightlevel,
|
||||
rover->alpha-1 > 255 ? 255 : rover->alpha-1, rover->master->frontsector, (rover->flags & FF_RIPPLE ? PF_Ripple : 0)|PF_Translucent,
|
||||
rover->alpha-1 > 255 ? 255 : rover->alpha-1, rover->master->frontsector,
|
||||
HWR_RippleBlend(gl_frontsector, rover, false) | (rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent),
|
||||
false, *gl_frontsector->lightlist[light].extra_colormap);
|
||||
}
|
||||
else
|
||||
{
|
||||
HWR_GetLevelFlat(&levelflats[*rover->bottompic]);
|
||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false);
|
||||
HWR_RenderPlane(sub, &extrasubsectors[num], false, *rover->bottomheight, (rover->flags & FF_RIPPLE ? PF_Ripple : 0)|PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, &levelflats[*rover->bottompic],
|
||||
HWR_RenderPlane(sub, &extrasubsectors[num], false, *rover->bottomheight, HWR_RippleBlend(gl_frontsector, rover, false)|PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, &levelflats[*rover->bottompic],
|
||||
rover->master->frontsector, 255, *gl_frontsector->lightlist[light].extra_colormap);
|
||||
}
|
||||
}
|
||||
|
@ -3195,7 +3212,7 @@ static void HWR_Subsector(size_t num)
|
|||
alpha, rover->master->frontsector, PF_Fog|PF_NoTexture,
|
||||
true, rover->master->frontsector->extra_colormap);
|
||||
}
|
||||
else if (rover->flags & FF_TRANSLUCENT && rover->alpha < 256)
|
||||
else if ((rover->flags & FF_TRANSLUCENT && rover->alpha < 256) || rover->blend)
|
||||
{
|
||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false);
|
||||
|
||||
|
@ -3204,14 +3221,15 @@ static void HWR_Subsector(size_t num)
|
|||
true,
|
||||
*rover->topheight,
|
||||
*gl_frontsector->lightlist[light].lightlevel,
|
||||
rover->alpha-1 > 255 ? 255 : rover->alpha-1, rover->master->frontsector, (rover->flags & FF_RIPPLE ? PF_Ripple : 0)|PF_Translucent,
|
||||
rover->alpha-1 > 255 ? 255 : rover->alpha-1, rover->master->frontsector,
|
||||
HWR_RippleBlend(gl_frontsector, rover, false) | (rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent),
|
||||
false, *gl_frontsector->lightlist[light].extra_colormap);
|
||||
}
|
||||
else
|
||||
{
|
||||
HWR_GetLevelFlat(&levelflats[*rover->toppic]);
|
||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false);
|
||||
HWR_RenderPlane(sub, &extrasubsectors[num], true, *rover->topheight, (rover->flags & FF_RIPPLE ? PF_Ripple : 0)|PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, &levelflats[*rover->toppic],
|
||||
HWR_RenderPlane(sub, &extrasubsectors[num], true, *rover->topheight, HWR_RippleBlend(gl_frontsector, rover, false)|PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, &levelflats[*rover->toppic],
|
||||
rover->master->frontsector, 255, *gl_frontsector->lightlist[light].extra_colormap);
|
||||
}
|
||||
}
|
||||
|
@ -3853,6 +3871,12 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
|||
else
|
||||
occlusion = PF_Occlude;
|
||||
|
||||
INT32 blendmode;
|
||||
if (spr->mobj->frame & FF_BLENDMASK)
|
||||
blendmode = ((spr->mobj->frame & FF_BLENDMASK) >> FF_BLENDSHIFT) + 1;
|
||||
else
|
||||
blendmode = spr->mobj->blendmode;
|
||||
|
||||
if (!cv_translucency.value) // translucency disabled
|
||||
{
|
||||
Surf.PolyColor.s.alpha = 0xFF;
|
||||
|
@ -3862,12 +3886,12 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
|||
else if (spr->mobj->flags2 & MF2_SHADOW)
|
||||
{
|
||||
Surf.PolyColor.s.alpha = 0x40;
|
||||
blend = HWR_GetBlendModeFlag(spr->mobj->blendmode);
|
||||
blend = HWR_GetBlendModeFlag(blendmode);
|
||||
}
|
||||
else if (spr->mobj->frame & FF_TRANSMASK)
|
||||
{
|
||||
INT32 trans = (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT;
|
||||
blend = HWR_SurfaceBlend(spr->mobj->blendmode, trans, &Surf);
|
||||
blend = HWR_SurfaceBlend(blendmode, trans, &Surf);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3876,7 +3900,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
|||
// Hurdler: PF_Environement would be cool, but we need to fix
|
||||
// the issue with the fog before
|
||||
Surf.PolyColor.s.alpha = 0xFF;
|
||||
blend = HWR_GetBlendModeFlag(spr->mobj->blendmode)|occlusion;
|
||||
blend = HWR_GetBlendModeFlag(blendmode)|occlusion;
|
||||
if (!occlusion) use_linkdraw_hack = true;
|
||||
}
|
||||
|
||||
|
@ -3916,6 +3940,9 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
|||
}
|
||||
}
|
||||
|
||||
if (R_ThingIsSemiBright(spr->mobj))
|
||||
lightlevel = 128 + (lightlevel>>1);
|
||||
|
||||
for (i = 0; i < sector->numlights; i++)
|
||||
{
|
||||
if (endtop < endrealbot && top < realbot)
|
||||
|
@ -4269,6 +4296,9 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
|||
else if (!lightset)
|
||||
lightlevel = sector->lightlevel > 255 ? 255 : sector->lightlevel;
|
||||
|
||||
if (R_ThingIsSemiBright(spr->mobj))
|
||||
lightlevel = 128 + (lightlevel>>1);
|
||||
|
||||
HWR_Lighting(&Surf, lightlevel, colormap);
|
||||
}
|
||||
|
||||
|
@ -4285,6 +4315,12 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
|||
else
|
||||
occlusion = PF_Occlude;
|
||||
|
||||
INT32 blendmode;
|
||||
if (spr->mobj->frame & FF_BLENDMASK)
|
||||
blendmode = ((spr->mobj->frame & FF_BLENDMASK) >> FF_BLENDSHIFT) + 1;
|
||||
else
|
||||
blendmode = spr->mobj->blendmode;
|
||||
|
||||
if (!cv_translucency.value) // translucency disabled
|
||||
{
|
||||
Surf.PolyColor.s.alpha = 0xFF;
|
||||
|
@ -4294,12 +4330,12 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
|||
else if (spr->mobj->flags2 & MF2_SHADOW)
|
||||
{
|
||||
Surf.PolyColor.s.alpha = 0x40;
|
||||
blend = HWR_GetBlendModeFlag(spr->mobj->blendmode);
|
||||
blend = HWR_GetBlendModeFlag(blendmode);
|
||||
}
|
||||
else if (spr->mobj->frame & FF_TRANSMASK)
|
||||
{
|
||||
INT32 trans = (spr->mobj->frame & FF_TRANSMASK)>>FF_TRANSSHIFT;
|
||||
blend = HWR_SurfaceBlend(spr->mobj->blendmode, trans, &Surf);
|
||||
blend = HWR_SurfaceBlend(blendmode, trans, &Surf);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4308,7 +4344,7 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
|||
// Hurdler: PF_Environement would be cool, but we need to fix
|
||||
// the issue with the fog before
|
||||
Surf.PolyColor.s.alpha = 0xFF;
|
||||
blend = HWR_GetBlendModeFlag(spr->mobj->blendmode)|occlusion;
|
||||
blend = HWR_GetBlendModeFlag(blendmode)|occlusion;
|
||||
if (!occlusion) use_linkdraw_hack = true;
|
||||
}
|
||||
|
||||
|
@ -5003,10 +5039,16 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
if (thing->spritexscale < 1 || thing->spriteyscale < 1)
|
||||
return;
|
||||
|
||||
INT32 blendmode;
|
||||
if (thing->frame & FF_BLENDMASK)
|
||||
blendmode = ((thing->frame & FF_BLENDMASK) >> FF_BLENDSHIFT) + 1;
|
||||
else
|
||||
blendmode = thing->blendmode;
|
||||
|
||||
// Visibility check by the blend mode.
|
||||
if (thing->frame & FF_TRANSMASK)
|
||||
{
|
||||
if (!R_BlendLevelVisible(thing->blendmode, (thing->frame & FF_TRANSMASK)>>FF_TRANSSHIFT))
|
||||
if (!R_BlendLevelVisible(blendmode, (thing->frame & FF_TRANSMASK)>>FF_TRANSSHIFT))
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1869,7 +1869,7 @@ static void HU_DrawChat_Old(void)
|
|||
|
||||
static inline void HU_DrawCrosshair(void)
|
||||
{
|
||||
INT32 i, y;
|
||||
INT32 i, y, dupz;
|
||||
|
||||
i = cv_crosshair.value & 3;
|
||||
if (!i)
|
||||
|
@ -1885,12 +1885,14 @@ static inline void HU_DrawCrosshair(void)
|
|||
#endif
|
||||
y = viewwindowy + (viewheight>>1);
|
||||
|
||||
V_DrawScaledPatch(vid.width>>1, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]);
|
||||
dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
|
||||
|
||||
V_DrawFixedPatch(vid.width<<(FRACBITS-1), y<<FRACBITS, FRACUNIT/dupz, V_TRANSLUCENT, crosshair[i - 1], NULL);
|
||||
}
|
||||
|
||||
static inline void HU_DrawCrosshair2(void)
|
||||
{
|
||||
INT32 i, y;
|
||||
INT32 i, y, dupz;
|
||||
|
||||
i = cv_crosshair2.value & 3;
|
||||
if (!i)
|
||||
|
@ -1906,17 +1908,19 @@ static inline void HU_DrawCrosshair2(void)
|
|||
#endif
|
||||
y = viewwindowy + (viewheight>>1);
|
||||
|
||||
if (splitscreen)
|
||||
{
|
||||
#ifdef HWRENDER
|
||||
if (!splitscreen)
|
||||
return;
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode != render_soft)
|
||||
y += (INT32)gl_viewheight;
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
y += viewheight;
|
||||
|
||||
V_DrawScaledPatch(vid.width>>1, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]);
|
||||
}
|
||||
dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
|
||||
|
||||
V_DrawFixedPatch(vid.width<<(FRACBITS-1), y<<FRACBITS, FRACUNIT/dupz, V_TRANSLUCENT, crosshair[i - 1], NULL);
|
||||
}
|
||||
|
||||
static void HU_DrawCEcho(void)
|
||||
|
|
|
@ -224,6 +224,7 @@ enum ffloor_e {
|
|||
ffloor_sinkspeed,
|
||||
ffloor_friction,
|
||||
ffloor_bouncestrength,
|
||||
ffloor_blend,
|
||||
};
|
||||
|
||||
static const char *const ffloor_opt[] = {
|
||||
|
@ -248,6 +249,7 @@ static const char *const ffloor_opt[] = {
|
|||
"sinkspeed",
|
||||
"friction",
|
||||
"bouncestrength",
|
||||
"blend",
|
||||
NULL};
|
||||
|
||||
#ifdef HAVE_LUA_SEGS
|
||||
|
@ -1924,6 +1926,9 @@ static int ffloor_get(lua_State *L)
|
|||
case ffloor_bouncestrength:
|
||||
lua_pushfixed(L, ffloor->bouncestrength);
|
||||
return 1;
|
||||
case ffloor_blend:
|
||||
lua_pushinteger(L, ffloor->blend);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -2002,6 +2007,9 @@ static int ffloor_set(lua_State *L)
|
|||
case ffloor_alpha:
|
||||
ffloor->alpha = (INT32)luaL_checkinteger(L, 3);
|
||||
break;
|
||||
case ffloor_blend:
|
||||
ffloor->blend = (INT32)luaL_checkinteger(L, 3);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
10
src/m_menu.c
10
src/m_menu.c
|
@ -4036,7 +4036,7 @@ static void M_DrawThermo(INT32 x, INT32 y, consvar_t *cv)
|
|||
xx += p->width - p->leftoffset;
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
V_DrawScaledPatch(xx, y, V_WRAPX, W_CachePatchNum(centerlump[i & 1], PU_PATCH));
|
||||
V_DrawScaledPatch(xx, y, 0, W_CachePatchNum(centerlump[i & 1], PU_PATCH));
|
||||
xx += 8;
|
||||
}
|
||||
V_DrawScaledPatch(xx, y, 0, W_CachePatchNum(rightlump, PU_PATCH));
|
||||
|
@ -4134,7 +4134,7 @@ void M_DrawTextBox(INT32 x, INT32 y, INT32 width, INT32 boxlines)
|
|||
p = W_CachePatchNum(viewborderlump[BRDR_L], PU_PATCH);
|
||||
for (n = 0; n < boxlines; n++)
|
||||
{
|
||||
V_DrawScaledPatch(cx, cy, V_WRAPY, p);
|
||||
V_DrawScaledPatch(cx, cy, 0, p);
|
||||
cy += step;
|
||||
}
|
||||
V_DrawScaledPatch(cx, cy, 0, W_CachePatchNum(viewborderlump[BRDR_BL], PU_PATCH));
|
||||
|
@ -4146,8 +4146,8 @@ void M_DrawTextBox(INT32 x, INT32 y, INT32 width, INT32 boxlines)
|
|||
cy = y;
|
||||
while (width > 0)
|
||||
{
|
||||
V_DrawScaledPatch(cx, cy, V_WRAPX, W_CachePatchNum(viewborderlump[BRDR_T], PU_PATCH));
|
||||
V_DrawScaledPatch(cx, y + boff + boxlines*step, V_WRAPX, W_CachePatchNum(viewborderlump[BRDR_B], PU_PATCH));
|
||||
V_DrawScaledPatch(cx, cy, 0, W_CachePatchNum(viewborderlump[BRDR_T], PU_PATCH));
|
||||
V_DrawScaledPatch(cx, y + boff + boxlines*step, 0, W_CachePatchNum(viewborderlump[BRDR_B], PU_PATCH));
|
||||
width--;
|
||||
cx += step;
|
||||
}
|
||||
|
@ -4159,7 +4159,7 @@ void M_DrawTextBox(INT32 x, INT32 y, INT32 width, INT32 boxlines)
|
|||
p = W_CachePatchNum(viewborderlump[BRDR_R], PU_PATCH);
|
||||
for (n = 0; n < boxlines; n++)
|
||||
{
|
||||
V_DrawScaledPatch(cx, cy, V_WRAPY, p);
|
||||
V_DrawScaledPatch(cx, cy, 0, p);
|
||||
cy += step;
|
||||
}
|
||||
V_DrawScaledPatch(cx, cy, 0, W_CachePatchNum(viewborderlump[BRDR_BR], PU_PATCH));
|
||||
|
|
47
src/p_pspr.h
47
src/p_pspr.h
|
@ -41,9 +41,20 @@
|
|||
/// \brief Frame flags - SPR2: Super sprite2
|
||||
#define FF_SPR2SUPER 0x80
|
||||
/// \brief Frame flags - SPR2: A change of state at the end of Sprite2 animation
|
||||
#define FF_SPR2ENDSTATE 0x1000
|
||||
#define FF_SPR2ENDSTATE 0x100
|
||||
/// \brief Frame flags - SPR2: 50% of starting in middle of Sprite2 animation
|
||||
#define FF_SPR2MIDSTART 0x2000
|
||||
#define FF_SPR2MIDSTART 0x200
|
||||
|
||||
/// \brief Frame flags: blend types
|
||||
#define FF_BLENDMASK 0x7000
|
||||
/// \brief shift for FF_BLENDMASK
|
||||
#define FF_BLENDSHIFT 12
|
||||
/// \brief preshifted blend flags minus 1 as effects don't distinguish between AST_COPY and AST_TRANSLUCENT
|
||||
#define FF_ADD ((AST_ADD-1)<<FF_BLENDSHIFT)
|
||||
#define FF_SUBTRACT ((AST_SUBTRACT-1)<<FF_BLENDSHIFT)
|
||||
#define FF_REVERSESUBTRACT ((AST_REVERSESUBTRACT-1)<<FF_BLENDSHIFT)
|
||||
#define FF_MODULATE ((AST_MODULATE-1)<<FF_BLENDSHIFT)
|
||||
#define FF_OVERLAY ((AST_OVERLAY-1)<<FF_BLENDSHIFT)
|
||||
|
||||
/// \brief Frame flags: 0 = no trans(opaque), 1-15 = transl. table
|
||||
#define FF_TRANSMASK 0xf0000
|
||||
|
@ -60,21 +71,31 @@
|
|||
#define FF_TRANS80 (tr_trans80<<FF_TRANSSHIFT)
|
||||
#define FF_TRANS90 (tr_trans90<<FF_TRANSSHIFT)
|
||||
|
||||
/// \brief Frame flags: brightness mask
|
||||
#define FF_BRIGHTMASK 0x00300000
|
||||
/// \brief Frame flags: frame always appears full bright
|
||||
#define FF_FULLBRIGHT 0x00100000
|
||||
/// \brief Frame flags: Flip sprite vertically (relative to what it should be for its gravity)
|
||||
#define FF_VERTICALFLIP 0x00200000
|
||||
/// \brief Frame flags: Flip sprite horizontally
|
||||
#define FF_HORIZONTALFLIP 0x00400000
|
||||
#define FF_FULLBRIGHT 0x00100000
|
||||
/// \brief Frame flags: frame always appears full darkness
|
||||
#define FF_FULLDARK 0x00200000
|
||||
/// \brief Frame flags: frame appears between sector bright and full bright
|
||||
#define FF_SEMIBRIGHT (FF_FULLBRIGHT|FF_FULLDARK)
|
||||
|
||||
/// \brief Frame flags: Thin, paper-like sprite (for collision equivalent, see MF_PAPERCOLLISION)
|
||||
#define FF_PAPERSPRITE 0x00800000
|
||||
#define FF_PAPERSPRITE 0x00400000
|
||||
/// \brief Frame flags: Splat!
|
||||
#define FF_FLOORSPRITE 0x00800000
|
||||
|
||||
/// \brief Frame flags: Flip sprite vertically (relative to what it should be for its gravity)
|
||||
#define FF_VERTICALFLIP 0x01000000
|
||||
/// \brief Frame flags: Flip sprite horizontally
|
||||
#define FF_HORIZONTALFLIP 0x02000000
|
||||
|
||||
/// \brief Frame flags - Animate: Simple stateless animation
|
||||
#define FF_ANIMATE 0x01000000
|
||||
/// \brief Frame flags - Animate: Start at a random place in the animation (mutually exclusive with below)
|
||||
#define FF_RANDOMANIM 0x02000000
|
||||
/// \brief Frame flags - Animate: Sync animation to global timer (mutually exclusive with above)
|
||||
#define FF_GLOBALANIM 0x04000000
|
||||
#define FF_ANIMATE 0x10000000
|
||||
/// \brief Frame flags - Animate: Sync animation to global timer (mutually exclusive with below, currently takes priority)
|
||||
#define FF_GLOBALANIM 0x20000000
|
||||
/// \brief Frame flags - Animate: Start at a random place in the animation (mutually exclusive with above)
|
||||
#define FF_RANDOMANIM 0x40000000
|
||||
|
||||
/** \brief translucency tables
|
||||
|
||||
|
|
|
@ -1372,8 +1372,11 @@ static void P_LoadSidedefs(UINT8 *data)
|
|||
if (msd->toptexture[0] == '#')
|
||||
{
|
||||
char *col = msd->toptexture;
|
||||
sd->toptexture = sd->bottomtexture =
|
||||
((col[1]-'0')*100 + (col[2]-'0')*10 + col[3]-'0') + 1;
|
||||
sd->toptexture =
|
||||
((col[1]-'0')*100 + (col[2]-'0')*10 + col[3]-'0')+1;
|
||||
if (col[4]) // extra num for blendmode
|
||||
sd->toptexture += (col[4]-'0')*1000;
|
||||
sd->bottomtexture = sd->toptexture;
|
||||
sd->midtexture = R_TextureNumForName(msd->midtexture);
|
||||
}
|
||||
else
|
||||
|
@ -1811,6 +1814,21 @@ static void ParseTextmapLinedefParameter(UINT32 i, char *param, char *val)
|
|||
lines[i].sidenum[1] = atol(val);
|
||||
else if (fastcmp(param, "alpha"))
|
||||
lines[i].alpha = FLOAT_TO_FIXED(atof(val));
|
||||
else if (fastcmp(param, "blendmode") || fastcmp(param, "renderstyle"))
|
||||
{
|
||||
if (fastcmp(val, "translucent"))
|
||||
lines[i].blendmode = AST_COPY;
|
||||
else if (fastcmp(val, "add"))
|
||||
lines[i].blendmode = AST_ADD;
|
||||
else if (fastcmp(val, "subtract"))
|
||||
lines[i].blendmode = AST_SUBTRACT;
|
||||
else if (fastcmp(val, "reversesubtract"))
|
||||
lines[i].blendmode = AST_REVERSESUBTRACT;
|
||||
else if (fastcmp(val, "modulate"))
|
||||
lines[i].blendmode = AST_MODULATE;
|
||||
if (fastcmp(val, "fog"))
|
||||
lines[i].blendmode = AST_FOG;
|
||||
}
|
||||
else if (fastcmp(param, "executordelay"))
|
||||
lines[i].executordelay = atol(val);
|
||||
|
||||
|
@ -5079,8 +5097,33 @@ static void P_ConvertBinaryMap(void)
|
|||
case 908: //Translucent wall (90%)
|
||||
lines[i].alpha = ((909 - lines[i].special) << FRACBITS)/10;
|
||||
break;
|
||||
case 909: //Fog wall
|
||||
lines[i].blendmode = AST_FOG;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Set alpha for translucent walls
|
||||
if (lines[i].special >= 900 && lines[i].special < 909)
|
||||
lines[i].alpha = ((909 - lines[i].special) << FRACBITS)/10;
|
||||
|
||||
// Set alpha for additive/subtractive/reverse subtractive walls
|
||||
if (lines[i].special >= 910 && lines[i].special <= 939)
|
||||
lines[i].alpha = ((10 - lines[i].special % 10) << FRACBITS)/10;
|
||||
|
||||
if (lines[i].special >= 910 && lines[i].special <= 919) // additive
|
||||
lines[i].blendmode = AST_ADD;
|
||||
|
||||
if (lines[i].special >= 920 && lines[i].special <= 929) // subtractive
|
||||
lines[i].blendmode = AST_SUBTRACT;
|
||||
|
||||
if (lines[i].special >= 930 && lines[i].special <= 939) // reverse subtractive
|
||||
lines[i].blendmode = AST_REVERSESUBTRACT;
|
||||
|
||||
if (lines[i].special == 940) // modulate
|
||||
lines[i].blendmode = AST_MODULATE;
|
||||
|
||||
//Linedef executor delay
|
||||
if (lines[i].special >= 400 && lines[i].special < 500)
|
||||
{
|
||||
|
|
|
@ -5621,6 +5621,12 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, I
|
|||
{
|
||||
fflr->flags |= FF_TRANSLUCENT;
|
||||
fflr->spawnflags = fflr->flags;
|
||||
|
||||
if (sides[master->sidenum[0]].toptexture >= 1001)
|
||||
{
|
||||
fflr->blend = (sides[master->sidenum[0]].toptexture/1000)+1; // becomes an AST
|
||||
fflr->alpha %= 1000;
|
||||
}
|
||||
}
|
||||
fflr->spawnalpha = fflr->alpha; // save for netgames
|
||||
|
||||
|
|
|
@ -30,9 +30,6 @@ typedef struct
|
|||
size_t numlumps;
|
||||
} lumplist_t;
|
||||
|
||||
// Possible alpha types for a patch.
|
||||
enum patchalphastyle {AST_COPY, AST_TRANSLUCENT, AST_ADD, AST_SUBTRACT, AST_REVERSESUBTRACT, AST_MODULATE, AST_OVERLAY};
|
||||
|
||||
UINT32 ASTBlendPixel(RGBA_t background, RGBA_t foreground, int style, UINT8 alpha);
|
||||
UINT32 ASTBlendTexturePixel(RGBA_t background, RGBA_t foreground, int style, UINT8 alpha);
|
||||
UINT8 ASTBlendPaletteIndexes(UINT8 background, UINT8 foreground, int style, UINT8 alpha);
|
||||
|
|
25
src/r_defs.h
25
src/r_defs.h
|
@ -197,6 +197,7 @@ typedef struct ffloor_s
|
|||
|
||||
INT32 lastlight;
|
||||
INT32 alpha;
|
||||
UINT8 blend; // blendmode
|
||||
tic_t norender; // for culling
|
||||
|
||||
// Only relevant for FF_BUSTUP
|
||||
|
@ -486,6 +487,7 @@ typedef struct line_s
|
|||
// Visual appearance: sidedefs.
|
||||
UINT16 sidenum[2]; // sidenum[1] will be 0xffff if one-sided
|
||||
fixed_t alpha; // translucency
|
||||
UINT8 blendmode; // blendmode
|
||||
INT32 executordelay;
|
||||
|
||||
fixed_t bbox[4]; // bounding box for the extent of the linedef
|
||||
|
@ -802,6 +804,9 @@ typedef struct
|
|||
#pragma pack()
|
||||
#endif
|
||||
|
||||
// Possible alpha types for a patch.
|
||||
enum patchalphastyle {AST_COPY, AST_TRANSLUCENT, AST_ADD, AST_SUBTRACT, AST_REVERSESUBTRACT, AST_MODULATE, AST_OVERLAY, AST_FOG};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
RF_HORIZONTALFLIP = 0x0001, // Flip sprite horizontally
|
||||
|
@ -815,17 +820,19 @@ typedef enum
|
|||
RF_NOSPLATBILLBOARD = 0x0040, // Don't billboard floor sprites (faces forward from the view angle)
|
||||
RF_NOSPLATROLLANGLE = 0x0080, // Don't rotate floor sprites by the object's rollangle (uses rotated patches instead)
|
||||
|
||||
RF_BLENDMASK = 0x0F00, // --Blending modes
|
||||
RF_FULLBRIGHT = 0x0100, // Sprite is drawn at full brightness
|
||||
RF_FULLDARK = 0x0200, // Sprite is drawn completely dark
|
||||
RF_NOCOLORMAPS = 0x0400, // Sprite is not drawn with colormaps
|
||||
RF_BRIGHTMASK = 0x00000300, // --Bright modes
|
||||
RF_FULLBRIGHT = 0x00000100, // Sprite is drawn at full brightness
|
||||
RF_FULLDARK = 0x00000200, // Sprite is drawn completely dark
|
||||
RF_SEMIBRIGHT = (RF_FULLBRIGHT | RF_FULLDARK), // between sector bright and full bright
|
||||
|
||||
RF_SPRITETYPEMASK = 0x7000, // ---Different sprite types
|
||||
RF_PAPERSPRITE = 0x1000, // Paper sprite
|
||||
RF_FLOORSPRITE = 0x2000, // Floor sprite
|
||||
RF_NOCOLORMAPS = 0x00000400, // Sprite is not drawn with colormaps
|
||||
|
||||
RF_SHADOWDRAW = 0x10000, // Stretches and skews the sprite like a shadow.
|
||||
RF_SHADOWEFFECTS = 0x20000, // Scales and becomes transparent like a shadow.
|
||||
RF_SPRITETYPEMASK = 0x00003000, // --Different sprite types
|
||||
RF_PAPERSPRITE = 0x00001000, // Paper sprite
|
||||
RF_FLOORSPRITE = 0x00002000, // Floor sprite
|
||||
|
||||
RF_SHADOWDRAW = 0x00004000, // Stretches and skews the sprite like a shadow.
|
||||
RF_SHADOWEFFECTS = 0x00008000, // Scales and becomes transparent like a shadow.
|
||||
RF_DROPSHADOW = (RF_SHADOWDRAW | RF_SHADOWEFFECTS | RF_FULLDARK),
|
||||
} renderflags_t;
|
||||
|
||||
|
|
|
@ -248,6 +248,9 @@ static void BlendTab_Subtractive(UINT8 *table, int style, UINT8 blendamt)
|
|||
result.s.green = max(0, result.s.green - blendamt);
|
||||
result.s.blue = max(0, result.s.blue - blendamt);
|
||||
|
||||
//probably incorrect, but does look better at lower opacity...
|
||||
//result.rgba = ASTBlendPixel(result, frontrgba, AST_TRANSLUCENT, blendamt);
|
||||
|
||||
table[((bg * 0x100) + fg)] = GetColorLUT(&transtab_lut, result.s.red, result.s.green, result.s.blue);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -855,28 +855,16 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
spanfunctype = (pl->ffloor->flags & FF_SPLAT) ? SPANDRAWFUNC_TRANSSPLAT : SPANDRAWFUNC_TRANS;
|
||||
|
||||
// Hacked up support for alpha value in software mode Tails 09-24-2002
|
||||
if (pl->ffloor->alpha < 12)
|
||||
return; // Don't even draw it
|
||||
else if (pl->ffloor->alpha < 38)
|
||||
ds_transmap = R_GetTranslucencyTable(tr_trans90);
|
||||
else if (pl->ffloor->alpha < 64)
|
||||
ds_transmap = R_GetTranslucencyTable(tr_trans80);
|
||||
else if (pl->ffloor->alpha < 89)
|
||||
ds_transmap = R_GetTranslucencyTable(tr_trans70);
|
||||
else if (pl->ffloor->alpha < 115)
|
||||
ds_transmap = R_GetTranslucencyTable(tr_trans60);
|
||||
else if (pl->ffloor->alpha < 140)
|
||||
ds_transmap = R_GetTranslucencyTable(tr_trans50);
|
||||
else if (pl->ffloor->alpha < 166)
|
||||
ds_transmap = R_GetTranslucencyTable(tr_trans40);
|
||||
else if (pl->ffloor->alpha < 192)
|
||||
ds_transmap = R_GetTranslucencyTable(tr_trans30);
|
||||
else if (pl->ffloor->alpha < 217)
|
||||
ds_transmap = R_GetTranslucencyTable(tr_trans20);
|
||||
else if (pl->ffloor->alpha < 243)
|
||||
ds_transmap = R_GetTranslucencyTable(tr_trans10);
|
||||
else // Opaque, but allow transparent flat pixels
|
||||
spanfunctype = SPANDRAWFUNC_SPLAT;
|
||||
// ...unhacked by toaster 04-01-2021, re-hacked a little by sphere 19-11-2021
|
||||
{
|
||||
INT32 trans = (10*((256+12) - pl->ffloor->alpha))/255;
|
||||
if (trans >= 10)
|
||||
return; // Don't even draw it
|
||||
if (pl->ffloor->blend) // additive, (reverse) subtractive, modulative
|
||||
ds_transmap = R_GetBlendTable(pl->ffloor->blend, trans);
|
||||
else if (!(ds_transmap = R_GetTranslucencyTable(trans)) || trans == 0)
|
||||
spanfunctype = SPANDRAWFUNC_SPLAT; // Opaque, but allow transparent flat pixels
|
||||
}
|
||||
|
||||
if ((spanfunctype == SPANDRAWFUNC_SPLAT) || (pl->extra_colormap && (pl->extra_colormap->flags & CMF_FOG)))
|
||||
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||
|
|
53
src/r_segs.c
53
src/r_segs.c
|
@ -155,18 +155,25 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
|||
if (!ldef->alpha)
|
||||
return;
|
||||
|
||||
if (ldef->alpha > 0 && ldef->alpha < FRACUNIT)
|
||||
{
|
||||
dc_transmap = R_GetTranslucencyTable(R_GetLinedefTransTable(ldef->alpha));
|
||||
colfunc = colfuncs[COLDRAWFUNC_FUZZY];
|
||||
|
||||
}
|
||||
else if (ldef->special == 909)
|
||||
if (ldef->blendmode == AST_FOG)
|
||||
{
|
||||
colfunc = colfuncs[COLDRAWFUNC_FOG];
|
||||
windowtop = frontsector->ceilingheight;
|
||||
windowbottom = frontsector->floorheight;
|
||||
}
|
||||
else if (ldef->blendmode)
|
||||
{
|
||||
if (ldef->alpha == NUMTRANSMAPS || ldef->blendmode == AST_MODULATE)
|
||||
dc_transmap = R_GetBlendTable(ldef->blendmode, 0);
|
||||
else
|
||||
dc_transmap = R_GetBlendTable(ldef->blendmode, R_GetLinedefTransTable(ldef->alpha));
|
||||
colfunc = colfuncs[COLDRAWFUNC_FUZZY];
|
||||
}
|
||||
else if (ldef->alpha > 0 && ldef->alpha < FRACUNIT)
|
||||
{
|
||||
dc_transmap = R_GetTranslucencyTable(R_GetLinedefTransTable(ldef->alpha));
|
||||
colfunc = colfuncs[COLDRAWFUNC_FUZZY];
|
||||
}
|
||||
else
|
||||
colfunc = colfuncs[BASEDRAWFUNC];
|
||||
|
||||
|
@ -600,28 +607,16 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
|||
boolean fuzzy = true;
|
||||
|
||||
// Hacked up support for alpha value in software mode Tails 09-24-2002
|
||||
if (pfloor->alpha < 12)
|
||||
return; // Don't even draw it
|
||||
else if (pfloor->alpha < 38)
|
||||
dc_transmap = R_GetTranslucencyTable(tr_trans90);
|
||||
else if (pfloor->alpha < 64)
|
||||
dc_transmap = R_GetTranslucencyTable(tr_trans80);
|
||||
else if (pfloor->alpha < 89)
|
||||
dc_transmap = R_GetTranslucencyTable(tr_trans70);
|
||||
else if (pfloor->alpha < 115)
|
||||
dc_transmap = R_GetTranslucencyTable(tr_trans60);
|
||||
else if (pfloor->alpha < 140)
|
||||
dc_transmap = R_GetTranslucencyTable(tr_trans50);
|
||||
else if (pfloor->alpha < 166)
|
||||
dc_transmap = R_GetTranslucencyTable(tr_trans40);
|
||||
else if (pfloor->alpha < 192)
|
||||
dc_transmap = R_GetTranslucencyTable(tr_trans30);
|
||||
else if (pfloor->alpha < 217)
|
||||
dc_transmap = R_GetTranslucencyTable(tr_trans20);
|
||||
else if (pfloor->alpha < 243)
|
||||
dc_transmap = R_GetTranslucencyTable(tr_trans10);
|
||||
else
|
||||
fuzzy = false; // Opaque
|
||||
// ...unhacked by toaster 04-01-2021, re-hacked a little by sphere 19-11-2021
|
||||
{
|
||||
INT32 trans = (10*((256+12) - pfloor->alpha))/255;
|
||||
if (trans >= 10)
|
||||
return; // Don't even draw it
|
||||
if (pfloor->blend) // additive, (reverse) subtractive, modulative
|
||||
dc_transmap = R_GetBlendTable(pfloor->blend, trans);
|
||||
else if (!(dc_transmap = R_GetTranslucencyTable(trans)) || trans == 0)
|
||||
fuzzy = false; // Opaque
|
||||
}
|
||||
|
||||
if (fuzzy)
|
||||
colfunc = colfuncs[COLDRAWFUNC_FUZZY];
|
||||
|
|
|
@ -1110,6 +1110,10 @@ static void R_SplitSprite(vissprite_t *sprite)
|
|||
|
||||
if (lindex >= MAXLIGHTSCALE)
|
||||
lindex = MAXLIGHTSCALE-1;
|
||||
|
||||
if (newsprite->cut & SC_SEMIBRIGHT)
|
||||
lindex = (MAXLIGHTSCALE/2) + (lindex >>1);
|
||||
|
||||
newsprite->colormap = spritelights[lindex];
|
||||
}
|
||||
}
|
||||
|
@ -1798,13 +1802,19 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
return;
|
||||
}
|
||||
|
||||
INT32 blendmode;
|
||||
if (oldthing->frame & FF_BLENDMASK)
|
||||
blendmode = ((oldthing->frame & FF_BLENDMASK) >> FF_BLENDSHIFT) + 1;
|
||||
else
|
||||
blendmode = oldthing->blendmode;
|
||||
|
||||
// Determine the translucency value.
|
||||
if (oldthing->flags2 & MF2_SHADOW || thing->flags2 & MF2_SHADOW) // actually only the player should use this (temporary invisibility)
|
||||
trans = tr_trans80; // because now the translucency is set through FF_TRANSMASK
|
||||
else if (oldthing->frame & FF_TRANSMASK)
|
||||
{
|
||||
trans = (oldthing->frame & FF_TRANSMASK) >> FF_TRANSSHIFT;
|
||||
if (!R_BlendLevelVisible(oldthing->blendmode, trans))
|
||||
if (!R_BlendLevelVisible(blendmode, trans))
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -2016,13 +2026,15 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
vis->scale += FixedMul(scalestep, spriteyscale) * (vis->x1 - x1);
|
||||
}
|
||||
|
||||
if ((oldthing->blendmode != AST_COPY) && cv_translucency.value)
|
||||
vis->transmap = R_GetBlendTable(oldthing->blendmode, trans);
|
||||
if ((blendmode != AST_COPY) && cv_translucency.value)
|
||||
vis->transmap = R_GetBlendTable(blendmode, trans);
|
||||
else
|
||||
vis->transmap = NULL;
|
||||
|
||||
if (R_ThingIsFullBright(oldthing) || oldthing->flags2 & MF2_SHADOW || thing->flags2 & MF2_SHADOW)
|
||||
vis->cut |= SC_FULLBRIGHT;
|
||||
else if (R_ThingIsSemiBright(oldthing))
|
||||
vis->cut |= SC_SEMIBRIGHT;
|
||||
else if (R_ThingIsFullDark(oldthing))
|
||||
vis->cut |= SC_FULLDARK;
|
||||
|
||||
|
@ -2045,6 +2057,9 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
if (lindex >= MAXLIGHTSCALE)
|
||||
lindex = MAXLIGHTSCALE-1;
|
||||
|
||||
if (vis->cut & SC_SEMIBRIGHT)
|
||||
lindex = (MAXLIGHTSCALE/2) + (lindex >> 1);
|
||||
|
||||
vis->colormap = spritelights[lindex];
|
||||
}
|
||||
|
||||
|
@ -3073,17 +3088,22 @@ boolean R_ThingIsPaperSprite(mobj_t *thing)
|
|||
|
||||
boolean R_ThingIsFloorSprite(mobj_t *thing)
|
||||
{
|
||||
return (thing->flags2 & MF2_SPLAT || thing->renderflags & RF_FLOORSPRITE);
|
||||
return (thing->flags2 & MF2_SPLAT || thing->frame & FF_FLOORSPRITE || thing->renderflags & RF_FLOORSPRITE);
|
||||
}
|
||||
|
||||
boolean R_ThingIsFullBright(mobj_t *thing)
|
||||
{
|
||||
return (thing->frame & FF_FULLBRIGHT || thing->renderflags & RF_FULLBRIGHT);
|
||||
return ((thing->frame & FF_BRIGHTMASK) == FF_FULLBRIGHT || (thing->renderflags & RF_BRIGHTMASK) == RF_FULLBRIGHT);
|
||||
}
|
||||
|
||||
boolean R_ThingIsSemiBright(mobj_t *thing)
|
||||
{
|
||||
return ((thing->frame & FF_BRIGHTMASK) == FF_SEMIBRIGHT || (thing->renderflags & RF_BRIGHTMASK) == RF_SEMIBRIGHT);
|
||||
}
|
||||
|
||||
boolean R_ThingIsFullDark(mobj_t *thing)
|
||||
{
|
||||
return (thing->renderflags & RF_FULLDARK);
|
||||
return ((thing->frame & FF_BRIGHTMASK) == FF_FULLDARK || (thing->renderflags & RF_BRIGHTMASK) == RF_FULLDARK);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -82,6 +82,7 @@ boolean R_ThingIsPaperSprite (mobj_t *thing);
|
|||
boolean R_ThingIsFloorSprite (mobj_t *thing);
|
||||
|
||||
boolean R_ThingIsFullBright (mobj_t *thing);
|
||||
boolean R_ThingIsSemiBright (mobj_t *thing);
|
||||
boolean R_ThingIsFullDark (mobj_t *thing);
|
||||
|
||||
// --------------
|
||||
|
@ -123,13 +124,14 @@ typedef enum
|
|||
SC_PRECIP = 1<<2,
|
||||
SC_LINKDRAW = 1<<3,
|
||||
SC_FULLBRIGHT = 1<<4,
|
||||
SC_FULLDARK = 1<<5,
|
||||
SC_VFLIP = 1<<6,
|
||||
SC_ISSCALED = 1<<7,
|
||||
SC_ISROTATED = 1<<8,
|
||||
SC_SHADOW = 1<<9,
|
||||
SC_SHEAR = 1<<10,
|
||||
SC_SPLAT = 1<<11,
|
||||
SC_SEMIBRIGHT = 1<<5,
|
||||
SC_FULLDARK = 1<<6,
|
||||
SC_VFLIP = 1<<7,
|
||||
SC_ISSCALED = 1<<8,
|
||||
SC_ISROTATED = 1<<9,
|
||||
SC_SHADOW = 1<<10,
|
||||
SC_SHEAR = 1<<11,
|
||||
SC_SPLAT = 1<<12,
|
||||
// masks
|
||||
SC_CUTMASK = SC_TOP|SC_BOTTOM,
|
||||
SC_FLAGMASK = ~SC_CUTMASK
|
||||
|
|
|
@ -511,7 +511,8 @@ static inline UINT8 transmappedpdraw(const UINT8 *dest, const UINT8 *source, fix
|
|||
void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 scrn, patch_t *patch, const UINT8 *colormap)
|
||||
{
|
||||
UINT8 (*patchdrawfunc)(const UINT8*, const UINT8*, fixed_t);
|
||||
UINT32 alphalevel = 0;
|
||||
UINT32 alphalevel = ((scrn & V_ALPHAMASK) >> V_ALPHASHIFT);
|
||||
UINT32 blendmode = ((scrn & V_BLENDMASK) >> V_BLENDSHIFT);
|
||||
|
||||
fixed_t col, ofs, colfrac, rowfrac, fdup, vdup;
|
||||
INT32 dupx, dupy;
|
||||
|
@ -538,13 +539,13 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
|
|||
patchdrawfunc = standardpdraw;
|
||||
|
||||
v_translevel = NULL;
|
||||
if ((alphalevel = ((scrn & V_ALPHAMASK) >> V_ALPHASHIFT)))
|
||||
if (alphalevel)
|
||||
{
|
||||
if (alphalevel == 13)
|
||||
if (alphalevel == 10)
|
||||
alphalevel = hudminusalpha[st_translucency];
|
||||
else if (alphalevel == 14)
|
||||
else if (alphalevel == 11)
|
||||
alphalevel = 10 - st_translucency;
|
||||
else if (alphalevel == 15)
|
||||
else if (alphalevel == 12)
|
||||
alphalevel = hudplusalpha[st_translucency];
|
||||
|
||||
if (alphalevel >= 10)
|
||||
|
@ -552,7 +553,11 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
|
|||
|
||||
if (alphalevel)
|
||||
{
|
||||
v_translevel = R_GetTranslucencyTable(alphalevel);
|
||||
if (blendmode)
|
||||
v_translevel = R_GetBlendTable(blendmode+1, alphalevel);
|
||||
else
|
||||
v_translevel = R_GetTranslucencyTable(alphalevel);
|
||||
|
||||
patchdrawfunc = translucentpdraw;
|
||||
}
|
||||
}
|
||||
|
@ -591,10 +596,6 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
|
|||
colfrac = FixedDiv(FRACUNIT, fdup);
|
||||
rowfrac = FixedDiv(FRACUNIT, vdup);
|
||||
|
||||
// So it turns out offsets aren't scaled in V_NOSCALESTART unless V_OFFSET is applied ...poo, that's terrible
|
||||
// For now let's just at least give V_OFFSET the ability to support V_FLIP
|
||||
// I'll probably make a better fix for 2.2 where I don't have to worry about breaking existing support for stuff
|
||||
// -- Monster Iestyn 29/10/18
|
||||
{
|
||||
fixed_t offsetx = 0, offsety = 0;
|
||||
|
||||
|
@ -605,15 +606,8 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
|
|||
offsetx = FixedMul(patch->leftoffset<<FRACBITS, pscale);
|
||||
|
||||
// top offset
|
||||
// TODO: make some kind of vertical version of V_FLIP, maybe by deprecating V_OFFSET in future?!?
|
||||
offsety = FixedMul(patch->topoffset<<FRACBITS, vscale);
|
||||
|
||||
if ((scrn & (V_NOSCALESTART|V_OFFSET)) == (V_NOSCALESTART|V_OFFSET)) // Multiply by dupx/dupy for crosshairs
|
||||
{
|
||||
offsetx = FixedMul(offsetx, dupx<<FRACBITS);
|
||||
offsety = FixedMul(offsety, dupy<<FRACBITS);
|
||||
}
|
||||
|
||||
// Subtract the offsets from x/y positions
|
||||
x -= offsetx;
|
||||
y -= offsety;
|
||||
|
@ -812,7 +806,8 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca
|
|||
void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 scrn, patch_t *patch, const UINT8 *colormap, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h)
|
||||
{
|
||||
UINT8 (*patchdrawfunc)(const UINT8*, const UINT8*, fixed_t);
|
||||
UINT32 alphalevel = 0;
|
||||
UINT32 alphalevel = ((scrn & V_ALPHAMASK) >> V_ALPHASHIFT);
|
||||
UINT32 blendmode = ((scrn & V_BLENDMASK) >> V_BLENDSHIFT);
|
||||
// boolean flip = false;
|
||||
|
||||
fixed_t col, ofs, colfrac, rowfrac, fdup, vdup;
|
||||
|
@ -838,13 +833,13 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, IN
|
|||
patchdrawfunc = standardpdraw;
|
||||
|
||||
v_translevel = NULL;
|
||||
if ((alphalevel = ((scrn & V_ALPHAMASK) >> V_ALPHASHIFT)))
|
||||
if (alphalevel)
|
||||
{
|
||||
if (alphalevel == 13)
|
||||
if (alphalevel == 10)
|
||||
alphalevel = hudminusalpha[st_translucency];
|
||||
else if (alphalevel == 14)
|
||||
else if (alphalevel == 11)
|
||||
alphalevel = 10 - st_translucency;
|
||||
else if (alphalevel == 15)
|
||||
else if (alphalevel == 12)
|
||||
alphalevel = hudplusalpha[st_translucency];
|
||||
|
||||
if (alphalevel >= 10)
|
||||
|
@ -852,7 +847,11 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, IN
|
|||
|
||||
if (alphalevel)
|
||||
{
|
||||
v_translevel = R_GetTranslucencyTable(alphalevel);
|
||||
if (blendmode)
|
||||
v_translevel = R_GetBlendTable(blendmode+1, alphalevel);
|
||||
else
|
||||
v_translevel = R_GetTranslucencyTable(alphalevel);
|
||||
|
||||
patchdrawfunc = translucentpdraw;
|
||||
}
|
||||
}
|
||||
|
@ -1411,11 +1410,11 @@ void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
|
|||
|
||||
if ((alphalevel = ((c & V_ALPHAMASK) >> V_ALPHASHIFT)))
|
||||
{
|
||||
if (alphalevel == 13)
|
||||
if (alphalevel == 10)
|
||||
alphalevel = hudminusalpha[st_translucency];
|
||||
else if (alphalevel == 14)
|
||||
else if (alphalevel == 11)
|
||||
alphalevel = 10 - st_translucency;
|
||||
else if (alphalevel == 15)
|
||||
else if (alphalevel == 12)
|
||||
alphalevel = hudplusalpha[st_translucency];
|
||||
|
||||
if (alphalevel >= 10)
|
||||
|
|
|
@ -122,17 +122,23 @@ void V_CubeApply(UINT8 *red, UINT8 *green, UINT8 *blue);
|
|||
#define V_70TRANS 0x00070000
|
||||
#define V_80TRANS 0x00080000 // used to be V_8020TRANS
|
||||
#define V_90TRANS 0x00090000
|
||||
#define V_HUDTRANSHALF 0x000D0000
|
||||
#define V_HUDTRANS 0x000E0000 // draw the hud translucent
|
||||
#define V_HUDTRANSDOUBLE 0x000F0000
|
||||
#define V_HUDTRANSHALF 0x000A0000
|
||||
#define V_HUDTRANS 0x000B0000 // draw the hud translucent
|
||||
#define V_HUDTRANSDOUBLE 0x000C0000
|
||||
// Macros follow
|
||||
#define V_USERHUDTRANSHALF ((10-(cv_translucenthud.value/2))<<V_ALPHASHIFT)
|
||||
#define V_USERHUDTRANS ((10-cv_translucenthud.value)<<V_ALPHASHIFT)
|
||||
#define V_USERHUDTRANSDOUBLE ((10-min(cv_translucenthud.value*2, 10))<<V_ALPHASHIFT)
|
||||
|
||||
#define V_AUTOFADEOUT 0x00100000 // used by CECHOs, automatic fade out when almost over
|
||||
#define V_RETURN8 0x00200000 // 8 pixel return instead of 12
|
||||
#define V_OFFSET 0x00400000 // account for offsets in patches
|
||||
// use bits 21-23 for blendmodes
|
||||
#define V_BLENDSHIFT 20
|
||||
#define V_BLENDMASK 0x00700000
|
||||
// preshifted blend flags minus 1 as effects don't distinguish between AST_COPY and AST_TRANSLUCENT
|
||||
#define V_ADD ((AST_ADD-1)<<V_BLENDSHIFT) // Additive
|
||||
#define V_SUBTRACT ((AST_SUBTRACT-1)<<V_BLENDSHIFT) // Subtractive
|
||||
#define V_REVERSESUBTRACT ((AST_REVERSESUBTRACT-1)<<V_BLENDSHIFT) // Reverse subtractive
|
||||
#define V_MODULATE ((AST_MODULATE-1)<<V_BLENDSHIFT) // Modulate
|
||||
|
||||
#define V_ALLOWLOWERCASE 0x00800000 // (strings only) allow fonts that have lowercase letters to use them
|
||||
#define V_FLIP 0x00800000 // (patches only) Horizontal flip
|
||||
#define V_CENTERNAMETAG 0x00800000 // (nametag only) center nametag lines
|
||||
|
@ -142,8 +148,8 @@ void V_CubeApply(UINT8 *red, UINT8 *green, UINT8 *blue);
|
|||
#define V_SNAPTOLEFT 0x04000000 // for centering
|
||||
#define V_SNAPTORIGHT 0x08000000 // for centering
|
||||
|
||||
#define V_WRAPX 0x10000000 // Don't clamp texture on X (for HW mode)
|
||||
#define V_WRAPY 0x20000000 // Don't clamp texture on Y (for HW mode)
|
||||
#define V_AUTOFADEOUT 0x10000000 // used by CECHOs, automatic fade out when almost over
|
||||
#define V_RETURN8 0x20000000 // 8 pixel return instead of 12
|
||||
|
||||
#define V_NOSCALESTART 0x40000000 // don't scale x, y, start coords
|
||||
#define V_PERPLAYER 0x80000000 // automatically adjust coordinates/scaling for splitscreen mode
|
||||
|
|
Loading…
Reference in a new issue