Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
madame-rachelle committed Oct 1, 2016
2 parents a89ec61 + 51ffd6d commit ff0d409
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 3 deletions.
13 changes: 13 additions & 0 deletions specs/udmf_zdoom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,19 @@ Note: All <bool> fields default to false unless mentioned otherwise.
damagehazard = <bool>; // Changes damage model to Strife's delayed damage for the given sector. Default = false.
floorterrain = <string>; // Sets the terrain for the sector's floor. Default = 'use the flat texture's terrain definition.'
ceilingterrain = <string>; // Sets the terrain for the sector's ceiling. Default = 'use the flat texture's terrain definition.'

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.
portal_floor_norender = <bool> // ceiling portal not rendered.
portal_floor_overlaytype = <string> // defines translucency style, can either be "translucent" or "additive". Default is "translucent".


* Note about dropactors
Expand Down
15 changes: 15 additions & 0 deletions src/namedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,21 @@ 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)
xx(portal_floor_norender)
xx(portal_floor_overlaytype)
xx(portal_floor_useglobaltex)


xx(offsetx_top)
xx(offsety_top)
Expand Down
2 changes: 1 addition & 1 deletion src/p_mobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3526,7 +3526,7 @@ void AActor::Tick ()
sector_t *sec = node->m_sector;
DVector2 scrollv;

if (level.Scrolls.Size() > (sec-sectors))
if (level.Scrolls.Size() > unsigned(sec-sectors))
{
scrollv = level.Scrolls[sec - sectors];
}
Expand Down
54 changes: 54 additions & 0 deletions src/p_udmf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,60 @@ class UDMFParser : public UDMFParserBase
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;

case NAME_portal_ceil_disabled:
Flag(sec->planes[sector_t::ceiling].Flags, PLANEF_DISABLED, key);
break;

case NAME_portal_ceil_nopass:
Flag(sec->planes[sector_t::ceiling].Flags, PLANEF_NOPASS, key);
break;

case NAME_portal_ceil_norender:
Flag(sec->planes[sector_t::ceiling].Flags, PLANEF_NORENDER, key);
break;

case NAME_portal_ceil_overlaytype:
if (!stricmp(CheckString(key), "translucent")) sec->planes[sector_t::ceiling].Flags &= ~PLANEF_ADDITIVE;
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;

case NAME_portal_floor_disabled:
Flag(sec->planes[sector_t::floor].Flags, PLANEF_DISABLED, key);
break;

case NAME_portal_floor_nopass:
Flag(sec->planes[sector_t::floor].Flags, PLANEF_NOPASS, key);
break;

case NAME_portal_floor_norender:
Flag(sec->planes[sector_t::floor].Flags, PLANEF_NORENDER, key);
break;

case NAME_portal_floor_overlaytype:
if (!stricmp(CheckString(key), "translucent")) sec->planes[sector_t::floor].Flags &= ~PLANEF_ADDITIVE;
else if (!stricmp(CheckString(key), "additive")) sec->planes[sector_t::floor].Flags |= PLANEF_ADDITIVE;
break;

// These two are used by Eternity for something I do not understand.
//case NAME_portal_ceil_useglobaltex:
//case NAME_portal_floor_useglobaltex:

default:
break;
}
Expand Down
1 change: 0 additions & 1 deletion src/serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,6 @@ void FSerializer::WriteObjects()
for (unsigned i = 0; i < w->mDObjects.Size(); i++)
{
auto obj = w->mDObjects[i];
player_t *player;

BeginObject(nullptr);
w->Key("classtype");
Expand Down
16 changes: 16 additions & 0 deletions src/thingdef/thingdef_codeptr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3322,6 +3322,22 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTranslucent)
return 0;
}

//===========================================================================
//
// A_SetRenderStyle
//
//===========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRenderStyle)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_FLOAT(alpha);
PARAM_INT_OPT(mode) { mode = 0; }

self->Alpha = clamp(alpha, 0., 1.);
self->RenderStyle = ERenderStyle(mode);
return 0;
}

//===========================================================================
//
// A_FadeIn
Expand Down
1 change: 1 addition & 0 deletions wadsrc/static/actors/actor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ ACTOR Actor native //: Thinker
native void A_LogInt(int whattoprint);
native void A_LogFloat(float whattoprint);
native void A_SetTranslucent(float alpha, int style = 0);
native void A_SetRenderStyle(float alpha, int style);
action native A_FadeIn(float reduce = 0.1, int flags = 0);
action native A_FadeOut(float reduce = 0.1, int flags = 1); //bool remove == true
native void A_FadeTo(float target, float amount = 0.1, int flags = 0);
Expand Down
20 changes: 19 additions & 1 deletion wadsrc/static/actors/constants.txt
Original file line number Diff line number Diff line change
Expand Up @@ -689,4 +689,22 @@ enum

VRF_NOANGLE = VRF_NOANGLESTART|VRF_NOANGLEEND,
VRF_NOPITCH = VRF_NOPITCHSTART|VRF_NOPITCHEND,
};
};

enum
{
STYLE_None,
STYLE_Normal,
STYLE_Fuzzy,
STYLE_SoulTrans,
STYLE_OptFuzzy,
STYLE_Stencil,
STYLE_Translucent,
STYLE_Add,
STYLE_Shaded,
STYLE_TranslucentStencil,
STYLE_Shadow,
STYLE_Subtract,
STYLE_AddStencil,
STYLE_AddShaded,
};

0 comments on commit ff0d409

Please sign in to comment.