Commit graph

11205 commits

Author SHA1 Message Date
Magnus Norddahl
ac518e23bf - improve triangle setup performance a little bit 2017-03-24 20:00:53 +01:00
Magnus Norddahl
bc8a4474d5 - optimize PolyTriangleDrawer::clipedge
- remove slow calls to roundf in the triangle setup functions
2017-03-24 13:04:02 +01:00
alexey.lysiuk
c1e425920e Fixed compilation with GCC and Clang 2017-03-24 13:02:00 +02:00
Magnus Norddahl
f178646e1a - improve sector portals rendering in softpoly
- fix a softpoly memory leak and change vertex list to be allocated using the frame allocator
2017-03-24 07:28:28 +01:00
Christoph Oelckers
b5720ee1e7 - initial work on DrawString method. 2017-03-24 02:38:44 +01:00
Christoph Oelckers
617934e1c2 - added a few exports for game strings which the SBARINFO string drawer can access and which should also be available by ZScript.
- merged BaseStatusBar and CustomStatusBar back together.

Since the low level draw functions are better done in native code for both performance and debuggability the split has become pointless.
2017-03-24 02:12:36 +01:00
Magnus Norddahl
c21037fb03 - fix sky sector portals 2017-03-24 02:11:24 +01:00
Christoph Oelckers
a3ee3c287e - major progress on the status bar code: SBARINFO's DrawGraphic has been ported into a generic function of the base statusbar class and put to use for a few items on the Strife status bar.
- decided to ditch the widget system I had started to lay out. As it turns out that would make things far more complicated and slower than they need to be.
2017-03-24 00:47:08 +01:00
Christoph Oelckers
74a2d58a52 - made the coordinate check fatal. If this happens the loaded map will be broken, there is no point trying to recover. 2017-03-23 10:19:07 +01:00
Christoph Oelckers
f31fb64750 - added range checks to UDMF coordinate fields. 2017-03-23 10:09:54 +01:00
Magnus Norddahl
e12f48699e - fix the culling bugs in softpoly by switching to a pseudo-angle clipper 2017-03-23 03:41:44 +01:00
Christoph Oelckers
31ea33bfc4 - rewrote the condition nodes from SBARINFO in ZScript. This compiles but hasn't been tested yet. 2017-03-23 00:25:26 +01:00
Christoph Oelckers
9bd75bcac5 - some conceptual work on statusbar stuff. This looks like a viable approach to build something that can replace SBARINFO. 2017-03-22 19:56:21 +01:00
Christoph Oelckers
f0e4f54c80 - one more bit of scriptification. 2017-03-22 18:38:09 +01:00
Christoph Oelckers
1423d5f42a - scriptified the SBARINFO wrapper.
This serves no purpose in itself but it removes a native side class from the status bar class hierarchy which allows for better editing options later.
2017-03-22 17:29:13 +01:00
Christoph Oelckers
04c2565d7f - added Get/SetValue functions to PBool. 2017-03-22 15:44:54 +01:00
Christoph Oelckers
62fbb00bc9 Merge branch 'master' of https://github.com/coelckers/gzdoom 2017-03-22 14:59:35 +01:00
Christoph Oelckers
4c51a4fc59 - reimplemented the health bar for Strife's status bar. 2017-03-22 14:59:12 +01:00
Rachael Alexanderson
09c3060728 - fixed: skybug on ARM was caused by undefined conversion from float to unsigned int. adding intermediary signed int cast fixes this problem. 2017-03-22 05:51:12 -04:00
Magnus Norddahl
b2e61412da - add missing sprite blends to the soft poly drawer 2017-03-22 09:11:21 +01:00
Christoph Oelckers
4417afd548 - changed VMValue to handle strings by reference.
This makes VMValue a real POD type with no hacky overloads and eliminates a lot of destructor code in all places that call a VM function. Due to the way this had to be handled, none of these destructors could be skipped because any value could have been a string.
This required some minor changes in functions that passed a temporary FString into the VM to ensure that the temporary object lives long enough to be handled. The code generator had already been changed to deal with this in a previous commit.
This is easily offset by the code savings and reduced maintenance needs elsewhere.
2017-03-22 01:44:56 +01:00
Christoph Oelckers
9bffe4ee50 - scriptified the main statusbar interface and the Strife status bar.
Note that the Strife status bar does not draw the health bars yet. I tried to replace the hacky custom texture with a single fill operation but had to find out that all the coordinate mangling for the status bar is being done deep in the video code. This needs to be fixed before this can be made to work.

