- added GetLineX/GetLineY ACS functions.

This commit is contained in:
Christoph Oelckers 2017-03-29 01:01:40 +02:00
parent d160424aea
commit 3a569f176d

View file

@ -4964,6 +4964,10 @@ enum EACSFunctions
ACSF_ScriptCall, ACSF_ScriptCall,
ACSF_StartSlideshow, ACSF_StartSlideshow,
// Eternity's
ACSF_GetLineX = 300,
ACSF_GetLineY,
// OpenGL stuff // OpenGL stuff
ACSF_SetSectorGlow = 400, ACSF_SetSectorGlow = 400,
@ -6822,11 +6826,24 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
G_StartSlideshow(FName(FBehavior::StaticLookupString(args[0]))); G_StartSlideshow(FName(FBehavior::StaticLookupString(args[0])));
break; 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: default:
break; break;
} }
return 0; return 0;
} }