mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- added GetLineX/GetLineY ACS functions.
This commit is contained in:
parent
d160424aea
commit
3a569f176d
1 changed files with 19 additions and 2 deletions
|
@ -4964,6 +4964,10 @@ enum EACSFunctions
|
|||
ACSF_ScriptCall,
|
||||
ACSF_StartSlideshow,
|
||||
|
||||
// Eternity's
|
||||
ACSF_GetLineX = 300,
|
||||
ACSF_GetLineY,
|
||||
|
||||
|
||||
// OpenGL stuff
|
||||
ACSF_SetSectorGlow = 400,
|
||||
|
@ -6822,11 +6826,24 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
G_StartSlideshow(FName(FBehavior::StaticLookupString(args[0])));
|
||||
break;
|
||||
|
||||
case ACSF_GetLineX:
|
||||
case ACSF_GetLineY:
|
||||
{
|
||||
FLineIdIterator it(args[0]);
|
||||
int lineno = it.Next();
|
||||
if (lineno < 0) return 0;
|
||||
DVector2 delta = level.lines[lineno].Delta();
|
||||
double result = delta[funcIndex - ACSF_GetLineX] * ACSToDouble(args[1]);
|
||||
if (args[2])
|
||||
{
|
||||
DVector2 normal = DVector2(delta.Y, -delta.X).Unit();
|
||||
result += normal[funcIndex - ACSF_GetLineX] * ACSToDouble(args[2]);
|
||||
}
|
||||
return DoubleToACS(result);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue