Commit graph

9661 commits

Author SHA1 Message Date
alexey.lysiuk
481bddf628 Fixed incorrect offscreen rendering of player's blend 2017-02-05 18:16:27 +01:00
ZZYZX
e4970189b6 Tactical merge 2017-02-05 19:14:56 +02: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
ZZYZX
b833f5a852 Merge remote-tracking branch 'gz/master' into thereisnospoon 2017-02-04 10:27:37 +02: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
ZZYZX
eb7548d639 Printf doesn't work with FString on GCC 2017-02-03 20:54:42 +02:00
ZZYZX
b18b71c065 Mouse coordinates for UI mouse events are actually data1/data2, not x/y 2017-02-03 20:49:45 +02:00
ZZYZX
f816537992 Setting Order directly (while the event handler is registered) will result in all sorts of broken behavior. Made readonly. 2017-02-03 20:44:27 +02:00
ZZYZX
03f7c39ea7 Fixed mouse input in event handlers. Added RequireMouse field in event handler to signify that native mouse should be turned on for certain handlers. 2017-02-03 20:34:34 +02:00
ZZYZX
08f1731ded Added keyboard modifiers for mouse events in SDL backend. 2017-02-03 17:39:26 +02:00
Christoph Oelckers
82eae78f7e - fixed a small memory leak in the texture manager. 2017-02-03 13:11:55 +01:00
ZZYZX
0d96517f5f Implemented RenderOverlay hook that executes directly after level and statusbar 2017-02-03 13:29:34 +02:00
ZZYZX
6a0103a746 Merged p_setup conflict 2017-02-03 13:02:44 +02:00
ZZYZX
b45af599c5 Explicit handler deinitizliation in P_Shutdown and P_FreeLevelData 2017-02-03 13:01:15 +02:00
ZZYZX
9bb4cf1c03 User input events first take 2017-02-03 12:28:40 +02: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
ZZYZX
27c5e21a1d Moved E_InitStaticHandlers(true) a bit higher in the initialization so that local scripts receive PlayerEntered properly 2017-02-03 09:04:01 +02:00
Christoph Oelckers
1515ab8f4a - removed the long broken and obsolete PlayMovie code. 2017-02-02 23:21:21 +01:00
ZZYZX
490159f6df Removed duplicate PlayerEntered call 2017-02-02 22:37:22 +02:00
ZZYZX
5d8b3e8084 Fixed PlayerEntered for non-travel enters 2017-02-02 22:22:10 +02:00
ZZYZX
7f2d97d7ef Reverted previous commit 2017-02-02 22:18:28 +02:00
ZZYZX
2f79f74d2d Fixed condition 2017-02-02 22:14:22 +02:00
ZZYZX
dae4a48574 G_FinishTravel: only call RETURN/REOPEN on actual hub return as documented, not on every snapshot/savegame load 2017-02-02 21:52:09 +02:00
ZZYZX
957a8cb117 Count resurrect cheat as respawn 2017-02-02 21:34:26 +02:00
ZZYZX
39355cf45d Implemented player scripts. 2017-02-02 21:25:07 +02:00
ZZYZX
19d2f6a4db REOPEN scripts should not be called per player pawn 2017-02-02 20:27:57 +02:00
ZZYZX
7fa50c22e5 Added player events 2017-02-02 20:26:56 +02:00
ZZYZX
bc1194d03b Added ordering for handlers - by int value returned by virtual function GetOrder(); Also, some handlers (WorldUnloaded and WorldThingDestroyed) are now executed in reverse order. 2017-02-02 19:57:00 +02: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
ZZYZX
765bc2db39 Made map-section handlers in MAPINFO not static. Static now unambiguously means 'global from GameInfo'. 2017-01-31 06:24:39 +02:00
ZZYZX
6ada9c0291 Made map-section handlers in MAPINFO not static. Static now unambiguously means 'global from GameInfo'. 2017-01-31 06:22:01 +02:00
ZZYZX
26d38e6527 Since WorldThingDestroyed is the reverse of WorldThingSpawned, it should ignore actors that didn't call PostBeginPlay. 2017-01-31 04:53:18 +02:00
ZZYZX
89c475c2d1 Added WorldThingDamaged hook 2017-01-31 04:35:44 +02:00
ZZYZX
9942a59866 Almost forgot (x2): thing revived world event 2017-01-31 04:11:09 +02:00
ZZYZX
e74cd9883d We don't want to store event objects in savegames. 2017-01-31 04:02:55 +02:00
ZZYZX
066b22af0a Almost forgot: WorldTick hook, since ZScript doesn't have delays 2017-01-31 03:24:46 +02:00
ZZYZX
9a8a93fe51 Made global handlers (from GameInfo) implicitly transient, because these never get serialized anyway. 2017-01-31 02:37:36 +02:00
ZZYZX
3c1cecfa2b Implemented WorldLightning and WorldThingDestroyed. 2017-01-31 02:15:57 +02:00
ZZYZX
71f62af6db Implemented WorldThingDied (calls at the same point as SCRIPT_Kill); Added Inflictor parameter for WorldThingDied. 2017-01-31 02:07:00 +02:00
ZZYZX
27c8140c46 Replaced specialized event handlers with Event structure passed to a method; returned the check for virtual implementation to make sure that we don't waste time initializing the event data. 2017-01-31 01:28:47 +02: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
ZZYZX
5751f84350 Moved empty virtual methods to script side 2017-01-30 11:56:03 +02:00
ZZYZX
2382a76be5 Made separate .Find in Static handlers for convenience. 2017-01-30 09:33:06 +02:00
ZZYZX
c7e3ff2356 Static event handlers can create/register/unregister other static event handlers. 2017-01-30 09:28:27 +02:00
ZZYZX
e8a0eda476 AddEventHandlers in GameInfo 2017-01-30 09:19:42 +02:00
ZZYZX
414d16a0f7 Reverted spriteID part - can't be a string 2017-01-30 09:11:10 +02:00
ZZYZX
83f868a049 Implemented WorldThingSpawned hook. Also changed Console.Printf to automatically add \n. Also fixed vararg calls with names. 2017-01-30 09:10:33 +02:00
ZZYZX
0598c18ad8 Added WorldEventHandler with WorldThingSpawned. WorldThingDestroyed is not implemented because you already can attach an object that would check master's state. 2017-01-30 08:47:15 +02:00
ZZYZX
fd282d3001 Fixed map/global static handlers; map handlers should not receive WorldLoaded/WorldUnloaded on load/save anymore. 2017-01-30 08:19:38 +02:00
ZZYZX
09ca1f610d Removed World*Unsafe handlers (merged with WorldLoaded/WorldUnloading); Removed the concept of 'map-local static' handlers, static handlers are now only those that run globally. 2017-01-30 07:50:09 +02:00
ZZYZX
3e44109ad1 Merge remote-tracking branch 'gz/master' into thereisnospoon 2017-01-30 05:39:01 +02: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
ZZYZX
9a54a5affe Merge remote-tracking branch 'gz/master' into thereisnospoon 2017-01-29 01:01:28 +02: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
2c314f3f3f Merge remote-tracking branch 'gz/master' into thereisnospoon 2017-01-28 05:23:16 +02: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
ZZYZX
8c36a2a3df Merge remote-tracking branch 'gz/master' into thereisnospoon 2017-01-24 11:05:14 +02: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
ZZYZX
3e093a20ff First take at serialization 2017-01-24 00:17:12 +02:00
Christoph Oelckers
3f999a990c - removed a line of debug code that made GCC/Clang go nuclear. 2017-01-23 23:06:29 +01:00
ZZYZX
23c9386add Removed RenderCamera, RenderBeforeThing, RenderAfterThing. Serialization preparations. 2017-01-23 23:05:51 +02:00
ZZYZX
efb1e5d33a Implemented global EventHandlers in MAPINFO 2017-01-23 20:48:57 +02:00
ZZYZX
ba4a74265c Fixed static handlers being OF_Fixed: only global (non-map) static handlers should be fixed. 2017-01-23 20:48:57 +02:00
ZZYZX
76b99da4b3 Added EventHandlers in Map section of MAPINFO 2017-01-23 20:48:57 +02:00
ZZYZX
890166a732 Hopefully I'm using OF_Fixed correctly 2017-01-23 20:48:57 +02:00
ZZYZX
35ec14f465 Made the EventHandler class tree a bit more branchy. Now disallowing creation of Static* via EventHandler.Create. 2017-01-23 20:48:57 +02:00
ZZYZX
a226337185 More portal fixing in software renderer 2017-01-23 20:48:57 +02:00
ZZYZX
ac19af7514 Fixed RenderCamera event in software renderer 2017-01-23 20:48:57 +02:00
ZZYZX
302af61686 Added per-thing render hooks 2017-01-23 20:48:57 +02:00
ZZYZX
5bfd484ae2 Generalized event handler definition; removed excessive VM calls when we don't have override defined. 2017-01-23 20:48:57 +02:00
ZZYZX
ca0d92a454 Added EventHandler.CreateOnce and EventHandler.Find to refer to handlers after they are created 2017-01-23 20:48:57 +02:00
ZZYZX
ce616f9c06 Added: prototype event system 2017-01-23 20:48:57 +02:00
Christoph Oelckers
b3aa7c61a9 - fixed: Class and struct name lookup was not context aware.
If a later module reused an existing name for a different class or struct type, this new name would completely shadow the old one, even in the base files.
Changed it so that each compilation unit (i.e. each ZScript and DECORATE lump) get their own symbol table and can only see the symbol tables that got defined in lower numbered resource files so that later definitions do not pollute the available list of symbols when running the compiler backend and code generator - which happens after everything has been parsed.