Currently this is not usable in mods because they cannot initialize custom status bars yet.
2017-03-22 00:32:52 +01:00
Rachael Alexanderson
4110f34139 - fixed: non-SSE2 drawers still had SSE2 intrinsics for light calculations, preventing successful compilation on ARM. 2017-03-21 17:51:09 -04:00
Magnus Norddahl
fc3cb01029 - only ray test sprites on lights that are shadowmapped 2017-03-21 14:32:48 +01:00
Magnus Norddahl
25a30f8b7e - remove vectorcall from the 8 bit drawer 2017-03-21 14:28:31 +01:00
Magnus Norddahl
d437b342db - replaced the softpoly drawers with templated versions 2017-03-21 14:12:19 +01:00
alexey.lysiuk
7aa6a6b0b3 Restored explicit assignment operators for VMValue
Unfortunately strings require special handling and so all operators must be available
This partly solves https://mantis.zdoom.org/view.php?id=453 (and https://mantis.zdoom.org/view.php?id=459 too)
2017-03-21 12:14:50 +02:00
Magnus Norddahl
11e5759913 - detached the poly renderer from the software renderer 2017-03-20 08:28:16 +01:00
Christoph Oelckers
f45371e231 - reverted the counter for the vertex angle cache to a simple incrementing global variable.
Using I_MSTime is not precise enough, because some camera textures can be done quicker. It was pointless anyway trying to make this multithreading-safe, the entire caching idea here makes no sense if two clippers can simultaneously work on the same level data without changing the memory organization and rendering it ineffective.
2017-03-20 01:21:33 +01:00
Christoph Oelckers
1031481167 - added some checks to exclude dynamic lights from being subjected to shadowmapping if they do not touch any one-sided lines from the back side. This condition is a requirement for a 1D shadowmap to even have an effect. 2017-03-20 00:34:19 +01:00
Christoph Oelckers
0721aef218 - fixed: FxAssign used the wrong value type for emitting the store operation.
It used the expression's value type, but needs to use the variable's, which can be different when the assignment is synthesized from a builtin function.
2017-03-19 21:36:18 +01:00
Christoph Oelckers
403c5693a9 - cleaned out a large part of unused methods from VMValue.
- keep string registers which are being used as function parameters allocated until after the function call returns. This is for allowing to pass strings by reference which would avoid some costly constructor/destructor loops in the call instruction.
2017-03-19 21:25:30 +01:00
Christoph Oelckers
0a11e38967 - let SBARINFO always read ST_X and ST_Y from the wrapper because it just too liberally changes these values in unpredictable ways. 2017-03-19 19:49:52 +01:00
Christoph Oelckers
6b95371813 - made a few adjustments to the clean factor calculation so that on large screens the smaller factor gets preferred.
Without such tweaking the menu scale tends to get a bit too large on some screen sizes.
2017-03-19 18:38:16 +01:00
Christoph Oelckers
0cfdd699ad - exported the base thinker class for sector lighting effects to ZScript. 2017-03-19 13:15:38 +01:00
Christoph Oelckers
d74b6a6896 - typo... 2017-03-19 12:41:00 +01:00
Christoph Oelckers
fd9dc9e3f4 - fixed handling for OkayToSwitchTarget. 2017-03-19 12:07:02 +01:00
Christoph Oelckers
ac95cba848 - fixed generic class type properties to handle "" and "none" as 'no class'. 2017-03-19 12:02:17 +01:00
Christoph Oelckers
2c789a2d75 - looks like the last commit missed a few files. 2017-03-19 11:35:24 +01:00
Christoph Oelckers
845c43876c - moved all trivial actor properties into the scripts as 'property' declarations. 2017-03-19 11:30:28 +01:00
Rachael Alexanderson
4784aae098 - backport cl_oldfreelooklimit from Skulltag - due to the advent of capped skies, there really was no reason to keep the upper limit so low. 2017-03-19 00:36:52 -04:00
Robert Cochran
077de36139 Fix method member being a qualified name
This breaks the Linux build with GCC. This is non-standard behavior, but
apparently Visual Studio allows it.
2017-03-18 22:44:21 +01:00
Christoph Oelckers
2c7ceaf96a - fixed the check for one-subsector BSPs. 2017-03-18 22:44:03 +01:00
Christoph Oelckers
3cced6c7cc - fixed the early-outs for empty functions in the VM caller.
OP_RET should not be used as an absolute number here.
2017-03-18 21:31:43 +01:00
Christoph Oelckers
622b4a6457 - switched over to the scripted intermission screens. 2017-03-18 21:19:32 +01:00
Christoph Oelckers
9ef88ea327 - need to be careful with ctype functions - the way they are written they will do bad things with non-ASCII characters if signed chars are fed to them. 2017-03-18 19:37:36 +01:00
Christoph Oelckers
a2f2be17ef - status screen fully scriptified but not active yet. 2017-03-18 19:35:26 +01:00
alexey.lysiuk
9a10a0f136 Added handling of any space characters in BEX par times
Back to Saturn X E1: Get Out Of My Stations (https://www.doomworld.com/idgames/levels/doom2/megawads/btsx_e1) uses tabs instead of spaces and bunch of 'Need data after par' warnings were printed during loading
PrBoom supports arbitrary space characters too
2017-03-18 18:28:19 +02:00
Christoph Oelckers
745b96beec - made the status screen a class and scriptified a few more functions. 2017-03-18 15:45:36 +01:00
Christoph Oelckers
74e9d9db1a - fixed: The evaluation of multi-string ZScript properties did not work correctly. 2017-03-18 15:45:36 +01:00
alexey.lysiuk
cb5ddeff25 Fixed compilation warnings reported by Clang
src/gl/scene/gl_clipper.h:150:23: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
src/gl/dynlights/gl_aabbtree.cpp:137:24: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
src/gl/dynlights/gl_aabbtree.cpp:137:34: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
src/gl/dynlights/gl_aabbtree.cpp:137:44: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
src/gl/dynlights/gl_aabbtree.cpp:139:6: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
src/gl/dynlights/gl_aabbtree.cpp:139:30: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
src/gl/dynlights/gl_aabbtree.cpp:139:54: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
src/gl/dynlights/gl_aabbtree.cpp:142:6: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
src/gl/dynlights/gl_aabbtree.cpp:143:3: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
src/gl/dynlights/gl_aabbtree.cpp:144:3: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
src/gl/dynlights/gl_aabbtree.cpp:167:6: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
src/gl/dynlights/gl_shadowmap.cpp:163:31: warning: '&&' within '||' [-Wlogical-op-parentheses]
src/p_saveg.cpp:367:16: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare]
src/p_saveg.cpp:402:60: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
src/p_setup.cpp:1553:39: warning: format specifies type 'ptrdiff_t' (aka 'long') but the argument has type 'int' [-Wformat]
src/scripting/zscript/zcc_compile.cpp:293:74: warning: field 'AST' will be initialized after field 'mVersion' [-Wreorder]
src/swrenderer/drawers/r_thread.cpp:113:21: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
2017-03-18 15:13:02 +02:00
alexey.lysiuk
0130fc27cc Fixed compilation with GCC/Clang
src/scripting/backend/codegen.cpp:317:35: error: cannot initialize return object of type 'FxExpression *' with an rvalue of type 'bool'
2017-03-18 14:31:15 +02:00
Christoph Oelckers
b416322032 - converted FInterBackground into a class so that the scripts can use it.
- fixed some issues with default value matching in savegames.
2017-03-18 13:25:22 +01:00
Christoph Oelckers
1e9ef2b1df - started scriptifying the level intermission screen. This compiles but is not active yet.
- allow treatment as one-character string constants as character constants. This became necessary because name constants already use single quotes and are much harder to repurpose due to a higher degree of ambiguity.
- fixed: protected methods in structs were not usable.
2017-03-18 12:18:15 +01:00
alexey.lysiuk
ce3c397ec7 Fixed builtin type names for -dumpast command line option 2017-03-18 13:11:13 +02:00
alexey.lysiuk
4557f751c8 Fixed sight check after blockmap refactoring
https://mantis.zdoom.org/view.php?id=446
2017-03-18 12:44:26 +02:00
Christoph Oelckers
f3ae144525 - removed some unused variables in wi_stuff.cpp. 2017-03-17 23:53:51 +01:00
Christoph Oelckers
d423ad0d18 - moved CheckRealHeight from wi_stuff.cpp to texture code. 2017-03-17 23:08:22 +01:00
Christoph Oelckers
c4f6a54753 - fixed reject check in particle code. 2017-03-17 21:54:03 +01:00
Christoph Oelckers
c9296ead57 - moved the skybox texture files to the main textures directory. 2017-03-17 21:12:09 +01:00
Christoph Oelckers
fee18a6971 - fixed the attenuation check in gl_GetLight. 2017-03-17 20:16:49 +01:00
Christoph Oelckers
7d8d69d01b - fixed: The clipper for the main scene may not be initialized before the camera textures have been drawn.
It looks like the memory management at use here is not capable of maintaining multiple instances simultaneously and the camera textures create another scene drawer so the initialization of the main scene drawer has to be delayed until after the camera textures are done.
2017-03-17 19:28:47 +01:00
alexey.lysiuk
3f7160183d Fixed compilation with GCC/Clang
src/p_blockmap.h:76:7: error: extra qualification ‘FBlockmap::’ on member ‘VerifyBlockMap’
2017-03-17 17:42:28 +02:00
Christoph Oelckers
d506b2e6a1 - fixed code generation bug with bad class names in DECORATE.
- print attenuation info with 'listlights' CCMD.
2017-03-17 16:00:04 +01:00
Christoph Oelckers
33d36157c8 - moved the blockmap into a substructure of FLevelLocals.
This part can certainly improved a lot but the most important thing, grouping all those global variables into one place, is done.
2017-03-17 14:24:21 +01:00
Christoph Oelckers
f864a09faa - moved more varialbles into FLevelLocals. 2017-03-17 12:49:43 +01:00
Christoph Oelckers
ea1d6634f7 - moved the Zones array into FLevelLocals.
- replaced TStaticArray with regular TArrays.

They had incomplete implementations preventing proper cleanup of the level loading code. It makes more sense to add the missing methods to the regular TArray and use that.
This also makes some changes to how the game nodes are used to avoid creating a copy: If the head node's pointer is stored in a separate variable, no code needs to check which of the two arrays gets used.
2017-03-17 12:11:37 +01:00
alexey.lysiuk
c1b774e809 Fixed compilation with GCC/Clang
src/p_glnodes.cpp:670:3: error: cannot jump from this goto statement to its label
src/p_glnodes.cpp:682:4: error: cannot jump from this goto statement to its label
2017-03-17 12:34:05 +02:00
Christoph Oelckers
309d086a15 - GCC complained about this part. 2017-03-17 10:16:04 +01:00
Christoph Oelckers
39b329e3f7 - this was accidentally left in. 2017-03-17 10:12:47 +01:00
Magnus Norddahl
fc0f2292ab - add non-sse version of the sprite drawers
- fix some typos
2017-03-17 08:44:33 +01:00
Magnus Norddahl
1435832b09 - added non-sse span drawers 2017-03-17 07:36:02 +01:00
Magnus Norddahl
5644b2c0fd Create non-sse version of the wall drawers 2017-03-17 06:58:36 +01:00
Magnus Norddahl
a6e47b571f - change _mm_load_ss to _mm_set_ss just in case compilers are really dumb 2017-03-17 06:19:26 +01:00
Christoph Oelckers
fea4079b7c - moved nodes into FLevelLocals. 2017-03-17 01:42:37 +01:00
Christoph Oelckers
f818d25542 - last commit deleted a small piece of code. 2017-03-17 00:31:15 +01:00
Christoph Oelckers
f201dab534 - moved the subsectors into FLevelLocals. 2017-03-17 00:22:52 +01:00
Christoph Oelckers
59b684bdbc - moved the segs array into FLevelLocals. 2017-03-16 21:34:04 +01:00
Christoph Oelckers
2b2c986bd0 - cleanup of GL renderer interface and improper header use in software renderer. 2017-03-16 21:34:03 +01:00
Magnus Norddahl
1f109a5deb - fix wrong particle Y offset 2017-03-16 19:15:42 +01:00
Rachael Alexanderson
55b95e68db - Restored a file that apparently worked fine back at a certain commit (0176c29). 2017-03-16 13:55:10 -04:00
Magnus Norddahl
dbea29e02c - added missing memory barrier 2017-03-16 17:58:41 +01:00
Magnus Norddahl
f1b03b48e9 - add thread safety to GetSpecialLights 2017-03-16 17:53:12 +01:00
Christoph Oelckers
b529b1e3a7 - removed several unneeded GL headers from the software renderer's sources.
- consolidated the code to calculate a sprite's display angle for all 3 renderers.

As it turned out, they all differed in their feature support because they had always been updated independently by different people.
2017-03-16 13:49:34 +01:00
Christoph Oelckers
005e6871f9 - increased the snd_channels default and minimum.
The values were still 8 and 32 respectively which applied to hardware from last decade, but for modern mods these are simply too low. New values are 64 as minimum and 128 as default.

- added script access to a sector's colormap and specialcolors fields. (Writing only through dedicated functions because these fields are render state which may need to trigger some form of refresh if the renderer changes.)
2017-03-16 10:38:56 +01:00
alexey.lysiuk
889a2ae6aa Fixed compilation with GCC/Clang 2017-03-16 11:13:02 +02:00
Christoph Oelckers
3aa7687d91 - made 'nocoloredspritelighting' a global option and also implemented it in the software renderer. 2017-03-16 00:56:03 +01:00
Christoph Oelckers
91da8aecdb - fixed fog init for SW Truecolor. 2017-03-15 23:38:12 +01:00
Christoph Oelckers
76d3ae5ba2 made the sector's color_* properties work in the software renderer.
With no 3D floors this appears to be ok, but there are so many places where colormaps are being set in the software renderer that I cannot guarantee that I got all of them correct. This will need some testing.
2017-03-15 23:24:53 +01:00
Christoph Oelckers
921bc763fb - separated the software-renderer-specific parts of colormap processing from the common parts.
- moved testcolor and test fades into SWRenderer files.

