Commit graph

10521 commits

Author SHA1 Message Date
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
Magnus Norddahl
dacb985878 Fix texture mapping bug 2016-11-22 01:59:28 +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
Magnus Norddahl
7af504df58 Draw 3d floor sides 2016-11-21 20:50:54 +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
Magnus Norddahl
ddb0161f9c Sub pinkie crashes the pal drawer :( 2016-11-21 15:40:42 +01:00
Magnus Norddahl
0108ff89d7 Bug fixes 2016-11-21 15:20:07 +01:00
Magnus Norddahl
fabac78ea8 Add poly renderer to the menus 2016-11-21 15:19:24 +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
Magnus Norddahl
5e9c9c825d Add stencil blend mode as apparently the shaded mode uses indices whiles stencil uses mask/alpha.. 2016-11-21 05:52:02 +01:00
Magnus Norddahl
e7d64a380a Fix AABB culling bug 2016-11-21 05:09:53 +01:00
Kyle Evans
3270b20045 Remove non-existant source file 2016-11-20 21:33:23 -06:00
Magnus Norddahl
2ba2dc7611 Change shaded blend mode use srcalpha and destalpha.
Fix blending error in add/sub/revsub
2016-11-21 03:49:55 +01:00
Magnus Norddahl
144c7f4139 Flip sub and revsub TC drawers in the old renderer 2016-11-21 01:56:54 +01:00
Magnus Norddahl
29005b5ce6 Compile fix for older versions of LLVM 2016-11-21 01:40:08 +01: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
Rachael Alexanderson
dadee080e4 - Implemented Wall blend modes
- fixed: set color for "shaded" modes - though it's still not yet properly implemented.
2016-11-20 18:36:26 -05: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
Rachael Alexanderson
4ed548a189 - Implemented some sprite blend modes. 2016-11-20 17:07:58 -05: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
Magnus Norddahl
ebd810d843 Fix decal vertical position being wrong 2016-11-20 16:43:13 +01:00
Magnus Norddahl
bd9ec843dd Add palette version of the blend modes 2016-11-20 16:42:53 +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
Magnus Norddahl
6761e8639a Add palette support 2016-11-20 04:06:21 +01:00
Magnus Norddahl
7ac0cace7d Stop copying the matrix and remove r_triangle 2016-11-20 02:07:55 +01:00
Magnus Norddahl
f8efe394cc Remove unused code 2016-11-20 01:51:08 +01:00
Magnus Norddahl
845bf93c95 Change triangle full block to use vectored load and store 2016-11-20 01:29:19 +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
Rachael Alexanderson
08c4f2ac18 - Added a tool to clear the LLVM cache, if ever there is corruption or it needs rebuilt. 2016-11-19 17:08:08 -05:00
Rachael Alexanderson
fc011e42dd Merge branch 'master' of https://github.com/rheit/zdoom 2016-11-19 12:46:01 -05:00