Commit graph

1977 commits

Author SHA1 Message Date
Christoph Oelckers
d819d5c862 - DoActorPickClosePlayer 2021-11-29 00:55:04 +01:00
Christoph Oelckers
125159772d - CanHitPlayer 2021-11-29 00:55:04 +01:00
Christoph Oelckers
ceb3ac2e5b - CanSeePlayer 2021-11-29 00:55:04 +01:00
Christoph Oelckers
a2dee7681a - DoActorNoise 2021-11-29 00:55:04 +01:00
Christoph Oelckers
3dbd002319 - DoActorSetSpeed + ActorFlaming. 2021-11-29 00:55:03 +01:00
Christoph Oelckers
ec9ab56ece - use collision struct in ActorMoveHitReact 2021-11-29 00:55:03 +01:00
Christoph Oelckers
2a897c0582 - SW hit code abstraction. 2021-11-29 00:55:03 +01:00
Christoph Oelckers
077c4f19a7 - ActorMoveHitReact + DebugMoveHit 2021-11-29 00:55:03 +01:00
Christoph Oelckers
c7f6b7a8c2 - DoFall + DoBeginFall. 2021-11-29 00:55:03 +01:00
Christoph Oelckers
dc6ea40911 - DoFall 2021-11-29 00:55:02 +01:00
Christoph Oelckers
2a56479e3e - DoBeginJump 2021-11-29 00:55:02 +01:00
Christoph Oelckers
9375a64ccc - cleanup only. 2021-11-29 00:55:02 +01:00
Christoph Oelckers
9e438b4042 - DoActorBeginSlide 2021-11-29 00:55:02 +01:00
Christoph Oelckers
ad0ed0c377 - KeepActorOnFloor 2021-11-29 00:55:02 +01:00
Christoph Oelckers
2ba98dc03c - minor cleanup, DoDebrisCurrent, move_debris, DoGenerateSewerDebris 2021-11-29 00:55:01 +01:00
Christoph Oelckers
ee8f6460c1 - DoActorDie 2021-11-29 00:55:01 +01:00
Mitch Richters
5d07c768b2 - SW: Tidy up use of cl_nomeleeblur use within panel code. 2021-11-29 00:55:01 +01:00
Mitch Richters
e491d15ff9 - Move InputScale() out of inputstate.cpp and into i_time.cpp as I_GetInputFrac() to make it available to GZDoom for potential future requirements.
* As part of this, feed the output of `I_GetInputFrac()` to `gi->GetInput()` instead of having each game's virtual override calling it locally.
2021-11-29 00:55:01 +01:00
Christoph Oelckers
dc1d97b6bd - SW: fix bad return value in QueueWallBlood.
Had been known for some time, it just wasn't unclear if this is bad.
Now I was able to confirm that this is indeed bad and can cause crashes.
2021-11-13 19:30:16 +01:00
Christoph Oelckers
01deb13694 - SW: fixed NORM_xxx macros
kHitIndexMask already has the -1 considered, it is 0x3fff.
2021-11-12 11:09:24 +01:00
Christoph Oelckers
8f19dc12d8 - SW: code/data pointer saving cleanup.
* a large number of code pointer records were removed because none of these functions ever gets assigned to a pointer
* instead of looking up entries by index, do it by name. This is far less fragile and will survive deeper refactoring. The old storage by table index will break as soon as a single entry gets removed.

Since the old savegames got broken due to this problem recently it was a good time to change the setup.
2021-11-11 23:28:28 +01:00
Christoph Oelckers
2164d244d2 - SW: removed 3 unused global arrays. 2021-11-11 21:58:14 +01:00
Christoph Oelckers
25a6774540 - SW: got rid of MAXWALLS.
Only places left are declarations of global arrays.
2021-11-11 21:58:14 +01:00
Christoph Oelckers
b6579809ad - SW: eliminated all remaining MAXSECTORS references, except static array declarations. 2021-11-11 21:58:14 +01:00
Christoph Oelckers
75e2d801a7 - SW: only check valid sectors for SecUser entries. 2021-11-11 21:58:14 +01:00
Christoph Oelckers
6bd239c5b7 - SW: use the global sector list in PreMapCombineFloors 2021-11-11 21:58:14 +01:00
Christoph Oelckers
a79f7a3784 - SW: use a dynamic array to track already visited sectors in TraverseBreakableWalls. 2021-11-11 21:57:55 +01:00
Christoph Oelckers
f2e344a235 - removed magic flags added to sector indices in Polymost.
These are better done as separate function arguments.
2021-11-11 21:28:53 +01:00
Mitch Richters
3c4afaa6ee - InputScale(): Add enabled-by-default scaler to returned value from function to correct drift that occurs as the frame-rate increases, taking into account different scaling ratios needed for differing ticrates. 2021-11-10 20:27:19 +11:00
Christoph Oelckers
a35900362e - only use un-deprecated variants of updatesector(z) in SW. 2021-11-09 00:09:48 +01:00
Christoph Oelckers
94b2b0af31 - widen sector index in engineLoadBoard to 32 bit 2021-11-09 00:07:00 +01:00
Christoph Oelckers
762ebafc2a - made clipmoveboxtracenum a function argument of clipmove
There’e zero need for hackery here.
2021-11-08 23:22:48 +01:00
Christoph Oelckers
2d91786516 - changed all sector variables being passed to pushmove to full ints 2021-11-08 23:18:40 +01:00
Christoph Oelckers
a5f51cfd88 - SW: migrate everything to the main clipmove function 2021-11-08 23:11:30 +01:00
Christoph Oelckers
16f9d4ec36 - got rid of COVERupdatesector
Not needed as it just forwards to the engine’s updatesector - and it gets in the way of other changes
2021-11-08 23:11:30 +01:00
Christoph Oelckers
d20aa47adf - made sector parameter of updatesectorz an int and deprecated the short version. 2021-11-06 19:27:51 +01:00
Christoph Oelckers
83fe41e71e - made updatesector receive a 32 bit int pointer and deprecated the 16 bit variant. 2021-11-06 15:53:16 +01:00
Christoph Oelckers
389f760d45 - address C++20 deprecation warnings with enums in floating point arithmetic. 2021-11-02 23:32:31 +01:00
Mitch Richters
59850fa768 - SW: When adjusting horizon in DoPlayerDeathHoriz(), just use integer horizon values and not Q16.16. 2021-11-02 10:29:31 +11:00
Christoph Oelckers
86166f5e67 Revert "- xs_Float.h: Make all inlines return an unsigned value, and change previous unsigned inlines to signed."
Revert "- `xs_Float.h`: Add `getint()` getter to `_xs_doubleints` struct."
Revert "- SW: When adjusting horizon in `DoPlayerDeathHoriz()`, just use integer horizon values and not Q16.16."
Revert "- Duke (RR): Clean up some unnecessary `FixedToFloat()` usage with the `fixedhoriz` `asbuildf()` method."
Revert "- `binaryangle.h`: Use `constexpr` on inline functions where it was previously not possible to do so."
Revert "- `m_fixed.h`: Use `constexpr` on inline functions where it was previously not possible to do so."
Revert "- `xs_Float.h`: Convert header to `constexpr`."

