mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Revamp alpha setup for custom FOFs
This commit is contained in:
parent
ac549eddeb
commit
d6a104f8a5
3 changed files with 19 additions and 11 deletions
|
@ -2163,6 +2163,11 @@ udmf
|
||||||
type = 13;
|
type = 13;
|
||||||
}
|
}
|
||||||
arg1
|
arg1
|
||||||
|
{
|
||||||
|
title = "Alpha";
|
||||||
|
default = 255;
|
||||||
|
}
|
||||||
|
arg2
|
||||||
{
|
{
|
||||||
title = "Flags";
|
title = "Flags";
|
||||||
type = 12;
|
type = 12;
|
||||||
|
@ -2180,7 +2185,6 @@ udmf
|
||||||
512 = "Split sprites";
|
512 = "Split sprites";
|
||||||
1024 = "Render inside planes";
|
1024 = "Render inside planes";
|
||||||
2048 = "Extra";
|
2048 = "Extra";
|
||||||
4096 = "Translucent";
|
|
||||||
8192 = "Fog";
|
8192 = "Fog";
|
||||||
16384 = "Only render inside planes";
|
16384 = "Only render inside planes";
|
||||||
32768 = "Render inside walls";
|
32768 = "Render inside walls";
|
||||||
|
|
|
@ -3381,15 +3381,19 @@ static void P_ConvertBinaryMap(void)
|
||||||
I_Error("Custom FOF (tag %d) found without a linedef back side!", lines[i].tag);
|
I_Error("Custom FOF (tag %d) found without a linedef back side!", lines[i].tag);
|
||||||
|
|
||||||
lines[i].args[0] = lines[i].tag;
|
lines[i].args[0] = lines[i].tag;
|
||||||
lines[i].args[1] = sides[lines[i].sidenum[1]].toptexture;
|
lines[i].args[2] = sides[lines[i].sidenum[1]].toptexture;
|
||||||
lines[i].args[2] = sides[lines[i].sidenum[1]].midtexture;
|
if (lines[i].flags & ML_EFFECT6)
|
||||||
if (lines[i].args[1] & FF_TRANSLUCENT)
|
lines[i].args[2] |= FF_SPLAT;
|
||||||
|
lines[i].args[3] = sides[lines[i].sidenum[1]].midtexture;
|
||||||
|
if (lines[i].args[2] & FF_TRANSLUCENT)
|
||||||
{
|
{
|
||||||
if (sides[lines[i].sidenum[0]].toptexture > 0)
|
if (sides[lines[i].sidenum[0]].toptexture > 0)
|
||||||
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS)/255;
|
lines[i].args[1] = sides[lines[i].sidenum[0]].toptexture;
|
||||||
else
|
else
|
||||||
lines[i].alpha = FRACUNIT/2;
|
lines[i].args[1] = 128;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
lines[i].args[1] = 255;
|
||||||
break;
|
break;
|
||||||
case 443: //Call Lua function
|
case 443: //Call Lua function
|
||||||
if (lines[i].text)
|
if (lines[i].text)
|
||||||
|
|
10
src/p_spec.c
10
src/p_spec.c
|
@ -6934,17 +6934,17 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
case 259: // Custom FOF
|
case 259: // Custom FOF
|
||||||
for (s = -1; (s = P_FindSectorFromTag(lines[i].args[0], s)) >= 0 ;)
|
for (s = -1; (s = P_FindSectorFromTag(lines[i].args[0], s)) >= 0 ;)
|
||||||
{
|
{
|
||||||
ffloor_t *fflr = P_AddFakeFloor(§ors[s], lines[i].frontsector, lines + i, (lines[i].args[1] & FF_TRANSLUCENT) ? (lines[i].alpha * 0xff) >> FRACBITS : 0xff, lines[i].args[1], secthinkers);
|
ffloor_t *fflr = P_AddFakeFloor(§ors[s], lines[i].frontsector, lines + i, lines[i].args[1], lines[i].args[2], secthinkers);
|
||||||
if (!udmf) // Ugly backwards compatibility stuff
|
if (!udmf) // Ugly backwards compatibility stuff
|
||||||
{
|
{
|
||||||
if (lines[i].args[1] & FF_QUICKSAND)
|
if (lines[i].args[2] & FF_QUICKSAND)
|
||||||
{
|
{
|
||||||
fflr->sinkspeed = abs(lines[i].dx) >> 1;
|
fflr->sinkspeed = abs(lines[i].dx) >> 1;
|
||||||
fflr->friction = abs(lines[i].dy) >> 6;
|
fflr->friction = abs(lines[i].dy) >> 6;
|
||||||
}
|
}
|
||||||
if (lines[i].args[1] & FF_BUSTUP)
|
if (lines[i].args[2] & FF_BUSTUP)
|
||||||
{
|
{
|
||||||
switch (lines[i].args[2] % TMFB_ONLYBOTTOM)
|
switch (lines[i].args[3] % TMFB_ONLYBOTTOM)
|
||||||
{
|
{
|
||||||
case TMFB_TOUCH:
|
case TMFB_TOUCH:
|
||||||
fflr->busttype = BT_TOUCH;
|
fflr->busttype = BT_TOUCH;
|
||||||
|
@ -6960,7 +6960,7 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lines[i].args[2] & TMFB_ONLYBOTTOM)
|
if (lines[i].args[3] & TMFB_ONLYBOTTOM)
|
||||||
fflr->specialflags |= FS_ONLYBOTTOM;
|
fflr->specialflags |= FS_ONLYBOTTOM;
|
||||||
if (lines[i].flags & ML_EFFECT4)
|
if (lines[i].flags & ML_EFFECT4)
|
||||||
fflr->specialflags |= FS_PUSHABLES;
|
fflr->specialflags |= FS_PUSHABLES;
|
||||||
|
|
Loading…
Reference in a new issue