Commit Graph

8311 Commits

Author SHA1 Message Date
Christoph Oelckers d46ceafd35 - fixed: A_Face* had the sign for the pitch inverted (In Doom, negative pitch is upward, this had positive pitch upward.) 2016-12-08 19:07:50 +01:00
Christoph Oelckers a4d2468d34 - disable weapon interpolation for offset changes.
This has been causing far too many problems so now it will only be done if a A_Weaponoffset is either used with WOF_ADD or WOF_INTERPOLATE.
2016-12-08 17:52:59 +01:00
Magnus Norddahl fb4e34d178 Fix crash reporter for 64 bit 2016-12-08 14:36:17 +01:00
Christoph Oelckers d741e0eb26 - fixed: P_CheckSight returned incorrect results when having to traverse the collected lines just for adding more portals to the list. 2016-12-08 11:23:08 +01:00
Christoph Oelckers 66d287ea81 - fixed: Stepping through a ceiling portal on a two-sided line did not work.
- fixed: Stepping up an actor checked against the sector's own ceiling, even if it was a crossable portal.
2016-12-08 10:16:22 +01:00
Christoph Oelckers 6adcba3c4b - fixed linkage for fuzzviewheight
- fixed naming conflict with GCC's virtual table.
2016-12-07 18:39:09 +01:00
Edoardo Prezioso e4c208602d - Fixed GCC/Clang warning/error. 2016-12-07 16:07:25 +01:00
Christoph Oelckers 2677976cae - r_drawt.cpp is no longer needed. 2016-12-07 15:44:25 +01:00
Christoph Oelckers a118903e3e - complete removal of assembly stuff. Nothing of this gets used anymore. 2016-12-07 14:41:21 +01:00
Christoph Oelckers ed141943e1 - removed use of BestColor_MMX because there is no measurable improvement at all on a modern system. On top of that this function does not get called nearly often enough to justify the hassle. Like DoBlending this would require hundreds of calls per frame to make any impact that would be measurable. 2016-12-07 14:40:19 +01:00
Christoph Oelckers 5910067c44 - discontinue using the MMX assembly version of DoBlending.
Some benchmarking shows that on SSE systems it only harms performance and compared to the intrinsics version the gains are too marginal for something this infrequently called.
Doing 100000 calls of DoBlending results in a 5 ms decrease of using assembly vs intrinsics on a 3.4 GHz Core i7, meaning that even on a computer that is 10x slower you can still do 1000 or so blends per frame without a speed hit.
2016-12-07 14:40:18 +01:00
Christoph Oelckers 42346c58d3 - disabled assembly entirely to make the MT drawer submission compile.
This still requires a review of the two non-drawer functions that get 'lost'.
2016-12-07 12:31:43 +01:00
Christoph Oelckers 1e42c6f227 - added copyright headers to two files missing them. 2016-12-07 11:40:59 +01:00
Magnus Norddahl 3ff91807b8 Move swrenderer into a namespace, add multithreading framework, and move drawers to commands 2016-12-07 09:34:49 +01:00
Christoph Oelckers 52645afb4b - for the time being, make ZScript command line switch locked so that everybody understands that it's not ready for use in released mods yet. 2016-12-06 22:42:10 +01:00
Christoph Oelckers b2d1b0d7a6 - fixed: FTranslatedLineTarget::angleFromSource returned the attack angle, not the angle between actors when returned from P_LineAttack.
For most attack functions this is wrong, it's only the Hexen fighter attack needing this particular value, so it has been split up into two return values now.
2016-12-06 11:04:54 +01:00
Christoph Oelckers daaa6e7831 - fixed bad parameter in AActor::ModifyDamage. 2016-12-06 00:00:56 +01:00
Christoph Oelckers 092461ed34 - make dynamic object casts a dedicated VM instruction instead of a builtin function.
This can see some heavy use in iterators where saving several hundreds of function calls can be achieved. In these cases, using a function to do the job will become a significant time waster.
2016-12-05 14:52:34 +01:00
Christoph Oelckers f722967abe - added automatic type deduction capabilities for local variables. If you type 'let variable = value;' the type of 'variable' will be deduced from the given value. This is mostly of interest for type casting pointers, because 'let p = Classtype(objectvar);' does not require writing the class type name twice. 2016-12-05 13:24:42 +01:00
Christoph Oelckers 67bdac5227 Merge branch 'master' into zscript 2016-12-05 12:03:59 +01:00
Christoph Oelckers 7624973ef3 - updated list of render styles in UDMF spec. 2016-12-05 11:50:41 +01:00
Christoph Oelckers c0a622eb54 - removed pointless assignment. 2016-12-05 02:08:26 +01:00
Christoph Oelckers f6fb27b683 - deleted rt_copy*col and rt_map*col assembly versions after running benchmarks that show inferior performance to the C++ versions on both older and newer CPUs. 2016-12-05 00:46:58 +01:00
Christoph Oelckers 86fcc3fd21 - added a heavily optimized version of vlinec4 for x64. The original loaded everything from the global variables. While this is acceptable in 32 bit code because it has an immediate register load instruction, for 64 bit this does not exist. Accessing these variables from the stack or a register doubles the execution speed of this function and on a Core i7-3770 from 2012 is even faster than the assembly version. Right now the assembly version is still there, pending a benchmark run on an older 64 bit system. 2016-12-04 23:53:36 +01:00
Christoph Oelckers f4454d2e00 - minor, but very effective optimization for R_DrawSpanMasked: Do not store the texel value in a byte. Store it in a local int variable. This allows the compiler to read it with a zero extending instruction instead of using a byte reading instruction and then later having it to convert to an int anyway. This removes one instruction from the loop which results in a 10% performance increase on 32 bit. 2016-12-04 19:32:54 +01:00
Christoph Oelckers c9caaf08c8 - removed asm version of R_DrawFuzzColumn, because even on my 9 year old laptop this was significantly slower than the C version. 2016-12-04 18:38:38 +01:00
Christoph Oelckers 13efb34964 - removed the asm version of R_DrawColumn because it doesn't provide any significant benefit.
On modern systems it is actually slower than the C version, only on old ones it is marginally faster - but the overall execution time for this function is so low that even in the worst case scenario the minor loss of performance on older systems is still not relevant.
2016-12-04 18:05:34 +01:00
Christoph Oelckers 8fd03bc4a3 - fixed a few prototypes. 2016-12-04 16:57:10 +01:00
Christoph Oelckers 93163d12f1 - removed R_DrawColumnHorizP_ASM completely after discovering that the compiler generated code isn't really anything worse than the old assembly code. This looks like something that may have been relevant 10 years ago but today it looks like there's no need for hand optimization here anymore. And since it appears to be broken anyway, off this goes. 2016-12-04 15:31:08 +01:00
Christoph Oelckers d0cf34890c - disabled R_DrawColumnHorizP_ASM because that function appears prone to crashing when rendering decals. 2016-12-04 15:01:48 +01:00
Christoph Oelckers bf0aedfd9c Merge branch 'master' of https://github.com/rheit/zdoom into zscript 2016-12-04 14:29:24 +01:00
Christoph Oelckers 5a08768eaf - removed unused label. 2016-12-04 14:29:03 +01:00
Magnus Norddahl 0ed0c47a45 Optimize capped sky rendering by writing 4 pixels at a time in 5 bands (solid, fade, texture, fade, solid) 2016-12-04 14:28:13 +01:00
Christoph Oelckers ebdc672985 - fixed: A_Saw was using the wrong angle for adjusting the facing direction at the end. 2016-12-04 10:45:20 +01:00
Christoph Oelckers 18b953dd50 - fixed: Blasted objects should also be subject to being checked with CanCollideWith. 2016-12-04 10:34:36 +01:00
Christoph Oelckers 71e8f09126 Merge branch 'master' of https://github.com/rheit/zdoom into zscript 2016-12-04 10:27:35 +01:00
Edoardo Prezioso 0cff443945 - Fixed missing linebreak in 'currentpos' error message. 2016-12-04 10:25:23 +01:00
Edoardo Prezioso c99a051a2a - Added lambda feature to FString::(Strip|Replace)Chars.
Use it in the other (Strip|Replace)Chars methods to show how it would work.
2016-12-04 10:24:49 +01:00
Christoph Oelckers 94287518e0 - added a virtual CanCollideWith script method that can be overridden to do class specific collision checks.
This will get called for both actors taking part in a collision, if one of the two calls returns false it will immediately abort PIT_CheckThing with no collision taking place at all.
2016-12-04 10:13:36 +01:00
Christoph Oelckers 04f5be6249 - zcc_compile.cpp needs to include version.h for the DYNLIGHT #define. 2016-12-03 19:14:20 +01:00
Christoph Oelckers 71bda99c3b - fixed: DECORATE didn't pass all needed arguments to FunctionBuildList.AddFunction. Removed the default parameter values from this function's declaration to prevent it from happening again. 2016-12-03 18:14:07 +01:00
Christoph Oelckers 21e3aba1c7 - optionally allow passing a script position object to V_GetColor and subfunctions for better error output. Implemented this for all occurences where this info was available. 2016-12-03 16:27:53 +01:00
Christoph Oelckers 1fc90b1ba9 - fixed: A_Face* should not require the target to be non-null. 2016-12-03 15:59:02 +01:00
Christoph Oelckers 6a4f867c91 Merge branch 'master' into zscript 2016-12-03 15:54:18 +01:00
Christoph Oelckers 30cbce051e - fixed: Custom automap colors were not invalidated on restart.
- fixed: D_DoomMain has 3 calls to D_DoomLoop but only the main call of these was capable of a clean restart.
2016-12-03 15:44:46 +01:00
Christoph Oelckers 5117b32431 - fixed: The math for emulating the old slop overflow was not correct and made the affected sectors in void.wad display incorrectly.
- set compat_polyobj for void.wad because its polyobjects glitch quite a bit with the normal setting.
2016-12-03 14:42:06 +01:00
Christoph Oelckers 28604bad62 - fixed: The polyobject init specials must be cleared after Polyobject initialization is done, because they can block usage of regular lines colinear with the polyobject 2016-12-03 14:06:51 +01:00
Christoph Oelckers 0da233a664 changed ZScript include mechanism.
* It will now use #include, just like most other definition formats and can be mixed with regular definitions. However, due to how the Lemon-generated parser works this will not recursively pull in all files, but store them in a list and process them sequentially. Functionally this shouldn't make a difference, because ZScript is mostly order-independent - the only thing where order is important is native classes, but these are completely internal to zdoom.pk3 where proper order is observed.
2016-12-03 13:16:09 +01:00
Christoph Oelckers 136e976b2a - added an error check for duplicate local variable definitions.
Note that this only applies if both are in the same block. Just like in C++, it is perfectly legal to have the same variable name in two different nested scopes.
2016-12-03 12:33:58 +01:00
Christoph Oelckers b3783a3850 redid the exception mechanism for script-side access violations to be of more use for diagnosing problems.
The original implementation just printed a mostly information-free message and then went on as if nothing has happened, making it ridiculously easy to write broken code and release it. Changed it to:

* Any VMAbortException will now terminate the game session and go back to the console.
* It will also print a VM stack trace with all open functions, including source file and line numbers pointing to the problem spots. For this the relevant information had to be added to the VMScriptFunction class.

An interesting effect here was that just throwing the exception object increased the VM's Exec function's stack size from 900 bytes to 70kb, because the compiler allocates a separate local buffer for every single instance of the exception object.
The obvious solution was to put this part into a subfunction so that it won't pollute the Exec function's own stack frame. Interesting side effect of this: Exec's stack requirement went down from 900 bytes to 600 bytes. This is still on the high side but already a lot better.
2016-12-03 12:23:13 +01:00