Another effect of this is that a mod that reuses the name of an internal global constant will only see its own constant, again reducing the risk of potential errors in case the internal definitions add some new values.

Global constants are still discouraged from being used because what this does not and can not handle is the case that a mod defines a global constant with the same name as a class variable. In such a case the class variable will always take precedence for code inside that class.

Note that the internal struct String had to be renamed for this because the stricter checks did not let the type String pass on the left side of a '.' anymore.

- made PEnum inherit from PInt and not from PNamedType.

The old inheritance broke nearly every check for integer compatibility in the compiler, so this hopefully leads to a working enum implementation.
2017-01-23 19:10:28 +01:00
alexey.lysiuk
d0565cafbd Fixed compilation error with GCC/Clang
src/scripting/zscript/zcc_compile.h:95:10: error: extra qualification ‘ZCCCompiler::’ on member ‘StringConstFromNode’ [-fpermissive]
2017-01-23 11:19:26 +02:00
Christoph Oelckers
5a4a5a17db - added core lump checks for ZScript.
- load internal shaders only from file 0. This does not contain aborts, like most of the other checks,but it will now refuse to load any core shader file from anything but gzdoom.pk3.
2017-01-23 01:56:15 +01:00
Christoph Oelckers
517733a04e Merge branch 'clangfix' of https://github.com/edward-san/zdoom
# Conflicts:
#	src/scripting/zscript/zcc_compile.h
2017-01-23 01:39:31 +01:00
Christoph Oelckers
f720073b31 - removed all code that was only there to implement the broken Simplifier that just got removed. 2017-01-23 01:37:43 +01:00
Christoph Oelckers
68c3f42a53 - no more Simplify for global constants as well. 2017-01-23 01:10:40 +01:00
Edoardo Prezioso
4694f9b201 - Fixed GCC/Clang 'extra qualification' error. 2017-01-23 00:22:25 +01:00
Edoardo Prezioso
092b2d6ea0 - Fixed Clang compile error [-Wnon-pod-varargs]. 2017-01-23 00:11:42 +01:00
Christoph Oelckers
061ba48dc1 - no more simplify in state parameters.
- resolving constants with the backend requires a few more error checks.
2017-01-22 23:53:50 +01:00
Christoph Oelckers
2880f56080 - also switched scripted properties away from Simplify. 2017-01-22 23:00:41 +01:00
Christoph Oelckers
4c93e2baa3 - use the expression evaluation capabilities of the compiler backend to resolve constants in actor defaults.
This is the first step to get rid of Simplify and all the baggage it depends on.
2017-01-22 22:19:32 +01:00
Christoph Oelckers
f9f5e45824 - memset the entire vissprite structure when drawing a psprite because this does not initialize all fields. 2017-01-22 20:12:44 +01:00
Christoph Oelckers
f15b051327 - use std::unique_ptr to manage the resource file for loading a savegame because the try/catch handler to ensure its deletion was causing some problems. 2017-01-22 20:06:11 +01:00
alexey.lysiuk
f9ef935840 Fixed warning reported by GCC/Clang when optimization is enabled
src/scripting/codegeneration/codegen.cpp:4097:12: warning: variable 'cast' is used uninitialized whenever 'if' condition is false
2017-01-22 17:00:36 +02:00
alexey.lysiuk
935d49d75f Fixed returning of value from TakeInventory() function
Issuing take CCMD no longer causes assertion failure at src/scripting/vm/vmexec.h:662
assert(numret == C && "Number of parameters returned differs from what was expected by the caller")
2017-01-22 13:51:46 +02:00
alexey.lysiuk
03f9425eb1 Fixed missing xBRZ menu options on platforms without MMX support
xBRZ texture resize modes are no longer removed from menu for targets with HAVE_MMX undefined
2017-01-22 12:11:17 +02:00
alexey.lysiuk
da4981ef91 Fixed invisible mouse cursor in SDL backend
See https://mantis.zdoom.org/view.php?id=71
2017-01-22 10:25:37 +02:00
Christoph Oelckers
d289c00ae3 - restored a line of code that got lost when fixing the parameter checks in CallStateChain. 2017-01-22 01:28:37 +01:00
Christoph Oelckers
ee40135d55 - removed the bogus SetPointer method from PClassPointer.
This was blocking proper bookkeeping of class pointer variables, in particular it rendered PointerSubstitution ineffective.
2017-01-21 23:26:58 +01:00
ZZYZX
659c11514b OpenGL: Added picnum override handling for actors 2017-01-21 23:04:45 +01:00
Christoph Oelckers
aaae52c60b - fixed: FResourceFile::OpenResourceFile did not close the opened file in case it contained invalid data. 2017-01-21 20:15:06 +01:00
alexey.lysiuk
2358b65921 Fixed compiler warning reported by GGC/Clang
No more 'warning: comparison of integers of different signs: int and unsigned long'
2017-01-21 14:47:10 +02:00
Christoph Oelckers
45d3b58cc6 - fixed redundant variable declaration shadowing an outer one. 2017-01-21 13:26:26 +01:00
Christoph Oelckers
2a6fafa15e - don't let P_DamageMobj return negative values.
This serves no purpose, there's not a single place in the code which checks for it, but if that negative values goes unchecked to functions that expect an actually meaningful value for damage inflicted, some bad results can happen. If no damage is inflicted, a proper 0 needs to be returned so that the value can actually be worked with. The return value was a ZDoom invention, it is completely unclear why -1 was chosen if some kind of protection rendered the damage ineffective.
2017-01-21 13:12:34 +01:00
Christoph Oelckers
4dc1d117f2 - fixed: Without letting CMake find OpenGL, under Windows the library must be added manually to the project or linker errors will happen. 2017-01-21 11:50:53 +01:00
Christoph Oelckers
cbdf9870ec - fix uninitialized variable. 2017-01-21 11:46:23 +01:00
Christoph Oelckers
19df603f92 - fixed: P_RailAttack did not make adjustments for the shooter's floorclip. 2017-01-21 10:55:57 +01:00
alexey.lysiuk
5158b1c337 Fixed undefined behavior of DropInventory()
See https://mantis.zdoom.org/view.php?id=93
2017-01-21 11:43:11 +02:00
ZZYZX
6f5fff00a0 Implemented static methods in String struct. Implemented String.Format and String.AppendFormat. Implemented native vararg methods for the future. 2017-01-21 10:32:26 +01:00
Edoardo Prezioso
da3da61b67 - Make OpenGL library link fully dynamic on Unix.
Also, remove all the OpenGL CMake checks, because they're not needed anymore.
2017-01-20 23:21:37 -05:00
Christoph Oelckers
7e114c1127 - moved some more code out of the way. 2017-01-21 00:49:54 +01:00
Christoph Oelckers
274727e8ae - moved the draw functions which are exclusively used by the Strife status bar into strife_sbar.cpp to get them out of the way. They are not expected to survive anyway. 2017-01-21 00:41:59 +01:00
Christoph Oelckers
74f4171947 - removed several unused draw functions from DBaseStatusBar. 2017-01-21 00:29:19 +01:00
Christoph Oelckers
355570198d - moved statusbar code to a separate directory before starting work on it. 2017-01-20 22:59:31 +01:00
Christoph Oelckers
36e1d71f2b - fix spelling error. 2017-01-20 22:45:09 +01:00
Christoph Oelckers
23a7fd40aa - fixed: The script wrapper for AActor::TakeInventory erroneously called RemoveInventory, not TakeInventory. 2017-01-20 20:04:57 +01:00
Christoph Oelckers
7adc34932f - fixed: The state parameter for CallStateChain was checked for the wrong type. 2017-01-20 19:56:29 +01:00
Edoardo Prezioso
e993f9304b - Fixed GCC/Clang compile error. 2017-01-20 19:10:07 +01:00
Christoph Oelckers
4fa5055548 - fixed: With some functions moved to Weapon, Dehacked needs to check Weapon, not StateProvider to find its code pointers. 2017-01-20 17:23:13 +01:00
Christoph Oelckers
302cb41403 - fixed typo in MorphMonster definition. 2017-01-20 17:20:50 +01:00
Christoph Oelckers
314e49f791 - let A_SpawnProjectile, A_FireProjectile, A_SpawnItem(Ex) and A_ThrowGrenade return the spawned actors to the calling code.
- fixed the return type checks in CallStateChain. These made some bogus assumptions about what return prototypes to support and would have skipped any multi-return function whose first argument was actually usable.
2017-01-20 12:39:51 +01:00
Christoph Oelckers
f5421491ec - wrapped the entire DSBarInfo class in a container and completely decoupled it from DBaseStatusBar.
The idea is, when status bars are moved to ZScript that only this small wrapper class needs to be dealt with and the implementation can be left alone. SBARINFO is far too complex to be scriptified, but having it inherit directly from DBaseStatusBar and access its member variables severely limits the options of dealing with the status bar code. This way, it only accesses some globally visible functions in DBaseStatusBar and no variables.