These CCMDs work by hacking the default colormap and were never implemented for hardware rendering because they require many checks throughout the code.
2017-03-15 22:04:59 +01:00
Christoph Oelckers
cd015f9340 - make the colormap comparison against NormalLight inline because this is by far the most frequent case and any cycle being saved here counts. 2017-03-15 22:04:59 +01:00
Christoph Oelckers
9a24771a7d - refactored FDynamicColormap out of sector_t.
This has increasingly become an obstacle with the hardware renderer, so now the values are being stored as plain data in the sector, with the software renderer getting the actual color tables when needed. While this is a bit slower than storing the pregenerated colormap, in realistic situations the added time is mostly negligible in the microseconds range.
2017-03-15 22:04:59 +01:00
Rachael Alexanderson
a2fc2fb707 - Add new drawer: AddClampShadedSprite
- fixed: AddShaded did not have a drawer associated with it in the software renderer - used new drawer for this purpose.
2017-03-15 14:40:22 -04:00
Christoph Oelckers
d0c77d7264 - added a GetRenderStyle function to Actor, so that the internal render style can be retrieved in a format suitable for scripting. 2017-03-15 10:36:41 +01:00
Magnus Norddahl
fea2361815 - fix broken voxel palette colors when using the game palette 2017-03-15 04:33:01 +01:00
Magnus Norddahl
225ce82a5a - turned r_scene_multithreaded back off as zdcmp2 revealed some problems 2017-03-15 04:01:28 +01:00
Magnus Norddahl
366d1637ce - enable r_scene_multithreaded 2017-03-15 03:01:43 +01:00
Magnus Norddahl
80f9c81e36 - move PrepareTexture out of the inner drawer loops 2017-03-15 02:59:33 +01:00
Christoph Oelckers
64bdc8c495 - fixed some incomplete checks for static arrays.
- made AActor::OkaytoSwitchTarget scripted virtual.
2017-03-15 01:39:59 +01:00
Christoph Oelckers
d283beb063 - implemented static constant arrays in class scope. 2017-03-14 23:55:30 +01:00