mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-12-15 06:31:01 +00:00
32 lines
551 B
C++
32 lines
551 B
C++
#include "actor.h"
|
|
#include "sc_man.h"
|
|
|
|
// A stub to simulate the interface of .96x's expression evaluator.
|
|
|
|
int ParseExpression (bool _not)
|
|
{
|
|
SC_MustGetFloat();
|
|
if (_not)
|
|
{
|
|
if (sc_Float==0.f) sc_Float=1.f;
|
|
else sc_Float=0.f;
|
|
}
|
|
|
|
return (int)(fixed_t)(sc_Float * FRACUNIT);
|
|
}
|
|
|
|
int EvalExpressionI (int id, AActor *self)
|
|
{
|
|
return id>>FRACBITS;
|
|
}
|
|
|
|
bool EvalExpressionN(int id, AActor * self)
|
|
{
|
|
return !EvalExpressionI(id, self);
|
|
}
|
|
|
|
float EvalExpressionF (int id, AActor *self)
|
|
{
|
|
return (float)id/FRACUNIT;
|
|
}
|
|
|