- renamed the global ST_X and ST_Y variables because it is far too confusing and error-prone to have the same names inside and outside DBaseStatusBar.
2017-01-20 11:11:22 +01:00
Rachael Alexanderson
f3159af211 - fixed: Remove ccmd should check if an object is actually an inventory object before attempting to check its owner. (Ooops!) 2017-01-20 10:03:33 +01:00
Christoph Oelckers
9d828a7ca0 - marked all virtual overrides in DSBarInfo with the 'override' keyword so that I do not have to search for them again. 2017-01-20 01:42:21 +01:00
Christoph Oelckers
c880b26d98 - scriptified MorphProjectile and CustomSprite.
This should for now conclude actor class scriptification. The remaining ten classes with the exception of MorphedMonster are all too essential or too closely tied to engine feature so they should remain native.
2017-01-20 01:11:36 +01:00
Christoph Oelckers
3c30b59bab more inventory scriptification
* completely scriptified DehackedPickup and FakeInventory.
* scriptified all remaining virtual functions of Inventory, so that its inheritance is now 100% script-side.
* scriptified CallTryPickup and most of the code called by that.

- fixed: Passing local variables by reference did not work in the VM.
2017-01-19 23:42:12 +01:00
Christoph Oelckers
1750ded7c4 - more exporting of AInventory. 2017-01-19 20:56:31 +01:00
Christoph Oelckers
7c6542e595 - partial scriptification of AInventory.
- scriptification of CustomInventory.
2017-01-19 19:14:22 +01:00
Christoph Oelckers
19b1c10ba8 - scriptified a large part of the weapon code. 2017-01-19 17:40:34 +01:00
Rachael Alexanderson
3b55406302 - fixed: Remove ccmd now no longer removes owned inventory objects (that's what the "take" ccmd is for) 2017-01-19 14:01:12 +01:00
Christoph Oelckers
6d3b26f94c - scriptified the WeaponGiver. 2017-01-19 14:00:00 +01:00
Christoph Oelckers
42f3ccc602 - scriptified a few parts of p_pspr.cpp.
- added a speed parameter to A_Lower and A_Raise in the process.
2017-01-19 13:26:46 +01:00
alexey.lysiuk
0376c8ba24 Removed no longer present file from CMakeLists.txt 2017-01-19 10:08:00 +02:00
Christoph Oelckers
9f550941d2 - fixed loop ordering in P_SetRenderSector. 2017-01-19 01:39:05 +01:00
Christoph Oelckers
8256f25a84 - no need to keep AArmor native, now that all child classes have been scriptified. 2017-01-18 23:46:19 +01:00
Christoph Oelckers
632a29e365 - scriptified HexenArmor. 2017-01-18 23:42:08 +01:00
Christoph Oelckers
2fcffd1fc1 - removed the remaining native parts of ABasicArmor.
- simplified some FindInventory calls using PClass::FindActor to call the variant taking a name directly.
2017-01-18 22:57:47 +01:00
Christoph Oelckers
3148496f57 - scriptified BasicArmor and fixed a few errors in the conversion. 2017-01-18 22:15:48 +01:00
Christoph Oelckers
2dd6fb9595 - scriptified BasicArmorBonus. 2017-01-18 20:23:13 +01:00
Christoph Oelckers
87b9b6111d - scriptified the BeginPlay methods of the VavoomLight classes.
- moved m_Radius back to arg[3] and arg[4], so that scripts have access to light sizes again.
2017-01-18 19:10:25 +01:00
Christoph Oelckers
1ce7b80158 - scriptified the rest of the weapon pieces. 2017-01-18 18:46:24 +01:00
Christoph Oelckers
30a8541a15 - scriptified the weapon piece functions.
- fixed: ClearInventory did not process depleted items properly.
- changed HexenArmor from UNDROPPABLE to UNTOSSABLE because this allowed to remove some special handling in ClearInventory. The only other place which checks this flag also checks UNTOSSABLE.
2017-01-18 17:26:12 +01:00
Christoph Oelckers
d8acf774a6 - scriptified the remains of AKey.
- replaced Key.KeyNumber with special1. This is only for internal bookkeeping purposes so there's really no need to complicate this with a new variable when this one works just as well.
2017-01-18 15:17:12 +01:00
Christoph Oelckers
d9fd2d509f - scriptified the remains of AAmmo. 2017-01-18 14:18:17 +01:00
Christoph Oelckers
cfdd580044 - deleted a_artifacts files. 2017-01-18 10:44:51 +01:00
Christoph Oelckers
534b2ebbfb - scriptified the remains of APowerup.
- ensure that actor defaults contain a valid virtual table and class pointer so that they can actually use virtual and class-dependent method functions. This is needed for retrieving script variables from them.
2017-01-18 10:33:03 +01:00
Christoph Oelckers
b41d4d9f84 - initialize variable to make Valgrind happy. 2017-01-18 01:53:15 +01:00
Christoph Oelckers
ade9e4c3da - implemented processing of multiple return values in script functions. 2017-01-18 01:27:50 +01:00
Christoph Oelckers
232b64d332 - eliminated the native PowerupGiver class.
- scriptified the respawn invulnerability code into a virtual OnRespawn function for PlayerPawn so that custom effects can be implemented.
2017-01-18 00:11:04 +01:00
Christoph Oelckers
98f9219334 - scriptified the remaining functions in a_artifacts.cpp.
- added some helpers to set scripted member variables through the native property parser.

Unfortunately some classes, e.g. PowerMorph, MorphProjectile and the powerup contain some that cannot be handled through the 'property' definition on the script side so they need to be done from the native side.
2017-01-17 20:30:17 +01:00
Christoph Oelckers
14f2c39e58 - scriptified cht_Give and cht_Take and made them virtual function of PlayerPawn so that this can be better configured for mods that want other options in here.
- improved the class pointer to string cast to print the actual type it describes and not the class pointer's own type.
- fixed: The 'is' operator created non-working code when checking the inheritance of a class pointer, it only worked for objects.
2017-01-17 17:34:39 +01:00
Christoph Oelckers
75d3f42d4f - scriptified APowerup. 2017-01-17 17:34:07 +01:00
Edoardo Prezioso
0da1142bdb - Run libsndfile before libmpg123 when reading an audio lump.
libmpg123 spews quite a lot of debug stuff in stdout when encountering files like WAV or Ogg Vorbis, while libsndfile is silent when encountering an MP3 file.
2017-01-17 16:47:37 +01:00
alexey.lysiuk
c4aaeef6b1 Removed homebrew MP3 format detection
It didn't work for all files so let libmpg123 handle all quirks for us
See https://mantis.zdoom.org/view.php?id=60
2017-01-17 11:26:51 +02:00
Edoardo Prezioso
c317a4cbf3 - Fixed: wrong FString 'Replace' action function.
The function replaced only the first character of the first argument with the first character of the second argument.
2017-01-17 10:00:35 +01:00
Edoardo Prezioso
bfb7b82bcc - Fixed uninitialized data for libsndfile.
According to the API docs, when opening a file for read, SF_INFO::format must be set to 0.
Discovered with Valgrind while running Deus Vult 2 map01.
2017-01-17 00:21:27 +01:00
Christoph Oelckers
8f6571241d - scriptified AÃœpwerInvulnerable. 2017-01-16 23:45:25 +01:00
Christoph Oelckers
6990a46daf - scriptified PowerStrength.
This revealed an interesting bug: When the berserk fadout formula was changed in 2005 the result was essentially broken, resulting in values around 7000 - it only worked by happenstance because the lower 8 bits of the resulting values just happened to work to some degree and never overflowed. But the resulting fade was far too weak and a slightly different handling of the color composition code for the VM made it break down entirely.
This restores the pre-2005 formula but weakened intensity which now comes a lot closer to how it is supposed to look.
2017-01-16 22:27:49 +01:00
Christoph Oelckers
c5f100a61d - fixed class name checks for custom properties. 2017-01-16 20:44:52 +01:00
Christoph Oelckers
d3ab691afb - scriptified APowerInvisibility.
- changed AlterWeaponSprite so that it doesn't expose renderer internals to the script code.
2017-01-16 20:34:12 +01:00
Christoph Oelckers
616f954153 - scriptified PowerIronFeet and PowerMask. 2017-01-16 19:04:03 +01:00
Christoph Oelckers
65b7e344f7 - added custom property parsing to DECORATE as well. 2017-01-16 10:36:56 +01:00
Christoph Oelckers
cd1d96b83a - fixed compilation. 2017-01-16 10:36:56 +01:00
Christoph Oelckers
cd0d17dbd5 - made AbsorbDamage work iteratively to avoid large stack use in the VM. 2017-01-16 10:36:56 +01:00
Braden Obrzut
ae7b95fc52 - There are more DYN options than just fluidsynth so unconditionally use CMAKE_DL_LIBS. 2017-01-16 02:19:03 -05:00
Christoph Oelckers
d207b571d9 - scriptified PowerLightAmp and PowerTorch.
- allow calling qualified super methods so skipping some levels is possible.
2017-01-16 00:46:15 +01:00
Christoph Oelckers
d2d6e5d486 - scriptified PowerFlight and PowerWeaponLevel2. 2017-01-15 23:21:38 +01:00
Christoph Oelckers
4837e1e770 - partially scriptified APowerSpeed. 2017-01-15 20:58:52 +01:00
Christoph Oelckers
7503937a84 - scriptified PowerTargeter. 2017-01-15 19:44:43 +01:00
Christoph Oelckers
bf52ce19e4 - fixed: AActor::ClearInventory should respect IF_KEEPDEPLETED for all items. 2017-01-15 18:58:17 +01:00
Christoph Oelckers
03c7b10fd6 - fully scriptified HealthPickup. 2017-01-15 18:46:40 +01:00
Christoph Oelckers
156f9c488e - added script variable access for native code so that many more classes can be fully exported. Tested with the puzzle items. 2017-01-15 18:16:36 +01:00
Christoph Oelckers
179b6e1a39 - added property definitions to the ZScript parser. This will allow defining custom properties for the default block in custom base classes. See 'Health' for an example.
- support transient object member variables for information that does not need to be put in a savegame.
- fixed: special initialization of objects needs to pass the proper defaults along, otherwise the parent classes will use their own, inappropriate one.
2017-01-15 16:55:30 +01:00
Christoph Oelckers
267600826f - sxriptified key and puzzleitem base classes. 2017-01-15 10:37:54 +01:00
Christoph Oelckers
87617b588a - some minor optimization in the VM. 2017-01-15 01:27:01 +01:00
Christoph Oelckers
9f9cea4b4a - scriptified the health items. 2017-01-15 01:02:38 +01:00
Christoph Oelckers
4759f9a399 - scriptified the backpack.
- added GetParentClass builtin to compiler.
2017-01-14 23:34:47 +01:00
Christoph Oelckers
a597979738 - scriptified ammo.
- moved inventory stuff into its own directory.
2017-01-14 21:27:31 +01:00
Edoardo Prezioso
d91023ba0b - Fixed GCC/Clang compile errors. 2017-01-14 18:30:01 +01:00
Christoph Oelckers
e16713492f - scriptified A_FreezeDeath(Chunks). 2017-01-14 18:26:59 +01:00
Christoph Oelckers
6dc1bb8475 - skriptified the skybox actors.
- fixed code generation for internal pointed arrays, they were missing a pointer dereference.
2017-01-14 18:04:49 +01:00
Christoph Oelckers
a9ef73528d - removed all skybox class types from code in preparation for exporting these classes.
- moved SectorPortal struct to FLevelLocals and exported it.
2017-01-14 16:05:40 +01:00
Christoph Oelckers
96777273c4 - scriptified ASoundSequence.
- exported virtual Actor.MarkPrecacheSounds function.
2017-01-14 14:37:29 +01:00
alexey.lysiuk
0b62645a35 Fixed compilation warnings reported by GCC/Clang
gl/data/gl_setup.cpp:430:11: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
gl/data/gl_setup.cpp:527:19: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
gl/data/gl_setup.cpp:542:19: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
nodebuild.cpp:1056:63: warning: format specifies type 'ptrdiff_t' (aka 'long') but the argument has type 'int' [-Wformat]
p_glnodes.cpp:379:50: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
p_saveg.cpp:381:18: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
p_scroll.cpp:532:11: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
p_setup.cpp:2304:43: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
p_setup.cpp:2302:12: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
scripting/codegeneration/codegen.cpp:8488:20: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
scripting/codegeneration/codegen.cpp:8606:15: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
2017-01-14 15:03:14 +02:00
Christoph Oelckers
f83444f3cc - exported the sound sequence interface to scripting.
- split out the map data definitions from base.txt into their own file.
2017-01-14 13:02:08 +01:00
Christoph Oelckers
386c00f17e - scriptified ASoundEnvironment.
This also exposes the functionality as a member function of Sector for easier script access.
2017-01-14 11:43:08 +01:00
Christoph Oelckers
40e7fa5be2 - scriptified the RandomSpawner.
- fixed: String constants were not processed by the compiler backend.
- added an explicit name cast for class types.
2017-01-14 02:05:52 +01:00
Christoph Oelckers
4d68f066a0 - fixed: sector.gravity was not serialized. 2017-01-13 23:29:52 +01:00
Christoph Oelckers
f759b6757a - scriptified the teleport fog. 2017-01-13 23:17:04 +01:00
ZZYZX
a8beb51ca3 Changed opcode implementation to native function implementation 2017-01-13 22:59:45 +01:00
ZZYZX
ee2ecf1450 Added %c (from int) and %p (from pointer) support to format() 2017-01-13 22:59:45 +01:00
ZZYZX
fcc5f4b77b Fixed EFX_ enum for FxFormat 2017-01-13 22:59:45 +01:00
ZZYZX
e75aa08d0a Implemented format() builtin call 2017-01-13 22:59:45 +01:00
Christoph Oelckers
4be0767d7b - scriptified the moving camera. 2017-01-13 22:13:03 +01:00
Christoph Oelckers
51cc7feb4c - scriptified the particle fountains. 2017-01-13 19:29:54 +01:00
Christoph Oelckers
8e7e1ed757 - don't use local TObjPtr variables. 2017-01-13 15:44:16 +01:00
Edoardo Prezioso
6eb9015303 - Fixed GCC/Clang compile errors. 2017-01-13 15:42:53 +01:00
Christoph Oelckers
d338ca3ec1 - scriptified the sector actions. 2017-01-13 13:51:47 +01:00
Edoardo Prezioso
3b7d18c129 - Fixed crash while exiting if compiled by GCC -O3. 2017-01-13 12:02:00 +01:00
Christoph Oelckers
e621b43dd3 - removed the upper limit of 20 for autosaves. 2017-01-13 11:59:55 +01:00
Christoph Oelckers
d73db8c1e8 - added a 'local' parameter to the A_Log family.
- complete "give quakes their own damage type." (was only partially saved.)
2017-01-13 11:48:05 +01:00
Christoph Oelckers
a388327acb - give earthquakes their own damage type. 2017-01-13 11:19:40 +01:00
Christoph Oelckers
6cbc0a80e8 - let 'forcenoskystretch' also apply to sky mode 2 and OpenGL, to reflect its true meaning the internal flag has been renamed to FORCETILEDSKY which it always was about. 2017-01-13 11:12:43 +01:00
alexey.lysiuk
4001e7e6bd Fixed compilation with macOS SDK earlier than 10.7 2017-01-13 10:52:35 +02:00
alexey.lysiuk
7e0c870d0f Added missing OpenGL extension for PowerPC Macs 2017-01-13 10:51:56 +02:00
Christoph Oelckers
76870beb2e - fixed the final bit of sector actions.
The IsActivatedByUse implementation was essentially useless because the value was not serialized so it got lost as soon as the game was reloaded from a savegame.
With the refactoring this is no longer an issue but the access function needed to be changed over to read the info from 'health'.
2017-01-13 01:44:17 +01:00
Christoph Oelckers
1400f401e7 - fixed use of multiple sector actions in the same sector.
The entire setup was quite broken with each item using its own activation result and the ones of the subsequent items in the list as the return value.
This rendered the STANDSTILL check in the main function totally unpredictable because the value it depended on could come from any item in the list.
Changed it so that the main dispatcher function is part of sector_t and does the stepping through the list iteratively instead of letting each item recursively call its successor and let this function decide for each item alone whether it should be removed.
The broken setup also had the effect that any MusicChanger would trigger all following SecActEnter specials right on msp start.
2017-01-13 01:34:43 +01:00
Christoph Oelckers
cf39af0642 - consolidated the sector action classes.
This can be done with a lot less overhead by using one of the object's properties to store the activation flag, so that all the nearly redundant trigger methods can be folded into one.
2017-01-13 01:06:37 +01:00
Christoph Oelckers
85a84b5e94 - scriptified FastProjectile. 2017-01-13 00:35:56 +01:00
Christoph Oelckers
cc58f13e4e - scriptified the sector silencer. 2017-01-12 23:35:24 +01:00
Christoph Oelckers
3d73919092 - scriptified CustomBridge.OnDestroy. 2017-01-12 22:56:06 +01:00
Christoph Oelckers
7b7623d2c4 - split DObject::Destroy into the main method, a native OnDestroy and a scripted OnDestroy method and made the main method non-virtual
This was done to ensure it can be properly overridden in scripts without causing problems when called during engine shutdown for the type and symbol objects the VM needs to work and to have the scripted version always run first.
Since the scripted OnDestroy method never calls the native version - the native one is run after the scripted one - this can be simply skipped over during shutdown.
2017-01-12 22:49:18 +01:00
Christoph Oelckers
0b94d4e0a3 - scriptified the bridge things, except the Destroy method which still requires work to allow virtually calling this. 2017-01-12 19:55:25 +01:00
alexey.lysiuk
de6a66851e Fixed issue with extraction of built GL nodes
See https://mantis.zdoom.org/view.php?id=39
2017-01-12 16:24:55 +02:00
Christoph Oelckers
8e19dc8f10 - restored dialog ID and removed commented-out old code. 2017-01-12 11:54:53 +01:00
Christoph Oelckers
23482735a0 - removed PClassAmmo.
No need to maintain these clunky meta class for one single property. The overhead the mere existence of this class creates is far more than 100 spawned ammo items would cost.
There is no need to serialize AAmmo::DropAmount, this value has no meaning on an already spawned item.
2017-01-12 11:44:33 +01:00
Christoph Oelckers
da43576035 - updated IWAD picker template to the one submitted by Gez for QZDoom. 2017-01-12 10:11:43 +01:00
Christoph Oelckers
bcd73292d3 - checked P_GetRenderSector against the original implementation from before the glsegextras were added and reinstated all checks from that version. 2017-01-12 09:58:13 +01:00
Christoph Oelckers
0d575a20cc - added new PRINTNAME_ constants for retrieving next and secret next level. 2017-01-12 01:11:26 +01:00
Christoph Oelckers
85488f2f30 - added GetActorFloorTexture and GetActorFloorTerrain ACS functions. 2017-01-12 00:49:40 +01:00
Christoph Oelckers
ea163f3898 - exported FCheckPosition to the VM and completed the parameter lists for Actor.CheckPosition and Actor.TryMove. 2017-01-12 00:26:16 +01:00
Christoph Oelckers
5ef9429ae4 - added the ability to attach a constructor or destructor to an internally defined struct.
There are a few which require explicit native construction or destruction that need to be exported to the VM, e.g. FCheckPosition.
The VM cannot handle this directly, it needs two special functions to be attached to handle such elements.
2017-01-11 23:46:03 +01:00
Christoph Oelckers
ca2ac4e4fd - reverted debug stuff. 2017-01-11 17:16:07 +01:00
Christoph Oelckers
7f3e18a6cc - fixed a few memory leaks. 2017-01-11 11:37:27 +01:00
Christoph Oelckers
72101473d0 - fixed: The texture for legacy dynamic light handling was always allocated, even if not needed, and it was never freed. 2017-01-11 10:47:45 +01:00
Christoph Oelckers
d1ce098d59 - fixed a crash with GL nodes not having partner segs where both sides have a sidedef. This can happen for some render hacks. 2017-01-11 10:46:26 +01:00
Christoph Oelckers
f4edaa2662 - fixed the railgun's spiral duration was set incorrectly. 2017-01-11 01:46:17 +01:00
Christoph Oelckers
385ebf2ed2 - fixed: Stairs_BuildUpDoomCrush wasn't in the special dispatcher list. 2017-01-11 01:13:39 +01:00
Christoph Oelckers
de4153ceaf some groundwork for the implementation of dynamic arrays
- created script exports for all relevant functions with all integral types.
- created script side definitions for the underlying data types.
- added a void pointer type so that the prototype for the pointer array can use a generic type every pointer can be assigned to.
2017-01-11 00:57:31 +01:00
Christoph Oelckers
11d93cb030 - removed r_columnmethod 1 because the code was broken and already gone from QZDoom. 2017-01-10 22:28:15 +01:00
Christoph Oelckers
6552e5a7a1 - fixed: 'stat music' tried to access a non-existent stream decoder for any music played through Timidity++ on OpenAL. 2017-01-10 22:16:32 +01:00
Christoph Oelckers
2abd16f117 - fixed: Any inventory item that is about to be placed in an inventory must stop all its sounds. 2017-01-10 22:01:29 +01:00
Christoph Oelckers
3e4f799bbc - made Actor.DamageMobj virtual. 2017-01-10 21:31:52 +01:00
Christoph Oelckers
3f94a15cfe - added a virtual PostSpawn method to RandomSpawner, this will get called when the actor has been spawned so that the spawner can do some special setup with it. 2017-01-10 20:14:48 +01:00
Christoph Oelckers
06c97d898b - added a new parameter to A_CustomRailgun to customize the inaccuracy induced by a moving target. 2017-01-10 20:08:23 +01:00
Christoph Oelckers
3696d34806 - added IF_NOSCREENBLINK flag, see http://mantis.zdoom.org/view.php?id=9 2017-01-10 19:57:51 +01:00
alexey.lysiuk
d9efeb206d Fixed crash on loading GL nodes
See http://mantis.zdoom.org/view.php?id=21
2017-01-10 17:16:18 +02:00
Christoph Oelckers
46179936ec - added global per-mod precaching lists, to be defined in MAPINFO's Gameinfo section. 2017-01-10 01:00:06 +01:00
Christoph Oelckers
96788850d3 - added a workaround for a crashing condition in FThinkerIterator.
It can actually happen that the thinker chain gets broken if an actor being iterated happens to destroy the immediately following actor in the chain as well. In that case both actors lose their chain links and the iterator cannot advance any further, the only solution to avoid a crash is to terminate the iteration of the current list.
2017-01-10 00:38:08 +01:00
Christoph Oelckers
26170419f4 - fixed: The stair builder code tried to access a member of a null pointer after finding no more stair sectors. 2017-01-09 23:24:00 +01:00
Edoardo Prezioso
815a440014 - Fixed the wrong handling of empty command line argument. 2017-01-09 22:00:48 +01:00
Christoph Oelckers
5396e8d07d - fixed: The Windows CreateFramebuffer methods need to check the desired screen size for an actual resolution when switching to fullscreen. 2017-01-09 21:26:19 +01:00
Christoph Oelckers
cc8c20adf8 - fixed: non-existent partner segs were not properly initialized. 2017-01-09 20:54:22 +01:00
alexey.lysiuk
bc492a0b7f Autoaim is now updated when adjusting slider with mouse
Fixes #208 Autoaim slider in Player Setup does not save if changed with cursor
2017-01-09 16:52:15 +02:00
Kyle Evans
8cc52dab5e Fix build on GCC/Clang
Obtained from: kcat/Csonicgo (IRC)
2017-01-09 10:11:13 +02:00
Christoph Oelckers
472ace1bea - removed the needless copying around of the vertexdatas array. The slope code can just use this from the TArray created by the UDMF parser. 2017-01-09 01:40:14 +01:00
Christoph Oelckers
b9ac44e8f2 - fixed: The sight checker's portalgroup variable was not initialized.
- got rid of glsegextras.

This was probably one of the most ill-conceived means to save some memory in ZDoom, but now, when a pure software rendered engine no longer needs to be considered it's just totally useless to keep this mess in.
2017-01-09 01:28:07 +01:00
Christoph Oelckers
12037fdc95 - made the vertexes array VM friendly. 2017-01-09 00:46:16 +01:00
Christoph Oelckers
f78927500e - exported all meaningful parts of side_t to the VM. 2017-01-08 21:42:26 +01:00
Christoph Oelckers
97a90c52e0 - fixed: Particles should disappear if their alpha goes below zero. 2017-01-08 19:44:00 +01:00
Christoph Oelckers
c9964d36d6 - fixed: A single sight check iteration may not succeed if origin and end point are in different portal groups. All those may do is collect more portals. 2017-01-08 19:34:04 +01:00
Christoph Oelckers
7a5171a2e9 - fixed: The check for virtual function overrides was never done if the overriding function had no qualifier at all.
- fixed several occurences where an 'override' qualifier was missing.
2017-01-08 19:07:26 +01:00
Christoph Oelckers
cd7986b1b1 - refactored global sides array to be more VM friendly.
- moved FLevelLocals to its own header to resolve some circular include conflicts.
2017-01-08 18:46:17 +01:00
alexey.lysiuk
e188047d70 Fixed compilation with GCC/Clang 2017-01-08 17:20:27 +02:00
Christoph Oelckers
a54d2d8a55 - fixed UDMF initialization for linedef portal info. 2017-01-08 16:09:21 +01:00
Christoph Oelckers
1c74faea73 - exported line_t's functions to the VM. 2017-01-08 15:45:37 +01:00
Christoph Oelckers
cb89a1a81a - fixed inconsistent use of line_t::portaltransferred.
Some parts used 0 as 'nothing' others used UINT_MAX. 0 should refer to the map's default sky, not to nothing.
2017-01-08 14:59:31 +01:00
Christoph Oelckers
71d1138376 - refactored the global lines array into a more VM friendly form, moved it to FLevelLocals and exported it to ZScript.
- disabled the Build map loader after finding out that it has been completely broken and nonfunctional for a long time. Since this has no real value it will probably removed entirely in an upcoming commit.
2017-01-08 14:39:16 +01:00
Christoph Oelckers
5ee52f159e - refactored the level backup data needed by the serializer into p_saveg.h. 2017-01-08 12:11:31 +01:00
Christoph Oelckers
5ec786eef7 - removed the 'dumpmap' CCMD because it was mostly broken anyway and would require a complete rewrite in UDMF to get back on track. 2017-01-08 11:52:35 +01:00
Christoph Oelckers
d2a51a57e1 - added new Stairs_BuildUpDoomCrush special from Eternity and used it to fix the bad implementation to make Doom's turbo stairs crush. This also removes the crushing from Generic_Stairs entirely, just like it was in Boom. 2017-01-08 01:15:45 +01:00
Christoph Oelckers
3beed216dd - exported all relevant functions from sector_t.
Please note that currently most of these have little use, they are for future feature support.
2017-01-08 00:50:40 +01:00
Christoph Oelckers
82adc5bf1e - exported secplane_t to scripting. 2017-01-07 21:29:43 +01:00
Christoph Oelckers
91981e25a8 - moved all 'sectorptr - &level.sectors[0]' constructs into a subfunction. 2017-01-07 20:02:25 +01:00
Christoph Oelckers
c02281a439 - refactored the global sectors array into a more VM friendly type and moved it into FLevelLocals. 2017-01-07 19:32:24 +01:00
Christoph Oelckers
d381fb5e3f - fixed: A_SetInventory must check for voodoo dolls and delegate the action to the real player because it will always break the real player's inventory if done so. 2017-01-07 15:44:39 +01:00
Christoph Oelckers
581cd27818 - floatified the translucency values in particle_t to elimintate the gross inaccuracies with fadeout time.
- widened ttl variable in particle_t to short to allow longer living particles than 6 seconds.
- reordered fields in particle_t to reduce struct size a bit.
2017-01-07 15:44:39 +01:00
Christoph Oelckers
42b1432b64 - fixed: initialization of local vector variables did not properly allocate registers if the initializer was a subelement of another local vector variable. 2017-01-07 15:44:38 +01:00
Christoph Oelckers
acf66d9f8f - fixed some edge cases with visible player sprites through non-static line portals. This required reinstating some code which I thought was no longer needed. 2017-01-07 15:44:38 +01:00
Christoph Oelckers
62ea83a35a - let the prediction code handle all 4 threaded lists an actor gets linked into.
This is mostly a straight refactoring of the existing code to work independently of specific member variables in the involved classes, using a bit of template magic to avoid redundancy and moving the work code into subfunctions.
It still needs some testing to see if it a) helps fix the crash issues and b) doesn't break anything-
2017-01-06 15:06:17 +01:00
Christoph Oelckers
c52bc06e9b - use a memory arena to allocate msecnodes.
These are rather small and extremely frequently allocated, so they are prime candidates for memory arena, because it not only avoids fragmentation and internal overhead due to mass allocation of small memory blocks but it also makes it a lot faster to free the memory when finishing a level.
2017-01-06 13:09:58 +01:00
Christoph Oelckers
ed25cf61c5 - moved the msecnode code to its own file.
Note that this originates from Boom so it needs to keep the Doom license.
2017-01-06 12:54:01 +01:00
Christoph Oelckers
b11c8fef57 - renamed a few variables for clarity. 2017-01-06 11:56:17 +01:00
Christoph Oelckers
44ad55602d - got rid of uint32(-1) casts. 2017-01-06 11:43:27 +01:00
alexey.lysiuk
b297047060 Removed useless integer type size expansion
Fixed Apple's Clang warnings:
absolute value function 'abs' given an argument of type 'long long' but has parameter of type 'int' which may cause truncation of value
2017-01-06 10:40:51 +01:00
alexey.lysiuk
1a0d8dffd9 Fixed harmless initialization order mismatch
No more 'field ... will be initialized after field ...' warnings reported by GCC/Clang
2017-01-06 10:40:51 +01:00
alexey.lysiuk
0e9f52f9e5 Added virtual destructor to FPresentShaderBase class
No more 'delete called on non-final class that has virtual functions but non-virtual destructor' warnings reported by GCC/Clang
2017-01-06 10:40:51 +01:00
alexey.lysiuk
d77718d422 Fixed harmless uninitialized variables warnings
No more 'variable  is used uninitialized whenever switch default is taken' warnings reported by GCC/Clang
2017-01-06 10:40:51 +01:00
alexey.lysiuk
9ed2da176e Fixed signed/unsigned mismatch in comparisons
No more 'comparison of integers of different signs' warnings reported by GCC/Clang
2017-01-06 10:40:51 +01:00
Christoph Oelckers
e0540c6b37 - fixed uninitialized variable warning in codegen.cpp 2017-01-06 10:33:58 +01:00
Christoph Oelckers
fcb1c1edc4 - only print GL extensions to the log, but not to the console.
The list has become so long by now that it's more of a distraction than help. Besides, searching on-screen for specific extensions is futile anyway.
2017-01-05 12:01:00 +01:00
Christoph Oelckers
c87836c3f3 - fixed check for Mesa driver. 2017-01-05 11:51:15 +01:00
Christoph Oelckers
b74c374a66 - fixed: The CheckReturn check for FxSwitchStatement was not strict enough.
It may only return true if there is no default case because without that any non-matching value will go past the statement.
2017-01-05 11:39:29 +01:00
Christoph Oelckers
e13627e9d8 - fixed: portal offsets at frame start were not applied to ViewActorPos. 2017-01-05 11:28:08 +01:00
Christoph Oelckers
4be9222646 - fixed: Dehacked must flag all states it touched for use in weapons. 2017-01-04 11:13:19 +01:00
Christoph Oelckers
b132782c49 - scriptified PowerBuddha and PowerFrightener. 2017-01-03 21:03:05 +01:00
Christoph Oelckers
15f30886cd - scriptified the TimeFreezer powerup. 2017-01-03 20:06:20 +01:00
Christoph Oelckers
341d9abdd0 - fixed: 'out' parameters must always allocate an address register, regardless of type. 2017-01-03 16:00:25 +01:00
Christoph Oelckers
96623b3052 - disabled OpenGL 3.0 on the Open Source Mesa driver for Linux because it appears to be broken. 2017-01-03 12:01:03 +01:00
alexey.lysiuk
2dec45ca39 Fixed compilation with GCC/Clang
Fixes #175
2017-01-03 09:45:53 +02:00