- Add a missing check for out-of-memory in the lemon code generator.
- Fix a total unimportant file descriptor leak in lemon. This is to silence warning messages.
- Fix a bug in lemon in computation of which non-terminals can generate an empty string. This bug and the fix make absolutely no difference for the grammar used by SQLite, but it can make a difference when lemon is used in other grammars.
- In Lemon, when comparing the output to the *.h file to see if it has changed, make sure that the proposed new output and the preexisting output are the same size before deciding that they are the same.
Mostly preparation to implement a per-mod automap option but also fixes a few minor issues with some colors that are not defined in the original game specific colorsets.
Since I remember that 'memset/memcpy' is safe in this code, it should be okay to cast to the generic pointer all the 'virtual class' arguments before calling the above functions. Shuts up Clang warnings.
- For the purposes of getting constant values from expressions, the only
class where Resolve doesn't duplicate the functionality of
EvalExpression was FxConstant. So, every other class has had its
EvalExpression taken away, and FxConstant has had it renamed to GetValue.
The 'unix' identifier isn't defined when '-std' is passed to the compiler (tested with gcc and clang), so use '__unix__' which is well enough documented.
- Now that the VM supports degrees, use those instructions when emitting
code for cos and sin DECORATE expressions. (This looks like it also
fixed a bug where sqrt also did the degree to radian conversion.)
- Added versions of the trig operations supported by FLOP that can work
with degrees directly instead of radians.
- Reorder FLOPs into more sensible groupings.
- After StateParams was removed in commit 4a1fbdb, the expressions for
default paramaters that ParseActionDef() created went nowhere and were
lost. Properly throw them away by deleting them as soon as they've been
parsed.
- Removed EvalExpression() implementations from some subclasses of
FxExpression that don't make any sense in the context of evaluating a
constant value.
- This all became vestigial code after the relevant information was all
moved into FStateTempCall. Now that the MBF code pointer code has been
converted, I can be sure it wasn't still used anywhere.
- Where the old code mucked about with parameter lists to convert misc1
and misc2 values to action function parameters, we now create new script
functions using a VMFunctionBuilder to pass the parameters to an action
function. This code is completely untested, as I have no BEX patches to
test it with, but at least it compiles without error.