mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
SetLineRenderStyle ACS function
SetLineRenderStyle(int tag, int blend, int alpha) Changes the blend mode and transparency of a linedef. Requires new compiler config for the blend mode constants.
This commit is contained in:
parent
c8ccb13614
commit
28354ec70e
3 changed files with 52 additions and 0 deletions
|
|
@ -1408,3 +1408,52 @@ bool CallFunc_PodiumFinish(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM
|
|||
K_FinishCeremony();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
bool CallFunc_SetLineRenderStyle(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC)
|
||||
|
||||
Changes a linedef's blend mode and alpha.
|
||||
--------------------------------------------------*/
|
||||
bool CallFunc_SetLineRenderStyle(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC)
|
||||
{
|
||||
mtag_t tag = 0;
|
||||
patchalphastyle_t blend = AST_COPY;
|
||||
fixed_t alpha = FRACUNIT;
|
||||
|
||||
INT32 lineId = -1;
|
||||
|
||||
tag = argV[0];
|
||||
|
||||
switch (argV[1])
|
||||
{
|
||||
case TMB_TRANSLUCENT:
|
||||
default:
|
||||
blend = AST_COPY;
|
||||
break;
|
||||
case TMB_ADD:
|
||||
blend = AST_ADD;
|
||||
break;
|
||||
case TMB_SUBTRACT:
|
||||
blend = AST_SUBTRACT;
|
||||
break;
|
||||
case TMB_REVERSESUBTRACT:
|
||||
blend = AST_REVERSESUBTRACT;
|
||||
break;
|
||||
case TMB_MODULATE:
|
||||
blend = AST_MODULATE;
|
||||
break;
|
||||
}
|
||||
|
||||
alpha = argV[2];
|
||||
alpha = std::clamp(alpha, 0, FRACUNIT);
|
||||
|
||||
TAG_ITER_LINES(tag, lineId)
|
||||
{
|
||||
line_t *line = &lines[lineId];
|
||||
|
||||
line->blendmode = blend;
|
||||
line->alpha = alpha;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,4 +88,6 @@ bool CallFunc_EncoreMode(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::
|
|||
bool CallFunc_PodiumPosition(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
||||
bool CallFunc_PodiumFinish(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
||||
|
||||
bool CallFunc_SetLineRenderStyle(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
||||
|
||||
#endif // __SRB2_ACS_CALL_FUNCS_HPP__
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ Environment::Environment()
|
|||
addFuncDataACS0( 500, addCallFunc(CallFunc_CameraWait));
|
||||
addFuncDataACS0( 501, addCallFunc(CallFunc_PodiumPosition));
|
||||
addFuncDataACS0( 502, addCallFunc(CallFunc_PodiumFinish));
|
||||
addFuncDataACS0( 503, addCallFunc(CallFunc_SetLineRenderStyle));
|
||||
}
|
||||
|
||||
ACSVM::Thread *Environment::allocThread()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue