Commit graph

7444 commits

Author SHA1 Message Date
Mitchell Richters
892eb16d8b - Duke: Clean up player/actor accesses in checkavailweapon(). 2023-10-02 20:36:58 +11:00
Mitchell Richters
3925af453a - Duke: Clean up player/actor accesses in moveactor(). 2023-10-02 20:36:39 +11:00
Mitchell Richters
ac35e09d1c - Move each game's stored nPlayer/pnum value to CorePlayer. 2023-10-02 18:44:04 +11:00
Mitchell Richters
16189ff7f9 - Remove GameInterface::getConsoleActor() in place of direct access. 2023-10-02 18:11:53 +11:00
Mitchell Richters
6de8fc91d6 - Remove GameInterface::reapplyInputBits() and directly perform operation in GameTicker(). 2023-10-02 18:11:51 +11:00
Mitchell Richters
02bd017d07 - Directly set CorePlayer::ucmd rather than copying it to a temporary array. 2023-10-02 17:00:50 +11:00
Mitchell Richters
d90aca9640 - Directly store a ticcmd_t object within CorePlayer. 2023-10-02 17:00:50 +11:00
Mitchell Richters
23d4cbc3bd - Remove all game-side PlayerArray[] objects and store within common code. 2023-10-02 15:43:00 +11:00
Mitchell Richters
789c4669f1 - SW: Initial setup to convert PlayerArray array to array of SWPlayer pointers. 2023-10-02 15:43:00 +11:00
Mitchell Richters
f9c3a64f35 - Exhumed: Initial setup to convert PlayerArray array to array of ExhumedPlayer pointers. 2023-10-02 15:43:00 +11:00
Mitchell Richters
6d2124dd01 - Duke: Initial setup to convert PlayerArray array to array of DukePlayer pointers. 2023-10-02 15:43:00 +11:00
Mitchell Richters
0aac044da6 - Blood: Initial setup to convert PlayerArray array to array of BloodPlayer pointers. 2023-10-02 15:43:00 +11:00
Mitchell Richters
1604cf009c - Move the actor pointer for each game's player structures into CorePlayer.
* Something strange was going on here with Blood where the static_cast would not work... Moved the player structure into `bloodactor.h` for now to work around it.
2023-10-02 15:42:59 +11:00
Mitchell Richters
6beec5eed2 - Set up initial implementation of CorePlayer struct and make game-side player structs inherit from it. 2023-10-02 15:42:59 +11:00
Mitchell Richters
6a7eabd23f - SW: Rename Player[] array to PlayerArray[] and wrap its access. 2023-10-02 15:42:59 +11:00
Mitchell Richters
2327e08acb - SW: Replace remaining Player + pointer arithmetic with array accesses. 2023-10-02 15:42:58 +11:00
Mitchell Richters
2733c90237 - SW: Replace all pp (.)\= Player \+ (.+)\) with array accesses. 2023-10-02 15:42:58 +11:00
Mitchell Richters
3c499b060f - SW: Replace all pp = Player \+ (.+); with array accesses. 2023-10-02 15:42:58 +11:00
Mitchell Richters
3cc2aa7af4 - SW: Replace remaining Player+ pointer arithmetic with array accesses. 2023-10-02 15:42:57 +11:00
Mitchell Richters
edd089cc0d - SW: Replace Player+pnum pointer arithmetic with array accesses. 2023-10-02 15:42:57 +11:00
Mitchell Richters
6a72b3dd83 - SW: Replace all pp (.)\= Player\+(.+)\) with array accesses. 2023-10-02 15:42:57 +11:00
Mitchell Richters
5d5327c427 - Replace direct pointer access to Player[] array with array accesses. 2023-10-02 15:42:57 +11:00
Mitchell Richters
dbb11eed4d - SW: Rename PLAYER struct to SWPlayer. 2023-10-02 15:42:55 +11:00
Mitchell Richters
d107b6a1fa - Exhumed: Rename PlayerList[] array to PlayerArray[] and wrap its access. 2023-10-02 15:42:09 +11:00
Mitchell Richters
5008ac08ac - Exhumed: Rename Player struct to ExhumedPlayer. 2023-10-02 15:41:15 +11:00
Mitchell Richters
6a367c6184 - Duke: Rename ps[] array to PlayerArray[] and wrap its access. 2023-10-02 15:41:15 +11:00
Mitchell Richters
bd9e42bb40 - Duke: Rename player_struct struct to DukePlayer. 2023-10-02 15:41:13 +11:00
Mitchell Richters
0ed54ed719 - Blood: Rename gPlayer[] array to PlayerArray[] and wrap its access. 2023-10-02 15:31:05 +11:00
Mitchell Richters
49104f9b24 - Blood: Rename PLAYER struct to BloodPlayer. 2023-10-02 15:30:51 +11:00
Mitchell Richters
a20e2b64f9 - SW: Wrap access to player's actor pointer. 2023-10-02 15:30:35 +11:00
Mitchell Richters
61bc8c23cf - Exhumed: Wrap access to player's actor pointer. 2023-10-02 15:30:35 +11:00
Mitchell Richters
6d6872fea7 - Duke: Ensure player_struct::GetActor() is exclusively used to get the player's actor. 2023-10-02 15:30:34 +11:00
Mitchell Richters
2755b17fd5 - Blood: Wrap access to player's actor pointer. 2023-10-02 15:30:34 +11:00
Mitchell Richters
719cc75fd2 - Duke: Rename player_struct::sync to player_struct::input to match the other games. 2023-10-02 15:30:32 +11:00
Christoph Oelckers
295d9e690b remove unneeded non-standard includes from inifile.cpp 2023-10-01 14:00:26 +02:00
Christoph Oelckers
716e059374 use shared SplitPath function 2023-10-01 13:09:22 +02:00
Christoph Oelckers
ee07ae35aa retrieve time in fillSummary. 2023-10-01 12:10:56 +02:00
Christoph Oelckers
4dcf0fd3c4 get rid of the GetStats interface function.
Now that all data it retrieves is available in shared code it is no longer needed.
2023-10-01 11:48:32 +02:00
Christoph Oelckers
19dfd84320 use global stat manager in SW 2023-10-01 10:33:07 +02:00
Christoph Oelckers
da3df98484 use global stat manager in Exhumed 2023-10-01 10:17:27 +02:00
Christoph Oelckers
3e821c5849 use global stat manager in Duke 2023-10-01 10:07:54 +02:00
Christoph Oelckers
4af7a649b6 move kill/secret management into the shared code
Implemented for Blood so far, this gets rid of gKillMgr and gSecretMgr
2023-10-01 10:07:45 +02:00
Christoph Oelckers
26ba62dc62 Blood: cleanup of INI loading
* use snprintf instead of sprintf
* keep the IniFile object local
* get rid of the FreeGameData interface function, it only existed to free the global INI object.
2023-09-30 22:34:09 +02:00
Christoph Oelckers
bb6d6ae83b replaced Ini-parser with a reworked version from Blood RE.
This was mainly for the license.
2023-09-30 21:47:17 +02:00
Christoph Oelckers
31541fd8ae correct else placement in calebSwimChase. 2023-09-29 20:22:56 +02:00
Christoph Oelckers
e072380470 Blood: fixed bad order of random numbers. 2023-09-29 20:11:34 +02:00
Mitchell Richters
dc8be29354 - Exhumed: Use range-based loop in seq_LoadSequences(). 2023-09-28 22:16:31 +10:00
Mitchell Richters
ad87f9ba54 - Duke: Adjust doVehicleTilting() somewhat.
* Don't adjust and scale the player's roll, we can rely on `player_struct::TiltStatus` alone for this.
* Ensure maximum tilt via full keyboard turn == (20. * 360. / 2048. * 0.5), same as original code.
2023-09-28 22:16:31 +10:00
Mitchell Richters
8f9b413d38 - Always clear object in PlayerAngles::initialize() rather than expecting the caller to do it. 2023-09-28 22:16:30 +10:00
Mitchell Richters
7fa5df934b - Make playercmds[] non-global and pass through as pointer. 2023-09-28 22:16:30 +10:00
Mitchell Richters
ae39645169 - Duke: Slight cleanup on e0e459216d. 2023-09-28 22:16:29 +10:00
Mitchell Richters
4958241c57 - Blood: Slight cleanup on 32480dde16. 2023-09-28 22:16:29 +10:00
Christoph Oelckers
b05b409695 Blood: removed 3 unused members in PLAYER 2023-09-28 11:45:16 +02:00
Christoph Oelckers
f46db83ab3 removed two leftover floatification helpers. 2023-09-28 11:43:14 +02:00
Christoph Oelckers
aea46548bd moved all Is***Sprite function to animatesprite.cpp because that's the only place they still get used from.
Naked sprite pointers have been removed everywhere else.
2023-09-28 11:41:35 +02:00
Christoph Oelckers
7e63ccd57a Blood: get rid of the mirror struct and related data.
This is a relic of Polymost.
2023-09-26 23:34:08 +02:00
Christoph Oelckers
bcad8a85d2 renamed at* fields in gib.cpp 2023-09-26 23:34:08 +02:00
Christoph Oelckers
3625a510d2 took a hint from Blood-RE and replaced that awful reconstructed sorting function with the qsort call it most likely originally was. 2023-09-26 23:34:08 +02:00
Christoph Oelckers
8a0f79141b code cleanup
* gave reverb functions the proper 'S_' prefix for consistency.
* Blood: fixed license of 4 files which do not contain any NBlood code anymore (sound code was completely rewritten, and all such code has long been moved out of d_menu.cpp)
* Blood: renamed VIEWPOS_* constants
2023-09-26 23:30:38 +02:00
Mitchell Richters
e0e459216d - Reduce GameInput::processVehicle() interface by changing three bools to a bitfield. 2023-09-25 19:51:53 +10:00
Mitchell Richters
ce236c795f - Blood: Don't attenuate view rolling when swimming.
* Blood's input and drag system is much more developed than the other games and further attenuation is not needed here.
2023-09-25 17:00:10 +10:00
Mitchell Richters
9ad0af4479 - Blood: Better fix for view rolling under all circumstances.
* Why is everything so difficult in Blood? 😕
* Do StrafeVel drag/resistance before `MoveDude()` as it may never be called if there's no velocity.
* Avoid using `mulscale16r()` in algorithm as we simply don't need to here.
* Move `doRollInput()` call into same area where drag is applied so all the code is concentrated in one spot.
2023-09-25 16:42:11 +10:00
Mitchell Richters
2916fe596f - Blood: Fix view rolling while underwater. 2023-09-24 20:00:11 +10:00
Mitchell Richters
32480dde16 - Ensure all games preserve SB_CENTERVIEW and SB_CROUCH bits upon loading. 2023-09-24 17:22:38 +10:00
Mitchell Richters
ff8cea673e - Duke: Ensure player_struct Serialiser only attempts to set variables when reading, not unconditionally. 2023-09-24 17:21:17 +10:00
Mitchell Richters
29e021b5bf - Move crouch toggling back into the backend so the toggle key can be used as a swim key.
* Reverts 272dfa762d, but is a fresh implementation.
* I doubted anyone was doing this but apparently not.
* Exhumed needed a bit more work as it has very specific underwater checks.
2023-09-24 14:15:49 +10:00
Christoph Oelckers
615267dbd4 - fixed incorrect setup in Blood map loader. 2023-09-23 21:13:03 +02:00
Christoph Oelckers
4bb66fb44e - Duke: Fixed WT fallback for classic sounds in cases the user data does not exist.
currently that's only the case for CRANEGRAB which is aliased because of differences between Duke and RR.
2023-09-23 14:29:41 +02:00
Christoph Oelckers
d96a928738 - Exhumed: fixed sprite positioning issues
Apparently tile #1 has some significance here.
2023-09-23 10:30:52 +02:00
Christoph Oelckers
a41ebfeb73 - Duke: fixed the explosion's lighting hackery.
The animatesprites handler in the old code got called on the already animated sprite, meaning it will only activate for the first frame.
To do this right the code had to be moved to applyanimations and be guarded by a flag.
2023-09-10 20:42:26 +02:00
Christoph Oelckers
230c1b9041 - fix animatesprite loop aborts on sector effectors 2023-09-10 19:55:41 +02:00
Christoph Oelckers
82057bcd5a - Backend update from GZDoom-
This compiles but doesn't run.
2023-08-23 20:36:19 +02:00
Christoph Oelckers
b95a5a4b2b - yet another backend update. 2023-08-20 02:15:57 +02:00
Christoph Oelckers
d34bad3045 - adapted game side code. 2023-08-19 19:41:40 +02:00
Christoph Oelckers
32ede813e9 - new files for backend update. 2023-08-19 18:17:17 +02:00
Christoph Oelckers
2095a2120c - consolidated the 4 ReadSound functions. 2023-08-19 18:11:19 +02:00
Christoph Oelckers
3c695a5abd - adapted to backend changes. 2023-08-19 18:08:27 +02:00
Christoph Oelckers
76e77d4e64 - Duke: fix enemy counting 2023-08-06 09:59:33 +02:00
Christoph Oelckers
f0623c7098 - fix compilation 2023-08-06 09:22:07 +02:00
Christoph Oelckers
bd078cc3e6 - SW: Clear FinishTimer when starting a new level. 2023-08-03 17:53:25 +02:00
Christoph Oelckers
20b96501b6 - moved rnd_plasma into global space again.
C++'s init rules for local static variables are so dumb that this will cause undefined behavior with the RNG management, it's also very inefficient.
2023-08-03 12:55:23 +02:00
Christoph Oelckers
c19653262e - Duke: fix management of killit_flag.
This cannot be in the actor because event scripts can be called without a valid actor.
It is now part of the parse state, but execute allows returning it to the caller, which is needed in one place.
2023-07-22 10:24:20 +02:00
Christoph Oelckers
ce34ef2921 - Duke: fixed skill filter handling for CON defined enemies. 2023-07-17 00:32:27 +02:00
Christoph Oelckers
0380ef3b80 - SW: remove redundant ; in sector object serializer.
This caused the animtype field not to be saved.
2023-07-16 10:59:39 +02:00
Kevin Caccamo
80ac9f6416 Fix a memory write issue with plasma_{A,B,C}
plasma_A[5] = {}; will write the default value for int to the sixth element of plasma_A, causing a global-buffer-overflow.

I assume the intention here was to fill these three arrays with zeroes, which is what I did with the memset calls.
2023-07-12 19:13:05 +10:00
Christoph Oelckers
1e2b5c2747 - added missing range checks to PlaySpriteSound.
This can be called with attr_none!
2023-06-29 18:28:16 +02:00
Christoph Oelckers
c4cb44f5f0 - RR: thunder may only be triggered when the player sees a sector with an activating texture as sky. 2023-06-19 20:45:16 +02:00
Christoph Oelckers
5bbcb82ef2 - unlimited the number of sectors to have window lightning. 2023-06-19 20:34:04 +02:00
Christoph Oelckers
b31e8dd8b4 - some initial preparations for exporting SW's actors. 2023-06-01 22:07:47 +02:00
Christoph Oelckers
d74c2ba52f - added a few texture names for picnum literals. 2023-05-31 21:53:14 +02:00
Christoph Oelckers
54335f7215 - got rid of the tilenum variant of hud_drawsprite. 2023-05-30 19:08:26 +02:00
Christoph Oelckers
0b158dbdd0 - Blood: use texture IDs in drawElements. 2023-05-30 19:05:33 +02:00
Christoph Oelckers
117874bb72 - Blood: fixed bad scaling in viewBurnTime. 2023-05-30 18:57:44 +02:00
Christoph Oelckers
af4189c2a1 - RR: fixed shotgun HUD placement
This original code is technically dead wrong - it just works by happenstance.
2023-05-30 18:26:05 +02:00
Christoph Oelckers
f8de8eb7a3 - Duke: fixed bad range check in tripbomb drawer. 2023-05-30 17:18:31 +02:00
Christoph Oelckers
517b77bfdc - RR: spawn the correct player class. 2023-05-30 00:11:49 +02:00
Christoph Oelckers
27d17bc413 - moving around some constants. 2023-05-29 22:16:23 +02:00
Christoph Oelckers
a2f0bfb073 - clean out digi.h
It's only the enum now - all the rest is externally defined.
2023-05-29 22:16:22 +02:00
Christoph Oelckers
d163e67a36 - named all breakable sprites. 2023-05-29 22:16:11 +02:00
Christoph Oelckers
e97dfb3687 - moved ActorActionFunc and Personality out of __LegacyState again. 2023-05-28 21:07:34 +02:00
Christoph Oelckers
b07a182df4 - change type of AF() 2023-05-28 11:19:36 +02:00
Christoph Oelckers
8d57281101 - turn the SO's Animator and PostMoveAnimator into non-functions as well.
What little is here can be done just as easily by more traditional means which are easier to serialize.
2023-05-28 11:19:35 +02:00
Christoph Oelckers
5e64d6c7aa - call ScaleSectorObject directly.
It's the only PreMoveAnimator so a bool can be used as easily as the full pointer.
2023-05-28 11:19:35 +02:00
Christoph Oelckers
20b39c6a0d - removed several non-actions from player.cpp's saveable code. 2023-05-28 11:19:35 +02:00
Christoph Oelckers
4bf0029c32 - remove lots of unneeded SAVE_CODE and SAVE_DATA declarations.
Everything ported to VMFunctions can now be saved natively and the DECISIONs never get stored in serialized pointers.
2023-05-28 11:19:35 +02:00
Christoph Oelckers
ddfb485424 - added a serializer for VMFunction pointers. 2023-05-28 11:19:34 +02:00
Christoph Oelckers
64d012b073 - implement the VM call's return value 2023-05-28 11:19:23 +02:00
Christoph Oelckers
fb79228600 - get rid of all ANIMATOR function pointers.
Everything now uses VMFunctions.
2023-05-28 09:06:51 +02:00
Christoph Oelckers
280d685774 - get rid of more ANIMATOR declarations. 2023-05-28 09:01:43 +02:00
Christoph Oelckers
4e5372133c - removed the godawful hack to use function addresses as identifier for playing sounds.
This already required a bad workaround, but let's do it cleanly now so it can be used from scripts properly.
In most places this wasn't even used to decide on sound playing at all - only the 'broadcast' decision matters.
2023-05-28 09:01:05 +02:00
Christoph Oelckers
f12cc01055 - wrap all personality decision actions in VM functions. 2023-05-28 08:52:46 +02:00
Christoph Oelckers
540f96407d - clean up ANIMATOR declarations. 2023-05-28 08:46:03 +02:00
Christoph Oelckers
1b685d8652 - wrap all action functions in a VMFunction.
To allow piece-by-piece refactoring.
2023-05-28 08:35:19 +02:00
Christoph Oelckers
89cce849e8 - wrapped more direct access to the states. 2023-05-28 08:32:52 +02:00
Christoph Oelckers
beb8368819 - more stateGroup wrapping 2023-05-28 08:24:56 +02:00
Christoph Oelckers
7eb713ab04 - wrap state setters so they can use state names. 2023-05-28 08:13:20 +02:00
Christoph Oelckers
213bdbadad - allocate VMFunction's PrintableName from the ClassDataAllocator arena.
This avoids execution order issues on shutdown. VMFunction should not use FString.
2023-05-27 22:40:47 +02:00
Christoph Oelckers
7d30f1921c - moved remaining stuff to refactor to a substructure for easier lookup later. 2023-05-27 22:15:52 +02:00
Christoph Oelckers
3612127a5e - move stuff to refactor to a sub-structure. 2023-05-27 12:37:24 +02:00
Christoph Oelckers
12266a3693 - SW: inline setting the end state. 2023-05-27 12:11:41 +02:00
Christoph Oelckers
98961b54a8 - removed unused variable 2023-05-27 10:11:31 +02:00
Christoph Oelckers
5dfb0c902a - consolidation of sound init code. 2023-05-27 09:12:51 +02:00
Christoph Oelckers
6866e86e3e - missed change for Blood 2023-05-27 09:11:26 +02:00
Christoph Oelckers
92f2503160 - did a bit of optimization on sfxinfo_t.
Using two bytes of alignment gap to add a userval variable.
2023-05-27 09:03:10 +02:00
Christoph Oelckers
1cb86af5f9 - give SW's sounds proper names and move their definition out of the EXE.
Also handle custom rolloff by the sound engine
2023-05-26 23:27:46 +02:00
Christoph Oelckers
f35ae98e13 - remove unused variable. 2023-05-21 08:11:44 +02:00
Christoph Oelckers
1b2a249243 - got rid of all tile index constants in Exhumed. 2023-05-21 07:42:26 +02:00
Christoph Oelckers
c707167c94 - eliminated all uses of tile index constants in Blood.
The literal numbers still remain, though.
2023-05-20 18:28:29 +02:00
Christoph Oelckers
9bf028b7f0 - eliminated use of one more tile index in Exhumed. 2023-05-20 18:27:12 +02:00
Christoph Oelckers
fd9a9232af - cleanup of Exhumed's 2D code. 2023-05-20 18:08:59 +02:00
Christoph Oelckers
4e4be4f3d0 - use the global texture ID array where available. 2023-05-20 18:08:58 +02:00
Christoph Oelckers
6de41eec46 - get rid of last tileGetTexture calls in Blood. 2023-05-20 18:08:58 +02:00
Christoph Oelckers
a2b2e2ec87 - got rid of tileHeight and tileWidth. 2023-05-20 18:08:40 +02:00
Christoph Oelckers
2f2021f5d2 - Blood: simplify burnTable. 2023-05-20 13:17:55 +02:00
Christoph Oelckers
058f1b4233 - handle exclusion of tilenum 0 for sprites in the backend. 2023-05-20 12:55:58 +02:00
Christoph Oelckers
de6b5fec7b - got rid of some 'picnum's that don't reference spritetype. 2023-05-20 10:59:03 +02:00
Christoph Oelckers
5999cb8218 - fix savegame size of temp_data 2023-05-20 10:00:29 +02:00
Christoph Oelckers
43bc6edba3 - print errors in red. 2023-05-20 09:11:14 +02:00
Christoph Oelckers
5ba01bb38d - fix crash in RR when dying with an item-less weapon. 2023-05-20 07:19:35 +02:00
Christoph Oelckers
a8e03723ef - NOSHADOW flag. 2023-05-19 23:03:20 +02:00
Christoph Oelckers
b993f05c8f - fixed missing handling for BADGUYSTAYPUT flag. 2023-05-19 23:00:27 +02:00
Christoph Oelckers
11ba136df1 - make autosaving happen immediately for other games than Blood only.
Blood does not like it, but for the others it should be ok.
2023-05-19 22:59:47 +02:00
Christoph Oelckers
513de38723 - pass the spawner to Initialize as an explicit parameter.
Using ownerActor is not robust, for some actors this will have unwanted side effects.
2023-05-19 22:57:26 +02:00
Christoph Oelckers
22415d0d22 - Duke: for camera textures, set display_mirror to 2, not 1.
This avoids actually mirroring the sprites while otherwise retaining the effects on player visibility. Although a value of 1 was working previously it was merely by happenstance, not by design.
Also remove two redundant local copies of display_mirror in Blood and SW.
2023-05-19 22:53:17 +02:00
Christoph Oelckers
6e060c2e83 Revert "- Tidy up autosaving for all the games."
This reverts commit 10445635cf.

