- This is an effort to emphasize that these are just type casts. Now they
look like function-style casts with no action function styling.
They do no magic joojoo at all. The only reason they exist is because
the DECORATE parser can only parse return statements that call a
function, so these satisfy that requirement. i.e. *return int(666);* is
identical to *return 666;* (if the parser could handle the latter).
- The A_Jump family of action functions now return the state to jump
to (NULL if no jump is to be taken) instead of jumping directly.
It is the caller's responsibility to handle the jump. This will
make it possible to use their results in if statements and
do something other than jump.
- DECORATE return statements can now return the result of a function
(but not any random expression--it must be a function call). To
make a jump happen from inside a multi-action block, you must
return the value of an A_Jump function. e.g.:
{ return A_Jump(128, "SomeState"); }
- The VMFunction class now contains its prototype instead of storing
it at a higher level in PFunction. This is so that
FState::CallAction can easily tell if a function returns a state.
- Removed the FxTailable class because with explicit return
statements, it's not useful anymore.
- Member variables are now declared all in one place: InitThingdef(). They
are not partially defined in thingdef_expression.cpp and further refined
in actor.txt.
- This left ParseNativeVariable() parsing only functions, so it has been
renamed to ParseNativeFunction().
- Note that their declarations in InitThingdef() are expected to be
temporary.
- So now you can do something like this for an action:
{
if (health > 1000)
{
A_Scream;
}
else
{
A_XScream;
}
}
Yes, the braces are required. Because I see too many instances where
somebody writes an if statement in ACS and doesn't understand why it
doesn't work right because they forgot braces.
- Fixed: Not actually putting an action between { and } would crash.
- You can now call several actions from one frame by grouping them between
curly braces. i.e. :
POSS G 3 { A_Pain; A_Log("Ow! That hurt!"); }
I will probably add an `if (something) { blah; blah; } else { wah; wah; }`
construct later, but that's the extent of the munging I plan for DECORATE. The
real work goes to the scripting language, not here. But if this branch is
getting merged to master sooner than later, here's an immediate benefit
from it right now.
- This replaces the general extensibility that had existed formerly
in thingdef_function.cpp. Parameter parsing for function calls is
shared with state parameter parsing. Functions are defined exactly in
the same way as action functions, but without the 'action' keyword.
Conflicts:
src/CMakeLists.txt
src/b_think.cpp
src/g_doom/a_doomweaps.cpp
src/g_hexen/a_clericstaff.cpp
src/g_hexen/a_fighterplayer.cpp
src/namedef.h
src/p_enemy.cpp
src/p_local.h
src/p_mobj.cpp
src/p_teleport.cpp
src/sc_man_tokens.h
src/thingdef/thingdef_codeptr.cpp
src/thingdef/thingdef_function.cpp
src/thingdef/thingdef_parse.cpp
wadsrc/static/actors/actor.txt
wadsrc/static/actors/constants.txt
wadsrc/static/actors/shared/inventory.txt
- Added register reuse to VMFunctionBuilder for FxPick's code emitter.
- Note to self: Need to reimplement IsPointerEqual and CheckClass, which
were added to thingdef_function.cpp over the past year, as this file no
longer exists in this branch.
- 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.
When set, the actor will run this state during its first tick. This means Spawn
states may now run an action function if you set this flag. Note that this action function
is executed during the actor's first tick, which is not the same as when it is spawned.
SVN r4240 (trunk)
- Changed Actor's Damage property into an actual function. All access to the damage property
must now be done through GetMissileDamage. actor->GetMissileDamage(0, 1) is equivalent
to the former actor->Damage, for the case where actor->Damage was not an expression. (I
suppose I will probably need to make a thunk for DECORATE expressions that want to read it.)
- Cleaned up some decorate expression evaluation functions that are no longer used.
SVN r3919 (scripting)
- Initialize the alt HUD explicitly in D_DoomMain.
- don't let S_UnloadReverbDef leave a broken list of sound environments behind.
- Added more code to explicitly delete data before initializing it.
SVN r3039 (trunk)
running with the checked VM can be quite slow, since it has asserts everywhere. Some other
fixes were needed before the code actually worked:
- A_CallSpecial needs to have its arguments cast to ints.
- Some functions that set pnum/paramnum directly did not decrement it by 1. This also applies
to A_Jump, though it just uses the value of paramnum instead of changing it.
- Renamed pnum in the PARAM macros to paramnum, since pnum is already used in a few other
places for something different, so this makes searching for it easier.
This has not been tested especially thoroughly, but a first glance seems to indicate success.
SVN r2163 (scripting)
Currently, they're only good for disassembly and pasting into a proper text editor
for viewing.
- Fixed some problems with the FxExpression emitters that were revealed by actually
using them on the standard actors.
SVN r1911 (scripting)
- Derive PClass from dobject.cpp. This has one major ramification: Since the PClass
is not allocated until runtime, you cannot initialize any static/global data
structures with pointers to PClasses using RUNTIME_CLASS. Attempting to do so
will just initialize with a NULL pointer. Instead, you can initialize using
the address of the pointer returned by RUNTIME_CLASS and dereference that. By
the time you have an opportunity to dereference it, it will no longer be NULL.
- Sync CmakeLists.txt.
- Random fixes for problems GCC spotted.
SVN r1852 (scripting)
- Added more things from Gez's experimental build:
* MBF grenade and bouncing code.
* Arch Vile ghosts emulation (only for compatibility.txt.)
* Several MBF related compatibility options.
SVN r1821 (trunk)
* info CCMD to print extended actor information (not fully implemented yet)
* summonmbf CCMD.
* Beta BFG code pointer (but not the related missiles yet.)
* PowerInvisibility enhancements.
* ScoreItem with one significant change: Added a score variable that can be
checked through ACS and DECORATE. The engine itself will do nothing with it.
* Nailgun option for A_Explode.
* A_PrintBold and A_Log.
* A_SetSpecial.
SVN r1819 (trunk)
issues that caused its inclusion. Is an optimized GCC build any faster
for being able to use strict aliasing rules? I dunno. It's still slower
than a VC++ build.
I did run into two cases where TAutoSegIterator caused intractable problems
with breaking strict aliasing rules, so I removed the templating from it,
and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
(in particular, dobject.h when not compiling with VC++).
SVN r1743 (trunk)
velocity, and now it's known as such. The actor variables momx/momy/momz
are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
continue to work as aliases from DECORATE. The ACS functions, however,
require you to use the new name, since they never saw an official release
yet.
SVN r1689 (trunk)