This does nor work as it violates the constexpr rules for unions. The code will error out on compilation for accessing an inactive member of a union.
2021-11-01 20:25:38 +01:00
Mitch Richters
3e25637385 - SW: When adjusting horizon in DoPlayerDeathHoriz(), just use integer horizon values and not Q16.16. 2021-11-01 23:37:32 +11:00
Mitch Richters
eb8b075727 - binaryangle.h: Change binangle bitshift operators to operate on signed value to properly handle angles > 1024. 2021-11-01 22:13:39 +11:00
Mitch Richters
6ca6d5639b - SW: Fix horizon of camera screens originating from changes in 09a05f354c. 2021-10-31 11:06:13 +11:00
Mitch Richters
9495b9e6d0 - SW: Interpolate the player's weapon recoil.
* Reported as missing by @nashmuhandes.
2021-10-31 08:53:26 +11:00
Christoph Oelckers
e8f9afb174 - DoScaleSprite. 2021-10-30 17:30:03 +02:00
Christoph Oelckers
e84d61e80a - redid the iterators in _polymost.cpp. 2021-10-30 17:30:03 +02:00
Mitch Richters
f0a347263a - SW: Replace use of getzrange_old() inline wrapper with getzrange() and remove inline wrappers. 2021-10-30 17:30:02 +02:00
Mitch Richters
add3481e40 - SW: Replace use of pushmove_old() inline wrapper with pushmove() and remove inline wrappers. 2021-10-30 17:30:02 +02:00
Mitch Richters
adcdbdc931 - SW: Replace use of clipmove_old() inline wrapper with clipmove() and remove inline wrappers. 2021-10-30 17:30:02 +02:00
Christoph Oelckers
57b638f26f - use std::clamp instead of our homegrown version. 2021-10-30 10:35:00 +02:00
Christoph Oelckers
509124c1dd - redid SW action interface to use a separate wrapper class from USER.
Turned out that not all sprites in the world have a USER, so we need something different to wrap the game's sprite data.
2021-10-29 20:55:31 +02:00
Christoph Oelckers
8bad95c7c6 - reinstated deleted saveable_code entries with dummy pointers.
This is to preserve savegame compatibility for now.
Later the code pointer saving needs a thorough cleanup.
2021-10-29 09:16:07 +02:00
Christoph Oelckers
e241e7dc52 - SW: changed Animator interface to use USERp parameters. 2021-10-28 23:37:07 +02:00
Christoph Oelckers
62d0d3712e - use a sprite flag to mark mapped sprites.
This avoids another global array which needs to be addressed by sprite index.
2021-10-14 15:09:43 +02:00
Christoph Oelckers
a358cf8516 - SW: eliminated all SPRITE_TAG# macros. 2021-10-12 22:21:08 +02:00
Christoph Oelckers
afce1aba88 - SW: eliminated the only use of the SPRITE_TAG1 macro. 2021-10-11 23:02:54 +02:00
Christoph Oelckers
7eac8b71d5 - removed unused constants 2021-10-10 11:47:19 +02:00
Christoph Oelckers
2af688dd62 - replaced RANDOM_RANGE macro with direct calls to RandomRange 2021-10-10 11:47:19 +02:00
Christoph Oelckers
cc912fbf93 - removed pointless BOUND_4PIX macro 2021-10-10 11:47:19 +02:00
Christoph Oelckers
3220a6d786 - some SW cleanup 2021-10-10 11:47:19 +02:00
Christoph Oelckers
6f8a5ee2d2 - Exhumed: replaced a large amount of sprite array accesses with pointers.
No logic changes, this is mainly search & replace.
2021-10-10 11:47:18 +02:00
Christoph Oelckers
948f194064 - fixed warnings in Duke. 2021-10-08 19:21:29 +02:00
Christoph Oelckers
0e82d75325 - SW: fixed recursive saving of panel sprites 2021-09-12 18:17:50 +02:00
Christoph Oelckers
bad57f6a5f - clear pspAsArray at the beginning of a save/load operation, not at the end.
If done at the end it may leave behind some stale data if saving or loading fails for some reason.
2021-09-12 18:17:50 +02:00
Christoph Oelckers
e13426ec6e - SW: avoid crashing when unwinding from a savegame loading error.
The linked list may be incomplete in this case.
Also kept the macro unmangling done to debug this code.
2021-09-12 18:17:50 +02:00
Christoph Oelckers
90b7524706 - SW: fixed episode indexing resulting in bad display on the automap. 2021-08-24 09:57:36 +02:00
Christoph Oelckers
5aa27bad3b - flag SW's cutscenes as 'boss death only'. 2021-08-13 22:25:13 +02:00
Mitchell Richters
32215ba570 - SW: Tidy some extra panel coordinate math that was missed in 4d4946fb6b. 2021-07-29 17:53:57 +10:00
Christoph Oelckers
9a8ee00aec - set currentLevel before calling engineLoadBoard.
This is needed if the compatibility patcher needs to alter mapinfo data.
2021-07-27 22:12:29 +02:00
Christoph Oelckers
1fde9f2173 - workaround to allow playing SW's Last Warrior mod in one go.
This disables the boss's death in L4 ending the game and just advances to the next level.
This seems to be the intent with this mod as the second episode starting at L5 is not defined and the first episode's subtitle advertises the full game.
2021-07-26 00:58:00 +02:00
Mitchell Richters
d9a7465c08 - SW: Remove gi->FreeGameData() from game as its inside code wasn't freeing game data but level data already freed in gi->FreeLevelData().
* This was causing `GameMain()` to try to call `TerminateLevel()` after tile data had been freed, causing a hard stop.
* Fixes #464.
2021-07-20 20:11:29 +10:00
Mitchell Richters
675356be1a - Ensure g_nextskill is used everywhere so that setting skill for next level works properly. 2021-07-20 18:51:34 +10:00
Mitchell Richters
33845c4a23 - Add skill CCMD to return player's current skill, while also being able to set skill for next game.
* Fixes #332.
2021-07-20 18:50:58 +10:00
Mitchell Richters
77630dcbc7 - Rename DeferedStartGame() to DeferredStartGame(). 2021-07-20 18:43:17 +10:00
Mitchell Richters
5441272bec - SW: Create inline function pspPresentRetractScale() to scale the rate at which weapons present and retract based on the current tile's height vs. the original asset's height.
* Reported to me by @Phredreeke, who had it reported to him from someone else.
* The sword in the widescreen assets pack we load by default has a height of 216px vs 136px of the default tile.
* Because the game presents and retracts weapons at a set rate, the time it took to swap between the sword and other weapons took ~1.58x longer than the original assets.
* This speeds up the present/retract rate based on the loaded asset's height to ensure the weapon switches in the same elapsed time.
* This may be extended to other weapons if required but the sword is the only one I'm aware of that has more height.
* Confirmed no matter what motion the sword was performing, `psp->picndx` was always 2080 so we shouldn't need a hashtable or anything like this.
2021-07-11 19:22:59 +10:00
Christoph Oelckers
1b45c83d59 - SW: fixed countermeasure for empty lower skills 2021-07-11 08:24:10 +02:00
Mitchell Richters
172b77b9e7 - SW: Ensure PANEL_SPRITEstruct's ox/oy values are in the save data. 2021-07-11 12:05:53 +10:00
Mitchell Richters
9d64779da0 - SW: Replace all uses of NULL with nullptr. 2021-07-10 22:25:18 +10:00
Mitchell Richters
e3f2d76378 - SW: Declare and initialise variables in pWeaponBob() vs declaring and initialising later on to reduce warnings about variables being uninitialised. 2021-07-10 22:16:51 +10:00
Mitchell Richters
5d7938c24e - SW: Rename cl_smoothsway to cl_swsmoothsway and enable by default 2021-07-10 22:07:05 +10:00
Mitchell Richters
55cef642b6 - SW: Factor out bob coordinate backups. 2021-07-10 22:01:42 +10:00
Mitchell Richters
9575f8a3d3 - SW: Factor out panel interpolation backups; 2021-07-10 22:01:40 +10:00
Mitchell Richters
4d4946fb6b - SW: Factor out repeated panel coordinate math into inline functions. 2021-07-10 22:01:37 +10:00
Mitchell Richters
27f1e487a2 - SW: Remove fixed-point math from panel x/y coordinate updating. 2021-07-10 22:01:35 +10:00
Christoph Oelckers
64fc0b66b2 - SW: added countermeasure to re-enable lower skills on mods not implementing them.
Aside from spawning the enemies from the lowest supported skill it will also reduce the threat level by reducing health of some enemies or by replacing the harder Ninja variants with the base type.
2021-07-06 10:26:43 +02:00
Mitchell Richters
0724b3326c - SW: Promote PANEL_SPRITEstruct's xorig/yorig values from int to double to match x/ox and y/oy respectively.
* Makes bobbing a touch smoother.
* Removes 47 explicit casts.
2021-06-27 22:40:33 +10:00
Christoph Oelckers
5e96e955f3 - add hitscan only autoaim for SW.
# Conflicts:
#	source/games/sw/src/weapon.cpp
2021-06-26 12:22:10 +02:00
Christoph Oelckers
2af2d29084 - add hitscan only autoaim for SW. 2021-06-26 12:18:27 +02:00
Christoph Oelckers
454816299e - reorganized loading of textures.
Due to dependencies on initializing some data in app_init it was not possible to cleanly set up the fonts.
This adds a game-side function for loading the entire palettes before starting with the texture data and another one for loading game-side texture data.
This now allows fully setting up the palettes before starting with the textures and to fully set up the textures before reading the .def files.

