Christoph Oelckers
3cbd62479b
- took VMFunction out of the DObject hierarchy.
...
As it stood, just compiling the internal ZScript code created more than 9000 DObjects, none of which really need to be subjected to garbage collection, aside from allowing lazy deallocation.
This puts an incredible drag on the garbage collector which often needs several minutes to finish processing before actual deletion can start.
The VM functions with roughly 1800 of these objects were by far the easiest to refactor so they are now. They also use a memory arena now which significantly reduces their memory footprint.
2017-02-08 11:13:41 +01:00
Christoph Oelckers
3cddcc8524
- removed PClassType and PClassClass.
...
All non-actors now use PClass exclusively as their type descriptor.
Getting rid of these two classes already removes a lot of obtuse code from the type system, but there's still three more classes to go before a major cleanup can be undertaken.
2017-02-07 20:45:56 +01:00
Christoph Oelckers
e3d07bddab
- moved the TypeTableType pointer from PClassType to PType.
...
Removing this variable is needed to remove PClassType and PClassClass as the next step to eliminate all of PClass's subclasses in order to clean up the type system.
2017-02-07 20:25:52 +01:00
Christoph Oelckers
7ed554158c
- got rid of PClassWeapon.
...
Still 5 subclasses of PClass left...
2017-02-07 19:02:27 +01:00
Christoph Oelckers
776509e68a
- let skip_super use the AActor assignment operator. The blanket memcpy it used was clobbering some data.
...
- moved the Finalize method from PClassActor to AActor. Now that defaults get their vtbl pointer initialized this will actually work.
2017-02-07 18:12:59 +01:00
Christoph Oelckers
56024a1ebe
- implemented the backend for dynamic arrays. Still needs thorough testing but it should be complete.
...
- use a memory arena to store flat pointers so that the messed up cleanup can be avoided by deallocating this in bulk.
- added a new SO opcode to the VM to execute a write barrier. This is necessary for all objects that are not linked into one global table, i.e. everything except thinkers and class types.
- always use the cheaper LOS opcode for reading pointers to classes and defaults because these cannot be destroyed during normal operation.
- removed the pointless validation from String.Mid. If the values are read as unsigned the internal validation of FString::Mid will automatically ensure proper results.
2017-02-07 14:48:27 +01:00
Christoph Oelckers
4ca69f10c7
- removed a few unused definitions.
2017-02-07 10:55:59 +01:00
Christoph Oelckers
f9712460f3
- fixed: 3D floors could be set for untagged sectors.
2017-02-07 00:31:01 +01:00
Christoph Oelckers
2021baf47d
- fixed: The 'transparent' line flag did not work due to a leftover OPAQUE constant where floats were expected.
2017-02-07 00:24:04 +01:00
Christoph Oelckers
f77a528e13
- added type checks for DynArray.Copy and Move and fixed parameter processing.
2017-02-07 00:12:55 +01:00
Christoph Oelckers
96b2cb0a45
- fixed code generation for local dynamic arrays.
...
- removed some code repetition by inherit all variable types which reference a PField for a variable offset from a base class so that PField replacements can be done with one set of code.
2017-02-06 22:57:42 +01:00
Christoph Oelckers
ca48a687f8
- major work on dynamic array support. Mostly working, some issues still exist with Move and Copy methods and with assignments in stack variables.
2017-02-06 21:39:21 +01:00
Christoph Oelckers
12477216ef
- did some cleanup on the OPL files to remove all use of homegrown integer types in favor of the standard ones. This already helps getting rid of one of the MUSLIB files still left.
2017-02-06 19:26:45 +01:00
ZZYZX
f368e70f89
Fixed overflows in String.Mid
2017-02-06 13:31:01 +01:00
ZZYZX
124d025131
More string methods
2017-02-06 12:35:21 +01:00
Christoph Oelckers
d90f2ba1fa
- wrap the va_list that gets passed around by the Draw functions into a struct so that the templates can use reliable, identical semantics for both this and the VM's arg list.
2017-02-05 21:54:09 +01:00
Christoph Oelckers
a4dbbf6969
- fixed P_NightmareRespawn did not respawn a map defined spawn health and neither made skill-related adjustments.
2017-02-05 21:43:16 +01:00
Christoph Oelckers
810efe517d
- fixed: AActor::SetOrigin lost its 'virtual' qualifier in the ZScript merge, but ADynamicLight needs this to work properly.
2017-02-05 21:38:06 +01:00
Christoph Oelckers
e55406bc23
- changed clean scaling factor calculation so that it doesn't prefer larger scales on high resolution displays.
...
This was a tweak that only makes sense when the scaling factors are low, i.e. 2 vs. 3, but for modern high resolutions it will enlarge things a bit too much.
2017-02-05 18:48:49 +01:00
alexey.lysiuk
481bddf628
Fixed incorrect offscreen rendering of player's blend
2017-02-05 18:16:27 +01:00
Christoph Oelckers
72810c969d
- added ChangeCamera script function.
2017-02-05 18:07:12 +01:00
Christoph Oelckers
9e038b75fa
- exported DrawChar and DrawText.
2017-02-05 16:47:33 +01:00
Christoph Oelckers
52bec33c0d
- exported BrokenLines to scripting as a new class.
...
- removed the hard limit of 128 lines for V_BreakLines.
2017-02-05 16:18:41 +01:00
Christoph Oelckers
d8a1ce88b0
- a few more exports from FFont.
2017-02-05 13:55:38 +01:00
alexey.lysiuk
ef871ec09f
Fixed compilation with GCC/Clang
...
error: cannot pass non-trivial object of type 'FName' to variadic function; expected type from format string was 'char *' [-Wnon-pod-varargs]
2017-02-05 14:52:17 +02:00
Christoph Oelckers
b570d0819b
- streamlined font handling for scripts a bit.
...
- moved the two 'you raised the alarm' messages for Strife to the string table
2017-02-05 13:14:22 +01:00
Christoph Oelckers
5cfac78116
- added write barriers to the menu code.
...
The GC was causing some crash issues with the items not having been subjected to a write barrier.
2017-02-05 01:52:09 +01:00
Christoph Oelckers
470dc138c6
- got rid of all DTA_Translation uses.
2017-02-05 00:17:29 +01:00
Christoph Oelckers
dadc8e2ec2
- removed all uses of DTA_Translation except for the single one that passes a custom built table.
...
This means that with the exception of 3 pointers the DrawTexture interface only accepts numeric values now.
Still need to get rid of the last 3 to have this ready for scripting.
2017-02-04 23:26:28 +01:00
Christoph Oelckers
d50e52ea59
- use DrawChar to draw font characters instead of calling DrawTexture directly.
...
Mostly done to remove uses of DTA_Translation.
2017-02-04 22:50:23 +01:00
Christoph Oelckers
6dea3eef8e
- exported DrawTexture to scripting.
...
This uses templates to avoid source duplication of ParseDrawTextureTags. Not tested yet.
2017-02-04 22:09:49 +01:00
Christoph Oelckers
a102807737
- atags for null pointers have no meaning so do not assert on them.
2017-02-04 19:37:19 +01:00
alexey.lysiuk
e8c2444ddd
Fixed compilation with GCC/Clang
...
error: use of undeclared identifier 'op'
error: no matching function for call to 'ListEnd'
error: no matching function for call to 'ListGetInt'
error: no matching function for call to 'ListGetDouble'
...
2017-02-04 18:10:30 +02:00
Christoph Oelckers
ec15c7f4c3
- removed the fatal errors for invalid actor->movedir.
...
These can be silently mapped to DI_NODIR to let the engine get the actor back on track.
2017-02-04 16:29:01 +01:00
Christoph Oelckers
43d759782d
- fixed: Stack based local VM object pointers should not be subjected to a read barrier.
...
This isn't done for register based variables so for consistency it should not be done for stack based variables, too.
This difference in handling made it impossible to check the target of a hitscan attack if it was destroyed by getting damaged.
2017-02-04 16:23:14 +01:00
Christoph Oelckers
d3ed83942f
- did some preparations to ParseDrawTextureTags to allow using the same code for parsing tag lists generated by the VM.
...
- removed the fixed point alpha tag from DrawTexture and replaced all uses with the floating point version.
2017-02-04 13:11:12 +01:00
Christoph Oelckers
abac756289
- exported some stuff for fonts and screen size that will be needed for the menus.
2017-02-04 00:46:22 +01:00
Christoph Oelckers
d5b908186c
- some work on the base classes for menus. None of this is being used yet.
2017-02-04 00:19:25 +01:00
Christoph Oelckers
8578a5a12e
- added a 'new' intrinsic to create new objects from inside scripts.
...
This is not tested yet and likely to not working correctly yet. Will be fixed once I get far enough to use it later.
2017-02-03 22:56:03 +01:00
Christoph Oelckers
d5962b290c
- turned all menu items into actual objects.
...
This is needed for script export.
2017-02-03 21:35:42 +01:00
alexey.lysiuk
c6e42d6fa0
Added handling of modifier keys for mouse events in Cocoa backend
2017-02-03 22:01:34 +02:00
alexey.lysiuk
f04b0d129d
Removed useless assignment in Cocoa backend
2017-02-03 21:56:14 +02:00
Christoph Oelckers
82eae78f7e
- fixed a small memory leak in the texture manager.
2017-02-03 13:11:55 +01:00
Christoph Oelckers
a5f417b1e5
- removed all uses of BYTE as function return value or functio parameter from the dynamic light code.
...
These were truncating the actual light values.
2017-02-03 10:13:41 +01:00
Christoph Oelckers
1515ab8f4a
- removed the long broken and obsolete PlayMovie code.
2017-02-02 23:21:21 +01:00
Christoph Oelckers
becc00a8be
- added a check to P_VerifyBlockmap to discard all blockmap with blocks whose first entry is not 0.
...
Seems someone has written a node builder which violates this long-standing assumption (https://www.doomworld.com/vb/source-ports/92468-introducing-zokumbsp/ )
However, rather than second-guessing the format's correctness it's more advisable to just discard such blockmaps to avoid some less obvious issues that may creep up.
2017-02-01 21:40:47 +01:00
Christoph Oelckers
d663f31e77
- removed the annoying assert in the dynamic light code.
...
I don't think that any of the remaining situations are a genuine problem, so let's just set the radius to the larger value.
2017-02-01 19:24:05 +01:00
Christoph Oelckers
a59a9e7420
- missed one.
2017-02-01 19:17:56 +01:00
Christoph Oelckers
6bfbff2a69
- renamed RF_INTERPOLATE to RF_INTERPOLATEANGLES to avoid confusion about its meaning.
2017-02-01 19:11:14 +01:00
Major Cooke
d55f1d3f6f
- Adopted Nash's code for handling models with INTERPOLATE.
2017-02-01 19:09:18 +01:00
Major Cooke
39fcea9176
Added INTERPOLATE actor flag, allowing the previously reverted interpolation code to be toggleable.
2017-02-01 19:09:18 +01:00
Christoph Oelckers
04988a331b
- fixed warning.
2017-02-01 19:07:41 +01:00
Christoph Oelckers
b77a0eb7cf
- let D_PageDrawer always clear the background.
...
The math in DCanvas::FillBorder does not always work out so better clean the entire screen before drawing a fullscreen image to ensure that the menu blend is always drawn over something valid.
2017-02-01 11:44:13 +01:00
Christoph Oelckers
bc29f61bfd
- set the default for menu mouse input to 'touchscreen-like' because there's too much hardware out there which doesn't play nice with mouse input events.
2017-02-01 11:25:28 +01:00
Christoph Oelckers
6d28aa3541
- do not use strtol for parsing critical values that can get large.
...
This function will truncate everything that is larger than LONG_MAX or smaller than LONG_MIN to fit into a long variable, but longs are 32 bit on Windows and 64 bit elsewhere, so to ensure consistency and the ability to parse larger values better use strtoll which does not truncate 32 bit values.
2017-02-01 11:19:55 +01:00
Christoph Oelckers
90ee22b760
- don't let monsters without a See state disappear if they try to enter it.
2017-02-01 01:13:26 +01:00
alexey.lysiuk
3d147a032c
Proper RDTSC implementation for x86_64 targets
...
Higher 32 bits of Time Stamp Counter were ignored in non-MSVC Windows and macOS builds
2017-01-31 17:51:12 +02:00
alexey.lysiuk
47faaa87fc
Fixed deprecation warning reported by Clang
...
warning: 'register' storage class specifier is deprecated and incompatible with C++1z [-Wdeprecated-register]
2017-01-31 17:41:44 +02:00
alexey.lysiuk
b12c8a8f79
RDTSC-based glcycle_t for macOS
...
Time profiler implementation is now closer to Windows version
2017-01-31 16:00:14 +02:00
alexey.lysiuk
1cdfcb4935
RDTSC-based cycle_t for macOS
...
Windows and macOS now share most of related code
Old implementation using mach_absolute_time() was more precise (at least in theory) but too costly
2017-01-31 15:57:47 +02:00
alexey.lysiuk
6225f60eb2
Added cheat flag for console variables
...
CVAR with this flag can be set in console or from command line when sv_cheats is enabled
There is no such restriction for changing its value from ACS, via SetCVar() and related functions
'cheat' modifier can be used in CVARINFO lump to create variable of this kind
2017-01-31 14:08:09 +01:00
Christoph Oelckers
94d5d6848e
- moved all code that deletes some data from P_SetupLevel to P_FreeLevelData so that P_Shutdown can also call it.
...
This is particularly important for camera textures which otherwise would not be taken down before a restart.
2017-01-31 13:46:35 +01:00
Christoph Oelckers
3131c08640
- fixed: the restart CCMD must clear out all statically stored pointers to VM functions because they do not survive the shutdown that is needed before loading new data.
2017-01-31 13:41:23 +01:00
Christoph Oelckers
f0a325a904
- fixed: The restart CCMD needs to clear the global FraggleScript before taking down the class system.
...
This is a soft root and would never be deleted otherwise.
2017-01-31 13:22:05 +01:00
Christoph Oelckers
0e5aee48aa
- clamp MAPINFO provided fog density values to a valid range because negative values can trigger undefined shader behavior.
2017-01-30 22:23:36 +01:00
Christoph Oelckers
7c5e3fb677
- disabled angular interpolation again.
...
This can only be used if the entirety of the game code is aware and dealing with this properly. However, that isn't the case so the amount of glitches this causes far exceeds the number of desired interpolations.
2017-01-30 14:19:50 +01:00
Christoph Oelckers
ba629379ca
- fixed: for levels with 0-length lines the allocation size of the lines array was too large because it didn't subtract those deleted lines.
2017-01-30 00:25:40 +01:00
Christoph Oelckers
b93c3619e9
- fixed: The implementation for Doom64 colors did not handle particles.
2017-01-29 18:57:47 +01:00
Christoph Oelckers
729eade8f5
- enable terrain splashes for non-solid non-swimmable 3D floors.
2017-01-29 18:46:35 +01:00
Christoph Oelckers
2883b113f3
- fixed bad scale setting for SBarInfo.
2017-01-29 18:33:19 +01:00
Christoph Oelckers
eef91463ab
- fixed: Non-actor classes never called InitializeDefaults to set up their special variables.
...
- fixed: DThinkerIterator and DBlockThingsIterator did not have a default constructor that was safe to call from an out-of-game context.
2017-01-29 18:23:39 +01:00
Christoph Oelckers
c0ef052d07
- added interpolation for actor angles which for models is needed.
2017-01-29 13:13:00 +01:00
Christoph Oelckers
1884c8a98d
- ensure that the radius of a dynamic light remains positive to avoid problems with the assumption that a light has an actual size.
...
- extended the maximum settable light size in GLDEFS to 1024 throughout.
- fixed: A fullbright flat should not be subjected to a sector's material color.
2017-01-29 12:00:05 +01:00
Christoph Oelckers
a2a1d214c0
- extended give and take cheat's arguments to full integers.
2017-01-29 11:45:28 +01:00
Christoph Oelckers
8e469c1343
Corrected bad 'or' operation
2017-01-29 09:57:55 +01:00
Christoph Oelckers
4f5d5d5de7
- this should have been in the last commit.
2017-01-28 21:49:52 +01:00
Christoph Oelckers
95afc97d48
- ok, that color_absolute option was pretty much redundant, considering that it is already possible to explicitly set a fog density per sector - it was only necessary to give that priority over standard depth fade calculations for fog-less sectors.
2017-01-28 21:42:58 +01:00
Christoph Oelckers
476aceb5d7
- added new properties to UDMF spec.
...
- implemented color_absolute flag,
2017-01-28 21:22:48 +01:00
Christoph Oelckers
e96f231420
- added Doom64 colors for sprites.
2017-01-28 21:02:03 +01:00
Christoph Oelckers
ee22a9371b
- use Doom64 colors on sectors and linedefs.
2017-01-28 20:44:46 +01:00
Christoph Oelckers
12d073a27d
- objectcolor stuff.
...
# Conflicts:
# src/gl/renderer/gl_renderstate.cpp
2017-01-28 19:06:21 +01:00
Christoph Oelckers
dbbd797baa
- added the needed properties for Doom64 colors and a little FraggleScript hack to test it with existing maps.
2017-01-28 19:05:39 +01:00
Christoph Oelckers
1d2ae53ecb
Revert "- made r_fullbrightignoresectorcolor a MAPINFO option, so far only working on the software renderer. GL still needs a few changes to handle it correctly."
...
This reverts commit dd03bb1fcb
.
Turns out that making this work in GL will create a complete mess so better remove the option as it would only cause problems.
2017-01-28 18:26:52 +01:00
Christoph Oelckers
dd03bb1fcb
- made r_fullbrightignoresectorcolor a MAPINFO option, so far only working on the software renderer. GL still needs a few changes to handle it correctly.
2017-01-28 12:20:18 +01:00
Rachael Alexanderson
c923f8c5e1
- fixed: If GLRenderer is uninitialized (i.e. using software renderer, or during startup), gl_paltonemap_* CVARs would crash the game.
2017-01-28 10:04:22 +01:00
ZZYZX
13c6d16905
Fixed: compile-time error in vararg function call would result in a crash.
2017-01-28 00:32:43 +01:00
Major Cooke
46ee2c5ec6
- Fixed HITTARGET, HITMASTER, HITTRACER, crash and xdeath states being broken on bouncing actors that die/explode.
2017-01-27 18:03:09 +01:00
Christoph Oelckers
1eb2c75328
- explode bouncing objects directly inside P_BounceActor if the bounce count expired. The calling code is too messed up to handle this cleanly.
2017-01-27 16:15:17 +01:00
Christoph Oelckers
08c252274a
- fixed issues with uninitialized RNGs and bad assumptions about corpse pointers always being fully initialized when being destroyed.
...
Both of these may be true when occuring during normal gameplay, but not during an exception unwind in the serializer, which caused crashes if ACS errored out due to mismatched scripts.
2017-01-27 12:02:47 +01:00
Christoph Oelckers
15b95cc023
- fixed: DECORATE was creating a new global constant namespace for each single included file, not just once per DECORATE lump.
2017-01-27 10:51:12 +01:00
Rachael Alexanderson
c1ff1c6336
- Set banded light to "false" to not impact GZDoom defaults.
2017-01-24 22:24:53 +01:00
Rachael Alexanderson
9a777f719b
- Added "gl_bandedswlight" to reduce the software light emulation gradient to 32 levels.
2017-01-24 22:24:53 +01:00
Rachael Alexanderson
eb3f83f908
- Since tonemap tweaks are on the menu now, make their changes affect instantly.
2017-01-24 17:57:03 +01:00
Rachael Alexanderson
494be00ce5
- Made default values for gl_paltonemap_powtable and gl_paltonemap_reverselookup more "id-like".
2017-01-24 17:57:03 +01:00
Rachael Alexanderson
6e47bf9bbc
- Added gl_paltonemap_powtable and gl_paltonemap_reverselookup for tweaking palette tonemap generation.
2017-01-24 17:57:03 +01:00
Christoph Oelckers
02f678dccc
- there seem to be ACS compilers which let 'delay' pass inside a function. Since this is an unsupported feature which brings the ACS VM into an unstable state it has to be handled with a hard abort to avoid crashes.
2017-01-24 11:59:59 +01:00
Christoph Oelckers
e3c36998b6
- delete all compile-time symbols for scripting after finishing compiling data.
...
Even the bare-bones gzdoom.pk3 gets rid of over 2000 symbols this way that otherwise would need to be tracked by the garbage collector.
2017-01-24 11:57:42 +01:00
Christoph Oelckers
c12dfd7e4d
- fixed: only explicit class type casts must obey strict namespace rules, i.e. only '(class<type>)(variable_to_cast)'
...
The general rule is as follows: A class name as a string will always be looked up fully, even if the class name gets shadows by another variable because strings are not identifiers.
It is only class names as identifiers that must obey the rule that if it is not known yet or hidden by something else that it may not be found to ensure that the older variable does not take over the name if it gets reused.
2017-01-24 10:04:46 +01:00
Christoph Oelckers
17ed23bfcc
- don't read the full height of a player from the defaults, because that cannot be changed by A_SetHeight.
...
Instead a new member, FullHeight is used for this now.
2017-01-24 00:12:06 +01:00
Christoph Oelckers
3f999a990c
- removed a line of debug code that made GCC/Clang go nuclear.
2017-01-23 23:06:29 +01:00