Commit graph

1203 commits

Author SHA1 Message Date
Christoph Oelckers
f25dadbaf2 - fixed: sector lights could access the sector before it was set. 2019-09-16 18:42:07 +02:00
alexey.lysiuk
79eadafa6b - fixed initial setup for dynamic light actors
They are attached and actived explicitly during usual actor initialization sequence
Postponed processing applicable to so called user dynamic lights must be skipped for them
RECREATELIGHTS flag handling for dynamic light actors had the opposite effect of deactivating them

https://forum.zdoom.org/viewtopic.php?t=65683
2019-09-02 13:58:49 +02:00
Christoph Oelckers
ac484634b3 - fixed attached dynamic light setup.
This was only run on a state change and missed every external light change.
Any place which wants to flag a light change now only will set a flag and at the end of the thinker loop all flagged actors will be processed.
For performance reasons this was merged with the P_RunEffects iterator loop.

# Conflicts:
#	src/p_effect.cpp
#	src/p_effect.h
#	src/p_tick.cpp

# Conflicts:
#	src/p_mobj.cpp
2019-08-18 21:33:42 +02:00
alexey.lysiuk
bb946348da - fixed compilation with GCC 5 and newer
src/r_data/a_dynlightdata.cpp:72:44: error: no matching function for call to ‘FSerializer::Array(const char [5], int [5], int, std::nullptr_t)’
2019-07-17 17:54:08 +02:00
Christoph Oelckers
26863bfd94 - tested and fixed the attachable lights.
# Conflicts:
#	src/g_shared/a_dynlight.cpp
2019-07-17 17:53:43 +02:00
Christoph Oelckers
0c4fc385cc - User definable dynamic lights
This hasn't been tested yet!

# Conflicts:
#	src/g_shared/a_dynlight.h

# Conflicts:
#	src/g_shared/a_dynlightdata.cpp
2019-07-17 17:51:28 +02:00
Christoph Oelckers
e27efa5a2e - fixed DHudMessageTypeOnFadeOut's character counter to be UTF-8 compatible.
This was reading the string by byte and not by character and could end up printing incomplete UTF-8 data.
2019-05-14 13:31:23 +02:00
alexey.lysiuk
60748c16e4 - improved handling of HUDMSG_TYPEON
This includes the following changes
* Validation of serialized values
* Proper fix for message cut off after an empty line, part of https://forum.zdoom.org/viewtopic.php?t=63935, which appeared to be broken again with dbf06fc
* No crash with an empty HUD message, https://forum.zdoom.org/viewtopic.php?t=63761 and https://forum.zdoom.org/viewtopic.php?t=64569

# Conflicts:
#	src/g_shared/hudmessages.cpp
2019-05-05 23:42:51 +02:00
Christoph Oelckers
1e21b44db2 - fixed DHUDMessageTypeOnFadeOut with empty messages. 2019-04-28 21:37:58 +02:00
Christoph Oelckers
d513cbf789 - only activate lights if the light actor isn't dormant, and only create a new one if it doesn't already have one.
-
2019-04-27 13:30:21 +02:00
Christoph Oelckers
4daa256e2f - fixed: RecreateAllAttachedLights must activate the lights it creates.
This also removes the gl_attachedlights CVAR because with the new management this doesn't really work anymore.

# Conflicts:
#	src/gl/system/gl_cvars.h
#	wadsrc/static/menudef.txt
2019-04-27 13:20:44 +02:00
Christoph Oelckers
1ab0be9d0c - fixed flicker light selection of light radius. 2019-04-27 12:43:20 +02:00
Christoph Oelckers
edfb814957 - fixed delete calls on FDynamicLight.
This isn't allocated from the system heap so it cannot be freed by it.
2019-04-26 01:29:03 +02:00
Christoph Oelckers
251b096b48 - removed all remaining native parts of APlayerPawn.
Unlike the other classes, the places where variables from this class were accessed were quite scattered so there isn't much scriptified code. Instead, most of these places are now using the script variable access methods.
This was the last remaining subclass of AActor, meaning that class Actor can now be opened for user-side extensions.
2019-04-26 01:20:02 +02:00
Christoph Oelckers
8fecfb8f85 - properly handle passing of the light flags.
Since these can be changed on the placed light actor they have to be read from there, so this is now a pointer in FDynamicLight, just like the other properties that can be user-changed.
Also did some cleanup on the interface so that external code doesn't need to dereference the lightflags pointer but can use utility functions for all flags.