All this is needed because to properly initialize, the fonts need to be able to access the fully initialized texture state, including replacements and hires substitutions from the .def files.
2021-06-01 11:05:26 +02:00
Christoph Oelckers
8b507ed606 - enabled the ENDOOM-like text screens when quitting Duke and SW.
Turned out that all they needed was the font.
2021-05-31 23:16:52 +02:00
Christoph Oelckers
9c60ab791b - implemented all needed font overrides for localization. 2021-05-31 21:20:31 +02:00
Christoph Oelckers
af781e0422 - moved all font setup out of the C++ code.
All internal fonts now get defined through FONTDEFS.
Also fixing a few offsets.
2021-05-31 21:20:31 +02:00
Christoph Oelckers
42b70a7d93 - added internationalized fonts.
This still needs a bit of fixing and tweaking but most is working.
2021-05-31 21:20:30 +02:00
Christoph Oelckers
a7921e4c01 - use the same formula as Duke to offset SW's shadows in Polymost. 2021-05-29 14:04:57 +02:00
Christoph Oelckers
1ea09cd3d2 - removed bogus assert in SW's track setup.
One of the stock maps (WT $airport map.) triggers this assert so it cannot remain.
2021-05-29 13:22:14 +02:00
Christoph Oelckers
8fae793341 - defined a new constant, CR_NATIVEPAL, to use the font functions with a predefined palette.
This is mainly for code clarification, the value is the same as CR_UNDEFINED.
2021-05-29 11:47:05 +02:00
Christoph Oelckers
d44500863b - removed the multiplayer scoreboard screens.
Since there is no plan to keep them in case MP gets implemented there's no need to maintain them.
These should later be replaced by a generic screen using a better font and a layout that takes higher resolutions into account.
2021-05-27 13:33:54 +02:00
Christoph Oelckers
e10bcf6294 - split the screen job code into a generic and a Raze specific part.
Preparations for porting this to GZDoom.
2021-05-22 01:35:50 +02:00
Christoph Oelckers
e5236d3423 - SW: fixed sector transfers involving a portal for real this time.
It is not enough to just copy the properties - if this happens the entire portal needs to be reinitialized. The only way to do this is to run CollectPortals again to reset all portals in the map.
2021-05-20 18:52:27 +02:00
Rachael Alexanderson
a75ed91796 - this crash was handled by nothing more than an assert... 2021-05-20 11:02:11 -04:00
Christoph Oelckers
1d7f4c1f2b - SW: fix sector property transfers involving a portal. 2021-05-18 00:26:57 +02:00
Christoph Oelckers
ee559b7ba9 - removed all leftover parts of the native status bars. 2021-05-16 10:35:33 +02:00
Christoph Oelckers
83f151529b - fixed SW status bar. 2021-05-16 10:25:56 +02:00
Christoph Oelckers
8d8b3cda46 - scriptified SW's status bar.
Not tested yet. This just compiles without errors.
2021-05-16 09:34:08 +02:00
Christoph Oelckers
d311792e06 - engine side preparations for Duke Statusbar scriptification.
Mainly, gotweapon had to be reverted to a flat bool array to avoid implementing FixedBitArray for the VM.
Also adding a few new tile names and PushV for string arrays.
2021-05-15 10:44:35 +02:00
Christoph Oelckers
645ea1e1ae - SW: better handling for bogus ladders.
If there is no back sector, use the front sector of the wall as the ladder sector.
This at least fixes the badly defined ladder in Wanton Destruction's first map.
2021-05-13 23:28:29 +02:00
Christoph Oelckers
fb21e39de5 - fixed remaining SW warnings. 2021-05-12 21:50:00 +02:00
Christoph Oelckers
1085b0b7a2 - first batch of SW warning fixes. 2021-05-12 21:49:34 +02:00
Christoph Oelckers
d097c8e635 - removed the non-functional and long abandoned level music alias feature.
With RMAPINFO such a hack is no longer needed for anything.
2021-05-12 21:48:40 +02:00
Christoph Oelckers
03289f5097 - silenced some warnings. 2021-05-12 21:47:32 +02:00
Christoph Oelckers
4c161ae403 - SW: fixed signed-ness issues with SOP-related angle checks. 2021-05-12 00:10:02 +02:00
Christoph Oelckers
633d205d80 - SW: fixed ammo pickup amount. 2021-05-12 00:01:19 +02:00
Christoph Oelckers
bde644f77f - SW: replaced some asserts with proper value checks.
These asserts can actually be triggered by some maps with incorrect setups.
2021-05-11 00:59:23 +02:00
Christoph Oelckers
ae94fb921c - SW: Abort GetInput immediately if no valid sprite is attached to the given player. 2021-05-11 00:52:39 +02:00
Christoph Oelckers
3194efc646 - SW: processWeapon must check for valid player sprites.
On map start it can happen that this gets called with an incompletely set up map.
2021-05-11 00:21:50 +02:00
Christoph Oelckers
e40ed2262e - cleanup of 'gotpic' handling. 2021-05-10 20:13:28 +02:00
Cacodemon345
ce4b748ff0 Fix compilation with Clang on FreeBSD 2021-05-09 19:52:52 +02:00
Christoph Oelckers
3dfc3e73d2 - only process actually existing mirrors when updating their state. 2021-05-08 15:23:45 +02:00
Kevin Caccamo
6e1554d7ae Fix mirror updates in Shadow Warrior 2021-05-08 14:58:20 +02:00
Christoph Oelckers
df6a9823e3 - fixed incorrect license in sw/d_menu.cpp.
Should be GPL 2+, not GPL 2.
2021-05-08 00:13:50 +02:00
Christoph Oelckers
db1cf63e7a - SW: fixed bad type for ceiling portals. 2021-05-07 00:23:56 +02:00
Christoph Oelckers
c679f83f75 - make all games return to the main menu when the game is ended with F10.
Duke still went to the intro movies which was a bit problematic.
2021-05-04 11:32:09 +02:00
Christoph Oelckers
0659bda6b6 - SW: clear old user content before allocating a new one.
If old data gets in here it may break the game.
https://github.com/coelckers/Raze/issues/349
2021-05-04 11:11:38 +02:00
Christoph Oelckers
7d77b2315f - merged the few remaining contents of mmulti.h into d_net.h 2021-05-03 19:01:00 +02:00
Christoph Oelckers
56fcf904b5 - Backend update from GZDoom. 2021-05-03 14:48:55 +02:00
Christoph Oelckers
8003ab6fa3 Merge branch 'scriptable_cutscenes' into newrenderer 2021-05-02 22:37:46 +02:00
Christoph Oelckers
dfd47ea33a - migrated SW to RMAPINFO as well.
Also removed the 'definecutscene' code from the .def parser as this was never meant to be more than a temporary solution.
2021-05-02 17:35:25 +02:00
Christoph Oelckers
1798380f23 - adapted map transition in Duke/RR.
There's still some issues which will be taken care of by adding map flags.
2021-05-02 10:35:43 +02:00
Christoph Oelckers
93bfc35ad6 - use the volumes to find the starting maps for the menu and the clusters for the cutscenes. 2021-05-02 01:01:30 +02:00
Christoph Oelckers
825963661b - migrated volumes to the new storage. 2021-05-02 00:35:56 +02:00
Christoph Oelckers
727244d52d - changed 3 places to call the proper map progression function.
These ignored the explicit settings in the map definition.
2021-05-01 23:10:04 +02:00
Christoph Oelckers
5959543380 - hooked up SW's intermission handling. 2021-04-30 20:08:36 +02:00
Christoph Oelckers
aa148d602c - scriptified SW's 2D screens.
Compiles but not tested yet.
2021-04-30 20:08:35 +02:00
Christoph Oelckers
0dc6980e5c - made episode intro cutscenes a game independent feature.
So far only defined for Duke E4 but all the logic is outside the game code now and can be universally handled.
2021-04-30 20:08:33 +02:00
Christoph Oelckers
1166b00af2 - switched intro movie playing over to the new system
Not tested yet.
2021-04-30 20:08:32 +02:00
Christoph Oelckers
e05f900315 - added the data structures to hold the cutscene data. 2021-04-30 20:08:31 +02:00
Christoph Oelckers
4ff2010bd1 - moved the entire screen job management to the script side.
This isn't hooked up yet and lots of code is commented out, the games won't start with this commit.
2021-04-30 20:08:30 +02:00
Christoph Oelckers
4a7430c8e4 - got rid of JobDesc. 2021-04-30 20:08:23 +02:00
Christoph Oelckers
71e5f9b70f - changed screen job list to work without per-job completion callbacks.
They made things more complex than necessary and do not translate well to scripting.
2021-04-30 20:08:22 +02:00
Christoph Oelckers
fb5e2fe0c0 - use flags instead of bools. 2021-04-30 20:08:22 +02:00
Christoph Oelckers
ad28630df6 - offloaded map patches to data files.
This is a lot easier to manage than having them in the code.
For now it piggybacks on the map hack feature, later this should use the same scripted approach as GZDoom.
2021-04-24 23:07:35 +02:00
Christoph Oelckers
14971f9569 Merge branch 'master' into newrenderer 2021-04-22 00:10:37 +02:00
Christoph Oelckers
729928c576 - SW: fixed bad serialization of sector object pointers 2021-04-22 00:03:18 +02:00
Christoph Oelckers
a4f5a32680 - fixed issue with restoring SO sprite array.
This array has -1 for empty entries so it cannot be saved partially.
2021-04-22 00:03:17 +02:00
Christoph Oelckers
c3e5cf322e - SW: cleaned up the depth variable handling in SECT_USER which was endian dependent, including the savegame handler 2021-04-22 00:03:17 +02:00
Christoph Oelckers
c17ec5fa45 - cleanup of savegame framework 2021-04-22 00:03:17 +02:00
Christoph Oelckers
b85da221d7 - SW: save tracks as JSON. 2021-04-22 00:03:17 +02:00
Christoph Oelckers
bb8309831c - SW: eliminated the int pointer in ANIM.
# Conflicts:
#	source/games/sw/src/save.cpp
2021-04-22 00:03:16 +02:00
Christoph Oelckers
c49c5fcf1d - SW: serialize SO interpolations as JSON. 2021-04-22 00:03:16 +02:00
Christoph Oelckers
2d571586bd - save sector objects as JSON 2021-04-22 00:03:16 +02:00
Christoph Oelckers
e9b1342ffd - SW: save globals as JSON. 2021-04-22 00:03:16 +02:00
Christoph Oelckers
66e5b9ada7 - SW: save SectUser as JSON, also store in a managed array. 2021-04-22 00:03:16 +02:00
Christoph Oelckers
06b03f7301 - SW: save the player and related data as JSON. 2021-04-22 00:03:15 +02:00
Christoph Oelckers
9bae2295cc - better USER clearing. 2021-04-22 00:03:15 +02:00
Christoph Oelckers
8fee2b3ed7 - save SW's User array as JSON. 2021-04-22 00:03:15 +02:00
Christoph Oelckers
32955621f8 - removed all parental lock garbage from SW.
Better get rid of it as it's a major complication as implemented.
2021-04-22 00:03:15 +02:00
Christoph Oelckers
bbb53bc717 - refactored the main User array into something that's automatically managed. 2021-04-22 00:03:14 +02:00
Christoph Oelckers
cd45a1f035 - made more parts of USER serialization friendly. 2021-04-22 00:03:14 +02:00
Christoph Oelckers
dcb393bc44 - started reorganizing SW's memory management.
Need to get rid of all those unmanaged allocations and present game data in an easily serializable form.
This adds a managed TPointer class that replicates the useful parts of std::unique_pointer but steers clear of its properties that often render it useless.
2021-04-22 00:03:14 +02:00
Mitchell Richters
93edeac791 - Clean-up of input functions.
* Remove unused `getincanglef()`.
* Remove unused `getincangleq16()`.
* In `PlayerHorizon` struct, clamp value when setting target in `__settarget()`, not each public `settarget()` overload.
* Rename `PlayerAngle` method `applylook()` to `applyinput()`.
* Rename `PlayerHorizon` method `sethorizon()` to `applyinput()`.
* In `PlayerHorizon::applylook()`, slightly clean return to centre code so it doesn't do math if already at 0.
* In `PlayerAngle::applylook()`, slightly clean rotscrnang/look_ang code so it doesn't do math if already at 0 and reposition where mouse input is applied so that if input is applied, the player never enters a spin.
* In `Duke3d::player_struct::apply_seasick()`, use `buildfang()` method instead of scaling float to BAM within function.
2021-04-21 20:41:04 +10:00
Christoph Oelckers
f51872db25 Merge branch 'master' into newrenderer 2021-04-20 20:46:06 +02:00
Christoph Oelckers
9e40e49c2c - generalized the special key handling for skipping cutscenes. 2021-04-20 15:01:26 +02:00
Mitchell Richters
0c5729b0f6 - SW: Ensure all sprite angles are backed up in the ticker.
* Fixes #326.
2021-04-20 21:33:42 +10:00
Mitchell Richters
d34070b8ae - gameinput.h: Remove precise bool from horizsumfrac(), look_anghalf() and looking_arc() added in a4895cb270.
* It looks terrible to have low precision math versions of look_anghalf and looking_arc since we always interpolate `look_ang` now, so lets just not.
2021-04-20 21:12:17 +10:00
Mitchell Richters
de06030ea0 - gameinput.cpp: Make sethorizon(), applylook() and calcviewpitch() class functions of PlayerHorizon and PlayerAngle where appropriate. 2021-04-19 20:50:10 +10:00
Christoph Oelckers
82194bbf6b Merge branch 'master' into newrenderer
# Conflicts:
#	source/games/exhumed/src/2d.cpp
2021-04-17 13:22:30 +02:00
Christoph Oelckers
2b9a527aba - added a 'Start' method to DScreenJob.
Since the menu pauses the ticker this is needed to perform initial setup before the first frame.
2021-04-16 23:29:53 +02:00
Christoph Oelckers
4950b556c9 - handled SW's screens. 2021-04-16 18:43:59 +02:00
Christoph Oelckers
dc8b72b2ce Merge branch 'master' into newrenderer2
# Conflicts:
#	source/games/duke/src/actors.cpp
#	source/games/duke/src/hudweapon_d.cpp
#	source/games/duke/src/hudweapon_r.cpp
#	source/games/duke/src/render.cpp
2021-04-15 19:34:03 +02:00
Christoph Oelckers
61a6321cd6 - Exhumed: Change map command to start the level directly without going through the scrolling map. 2021-04-15 18:55:54 +02:00
Mitchell Richters
a4895cb270 - All Games: Allow for HUD interpolation to be disabled.
* Requested by users, really don't know why...
* Interpolation values are guarded by the CVAR.
* For Blood, integer truncation is employed just like original game.
* For all games where more precise sine/cosine math has been utilised, no changes have been made.
2021-04-15 13:35:53 +10:00
Christoph Oelckers
f83e678ea0 - use the smooth ratio from the game logic in the renderer instead of calling I_GetTimeFrac again.
Unlike the higher level code this does not check for game over conditions.
2021-04-14 21:17:32 +02:00
Christoph Oelckers
798cf2f973 Merge branch 'newrenderer2' of https://github.com/coelckers/Raze-private into newrenderer2 2021-04-12 20:25:56 +02:00
Christoph Oelckers
42d02834b1 Merge branch 'master' into newrenderer2
# Conflicts:
#	source/build/include/build.h
#	source/build/src/polymost.cpp
#	source/build/src/voxmodel.cpp
#	source/core/gamecontrol.cpp
#	source/core/gamestruct.h
#	source/games/blood/src/animatesprite.cpp
#	source/games/blood/src/misc.h
#	source/games/blood/src/view.cpp
#	source/games/duke/src/render.cpp
#	source/games/sw/src/draw.cpp
#	source/games/sw/src/game.h
#	source/games/sw/src/jsector.cpp
#	source/glbackend/glbackend.cpp
2021-04-11 14:38:56 +02:00
Christoph Oelckers
0ee28fb45e - also handle SW's voxels. 2021-04-11 13:38:23 +02:00
Christoph Oelckers
387c62d584 - rewrote SW's precaching code.
* made it palette aware
* use backend facilities to track precached data.
* fixes bug in animation precaching loops - they only precached the base index over and over again.
2021-04-11 10:20:52 +02:00
Christoph Oelckers
9fd3ab6b5e - fixed texture precaching.
After the migration to GZDoom's full backend this never created any textureds when precaching things.
2021-04-11 09:59:55 +02:00
Mitchell Richters
f343bd8d5e - Fix death camera issues stemming from f254eeb465.
* Adjustment in `__addadjustment()` needs to be signed.
* Output of `bvectangbam()` needs to be signed before Duke/SW left-shift the value.
2021-04-11 17:52:29 +10:00
Mitchell Richters
e76f63e2c0 - Consolidate all game interpolation code into inline functions. 2021-04-11 16:45:35 +10:00
Christoph Oelckers
b3bcedda6c - moved backend independent HUD code out of glbackend.cpp. 2021-04-11 08:40:18 +02:00
Mitchell Richters
f254eeb465 - binaryangle.h: Remove lookangle class and replace use with binangle.
* Added in fca846272e to deal with signed adjustments but its just not needed.
* Made better use of `binangle`/`fixedhoriz` class getters and setters than before as well.
2021-04-11 15:45:53 +10:00
Christoph Oelckers
057b8a7354 - cleanup of bvectan family of functions.
This can be greatly simplified to a single bvectangbam function using atan2 directly.
2021-04-10 12:54:29 +02:00
Christoph Oelckers
b4d89cbac3 - got rid of the remaining occurences of gethiq16angle and all related tables. 2021-04-10 12:10:28 +02:00
Christoph Oelckers
a530dfbe35 Merge branch 'master' into newrenderer2 2021-04-08 18:52:54 +02:00
Christoph Oelckers
a53ed46bae - fixed item placement on SW minihud.
Fixes #295
2021-04-08 17:43:56 +02:00
Christoph Oelckers
3a34043267 Merge branch 'master' into newrenderer2 2021-04-07 15:12:27 +02:00
Christoph Oelckers
4a6a999f89 - SW: fixed interpolation for sector object sprites.
When checking for an existing interpolation it needs to check the actual sprite, not just the interpolation type.
2021-04-07 15:08:26 +02:00
Christoph Oelckers
e30dc82676 - Cleanup of the voxel code.
* moving polymost_voxdraw into polymost.cpp.
* consolidated all remaining voxel code in hw_voxels.cpp. All original Build voxel code is completely gone now, except for polymost_voxdraw, so this got moved out of the build/ folder.
* integrate Blood's voxel init code into the main function.
* some further cleanup was allowed as a result of this, so engineInit is gone now because these parts can now be done outside the games' app_init functions.
2021-04-05 18:05:43 +02:00
Christoph Oelckers
ea91b5ba5d - added a map patch for SW:WT's 'skyline' map.
This contains a badly tagged sky sector that makes the new renderer glitch out.
2021-04-04 18:57:03 +02:00
Christoph Oelckers
55ad51ee1f Merge branch 'master' into newrenderer2 2021-04-04 13:23:51 +02:00
Christoph Oelckers
97a0cb2a10 - handle voxel rotation in the backend to enable it for all games.
This was previously only present in the Blood module and missed in Exhumed from upstream so the entire option was rather pointless.
Fixes #290
2021-04-04 10:33:29 +02:00
Christoph Oelckers
952bccbf5f - added a check for game-side-defined voxels when discarding one-sided wall sprites viewed from the back. 2021-04-03 21:49:28 +02:00
Christoph Oelckers
9c95c902c7 - added a check for game-side-defined voxels when discarding one-sided wall sprites viewed from the back. 2021-04-03 21:40:16 +02:00
Mitchell Richters
9c01bde44e - gameinput.cpp: Block player input within sethorizon() and applylook() if target for each has been set by the ticker.
* Stops players having the ability to provide input and fight the system trying to set an input.
2021-04-02 22:47:19 +11:00
Christoph Oelckers
c8a75a8664 - give each DrawInfo its own list of tsprites.
Since these do not fully get processed sequentially the contents need to be preserved until needed.
This required getting rid of the global tsprite array. Polymost still uses a static vatiable, though, but this is only accessed in polymost-exclusive code.
2021-04-02 10:28:40 +02:00
Christoph Oelckers
80e5cd0dc5 - fixed some automap issues:
* Blood's automap was not drawn at all.
* SW's automap always showed all sectors
* SW's player sprite was not rendered.
* Non-automap: Forward gotsector to the game code because there's still a few places in Blood that need it.
2021-04-01 20:47:05 +02:00
Mitchell Richters
88695ef554 Merge branch 'master' into newrenderer2 2021-04-01 16:49:07 +11:00
Mitchell Richters
029f8807df - Make 360. / 2048. a constant expression and replace all uses throughout code. 2021-04-01 10:42:22 +11:00
Christoph Oelckers
7bea8ad6ba - fixed texture overlays for SW's sector portals. 2021-03-30 23:27:11 +02:00
Christoph Oelckers
a84060fda7 - SW: mark sector as dirty in wallmove. 2021-03-30 21:51:37 +02:00
Christoph Oelckers
f6984314b7 - SW: let sector objects properly invalidate the sector they are in. 2021-03-30 21:28:27 +02:00
Christoph Oelckers
92bb9c5319 - fixed display of player in mirrors. 2021-03-29 21:48:23 +02:00
Christoph Oelckers
18cf208b7d - fixed SW shadows in new renderer.
shade clamping and full sprite sort was missing,
2021-03-28 22:29:13 +02:00
Christoph Oelckers
e8edb32e0d - fixed camera texture setup.
They still are upside-down but aside from that work as expected.
2021-03-28 19:22:51 +02:00
Christoph Oelckers
81a690970b - SW: hide the player sprite before calling the renderer. 2021-03-28 15:28:08 +02:00
Christoph Oelckers
be7bca8e9e - expose animatesprite set of functions to new renderer as a callback. 2021-03-26 10:05:01 +01:00
Christoph Oelckers
0b1e81023f - added sprite collection loop to ProcessSector and did a bit of cleanup on the TSprite code. 2021-03-25 23:16:32 +01:00
Christoph Oelckers
f6568fee0c - rewrote SW portal setup to use static data instead of ad-hoc setup.
This was by far the messiest game, there's two reasons for this.
First, the portal links do not need to be in an actual portal sector, so they cannot be used to detect portal sectors.
Second, the game moves portals in place, so all offsets are (0,0,0) so that not even these can be used for detection.

