Commit graph

184 commits

Author SHA1 Message Date
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