Commit graph

8238 commits

Author SHA1 Message Date
Christoph Oelckers
7527141ad4 - fixed: The morph actors stored their required classes as names, not as class pointers.
This prevented any kind of error check on them.
Unfortunately, due to backwards compatibility needs, on DECORATE the missing class may not be fatal so a workaround had to be added to clear those bogus pointers later if they are discovered to be broken.
For ZScript, though, this will result in a compile error, which was the intention behind this change.
2016-11-23 22:34:17 +01:00
Christoph Oelckers
5e67cf79d3 - scriptified the Ironlich. 2016-11-23 21:26:59 +01:00
Christoph Oelckers
1a20a5b999 - scriptified A_PainShootSkull which was the last remaining bit in g_doom, so this directory is gone now. 2016-11-23 19:47:09 +01:00
Christoph Oelckers
f8c6adb7eb - completely redid how A_PainShootSkull checks the legality of the LS spawn.
It turned out that the Boom method does not work well with portals and fixing it while keeping it doesn't look feasible - the entire approach was bad from the start.
Instead, let's use the same approach as P_XYMovement: Spawn the Lost Soul at the center of the PE, and then use multiple P_TryMoves to get it to its intended location.
This will check all blocking lines, just like Boom did, but it will also properly handle z-positioning and portal transitions.
2016-11-23 18:54:16 +01:00
Christoph Oelckers
7325e3f0f8 - exported all member fields that make sense. Entirely private ones or classes that are not supposed to be extended were left out. 2016-11-23 17:34:36 +01:00
Christoph Oelckers
d1f5d916c2 Merge branch 'master' into zscript 2016-11-23 14:39:14 +01:00
Christoph Oelckers
9bd19c2d2e - ensure that the MAPINFO parser never mixes HexenHack parsing with the new format. 2016-11-23 14:38:45 +01:00
alexey.lysiuk
e138a3ffbc Fixed infinite recursion with self-referencing multipatch textures
See http://forum.zdoom.org/viewtopic.php?t=54355
2016-11-23 14:33:31 +01:00
Christoph Oelckers
5b059971f0 - fixed: P_SpawnMapThing forced gravity instead of disabling it when being given Gravity = 0 from UDMF. 2016-11-23 14:32:18 +01:00
Christoph Oelckers
6ae266c76e - fixed: The check for identical floor planes on an opening should never allow it to be narrowed down.
This can cause problems in rare situations where a sloped plane is checked outside its sector boundaries.
2016-11-23 14:27:08 +01:00
Edoardo Prezioso
0489b6e7c5 - Fixed missing newlines to the conversation error message. 2016-11-23 10:19:52 +01:00
Christoph Oelckers
649c96261a - clarified error messages for bogus conversation scripts. 2016-11-23 10:13:50 +01:00
Braden Obrzut
789315bb4a - Fixed build with MinGW-w64 (TDM-GCC 5.1). Note that the resulting binary will crash under -O3 until the alignment violation is taken care of in FRemapTable::Alloc.
- It appears that CMake added native support for building rc files with MinGW at some point so removed manual rc compiling code.
2016-11-22 22:41:32 -05:00
Christoph Oelckers
0c95568d98 - exported native fields of several more classes. 2016-11-23 01:31:48 +01:00
Christoph Oelckers
46757ff8bf - exported the native fields of FState and FLevelLocals as well. 2016-11-23 00:35:06 +01:00
Christoph Oelckers
099b9970ef - added proper definitions for all exported native fields.
- synthesize native fields for all declared flags, not just for AActor.
2016-11-22 23:43:32 +01:00
Edoardo Prezioso
e1c4e4939a - Fixed the order of the MS sections. 2016-11-22 21:20:42 +01:00
Edoardo Prezioso
e2167c661c - Fixed GCC/Clang compile errors. 2016-11-22 21:16:13 +01:00
Christoph Oelckers
980c986305 - allow defining native fields through scripts. Internally this only requires exporting the address, but not the entire field.
- added new VARF_Transient flag so that the decision whether to serialize a field does not depend solely on its native status. It may actually make a lot of sense to use the auto-serializer for native fields, too, as this would eliminate a lot of maintenance code.
- defined (u)int8/16 as aliases to the byte and short types (Can't we not just get rid of this naming convention already...?)
- exporting the fields of Actor revealed a few name clashes between them and some global types, so Actor.Sector was renamed to CurSector and Actor.Inventory was renamed to Actor.Inv.
2016-11-22 19:20:31 +01:00
Christoph Oelckers
ab5c11064a - added a few missing tildes. 2016-11-22 13:03:46 +01:00
Christoph Oelckers
03a02a2036 - updated copyrights in a few files. 2016-11-22 12:28:11 +01:00
Christoph Oelckers
bbb0778fd4 - scriptified Chicken and Pig - not tested yet, because other things have priority. 2016-11-22 12:21:55 +01:00
Christoph Oelckers
3db712cd73 - fixed: Switch statement without a default jumped to the first first case label instead.
- removed placeholder code from scripted Marine.
2016-11-21 22:20:25 +01:00
Christoph Oelckers
135cfcf016 - implemented State as an actual native struct, so that its fields can be accessed from scripts.
- refactored state bitfield members into a flag word because the address of a bitfield cannot be taken, making such variables inaccessible to scripts.
- actually use PNativeStruct for representing native structs defined in a script.
2016-11-21 21:34:34 +01:00
Christoph Oelckers
ff3baac8a7 - made PStatePointer a real pointer pointing to a native struct named 'state', because that's what it really is and what it needs to be if we want to use a state as more than an opaque identifier in the VM 2016-11-21 19:36:14 +01:00
Christoph Oelckers
6cc00e79a6 - made all internal struct types NativeStructs so that all variables of their types are made references. 2016-11-21 19:20:27 +01:00
Christoph Oelckers
360436c201 - scriptified the scripted marines.
- fixed symbol name generation for native functions.
- moved PrintableName to VMFunction so that native functions also have this information.
2016-11-21 19:09:58 +01:00
Christoph Oelckers
97763b5a2b - added scriptable virtual overrides for PostBeginPlay, Tick, BeginPlay, Activate and Deactivate. 2016-11-21 14:59:17 +01:00
Christoph Oelckers
7d99552903 - added two new integral types SpriteID and TextureID, both are needed to allow proper serialization as they require something different to be written out than a regular integer. 2016-11-21 13:45:33 +01:00
Christoph Oelckers
7c122d03e9 - renamed all instances of 'float' parameters to 'double', so that the Float32 type can be made usable for structs. 2016-11-21 13:04:27 +01:00
Christoph Oelckers
de2eb18727 - added per-channel access for color variables. However, since they are locally stored in registers, it required a minor bit of fudging for this case.
- make sure that a PFunction's implementation is always initialized before starting the code generator.
2016-11-21 12:38:39 +01:00
Christoph Oelckers
393bcf9e91 - extended ExpEmit::RegNum to 16 bits so that it can hold larger values for constant registers. 2016-11-21 10:50:09 +01:00
Christoph Oelckers
188c0ee932 - removed the REGT_NIL check from the PARAM_EXISTS macro, because with the implemented handling of named arguments it isn't possible that REGT_NIL can end up in the parameters without a programming error.. 2016-11-21 10:28:06 +01:00
Kyle Evans
3270b20045 Remove non-existant source file 2016-11-20 21:33:23 -06:00
Christoph Oelckers
e7f6bae83e - implemented named arguments.
- fixed flag CVAR access. As it turned out, OP_LBIT is a bit messy to set up properly when accessing integers that may or may not be big endian, so it now uses a shift and bit masking to do its work.
- used the SpawnPlayerMissile call in A_FireBFG to test named arguments.
2016-11-21 01:32:01 +01:00
Christoph Oelckers
7d8143224e - restored two accidentally deleted VM instructions. 2016-11-21 00:33:55 +01:00
Christoph Oelckers
0cbd260f96 - replaced all calls to GetCVar with direct CVar accesses. 2016-11-20 23:39:37 +01:00
Christoph Oelckers
8f722a3633 - fixed: FxCVar must free its address register. 2016-11-20 23:26:32 +01:00
Christoph Oelckers
e93961da96 - removed all constant versions of vector instructions. The vector code does not use compound constants so there's no need to have instructions for them.
- fixed: The code generator had no good safeguards for exceeding the maximum amount of registers.

All there was was a handful of pitiful asserts which in production code do nothing at all but generate broken output.
Even worse, the VM was hardwired to at most 255 constants per type per function by storing the constant count in a byte! This has been extended to 65535, but since many instructions only have a byte available for the constant index, a workaround had to be added to do a two-instruction setup if larger indices are needed.
2016-11-20 23:00:05 +01:00
Christoph Oelckers
1c2c26eb08 - implemented direct CVar access. 2016-11-20 20:24:39 +01:00
Christoph Oelckers
159f09105e - used static constant arrays to shorten some code. 2016-11-20 18:34:27 +01:00
Christoph Oelckers
5951a9449c - added static constant arrays. At the moment they can only be defined inside functions due to lack of dedicated storage inside classes for static data.
- added new VM instructions to access the constant tables with a variable index.
- refactored VMFunctionBuilder's constant tables so that they are not limited to one entry per value. While this works fine for single values, it makes it impossible to store constant arrays in here.
2016-11-20 18:00:37 +01:00
Christoph Oelckers
bb25c5faaa - scriptified the remaining Doom weapon code.
- implemented method calls from struct instances.
- optimized disassembly of VM call instructions to print the function's name at the end where it is more visible and does not need to be truncated. Also use the printable name for script functions here.
2016-11-20 12:27:26 +01:00
Christoph Oelckers
ab6b2f369e - fixed: For varargs, not only the type but also the flag of the last specified argument need to be stored for later parameters. 2016-11-20 09:47:46 +01:00
Christoph Oelckers
3c726aa570 - scriptified A_FirePlasma. 2016-11-20 01:18:21 +01:00
Christoph Oelckers
fdab994fcb - scriptified the Rocket launcher. 2016-11-20 01:11:01 +01:00
Christoph Oelckers
814493b68d - scriptified the Super Shotgun. 2016-11-20 00:45:06 +01:00
Christoph Oelckers
af34d82888 - scriptified A_Saw.
- implemented multiple-return-value assignment. Due to some grammar conflicts the originally intended Lua-inspired syntax of 'a, b = Function()' could not be done, so it's '[a, b] = Function()'
2016-11-20 00:25:38 +01:00
Christoph Oelckers
74c5659fc5 - explicitly call Destroy in PClass::StaticShutdown because some class type objects were no longer automatically collected. 2016-11-19 18:09:34 +01:00
Christoph Oelckers
7595343aaa - fixed: Completely empty if statements left the code generator in a broken state. 2016-11-19 18:02:07 +01:00