The only working method is the super-complicated original way to look up portals at run time, just being done at map start.
Having static portal links should reduce the render glitches quite significantly because the renderer knows now which sectors belong to a portal and can use this information to ensure proper processing.
2021-03-25 21:21:48 +01:00
Christoph Oelckers
af54cf3a3c - made SW's sector portals operational.
Unlike the other games these are so poorly defined that the engine has to rely on the original fudging to pick the proper portal to link to. As a result they are just as limited as they always were.
In addition all the portal search code had to be reinstated.
2021-03-25 16:45:40 +01:00
Mitchell Richters
957f7e9487 - Accept binangle, fixedhoriz and lookangle classes in SetupViewpoint() vs. Q16.16 variables.
* Allows for more precision than Q16.16.
* Used as opportunity for `rollang` to be set using the `asdeg()` method, not `asbuildf()`.
2021-03-25 19:06:01 +11:00
Christoph Oelckers
b7e8815133 - some further lightening of compat.h. 2021-03-24 21:13:36 +01:00
Christoph Oelckers
d8627a2b3f - removed all remains of projection math weirdness from the automap code in the games plus a bit more cleanup of the engine code. 2021-03-24 20:28:58 +01:00
Christoph Oelckers
09a9e14feb - set up engine portals for SW.
Also moving more code to _polymost.cpp which is only needed for ad-hoc lookup of portals with a client side implementation of a two-layer renderer.
2021-03-21 17:04:06 +01:00
Christoph Oelckers
b91441f849 - same render interface rework for Shadow Warrior. 2021-03-21 12:22:50 +01:00
Christoph Oelckers
91957e40f1 - moved some original Raze code out if the Build folder. 2021-03-20 17:08:55 +01:00
Christoph Oelckers
30f4e2b29d - replaced the engine automap drawer with one leveraging the newly added sector geometry data.
This eliminates a lot of code depending on Build's projection math.
2021-03-20 16:20:48 +01:00
Christoph Oelckers
25bf0854cf - allow game specific music names for all games supporting an Ogg-format CD audio soundtrack.
New names are:

REDNECKxx.ogg for Redneck Rampage
REDNECKRIDESxx.ogg for RR Rides Again.
SHADOWxx.ogg for Shadow Warrior.

The motivation here is to allow copying all this music to a single folder or .zip file and reference it from all games.
2021-03-12 23:15:34 +01:00
Christoph Oelckers
5b85105762 - re-added the fix for the inverted card reader in Twin Dragon's Map 10.
This accidentally got lost when the one-sided key fix was generalized.
2021-03-06 12:20:03 +01:00
Mitchell Richters
e0f1a83f40 Revert "- SW: Alt implementation for preparing a nuke."
This reverts commit 4fcec5f6d3.

Functionality wasn't working properly, most players will never use it and care only for 100% originality. Was a nice idea, though.

# Conflicts:
#	source/core/gamecvars.cpp
#	source/games/sw/src/panel.cpp
2021-03-02 20:02:20 +11:00
Christoph Oelckers
fa8ca81460 - SW: added persistent copy of oz.
The door movement code uses oz for its position checks so we need a persistent version of it that survives uncontrolled changes from the engine side.
2021-02-28 12:35:34 +01:00
Christoph Oelckers
b15810e173 - SW: fixed crash with credits screen and CD tracks missing. 2021-02-26 18:58:13 +01:00
Christoph Oelckers
99f1f0952a - little bit of engine cleanup. 2021-02-25 12:16:21 +01:00
Mitchell Richters
cff97c9cf3 - calcChaseCamPos(): Restore original algorithms for new position via GameInterface struct.
* Averaging out the values was a net negative for all games. Each games' original value is tuned to the specific games.
2021-02-18 21:47:39 +11:00
Mitchell Richters
ba57429ac6 - Blood, Duke & SW: Create new backend chasecam function and replace game-specific versions with it.
* Based off SW's implementation.
2021-02-18 21:47:37 +11:00
Mitchell Richters
2abda0e27d - All Games: Migrate each game's clock counter to backend solution. 2021-02-18 21:47:33 +11:00
Christoph Oelckers
8cf3e50ade - removed bad 'pos' setup in PreDrawStackedWater
This was a) supposed to set 'opos' not 'pos' and is b) redundant because here both Users point to the same sprite.

Fixes #261
2021-01-25 18:07:49 +01:00
Christoph Oelckers
fc11f537f7 - project cleanup
* moved all games into the 'games' folder.
* fixed project to include all sources and move them to the proper folders.
2021-01-10 20:31:32 +01:00