# Conflicts:
#	src/hwrenderer/dynlights/hw_dynlightdata.cpp
#	src/swrenderer/line/r_walldraw.cpp

# Conflicts:
#	src/g_level.cpp
#	src/gl/compatibility/gl_20.cpp
2019-04-26 00:42:05 +02:00
Christoph Oelckers
17b13f1a60 - fixed: DeactivateLight called Activate instead of Deactivate. 2019-04-26 00:28:08 +02:00
Christoph Oelckers
f261ec7d53 - rewrote dynamic lights to not use actors for the internal representation and made DynamicLight a purely scripted class.
This should be less of a drag on the playsim than having each light a separate actor. A quick check with ZDCMP2 showed that the light processing time was reduced to 1/3rd from 0.5 ms to 0.17 ms per tic.
It's also one native actor class less.

# Conflicts:
#	src/g_shared/a_dynlight.cpp
#	src/g_shared/a_dynlight.h
#	src/hwrenderer/dynlights/hw_dynlightdata.cpp
#	src/hwrenderer/dynlights/hw_dynlightdata.h
#	src/hwrenderer/scene/hw_renderhacks.cpp
#	src/namedef.h
#	src/scripting/thingdef_data.cpp
#	src/swrenderer/line/r_walldraw.cpp

# Conflicts:
#	src/d_main.cpp
#	src/g_levellocals.h
#	src/g_shared/a_dynlight.cpp
#	src/g_shared/a_dynlight.h
#	src/gl/dynlights/gl_dynlight.h
#	src/gl/dynlights/gl_dynlight1.cpp
#	src/gl/scene/gl_spritelight.cpp
#	src/gl/scene/gl_walls.cpp
#	src/hwrenderer/dynlights/hw_shadowmap.cpp
#	src/hwrenderer/dynlights/hw_shadowmap.h
#	src/hwrenderer/scene/hw_flats.cpp
#	src/p_setup.cpp
2019-04-26 00:19:03 +02:00
Christoph Oelckers
08c75efb10 - fixed: ADynamicLight's shadowmap index must be reset when loading a savegame. 2019-04-25 21:20:56 +02:00
Christoph Oelckers
bc8af1cab8 Fixed initialization issues with dynamic lights.
Actors get initialized from their defaults so anything done in the constructor or some explicit member initialization will be overwritten.
They must use their properties for setting up configurable fields and do the rest in BeginPlay.
2019-04-25 20:59:06 +02:00
Christoph Oelckers
b3a8dcdbd4 store shadow map index in the light actor instead of a separate TMap
This frees another file of a direct renderer dependency and generally also should be faster
2019-04-25 20:14:00 +02:00
drfrag
e335a48009 - Fixed bad merge of "- changed handling of attenuated lights in the legacy renderer to be adjusted when being rendered instead of when being spawned.". 2019-04-25 19:11:40 +02:00
Christoph Oelckers
96d40ac403 - fixed the direct native variant of DynamicLight.SetOffset. 2019-04-25 16:26:40 +02:00
Cacodemon345
fdd6e3cec9 Export P_GetOffsetPosition and ADynamicLight::SetOffset to ZScript 2019-04-18 16:23:01 +02:00
Christoph Oelckers
c0e9530fd0 - fixed: The light defaults were not fully deleted on an engine restart. 2019-04-18 13:12:55 +02:00
Christoph Oelckers
013040eacd - missed one definition for adding a direct native call. 2019-04-17 17:27:42 +02:00
alexey.lysiuk
3252390642 - fixed linking of optimized targets
CMakeFiles/zdoom.dir/r_utility.cpp.o: In function `R_SetupFrame(FRenderViewpoint&, FViewWindow&, AActor*)':
/home/travis/build/coelckers/gzdoom/src/r_utility.cpp:832: undefined reference to `AActor::GetCameraHeight() const'
CMakeFiles/zdoom.dir/g_shared/a_action.cpp.o: In function `A_Unblock(AActor*, bool)':
/home/travis/build/coelckers/gzdoom/src/g_shared/a_action.cpp:64: undefined reference to `AActor::GetDropItems() const'
2019-04-17 15:11:26 +02:00
Christoph Oelckers
f22aaca74d - scriptified ASpecialSpot.
This only had two simple native methods so the class is not fully scripted.
2019-04-17 14:32:10 +02:00
Christoph Oelckers
044b635a26 - more direct native function calls. 2019-04-17 14:32:06 +02:00
Christoph Oelckers
d40de21bae - scriptified A_SpawnSingleItem, which was the last piece of native code still referencing AInventory 2019-04-16 23:57:19 +02:00
Christoph Oelckers
5043106e97 - started replacing direct references to class AInventory.
The easiest part was the type checks which could be changed to the name variant with a global search and replace.