Contrary to what the reverted commit states, it is absolutely essential to have this delay. Duke and Blood initialize a lot of things in their first tick that are necessary before the world is stable to save.
2023-05-19 22:53:17 +02:00
Christoph Oelckers
5d4e6696ca - Blood: clear gHitInfo when starting a level. 2023-05-19 22:53:17 +02:00
Christoph Oelckers
cf349fbd7d - Duke: clear resource ID when setting up the original sounds for World Tour.
This made them unconditionally override the replacements - bad as they are.
2023-05-19 22:53:16 +02:00
Christoph Oelckers
e0de0893a9 - autoaim must never apply to WW2GI's pistol. 2023-05-19 22:53:16 +02:00
Christoph Oelckers
bab432ed72 - refinement of aiming fix. 2023-05-19 22:53:15 +02:00
Christoph Oelckers
fa1e667140 - Duke/RR: Use the exact same trajectory for autoaiming and the actual attack hitscan for the pistol.
These were not identical so the pistol was likely to miss small targets the autoaim acquired. This was particularly bad for Duke's ceiling turret and RR's mosquito.
2023-05-19 22:52:36 +02:00
Christoph Oelckers
94a80dda11 - initialize the angle of script spawned actors. 2023-05-19 22:52:00 +02:00
Christoph Oelckers
e8a3e2ee53 - fixed sprite rotation in mirrors. 2023-05-19 22:51:45 +02:00
Christoph Oelckers
ff24711710 -put the remaining directly accessed textures into the aTexIDs arrays for Blood and Exhumed. 2023-05-19 22:51:32 +02:00
Christoph Oelckers
481f139962 - put texture ID lists into a namespace.
These conflicted with each other.
2023-05-19 22:51:31 +02:00
Christoph Oelckers
aee26c2637 - reset counter in SetMove 2023-05-19 22:50:02 +02:00
Christoph Oelckers
8aaa8b4113 - use the native implementation for Duke.rnd.
This ensures that results are consistent.
2023-05-19 22:46:43 +02:00
Christoph Oelckers
7bb678bb7e - fixed 'move' property handler to properly store its z value. 2023-04-30 13:33:05 +02:00
Christoph Oelckers
b07a43a9db - Duke: fixed ChangeType to also change the actor's base pic. 2023-04-30 13:33:05 +02:00
alexey.lysiuk
a69d904192 - fix GCC/Clang compilation error
source/games/duke/src/types.h:178:14: error: exception specification of overriding function is more lax than base version
2023-04-30 13:14:45 +03:00
Christoph Oelckers
ecfa45c3ec - Duke: fixed animation lookup code. 2023-04-30 10:51:48 +02:00
Christoph Oelckers
b55d39e58d - fixed invocation of RunState. 2023-04-30 10:51:48 +02:00
Christoph Oelckers
83c401574c - remove debug check 2023-04-30 10:51:48 +02:00
Christoph Oelckers
4010fc1aa7 - Duke: init the animation arrays early.
app_init is too late for having the data set up during script compilation.
2023-04-30 10:51:48 +02:00
Christoph Oelckers
96b0542cd8 - flag all actors that override RunState.
This is for allowing quick checks of actors which need the special consideration.
2023-04-30 09:01:28 +02:00
Christoph Oelckers
2a38e83a2f - moved the animation code out of execute so it can be used without CON. 2023-04-30 08:57:28 +02:00
Christoph Oelckers
29322777dd - adapt the animation init code for CON replaced actors and consolidated the two cases. 2023-04-30 08:46:51 +02:00
Christoph Oelckers
21a37d2c07 - added helpers needed to run CON replacement code.
* killit must exit to the top level right away. Use an exception for this.
* two new flags to make checking easier.
* do not export killit_flag to scripting.
2023-04-30 08:11:30 +02:00
Christoph Oelckers
960e58cdf2 - move the action default propeerties into FActorInfo 2023-04-30 08:07:10 +02:00
Christoph Oelckers
9d43729e8c get rid of the killit_flag in the parse state.
Use the one in the actor instead.
2023-04-30 08:04:56 +02:00
Christoph Oelckers
4e8dfe8986 - got rid of the laat picnums in Blood. 2023-04-29 11:32:04 +02:00
Christoph Oelckers
a662a3bd12 - another bunch of picnums in Blood removed.
4 remaining after this.
2023-04-29 11:32:04 +02:00
Christoph Oelckers
83dfd77bd0 - eliminate picnums in QAV code. 2023-04-29 11:32:04 +02:00
Christoph Oelckers
9a703639cb - final cleanup of Blood/Exhumed changes. 2023-04-29 11:32:04 +02:00
Christoph Oelckers
01b6d9f27f - eliminated all remaining uses of picnum in Exhumed. 2023-04-29 11:32:03 +02:00
Christoph Oelckers
44e9a66319 - handle 3 more of Exhumed's picnums that were quick to refactor 2023-04-29 11:32:03 +02:00
Christoph Oelckers
0e097903c4 - got rid of a large chunk of picnum accesses in Exhumed. 2023-04-29 11:32:03 +02:00
Christoph Oelckers
f115f9427d - got rid of a few more picnum references in Blood. 2023-04-29 11:32:03 +02:00
Christoph Oelckers
76c0de2ef1 - moved some of Blood's precaching info to external data. 2023-04-29 11:32:03 +02:00
Christoph Oelckers
52706e9afd - handle the direct assignments of values to picnum in Blood. 2023-04-29 11:32:02 +02:00
Christoph Oelckers
36c07aaca5 - did some simple picnum replacements in Blood. 2023-04-29 11:32:02 +02:00
Christoph Oelckers
47f9642294 - added compile time validation for SetAction, SetAI and SetMove.
the expression classes were deleted again, this can be done without them.
2023-04-29 10:09:36 +02:00
Christoph Oelckers
f1f1e54e04 - moved the remaining content of the flags* files directly into game.cpp 2023-04-29 09:59:54 +02:00
Christoph Oelckers
bfcceccc98 - consolidated checkhitdefault functions. 2023-04-29 09:58:42 +02:00
Christoph Oelckers
6fd4368592 - moved Duke/RR's tile name list to raze.pk3, now that internally it is not used anymore.
This way it can later also be used by editors.
2023-04-29 09:55:48 +02:00
Christoph Oelckers
44f4104eda - got rid of the last tilenum uses in Duke.
This meant refactoring the crosshair drawer to work on a named texture called "CROSSHAIR" and hard coding the magic numbers for spawndebris.
2023-04-29 09:54:15 +02:00
Christoph Oelckers
bb08a118d9 - replaced the sprite precaching code with one that scans the actual content.
This will currently not do proper precacing for Duke, which requires actions to be defined as the ones from CON cannot be assigned to an actor.
2023-04-29 09:53:52 +02:00
Christoph Oelckers
83eb4852f7 - do not use literal tile numbers for initializing WW2GI's weapon gamevars.
Instead use the type numbers of the items to be spawned so it is derived from configurable data.
2023-04-29 09:51:51 +02:00
Mitchell Richters
312b649d93 - Duke: Pass HUD offsets to bike/moto drawers by const reference. 2023-04-29 09:19:09 +02:00
Christoph Oelckers
f278a29fad - migrated all RR weapons to texture names. 2023-04-29 09:16:55 +02:00
Christoph Oelckers
5d4f137623 - migrated Duke's entire HUD weapon code to texture names. 2023-04-29 09:16:46 +02:00
Christoph Oelckers
d5f1a82f21 - Duke shotgun and chaingun handled. 2023-04-29 09:13:42 +02:00
Christoph Oelckers
1aa88bd201 - more HUD refactoring 2023-04-29 09:13:28 +02:00
Christoph Oelckers
8f61abdf75 - more HUD refactoring and fixed issues with badly named textures crashing the precacher. 2023-04-29 09:08:42 +02:00
Christoph Oelckers
8a331e226f - handle cases where CON tries to spawn unknown actors.
It must fall back to spawning an inert sprite in these cases, not just fail.
2023-04-29 07:06:53 +02:00
Christoph Oelckers
34160a4354 - ported the scuba mask drawers to texture IDs.
These were also the last places in Duke using tileWidth and tileHeight.
2023-04-29 07:06:42 +02:00
Mitchell Richters
ef81e713e2 - Exhumed: Clamp off vale in fix from adbd5c3c69.
* Fixes example situations where the player is underwater and smashing against the ceiling, etc.
2023-04-28 19:30:14 +10:00
Mitchell Richters
742d76a4bf - Exhumed: Tidy up some unnecessarily nested if statements in movespritez(). 2023-04-27 22:51:30 +10:00
Mitchell Richters
adbd5c3c69 - Exhumed: Fix velocity loss in movespritez() when warping.
* Old code was adjusting the actor's Z to right off the ceiling with no factoring in of the old interpolation position.
* Due to this, we were hitting the `nCamerapos.Z = min(max(nCamerapos.Z, pSector->ceilingz + 1), pSector->floorz - 1);` bounding in the draw code.
* Since game puts you right at the ceiling, we apply this to the old interpolation position, as well as the current position, however we then add their velocity back onto the current position to make the warp seamless.
2023-04-27 22:51:30 +10:00
Mitchell Richters
78df82e1ed - Exhumed: Clean up loHit global in move.cpp.
* More lazy arg passing via a global...
2023-04-27 22:51:30 +10:00
Mitchell Richters
4c5339274d - Exhumed: Fix bad velocity zeroing from ece41ac84c. 2023-04-27 21:32:36 +10:00
Mitchell Richters
3edc1a5a5a - Exhumed: Make getSequence() return a pointer instead of a reference.
* Gets rid of the awkward `operator[]()` calls.
* Gets rid of `std::ref()` setup in gun.cpp.
* Ensures a copy isn't made if the caller accidentally leaves off an ampersand.
* Allows us to use a consistent getter for native code and VM exports.
2023-04-27 20:16:14 +10:00
Mitchell Richters
ea7fe0e0b4 - Exhumed: Add fixSeqs() and use it to patch OOB issue with skulstrt.seq. 2023-04-26 20:27:28 +10:00
Mitchell Richters
33d4809663 - Exhumed: Ensure sequence data cannot be changed via the getters. 2023-04-26 20:13:26 +10:00
Mitchell Richters
64c47b0385 - Exhumed: Slightly tune damage pushback from previous commit.
* The logic here is that the player's running/double speed velocity is scaled by 0.375 in `updatePlayerVelocity()`, so 0.1875 is half of that scale.
2023-04-25 20:07:10 +10:00
Mitchell Richters
64745dff89 - Exhumed: Allow damage pushback behind CVAR cl_exdamagepush.
* Fixes #907.
* Works in conjunction with ece41ac84c by using the player actor's velocity.
* Original game blanket reset the sprite/actor's vel each tic which cancelled this out.
* Original damage value is far, far too high. Had to scale it back by 1024 units to make it reasonable!
2023-04-25 19:55:05 +10:00
Mitchell Richters
0a6ff79f4f - Exhumed: Give runlist_CheckRadialDamage() a bit of a tidy. 2023-04-25 19:44:25 +10:00
Mitchell Richters
ece41ac84c - Exhumed: Move player's velocity back into the actor, again.
* Was done in 67c7dd65f9 but caused issues.
* Reverted in 3d6f1e1a04 to ensure the game worked as expected.
* Actual problem identified and isolated to remove this duplication.
2023-04-25 19:36:46 +10:00
Mitchell Richters
7c2bd266b9 - Exhumed: Fix incorrect distance check operator for the rat. 2023-04-25 18:39:56 +10:00
Mitchell Richters
fe356f3183 - Exhumed: Fix OOB frame with the rat.
* No idea what this does in the original source... plays the first frame of the next sequence?
2023-04-25 18:18:26 +10:00
Mitchell Richters
52ab0fae19 - Duke: Allow reversing while moving forwards to act as the brake.
* Much more intuitive for controllers.
2023-04-25 11:30:48 +10:00
Mitchell Richters
6d2e114dec - Duke: Move moto tilt scaling into main tilt function, not within the draw code. 2023-04-25 08:37:38 +10:00
Mitchell Richters
6004a9fb5a - Exhumed: Fix bad jump setup from c252b19e9a. 2023-04-24 23:27:02 +10:00
Mitchell Richters
fd1c3dffe8 - Duke: Allow view tilting for RRRA vehicles on separate CVAR.
* Tilts at the same angle as the HUD.
2023-04-24 23:20:14 +10:00
Mitchell Richters
918789705f - Duke: Use the player's angle when adjusting vehicle's HUD rotation. 2023-04-24 22:44:22 +10:00
Mitchell Richters
6ac2af9f3c - Duke: Convert RRRA's vehicle HUD tilting to a DAngle. 2023-04-24 22:17:37 +10:00
Mitchell Richters
11181f51f8 - Allow roll input through the packet system, giving us 6DOF for VR usage, etc. 2023-04-24 21:31:21 +10:00
Mitchell Richters
8e3df00b8b - SW: Hook up InputPacket::uvel to relevant code. 2023-04-24 21:01:32 +10:00
Mitchell Richters
67390511b7 - Blood: Hook up InputPacket::uvel to relevant code. 2023-04-24 19:06:48 +10:00
Mitchell Richters
c252b19e9a - Exhumed: Hook up InputPacket::uvel to relevant code. 2023-04-24 19:06:48 +10:00
Mitchell Richters
80f2afd6a4 - Exhumed: Slightly tidy up updatePlayerWeapon(). 2023-04-24 19:06:46 +10:00
Mitchell Richters
e29726370c - Exhumed: Tidy up two if statements in AIPlayer::Damage(). 2023-04-24 19:03:04 +10:00
Mitchell Richters
afcc65c332 - Duke: Hook up InputPacket::uvel to remainder of relevant code. 2023-04-24 18:27:44 +10:00
Mitchell Richters
09ab66b8c9 - Duke: Clean up p->GetActor() calls in movement() funcs. 2023-04-24 16:16:07 +10:00
Christoph Oelckers
1c7ca7b63a - moved all indirect precaching info to external definition files. 2023-04-23 17:43:22 +02:00
Christoph Oelckers
6924869895 - store texture IDs in the sprite set. 2023-04-23 17:42:07 +02:00
Christoph Oelckers
1bace1d508 - use texture IDs in the spawn records. 2023-04-23 17:33:50 +02:00
Christoph Oelckers
4692cc55f7 - cleaned up checkhitdefault
Only required 4 new flags plus one property...
2023-04-23 17:33:36 +02:00
Christoph Oelckers
125ea52e57 - handle special case for activation sounds when player bumps into other actors. 2023-04-23 17:33:35 +02:00
Christoph Oelckers
fd7a4e050a - no more picnum in gameexec.cpp 2023-04-23 12:15:36 +02:00
Christoph Oelckers
cd2cb8d60e - minor cleanup 2023-04-23 12:15:36 +02:00
Mitchell Richters
a731db95ae - Add initial support for up/down movement within the game, either by key or joystick axis.
* Started with Duke's jetpack, other games to follow for swimming, etc.
2023-04-23 19:53:45 +10:00
Mitchell Richters
87144564fd - Duke: Consolidate the mostly duplicate underwater() functions. 2023-04-23 19:21:04 +10:00
Mitchell Richters
02325c37bc - Duke: Fix incorrect scaling of underwater bubble. 2023-04-23 19:21:04 +10:00
Mitchell Richters
8db8d43f89 - Duke: Tidy up underwater(). 2023-04-23 19:21:04 +10:00
Mitchell Richters
95fe3d1bc4 - Duke: Tidy up operateJetpack(). 2023-04-23 19:21:04 +10:00
Mitchell Richters
eca8526c11 - Exhumed: Unlimit the SeqNames[] array. 2023-04-23 19:20:19 +10:00
Mitchell Richters
19501f3ed0 - Exhumed: Fix some typos in comments. 2023-04-23 19:19:47 +10:00
Mitchell Richters
e60e767232 - Break down some increasingly long lines in GameInput::processMovement(). 2023-04-23 19:19:26 +10:00
Christoph Oelckers
07c4b61260 - make sure that the aplWeapon* stuff is never accessed outside of WW2GI. 2023-04-23 10:45:44 +02:00
Christoph Oelckers
f0a6c4ecd8 - check for NOGRAVITY in 'fall'. 2023-04-23 10:45:44 +02:00
Christoph Oelckers
17a8dd5c2e - added tile names for all of Vacation's new actors.
Although several just replace existing actors, we want different names for these when replacing them.
2023-04-23 10:45:44 +02:00
Christoph Oelckers
4c1e379149 - only declare the weapon gamevars for WW2GI.
none of the other games uses any of this.
2023-04-23 10:45:44 +02:00
Christoph Oelckers
d5fa2d73ad - removed code for unused ATWITH gamevar. 2023-04-23 10:45:44 +02:00
Christoph Oelckers
fc0c8e0787 - NOHITJIBS flag. 2023-04-23 10:45:44 +02:00
Christoph Oelckers
91ee3cb7b8 - got rid of the picnum CreateActor variant. 2023-04-23 10:45:43 +02:00
Christoph Oelckers
a6600c200f - a lot of simple picnum or TILE_* replacements. 2023-04-23 10:45:43 +02:00
Christoph Oelckers
5d43975467 - store class pointers in weaprecs. 2023-04-23 10:36:39 +02:00
Christoph Oelckers
2f78a10ce1 - don't use picnum to address gs.actorinfo 2023-04-23 10:36:39 +02:00
Christoph Oelckers
b56aa1e1a3 - no more picnum in spawn CCMD 2023-04-23 10:36:38 +02:00
Christoph Oelckers
745275dc24 - use texture names for special player sprites, 2023-04-23 10:36:38 +02:00