# Conflicts:
#	src/hwrenderer/scene/hw_sprites.cpp

# Conflicts:
#	src/hwrenderer/scene/hw_sprites.cpp
2019-04-16 21:34:23 +02:00
Christoph Oelckers
a1615457ac - properly hook up the alt HUD with the status bar.
# Conflicts:
#	src/d_main.cpp
2019-04-16 19:09:14 +02:00
Christoph Oelckers
0d8975ed31 - scriptified the last components of the alternative HUD.
- moved the ALTHUDCF parser PClass::StaticInit, so that it gets done right after creating the actor definitions.

All left to do is not to reallocate the AltHud object for each frame but store it in a better suited place.

# Conflicts:
#	src/d_main.cpp

# Conflicts:
#	src/info.cpp
2019-04-16 19:03:43 +02:00
Christoph Oelckers
376266b6a0 - scriptified the main drawer for the in-game HUD and removed all intermediate VM calls from the native source. 2019-04-16 19:02:01 +02:00
Christoph Oelckers
9d8dd5c529 - scriptified the AltHUD'S powerup drawer. 2019-04-16 19:01:55 +02:00
Christoph Oelckers
f509fdfdaa - scriptified and cleaned up the AltHUD's DrawCoordinates, DrawTime and DrawLatency functions.
Some backing functionality was moved elsewhere because scripting should not have access to low level system information.
2019-04-16 19:01:53 +02:00
Christoph Oelckers
eb07b8e543 - scriptified the AltHUD's inventory drawer and fixed the InvPrev CCMD. 2019-04-16 19:01:51 +02:00
Christoph Oelckers
e0915877b4 - scriptified the AltHUD's weapon drawer. 2019-04-16 19:01:50 +02:00
Christoph Oelckers
045d6d4355 - added the missing TNT1A0 check for icon-less keys.
Since it tries to get the icon from the spawn state it also has to check if that actually has a valid sprite.
2019-04-16 19:01:48 +02:00
Christoph Oelckers
437c72a089 - AltHUD ammo drawer scriptified. 2019-04-16 19:01:46 +02:00
Christoph Oelckers
1033dc3b10 - Alt HUD scriptification, part 1. 2019-04-16 19:01:43 +02:00
Christoph Oelckers
d021d63d33 - moved AInventory::DoRespawn fully to the script side. 2019-04-16 18:45:49 +02:00
Christoph Oelckers
4049b56d50 - a bit of code reordering for adding direct native entry points.
- offloaded key list generation for alternative HUD to non-UI parts.

This change also revealed a problem with handling empty sprites in the key list so this got fixed, too.

# Conflicts:
#	src/g_shared/shared_hud.cpp
2019-04-16 18:17:05 +02:00
Christoph Oelckers
96e9dbd967 - removed all remaining native components of the weapon class. 2019-04-15 22:29:52 +02:00
Christoph Oelckers
309cc57504 - removed all direct access to AWeapon's members to prepare moving this class fully to the script side.
Disregarding UI-side and setup-related calls there's unfortunately still 6 places in the native game code which require direct access.
2019-04-15 22:29:43 +02:00
Christoph Oelckers
af4c37471e - took the weapon selection logic out of the WeaponSlots data and blocked all direct access to the weapon slots internals
This seriously needs to be independent from the data store and better abstracted. More work to come to move this to its proper place.

# Conflicts:
#	src/g_inventory/a_pickups.cpp
2019-04-15 21:59:05 +02:00
Christoph Oelckers
9e6279ed5b - scriptified the rest of the morph code. 2019-04-15 21:56:28 +02:00
Christoph Oelckers
b886219f53 - scriptified P_MorphMonster. 2019-04-15 21:56:23 +02:00
Christoph Oelckers
02f785f794 - testing and cleanup of scripted morph code. 2019-04-15 21:56:20 +02:00
Christoph Oelckers
9b1e96262c - P_UndoPlayerMorph scriptified.
Not tested yet and still missing a new native interface.
2019-04-15 21:56:18 +02:00
Christoph Oelckers
395413fc9a - scriptified P_MorphPlayer and dependencies.
It still needs its counterpart scriptified as well before it can work.

# Conflicts:
#	src/gi.cpp
#	wadsrc/static/zscript/base.txt
2019-04-15 21:56:16 +02:00