Commit Graph

5877 Commits

Author SHA1 Message Date
Christoph Oelckers 007c6e122d - gameclock abstraction
This may need more work to have a reliable timer
2020-08-31 00:16:43 +02:00
Christoph Oelckers 7684f9e3e6 - fixed duplicate symbol error on macOS 2020-08-31 00:15:48 +02:00
Christoph Oelckers 2f05a93547 Merge branch 'Packet' into back_to_basics2
# Conflicts:
#	source/core/gamestruct.h
#	source/games/duke/src/gameloop.cpp
#	source/games/duke/src/player_d.cpp
2020-08-31 00:09:56 +02:00
Christoph Oelckers b8258da997 - cleaning out some trash from compat.h.
The header from hell...
2020-08-30 23:34:40 +02:00
Christoph Oelckers 00d35bc42c - fixed the number pulsing on Duke's and RR's HUD. 2020-08-30 22:52:50 +02:00
Christoph Oelckers 98557947da - gameclock must also be set before calling gi->Render.
This runs at the display's frame rate so the timer value from the Ticker call is not precise enough to do all the work.
2020-08-30 22:52:20 +02:00
Christoph Oelckers ba8dc788fe - hotfixing some Exhumed map transition issues.
This avoids crashing on LEV20, but the whole thing is simply too poorly implemented to actually work - this needs to be redone so that the map transition does not occur in the middle of the game ticker.
2020-08-30 21:45:21 +02:00
Mitchell Richters 5daaa1fc06 - fix issues with `cl_syncinput 0`. 2020-08-31 05:24:29 +10:00
Christoph Oelckers 511cb51e7f - these 2 variables no longer exist. 2020-08-30 21:20:05 +02:00
Christoph Oelckers 26f6bac060 - Exhumed: save the status variables to savegames again.
Since this status bar depends on explicit updates, this data needs to be restored after loading, and just saving it out is the easiest way to ensure that.
Fixes #274
Fixes #276
2020-08-30 21:16:37 +02:00
Christoph Oelckers a9bf1ab4bc - Exhumed: Renamed changelevel CCMD to Levelwarp for consistency.
Fixes #278
2020-08-30 21:07:00 +02:00
Christoph Oelckers 5136e7dc2d - SW: Moved the key display on the fullscreen HUD above the ammo display.
Space is a bit too tight when activating the clip display otherwise, especially on 4:3 screens.
2020-08-30 21:01:29 +02:00
Mitchell Richters d0e390c554 - Blood: Don't treat akimbo shotguns as a reloading weapon. It doesn't go through the reload sequence like when the player doesn't have the power-up. 2020-08-30 20:24:39 +02:00
Mitchell Richters c0374cf890 - SW: Move static function `DoReloadStatus()` into the class as private function 2020-08-30 20:24:38 +02:00
Mitchell Richters 26ffc82cc0 - SW: Remove duplicated code from dd832aaea3f688b375c74643606f299c76d92f3b. 2020-08-30 20:24:38 +02:00
Mitchell Richters c555540e24 - Blood: Implement `cl_showmagamt` for the game's shotgun.
* Tile set for `kSBarNumberAmmo` does not include a slash. Hack put in place to get me a slash from a specific tile of a different font. It "works" and I don't think it looks too bad.
2020-08-30 20:24:38 +02:00
Mitchell Richters 1617938d4f - Duke: When using `cl_showmagamt 1`, increase pistol maximum by 4 so that when you have full ammunition, you have a full clip.
* On the fence about this. Lower makes the game harder, and higher could mean the difference between life and death. I do think that if we're showing amounts in the magazine, full ammo should constitute a full magazine. I think the max of 200 is an oversight from the original devs as all other games have proper defaults that reflect the magazine or cylinder capacity.
2020-08-30 20:24:38 +02:00
Mitchell Richters 10962e2193 - SW: Implement `cl_showmagamt` for the game's shotgun and uzi.
* SW does not have any special characters in its BigFont, so currently there's no divider between ammunition amounts. This is to be discussed on the PR.
2020-08-30 20:24:37 +02:00
Mitchell Richters eb3a21e677 - Duke: Implement `cl_showmagamt` for the RR's pistol and shotgun. 2020-08-30 20:24:37 +02:00
Mitchell Richters 161647ed5b - Duke: Implement `cl_showmagamt` for the game's pistol. 2020-08-30 20:24:37 +02:00
Mitchell Richters 6f653da0fc - DBaseStatusBar: Create function `DBaseStatusBar::CalcMagazineAmount()` for use with calculating magazine values when drawing the HUD. 2020-08-30 20:24:37 +02:00
Mitchell Richters aeb807bea1 - gamecvars.cpp: Create CVAR `cl_showmagamt`. 2020-08-30 20:24:37 +02:00
Mitchell Richters e32cd81cc7 - Unify `stat fps` for all games. 2020-08-30 20:24:36 +02:00
Christoph Oelckers 59a964bb83 - same for SW 2020-08-30 20:24:36 +02:00
Christoph Oelckers 747dac6c41 - Exhumed: Mark unused function arguments in standard C++ fashion. 2020-08-30 20:24:36 +02:00
Christoph Oelckers 84e54e4fdb - deleted several unused local variables
None of the initializers here is modifying gamestate, this looks like overcautious preservation for demo compatibility.
2020-08-30 20:24:23 +02:00
Christoph Oelckers 3a7b23f655 remove unused stuff 2020-08-30 20:23:48 +02:00
Christoph Oelckers 765f211e05 - things are mostly working again.
Rendering produces an image again, input gets properly processed, but unsynchronised mouse input isn't properly applied yet.
2020-08-30 19:59:46 +02:00
Christoph Oelckers c3fa9b76c4 - fixed: The render style must be set to a defined value at the start of rendering a scene. 2020-08-30 17:40:04 +02:00
Christoph Oelckers 2602774571 - fixed: The render style must be set to a defined value at the start of rendering a scene. 2020-08-30 17:38:24 +02:00
Christoph Oelckers 38d10cc591 - game input works, but still no 3D scene rendered. 2020-08-30 13:04:07 +02:00
Christoph Oelckers ffe5b114f3 - the engine starts on the new main loop and is capable of running the intros and the menu, but not the game yet. 2020-08-30 12:49:21 +02:00
Christoph Oelckers d59284c96b - transitioned Duke to the new main loop.
Everything compiles, but hasn't been tested. Doing a safety commit first.
2020-08-30 12:02:32 +02:00
Christoph Oelckers 0c455acaa2 - more work to switch over to the new loop.
Mainly separation of ticker and render calls
2020-08-30 10:42:44 +02:00
Christoph Oelckers 367b4ce051 - this should be all we need from GZDoom to hook up the main loop. 2020-08-30 09:32:34 +02:00
Christoph Oelckers 1e0b8038e5 - removed I_ResetTime entirely and refactored SW's use of it. 2020-08-30 08:13:34 +02:00
Christoph Oelckers 49106c5b5e - Duke: Do not reset the global ticker.
The new main loop code cannot handle that. Instead set a start value for gameclock so that gameclock can be based on an arbitrary time value instead of directly representing global time.
2020-08-30 08:04:33 +02:00
Christoph Oelckers 34510ae9b3 - added ticker stub to the game interface. 2020-08-30 08:03:03 +02:00
Christoph Oelckers cc04d41903 - Duke: moved the clock reset to a separate function and deleted the unused lockclock variable. 2020-08-30 07:53:20 +02:00
Christoph Oelckers d49aedacea - continued work on main loop - added a few new entry points to the game interface. 2020-08-30 00:55:49 +02:00
Christoph Oelckers c0ebe3e08b - hooked up ZDoom's d_net.cpp file.
Still not active but this contains some code needed to do a proper main loop that can work with the networker.
2020-08-29 23:24:18 +02:00
Christoph Oelckers 15adf1f6e5 - hooked up ZDoom's i_net.cpp to compile within the project.
Note about the license: This file was available from GZDoom 2.4.x under the Doom source license which is compatible with Build.
This isn't used yet.
2020-08-29 22:07:47 +02:00
Christoph Oelckers fab561d757 - cleaned up Duke's main GameTicker function.
* moved the part that alters the input before queuing it to GetInput
* moved moveloop into the main function
* reshuffled a few things for better grouping by task.
2020-08-29 21:20:10 +02:00
Christoph Oelckers 20426a5a4f Revert "- pass loc as a parameter to Duke's GetInput function to uncouple it from the global variable."
This reverts commit a03b6cf57c.

Turns out this wasn't really useful.
2020-08-29 21:09:04 +02:00
Christoph Oelckers e3839b01bc - removed in_mousesmoothing.
This not only was redundant with m_filter, even worse, it was in the wrong place.
Control_GetInput is used to read the current input state from the backend and can get called at uneven intervals, or even multiple times during the same frame, so smoothing the movement here can lead to erratic behavior.
With this change CONTROL_GetInput will return the same data unless it gets updated between calls.
2020-08-29 18:37:22 +02:00
Christoph Oelckers a03b6cf57c - pass loc as a parameter to Duke's GetInput function to uncouple it from the global variable. 2020-08-29 18:07:49 +02:00
Christoph Oelckers 56d0647412 - migrated the last 3 remaining UI controls to CCMDs. 2020-08-29 17:49:15 +02:00
Christoph Oelckers eb34b41716 - fixed keyboard look in Blood. 2020-08-29 17:07:25 +02:00
Mitchell Richters be33872b42 - Blood: Implement `WeaponSel_Alt` for game. 2020-08-29 22:51:20 +10:00
Mitchell Richters 7ff73ae2f1 - Duke: Add missing World Tour flamethrower from alt weapon mode implementation completed in 51a08fbaf3. 2020-08-29 22:30:45 +10:00
Christoph Oelckers 694444b62a - converted the remaining input bits.
Looks like it is working in all games except Blood (not that it surprises me that it's Blood again which has issues...)
2020-08-29 13:32:55 +02:00
Mitchell Richters 51a08fbaf3 - Duke: Implement `WeaponSel_Alt` for Duke and RR. 2020-08-29 21:27:58 +10:00
Christoph Oelckers 7659107b75 - removed SW's SK_AUTO_AIM for good.
When networking becomes a thing again this can be done as a server CVAR without such a messy approach.
2020-08-29 02:19:41 +02:00
Christoph Oelckers 3a9bcb0b64 - moved Exhumed's cheat bits back into the game module.
They are no longer part of the packet interface.
2020-08-29 02:17:28 +02:00
Christoph Oelckers dc1f56e8f9 Merge remote-tracking branch 'remotes/Github_private/back_to_basics2' into Packet
# Conflicts:
#	source/core/inputstate.cpp
#	source/exhumed/src/exhumed.h
2020-08-29 01:19:48 +02:00
Christoph Oelckers fe7f3a2f9e - handle the run key. 2020-08-29 00:57:07 +02:00
Mitchell Richters c47b60e193 - Fix compile regression from 847fa48724.
Fixes #283.
2020-08-29 08:16:05 +10:00
Christoph Oelckers b9e0f493b2 - transitioned the 5 primary action keys: Open, Jump, Crouch and Fire/AltFire. 2020-08-28 23:25:08 +02:00
Christoph Oelckers 847fa48724 - cleaned out the remaining parts of baselayer.h
In particular this means to remove the option to disable widescreen aspect ratios. The way this was handled makes no sense with the current render backend.

The aspect ratio code will have to be redone entirely to properly obey the backend's settings.
2020-08-28 09:06:49 +02:00
Christoph Oelckers 536e7455f2 - moved I_StartFrame to the top of the loop and cleaned up baselayer.hj 2020-08-28 08:44:44 +02:00
Christoph Oelckers d73bf62465 Revert "- Set frame-time as close to the buffer swap as possible, and calculate smoothratio for Duke/SW as late as possible."
This reverts commit 97feb483ab.
2020-08-28 08:25:51 +02:00
Mitchell Richters ea2790ce08 - Duke: Switch game tic back to a while loop. I didn't mean to commit it this way in ab06235971.
* I doubt anyone will be running this on a system where computing a tic might take longer than a tic, but it's more consistent with the other games and is what it was.
2020-08-28 15:29:41 +10:00
Mitchell Richters 97feb483ab - Set frame-time as close to the buffer swap as possible, and calculate smoothratio for Duke/SW as late as possible.
* Micro-optimisation, but was getting a very occasional jitter in Duke 3D that seems to have gone with this.
2020-08-28 15:27:16 +10:00
Christoph Oelckers d62d2eaec7 - processed all remaining local input CCMDs and removed some bits only needed for multiplayer.
These MP bits should be reimplemented as network commands later, they only take up valuable space in the bit field.
2020-08-28 00:03:35 +02:00
Christoph Oelckers ee7d558282 - removed the remains of sending pause with the input packets.
None of this was really working anymore, but will have to be rethought once a network stream exists again.
But even then, this is better sent as a separate command, and in MP only.
2020-08-27 22:38:52 +02:00
Christoph Oelckers e0ca98602d - made Blood's inventory cycle-able.
IMO it's a totally annoying limitations to block wraparound of the cursor.
2020-08-27 22:29:45 +02:00
Christoph Oelckers 447573aa36 - consolidation of invprev, invnext and invuse. 2020-08-27 22:19:24 +02:00
Christoph Oelckers 43de0d8312 - consolidation of inventory item activation through hotkeys.
This also adds hotkeys for Exhumed which never implemented them.
2020-08-27 21:25:09 +02:00
Mitchell Richters 0c55c3983c - Duke: Fix potential interpolation issues for RR's shotgun observed while working on something else. 2020-08-27 22:47:18 +10:00
Mitchell Richters 8bb13bc4c2 - InputState: Exclude volume keys from setting `AnyKeyStatus` to true. 2020-08-27 13:05:05 +02:00
Mitchell Richters a2b51edcdb - Duke: Delete enum created in 3e79e7b63f and move `CRACK_TIME` to `miscConstants`.
* Didn't have a very good look, apparently...
2020-08-27 16:09:18 +10:00
Mitchell Richters 65a54361b4 - Duke: Apply same fix in 3e79e7b63f for RR, accidentally missed. 2020-08-27 15:55:32 +10:00
Mitchell Richters 3e79e7b63f - Duke: Fix bug where player wasn't cracking knuckles after 777 idle tics while `cl_syncinput` was 1.
* Use opportunity to replace the literal constant of `777` with an enum.
2020-08-27 15:54:49 +10:00
Christoph Oelckers 10df3e094a - rework of weapon input to use common features in shared code.
This also adds stubs for all unimplemented features in the games for easier addition.
2020-08-27 00:53:35 +02:00
Christoph Oelckers 89f5b26988 - fixed badly placed include. 2020-08-27 00:27:10 +02:00
Christoph Oelckers f597f7c265 - made the GameFunc constants global again.
With most of the more specific features being migrated to CCMDs the list is relatively clean now, with merely 2 buttons that are game specific.
2020-08-27 00:25:59 +02:00
Christoph Oelckers 4b299fa412 - Exhumed also handled. 2020-08-27 00:58:21 +02:00
Christoph Oelckers 99486cba7e - gave Blood the same treatment. 2020-08-27 00:21:11 +02:00
Christoph Oelckers c7e667a17a - transition weapon selection in SW.
Thanks to the macro insanity for trivial operations in this code base this turned out to be a lot more troublesome than Duke...
2020-08-27 00:06:59 +02:00
Mitchell Richters 55f688b13f - SW: Rename `q16horz` to `q16horiz` and `q16aimvel` to `q16horz` for consistency and to avoid confusion down the track. 2020-08-27 08:00:50 +10:00
Christoph Oelckers e768a2bf24 - use new bitmask for weapon selection in Duke. 2020-08-26 23:02:55 +02:00
Christoph Oelckers 36d676ca20 - renamed ESyncBits so that the replacement can take that name later. 2020-08-26 22:39:15 +02:00
Christoph Oelckers 78a024a50c - fixed: Exhumed's sound module did not check the 'sound disabled' CVAR. 2020-08-26 22:26:28 +02:00
Christoph Oelckers b4df1fd662 - fixed Ramses text display.
Fixes #265.
2020-08-26 22:22:46 +02:00
Christoph Oelckers 1a25504d02 - looks like the nAngle field in the PLayerInput struct isn't used for anything anymore. 2020-08-26 21:32:18 +02:00
Christoph Oelckers 83c8770d02 - fixed Ramsed head display and not freezing the input when it is active. 2020-08-26 21:28:57 +02:00
Christoph Oelckers 096a2bd4e9 - fixed some of the sound issues in Exhumed
* ambient sounds were constantly restarted resulting in garbled sound.
* sound priorities were not checked. This was used to limit some sounds to one instance per actor or to allow terminating other sounds playing on the same actor.
2020-08-26 20:22:11 +02:00
Christoph Oelckers e5a4276a5a - fixed infinite loop. 2020-08-26 20:20:36 +02:00
Christoph Oelckers 4e846f8d66 - do not print game init messages to the notify display. 2020-08-26 20:19:54 +02:00
Mitchell Richters e3fe1b2b60 - Exhumed: Correctly transform player velocities when running on single 30Hz timer.
Thanks, Graf :)

# Conflicts:
#	source/exhumed/src/exhumed.cpp
2020-08-26 17:27:15 +02:00
Mitchell Richters 0c300c181f - Exhumed: Unify game with single timer instead of getting forward/side velocity at 120Hz.
* Player movement is close, but not exactly as it was. Requires more work if it is to be considered.

# Conflicts:
#	source/exhumed/src/exhumed.cpp
#	source/exhumed/src/ps_input.h
2020-08-26 17:26:42 +02:00
Christoph Oelckers f90d953ab5 default cl_smoothsway to false. 2020-08-26 17:23:08 +02:00
Christoph Oelckers abf715eace - unified the packet structures of all games.
Currently the bit fields are still separate and they have to be merged, but for now the added memory does not matter.
Having this structure in the common parts will allow work on consolidating the input code, though.
2020-08-26 17:12:48 +02:00
Christoph Oelckers 2ae5f960c5 - renamed fields in Exhumed's packed struct.
One step closer to getting these merged.
2020-08-26 17:09:47 +02:00
Christoph Oelckers c7f5f05e14 - cleaned up gamecvars.cpp and deleted a large amount of unused ones. 2020-08-26 17:05:17 +02:00
Mitchell Richters 4fcec5f6d3 - SW: Alt implementation for preparing a nuke.
* Given the original code in `pNukeAction()` (poorly named), the intent appeared to be that the weapon should go off-screen for preparation, returning once weapon initialised.
* Commit restores that behaviour behind a CVAR.

# Conflicts:
#	source/core/gamecvars.cpp
#	source/core/gamecvars.h
2020-08-26 17:00:19 +02:00
Christoph Oelckers 5a77aace2f - strip the structure for local input off the fields not needed here.
Now it's basically the same as Dukes.
2020-08-26 16:59:42 +02:00
Christoph Oelckers c1b1182f90 - fix weapon selection in Exhumed.
Like Blood it looks like the request isn't processed immediately so it needs to stick around.
2020-08-26 16:59:42 +02:00
Christoph Oelckers d0655a1068 - renamed the fields in Blood's packet structure to match Duke's. 2020-08-26 16:59:41 +02:00
Christoph Oelckers 3fc79940f2 - merged the bit fields in Blood's packet structure.
Whatever this was for it made that thing extremely unwieldy.
With these merged the resulting structure doesn't look much different from Duke's anymore.
2020-08-26 16:59:41 +02:00
Christoph Oelckers b76168f673 - moved the main event processing functions into the global main loop.
Now, with all the Build timer stuff removed these calls were all identical between games.
2020-08-26 16:59:41 +02:00
Mitchell Richters a9f556c1bd - SW: Restore random element to player's weapon left/right bobbing behind a CVAR.
# Conflicts:
#	source/core/gamecvars.cpp
#	source/core/gamecvars.h
2020-08-26 16:45:42 +02:00
Mitchell Richters 50793184ee - SW: Remove random element from player's weapon left/right bobbing causing bob value to be between 24-48 and lock to 36. 2020-08-26 16:45:42 +02:00
Mitchell Richters 88a49b0d22 - Duke: Restore RPG harsh recoil behind a CVAR.
# Conflicts:
#	source/core/gamecvars.cpp
#	source/core/gamecvars.h
2020-08-26 16:45:41 +02:00
Mitchell Richters 839a7bcbe4 - subjective fix to Duke 3D's RPG harsh recoil. 2020-08-26 16:45:41 +02:00
Mitchell Richters 60f334f57c - Exhumed: Partially restore sound issues following cc5e6d19c3.
* Restored call of `UpdateSounds()` to `GameLoop()` and not `DrawView()` like previously.

Partially addresses #253.
2020-08-26 23:22:44 +10:00
Mitchell Richters 62388e30be - fix `C_SetNotifyFontScale()` for RR.
Fixes #264.
2020-08-26 22:33:19 +10:00
Mitchell Richters 5bfd4069ef - Blood: Cleanup some timing variables following timing uplift.
* Remove cast of int on `gFrameClock` since gFrameClock is now just an int.
* Remove unused `gFrameTicks`.
* Remove unused `gFrameRate`.
* Rename `gFrame` to `gFrameCount` so it's easier to search and distinguish from `gFrameClock` without relying on regex.
2020-08-26 20:55:46 +10:00
Christoph Oelckers ddd6a300ab - added UpdateSounds calls to the blocking loops in Duke's and SW's StartGame functions. 2020-08-26 04:15:33 +02:00
Christoph Oelckers cc5e6d19c3 - fixed sound updating by moving the engine's UpdateSound call into the main loop.
This needs to be called unconditionally for every frame being rendered, not all of the game modules did that.
Placing this call here ensures that it is independent of anything the games do.
2020-08-26 04:10:16 +02:00
Christoph Oelckers de871c9ab9 - use the game timer, not the Build timer for the sound eviction delay.
This is supposed to wait for two game frames to be on the safe side.
2020-08-26 03:50:07 +02:00
Mitchell Richters e1424d454f - Duke: Clean out some left over stub code during initial testing. 2020-08-26 11:23:57 +10:00
Mitchell Richters 4eec9dca63 - Duke/SW: Use `I_GetBuildTime()` instead of `gameclock` in game-side sound code.
* Code is called where `gameclock` might not be set.
2020-08-26 10:09:02 +10:00
Mitchell Richters ef728429e0 - Core: Remove legacy smoothratio calculator `CalcSmoothRatio()`. 2020-08-26 09:49:47 +10:00
Mitchell Richters e0aaaf1f60 - All Games: Move `gameclock` and `lastTic` to gamecontrol. 2020-08-26 09:49:44 +10:00
Mitchell Richters 76776d24d7 - All Games: Remove use of `ClockTicks` and replace with `int`. 2020-08-26 09:49:42 +10:00
Mitchell Richters 1c8b0a20fb - Build: Remove all timer code. 2020-08-26 09:49:40 +10:00
Mitchell Richters 2bf11ad378 - All Games: Remove use of `timerGetTicks()`. 2020-08-26 09:49:38 +10:00
Mitchell Richters aba5c4c134 - All Games: Remove use of `timerGetHiTicks()`. 2020-08-26 09:49:36 +10:00
Mitchell Richters b883204f6a - All Games: Remove remaining use of `totalclock` and associated timing code. 2020-08-26 09:49:34 +10:00
Mitchell Richters c207437a57 - Duke: Rename `cloudtotalclock` to `cloudclock`.
* Mostly so it doesn't come up on searches for `totalclock`.
2020-08-26 09:49:32 +10:00
Mitchell Richters d358c71f82 - Blood: Migrate to GZDoom time code like Duke, SW and Exhumed. 2020-08-26 09:49:23 +10:00
Mitchell Richters 39541408f2 - Exhumed: Fix what I believe is a typo. 2020-08-26 09:49:02 +10:00
Mitchell Richters 2748d6dc64 - Exhumed: Rename remaining use of `totalclock` locally in screenjobs to `currentclock` like Duke. 2020-08-26 09:48:59 +10:00
Mitchell Richters a6cc3c4128 - Exhumed: Migrate to GZDoom time code like Duke and SW. 2020-08-26 09:48:57 +10:00
Mitchell Richters 76b05dbcd6 - Build (and games): Remove `totalclocklock`. 2020-08-26 09:48:56 +10:00
Mitchell Richters 576b13248e - Build: Use `I_GetBuildTime()` in place of `totalclocklock` in `animateoffs()`. This makes the SW menu work pre-game. 2020-08-26 09:48:54 +10:00
Mitchell Richters 40739d9176 - SW: Add `ogameclock` and use in places where `ototalclock` was used.
* Duke used `ototalclock` only to keep track of when the game ticked. SW uses it in the rendering code for differentials between tics so we should preserve that to prevent issues down the track.
2020-08-26 09:48:51 +10:00
Christoph Oelckers d38a3a1fb1 - added autoaim switch for Exhumed.
Pointers for the needed change taken from GDX.
This applies only to hitscan weapons the rest do not appear to autoaim.
Fixes #260
2020-08-26 00:22:11 +02:00
Christoph Oelckers 9440ddb68f - thinned out Blood's network code. 2020-08-25 23:04:08 +02:00
Christoph Oelckers 84b6af24d3 - renamed the fields in SW's packet structure to match Duke's.
Preparation for moving the packet management into public code.
2020-08-25 22:06:01 +02:00
Christoph Oelckers 70cac1db54 - removed unused parts from timer.cpp. 2020-08-25 21:47:03 +02:00
Christoph Oelckers 5af71c0af2 - Exhumed: Implement "Quit to title".
Fixes #252
2020-08-25 21:34:12 +02:00
Christoph Oelckers efc83e1a5f - Exhumed: properly terminate the "Ramses" save block.
Fixes #258
2020-08-25 21:30:00 +02:00
Christoph Oelckers 6b0e1baf02 - added a timerUpdateClock call to the main loop so that Blood and Exhumed work again.
This may only be removed when nothing uses totalclock anymore. We're not there yet.
2020-08-25 21:24:45 +02:00
Christoph Oelckers a323591d5a - call C_RunDelayedCommands() from a centralized place. 2020-08-25 21:16:37 +02:00
Christoph Oelckers fd12ad382f - add shadows to the statistics display.
Fixes #256
2020-08-25 20:58:32 +02:00
Christoph Oelckers 5df0a7241f - disabled a few menu options for unsupported features in Exhumed.
Fixes #255
2020-08-25 20:40:30 +02:00
Christoph Oelckers e97fb2ab7f - reduce message spam in the notification display. 2020-08-25 20:21:18 +02:00
Christoph Oelckers 8256b54005 - applied a few fixes:
* removed the timer callback stuff that came back through the backdoor.
* do not use gameclock in the UI code - use the underlying timer directly.
* UpdateSounds must still use totalclock, until this can be refactored in its entirety.
2020-08-25 20:20:35 +02:00
Mitchell Richters c888bc802d - SW: Make a bit more use of the calculated smooth ratio. 2020-08-25 19:51:32 +02:00
Mitchell Richters 386661f1ba - SW: Migrate to GZDoom time code like Duke. 2020-08-25 19:51:32 +02:00
Mitchell Richters d04aa603dd Revert "Revert "- Duke: Remove left-over line." and re-do as a multiplier of `TICSPERFRAME` for better clarity as to what's happening rather than a bit-shift."
This reverts commit 0cdd27b61534219a0d00b794a45a09f26a95afaa.
2020-08-25 19:51:12 +02:00
Mitchell Richters d3b506eb2b - Duke (and Engine): Eliminate use of totalclock for game.
* Breaks every other game except Duke unless/until they get migrated. Done for the purpose of demonstrating PR #244.

# Conflicts:
#	source/build/src/timer.cpp
#	source/games/duke/src/game.cpp
2020-08-25 19:51:12 +02:00
Mitchell Richters c5f523fb3c - Duke: Make a bit more use of the calculated smooth ratio. 2020-08-25 19:48:52 +02:00
Mitchell Richters e9c0831ccc Revert "- Duke: Remove left-over line." and re-do as a multiplier of `TICSPERFRAME` for better clarity as to what's happening rather than a bit-shift.
* It's also better that everything be based off the one tic clock and not call `I_GetBuildTime()` to set `gameclock`. This also ensures that `gameclock` always increases in intervals of 4.

This reverts commit 63eac13d6442357fdab57067ec913a2ce8ce72db.
2020-08-25 19:48:38 +02:00
Mitchell Richters be5419e77c - i_time: Add `I_GetBuildTimeFrac()`.
* Currently not needed, but adding for feature parity.
2020-08-25 19:48:26 +02:00
Mitchell Richters 2231386830 - Duke: Create function to reset timer and apply in game where timer restarts are needed. 2020-08-25 19:48:15 +02:00
Mitchell Richters 7d1f021fcd - Duke: Remove left-over line. 2020-08-25 19:47:45 +02:00
Mitchell Richters afb09456e0 - Duke: Migrate away from using `totalclock` and use new game-specific `gameclock` with underlying timer code in common.
* Build timer still requires initialisation due to multiple `timerSetCallback()` that still need to work.

# Conflicts:
#	source/core/menu/menu.cpp
#	source/games/duke/src/game.cpp
2020-08-25 19:47:31 +02:00
Mitchell Richters ab06235971 - Duke: Demonstration of a re-timed game and associated interpolation improvements that come from it.
# Conflicts:
#	source/games/duke/src/game.cpp
2020-08-25 19:43:28 +02:00
Christoph Oelckers 435e13dfa4 cleanup of the timer interface.
* rewrote all uses of timerSetCallback. Most were unnecessary or long obsolete, the sound updates need to run per frame, not per tic and the UI tickers need to be handled in the main loop anyway.
* Use a more precise timer to animate the menu transition.
* uncouple other menu animations from the game timer.
2020-08-25 19:42:11 +02:00
Christoph Oelckers a55da24277 - hooked up the chat display.
Currently not really useful, aside from being usable to enter cheats. For this the cheat must be prefixed with a '#' to be recognized.
2020-08-25 18:51:56 +02:00
Christoph Oelckers cf36e7d770 - SW: stop cutscene sound before going to the summary screen. 2020-08-25 18:28:50 +02:00
Christoph Oelckers 7d30218d8e - fixed: In SW the automap follow mode blocked all game input, even when the automap was off. 2020-08-25 18:09:57 +02:00
Christoph Oelckers ce853c5376 - Blood does not restart the intro sequence.
Fixes #247
2020-08-25 18:06:16 +02:00
Christoph Oelckers a0e4d6f62c - implemented proper scaling support for the notify display - both the classic and advanced variant. 2020-08-25 18:03:15 +02:00
Christoph Oelckers 1a633ce6a6 - give Exhumed some automap labels as well.
This game didn't have them originally so here the 'native' mode does not exist.
2020-08-25 00:27:14 +02:00
Christoph Oelckers 7c1e64757a - use generalized automap label code for Shadow Warrior, too. 2020-08-25 00:16:02 +02:00
Christoph Oelckers faf23d8ff0 - proper defaults for Blood. 2020-08-25 00:01:33 +02:00
Christoph Oelckers 777bbd4bd8 - use the generalized code to display automap labels in Blood. 2020-08-24 23:59:09 +02:00
Christoph Oelckers 6672b8af99 - generalized the automap label code.
Using proper scaling and should be reusable from all games now.
2020-08-24 23:14:55 +02:00
Christoph Oelckers 25ade79b90 - stat display fine tuning. 2020-08-24 22:18:45 +02:00
Christoph Oelckers fef7608705 - made a few fixes for the fullscreen HUD in Nam:
* the font was placed too low
* the Duke health icon is not a health icon in this game so it had to be exchanged for something proper.
2020-08-24 22:12:56 +02:00
Christoph Oelckers 88bcaf37ab - changed the scale range of hud_statscale so that 1 is for fullscreen 320x200. 2020-08-24 22:02:49 +02:00
Christoph Oelckers e7c58a5b29 - make hud_scale a floating point CVAR. 2020-08-24 21:48:47 +02:00
Christoph Oelckers 3a6ccac8ea - fixed bad offset with vertically mirrored sprites.
Fixes #239
2020-08-24 21:15:22 +02:00
Christoph Oelckers 6d1e3e77fc - fixed item percentage display on SW's status bar.
Fixes #242
2020-08-24 20:46:14 +02:00
Christoph Oelckers 76811a1881 - InputState cleanup
This removes most of the InputState class because it is no longer used.
The only remaining places still checking scan codes are the modifiers for sizeup and sizedown.
All the rest was remapped to safer methods. The multiplayer taunts are currently inoperable, they will need support of shift-bindings to get proper support.
2020-08-24 20:34:18 +02:00
Christoph Oelckers b88a279a57 - removed the mouse wheel up event hackery
With the weapon cycling commands being done as CCMDs this is no longer needed.
2020-08-24 20:26:32 +02:00
Christoph Oelckers c09a5150a9 - added some predefined fullscreen modes
This is to cut down on boilerplate code because these encode the virtual screen size in the mode parameter, making it unnecessary to specify a virtual size separately.
2020-08-24 20:25:53 +02:00
Christoph Oelckers f1a988b221 - make use of map bindings
All automap controls have been moved there, and sizeup/sizedown have been made CCMDs, taking screen size management entirely out of the game modules
2020-08-24 20:20:15 +02:00
Christoph Oelckers 092fb55db3 - hooked up the automap bindings.
Now, with centralized state management these can finally work.
2020-08-24 19:55:21 +02:00
Christoph Oelckers e158775e67 - … and for Exhumed
This game does not implement follow mode.
Note: Follow mode needs to be simplified across games!
2020-08-24 19:54:26 +02:00
Christoph Oelckers 0ee042fb60 - same procedure for Blood 2020-08-24 19:47:09 +02:00
Christoph Oelckers debb4b17b6 - transitioned SW's automap to the global variables
Also copied the automap label output to the status bar for proper ordering.
2020-08-24 19:36:17 +02:00
Christoph Oelckers 7859a29e95 - use global variables to track automap state
So far implemented in Duke/RR.
2020-08-24 19:31:43 +02:00
Mitchell Richters 89a15335df - Exhumed: Clear the screen in the 2D drawer prior to drawing in `menu_DoPlasma()`.
Fixes #237.
2020-08-24 17:44:39 +10:00
Mitchell Richters e8057cd871 - Exhumed: Fix menu scaling upon opening following changes in 979cc63835.
Fixes #238.
2020-08-24 17:11:51 +10:00
Mitchell Richters 6cbd607f31 - Exhumed: Stop playing `kSoundJonLaugh2` in `DLobotomyScreen` screenjob if `skiprequest` is true. 2020-08-24 16:51:38 +10:00
Mitchell Richters b5823385e1 - Exhumed: Fix if statement in `DrawWeapons()` following changes in e225e85ae1. 2020-08-24 16:02:12 +10:00
Mitchell Richters e225e85ae1 - Exhumed: Perform weapon bobbing with maximum precision and implement `cl_weaponsway`. 2020-08-24 13:22:52 +10:00
Christoph Oelckers fed70e6df7 - make Exhumed's intro block the UI.
Fixes #235.
2020-08-24 00:36:47 +02:00
Christoph Oelckers c60acd7af4 - fixed RR's HUD positioning when the weapon bar is active. 2020-08-24 00:35:04 +02:00
Christoph Oelckers e25d1c4cda - improvements for automap labels.
* use a CVAR to decide whether to show them at the top or bottom
* draw them on top of the screen border so that they don't get overdrawn on smaller windows.
2020-08-24 00:25:42 +02:00
Christoph Oelckers e7c1595531 - allow using a better font for the map name on the automap.
- allow displaying the map label on the automap.

So far only for Duke and related games, the rest will follow.
2020-08-24 00:05:36 +02:00
Christoph Oelckers f6417f5876 - fixed bad texture validation in Duke automap. 2020-08-23 23:02:15 +02:00
Christoph Oelckers 91b31cec39 - fixed: hud_messages completely blocked the messages, even from going to the console.
It should only block the on-screen notification display, which the backend already implements. The game code should not check this CVAR again.
2020-08-23 22:46:53 +02:00
Christoph Oelckers 41a1120033 - added a native style display mode to the notification message display.
Fixes #9
2020-08-23 22:39:53 +02:00
Christoph Oelckers 4469cf7edb - only go from menu to console when closing with Escape. 2020-08-23 21:24:31 +02:00
Christoph Oelckers c0da85d0ff - SW: fixed: When entering the summary screen, clear the FinishedLevel variable immediately.
So that its value won't stick around and trigger the screen again. Same when an exception occurs.
Fixes #232.
2020-08-23 20:55:21 +02:00
Christoph Oelckers 7417160abd - when closing the main menu, go directly to the full console.
Fixes #27
2020-08-23 20:48:48 +02:00
Christoph Oelckers c777fea1af - added back the player sprites in Duke/RR's player setup menu.
Fixes #46
2020-08-23 20:44:17 +02:00
Christoph Oelckers 8b8f048393 - moved parts of videoNextPage to app_loop. 2020-08-23 18:08:08 +02:00
Christoph Oelckers adb98a47ba - restructured the main loop code so that the actual loop is in the common code. 2020-08-23 17:47:05 +02:00
Christoph Oelckers 85875da77a - removed the old start-of-level-only savegame code.
This serves no purpose anymore, even with a checkpoint-based gameplay the full saves will do just as well.
2020-08-23 16:30:20 +02:00
Christoph Oelckers f7fcd341ec - removed redundant levelnum variable.
Better use the global map record.
2020-08-23 16:24:54 +02:00
Christoph Oelckers 1a0e413d5c - use CCMDs for Exhumed's input where applicable.
- made crosshair toggle consistent across games.
2020-08-23 16:11:18 +02:00
Christoph Oelckers 7fe7b9b8e0 - be gone, rotatesprite. 2020-08-23 14:59:34 +02:00
Christoph Oelckers a4a26ef6bc - removed the last uses of the original rotatesprite function. 2020-08-23 14:55:19 +02:00
Christoph Oelckers 2a3f7a48c9 - implemented a proper kill counter.
Unfortunately the display is a bit limited by the available font characters.
2020-08-23 14:39:14 +02:00
Christoph Oelckers e75cfd82f9 - the training map could not be started. 2020-08-23 14:00:53 +02:00
Christoph Oelckers 979cc63835 - use DrawTexture for rendering the menu items. 2020-08-23 13:57:56 +02:00
Christoph Oelckers 4d477bc15b - fixed uninitialized GameAction variable. 2020-08-23 13:57:31 +02:00
Christoph Oelckers 212b3ae0f9 - Exhumed: fixed map startuo 2020-08-23 12:59:01 +02:00
Christoph Oelckers 5c7b613aa7 - reworked the main loop. 2020-08-23 12:26:52 +02:00
Christoph Oelckers 7889605ff4 - condensed main loop further, started laying out the new one. 2020-08-23 09:11:32 +02:00
Christoph Oelckers 9e5ca8c408 - moved game and level init code out of app_main. 2020-08-23 08:22:59 +02:00
Christoph Oelckers 5ba384db35 - moved the main game ticker out of app_main. 2020-08-23 07:49:58 +02:00
Christoph Oelckers 3a3ba43985 - Exhumed: moved the input code out of the main loop 2020-08-23 07:41:29 +02:00
Christoph Oelckers fccd054381 - split off the entire game loop related code into its own file.
This should make it easier to work on this.
2020-08-22 22:40:22 +02:00
Christoph Oelckers 7401c0e133 - moved Ramses head code into its own file. 2020-08-22 21:39:14 +02:00
Christoph Oelckers 8589d43835 - migrated Exhumed's cheats to the global system.
This also eliminates the last pieces using that global string list. All relevant text is now in the external string table.
2020-08-22 21:13:11 +02:00
Christoph Oelckers 6d852c33dd - added CCMDs for all 'holly' cheats that didn't have an equivalent yet. 2020-08-22 20:34:58 +02:00
Christoph Oelckers 6b1d6a44d7 - exported the item pickup messages to the string table and use the global 'nomonsters' flag. 2020-08-22 20:14:00 +02:00
Christoph Oelckers bddd196539 - ported the credits screen. 2020-08-22 19:50:04 +02:00
Christoph Oelckers d94077f833 - exported cinema texts to the string table as well. 2020-08-22 18:30:48 +02:00
Christoph Oelckers 0843f5f04a - ported the final level's text screen and exported its text to the string table. 2020-08-22 18:12:19 +02:00
Christoph Oelckers 6f039164a3 - set up the computer font as SmallFont2.
Unlike the sheet font, this one is needed.
2020-08-22 16:24:42 +02:00
Christoph Oelckers 7e7f9670c1 - transitioned the text intermission screen to use DScreenJob and interpolate the scrolling text display. 2020-08-22 11:56:54 +02:00
Christoph Oelckers 8e34288a1c - moved the end level handler further out in the main loop. 2020-08-22 10:39:37 +02:00
Christoph Oelckers 8b3e3b6d4a - cleaned out some waiting code.
There's still too many loops but this at least gets rid of the empty ones.
2020-08-22 10:17:24 +02:00
Christoph Oelckers c74a1f03e3 - defer FinishLevel handling to the main loop instead of doing it deep inside the game logic code. 2020-08-22 10:03:21 +02:00
Christoph Oelckers 9f682083c8 - same procedure as last time. 2020-08-22 09:41:18 +02:00
sirlemonhead 80dd794550 PCExhumed: Handle integer overflow in PlotCourseToSprite() 2020-08-22 09:40:35 +02:00
Christoph Oelckers 2a1ef00542 - redirect messages from last commit to debug mode. 2020-08-22 09:39:49 +02:00
sirlemonhead b1c9ec1f47 PCExhumed: Handle the rest of the possible overflows for ksqrt() 2020-08-22 09:38:11 +02:00
sirlemonhead fc530a362d PCExhumed: Fix Selkis boss AI stupid typo 2020-08-22 09:34:09 +02:00
Christoph Oelckers b96f12aa34 - removed Exhumed's demo loop.
It was broken already anyway and also looks like a first grade refactoring blocker.
2020-08-22 09:31:17 +02:00
Christoph Oelckers e1fd0d8d80 - replaced most of the old text and graphics display functionality in Exhumed. 2020-08-21 22:40:09 +02:00
Christoph Oelckers ca943317e7 - ported Exhumed's map to the ScreenJob interface. 2020-08-21 22:30:51 +02:00
Christoph Oelckers 4467547c8c - fixed fortune cookie message display.
Fixes #219.
2020-08-21 21:15:32 +02:00
Christoph Oelckers a3915c6861 - added missing menu sounds for SW.
Fixes #220.
2020-08-21 21:04:16 +02:00
Christoph Oelckers a4d0e47389 - Exhumed: Play sound on Lobotomy logo
Fixes #224.
2020-08-21 19:40:18 +02:00
Christoph Oelckers 0f3555fc7c - fixed speed of SW's credits.
Fixes #229.
2020-08-21 19:38:38 +02:00
Mitchell Richters b9038db433 - remove all the discrete definitions of variables from alt HUDs in Duke/RR/SW. 2020-08-21 22:20:54 +10:00
Mitchell Richters 8e10bb8856 - SW: Don't flash the weapon's ammo icon when flashing text for low ammo in DrawHUD2. 2020-08-21 10:18:31 +02:00
Mitchell Richters d8db31bdd8 - Duke: Don't flash the weapon's ammo icon when flashing text for low ammo in RR FullscreenHUD1. 2020-08-21 10:18:31 +02:00
Mitchell Richters 2cabc4b14d - Duke: Don't flash the weapon's ammo icon when flashing text for low ammo in Duke FullscreenHUD1. 2020-08-21 10:18:31 +02:00
Mitchell Richters 4e0bef35c0 - simplify some of my math in the the fullscreen HUD drawers.
May no one ever see the original code again... :S
2020-08-21 16:23:44 +10:00
Mitchell Richters 3067bad9b9 - Blood/Duke/Exhumed/SW: Fix `map` CCMD so the game doesn't return to the menu if incorrect map specified (or crash in the case of Exhumed). 2020-08-21 15:11:02 +10:00
Christoph Oelckers 2713c2d3c3 - deleted unused printext function. 2020-08-21 00:54:57 +02:00
Christoph Oelckers 33dcb413d8 - final cleanup on Exhumed's intro sequence. 2020-08-21 00:49:07 +02:00
Christoph Oelckers 80055b97e8 - fixed the title screen 2020-08-21 00:30:46 +02:00
Christoph Oelckers 98c064dcbc - fixed the missing plasma effect in Exhumed's title screen. 2020-08-21 00:13:05 +02:00
Christoph Oelckers 6947b9cf98 - title screen WIP 2020-08-20 23:45:52 +02:00
Christoph Oelckers d9e23c0ab9 - missing null check 2020-08-20 23:41:45 +02:00
Christoph Oelckers 31e792223a - converted Exhumed intro to use the ScreenJob framework. 2020-08-20 21:05:14 +02:00
Christoph Oelckers da90bd3b6a - fixed: When drawing fullscreen, ignore texture offsets.
Fixes #218.
Exhumed also has a fullscreen image with bogus offsets.
2020-08-20 20:43:17 +02:00
Christoph Oelckers 4267b7d5fc - put the movie player in a class so that it can be allocated on the stack. 2020-08-20 18:35:52 +02:00
Christoph Oelckers 966cf5e262 - fixed the sound in Exhumed's intro movie.
Taking a cue from GDX to properly synchronize it because PCExhumed's approach looked broken by design.
It had no frame rate sync and solely depended on the low level audio stream for it.
2020-08-20 17:52:56 +02:00
Christoph Oelckers 3a5c0b30bb - statusbar fixup. 2020-08-20 17:04:21 +02:00
Christoph Oelckers 78bfbdb253 - Exhumed status bar work.
Unfortunately this is a bit limited due to how the data was designed.
2020-08-20 17:04:21 +02:00
Mitchell Richters 37d687e4e9 - Blood: Repair regression in `VectorScan()` from 266364fc2e causing demo regressions and other game issues.
Fixes #216.
2020-08-20 22:17:28 +10:00
Mitchell Richters cc15de3ed9 - SW: Comment out code block causing interpolation issues when initialising a nuke.
* If there was a `pNukePresent()` function, that's where the commented out code belongs.
* I believe the rocket switching type was simplified during development and this is just an omission that's now obvious with interpolation. Only just, but you can notice this in an uninterpolated state while bobbing.
* Fixes #212.
2020-08-20 08:52:22 +10:00
Mitchell Richters 7698723e43 - SW: Fix cheats via the console following changes in e22d9b21e4. 2020-08-20 07:43:57 +10:00
Christoph Oelckers 70bc99dba7 - Duke: draw the screen border after all the content it's supposed to mask. 2020-08-19 22:16:57 +02:00
Christoph Oelckers f888df9f5b - fixed screen resize actions to work outside the automap. 2020-08-19 20:38:36 +02:00
Christoph Oelckers d645674c1c - consolidated the DEF parser parts in the backend.
Only Blood had some special handling - better implement callbacks here instead of requiring a second parsing pass.
2020-08-19 20:29:37 +02:00
Christoph Oelckers dd20d74c51 - revert unintended change of text labels. 2020-08-19 19:18:47 +02:00
Christoph Oelckers cbe4618a91 - do not play the random sword selection sounds on a map's very first tic.
This tends to interfere with map specific voice lines.
Fixes #214
2020-08-19 19:07:06 +02:00
Christoph Oelckers c2fd4d3d18 - SW: reset screen blend when resetting a level.
Fixes #211
2020-08-19 17:31:05 +02:00
Christoph Oelckers 5cfd427e42 - renamed local totalclock variables to reduce noise for the forthcoming timer cleanup. 2020-08-19 17:23:18 +02:00
Christoph Oelckers 91cc6a657b - tick the fortune cookie display within the playsim code to ensure its duration is handled properly.
Fixes #204
2020-08-19 17:10:54 +02:00
Christoph Oelckers f327e3832a - fixed Blood's weapon drawer.
It didn't clear its custom flags and applied the wrong shade.
2020-08-19 16:56:36 +02:00
Christoph Oelckers e22d9b21e4 - changed SW's cheat prefix from 'sw' to 'lw' (i.e. Lo Wang) so that the cheats do not start with two movement keys. 2020-08-19 16:51:15 +02:00
Christoph Oelckers 94beac937d - scale down the notify display by 2 in RR.
Its fonts are double the size as the other games and this must be factored in here for HUD scaling to work as expected.
2020-08-19 16:40:54 +02:00
NY00123 829bc10ccb SW: If a saved load is loaded at a point which is right after killing
a boss, ensure that FinishTimer and FinishAnim are appropriately
updated. This commit bumps GameVersion.
Additionally, the set of FinishAnim to 0 in NewLevel had
to move to a different location (InitLevelGlobals2), so
it doesn't override the value stored in the saved game.

# Conflicts:
#	source/sw/src/game.cpp
2020-08-19 14:24:56 +02:00
Mitchell Richters 042caf1b21 - SW: Implement `cl_weaponsway` for game. 2020-08-19 15:35:04 +10:00
Christoph Oelckers 0a8f7e60b6 - fixed incompatibility of FindDistance3D with Shadow Warrior.
Fixes #200 and most likely many other issues as well.
2020-08-18 23:49:44 +02:00
Christoph Oelckers 57cdcda253 - initiate a proper game state reset when ending an episode.
Fixes #207.
2020-08-18 20:56:18 +02:00
Christoph Oelckers 6eba7dc410 - play music on the summary screen and check for advancing every frame.
Fixes #203
2020-08-18 20:26:16 +02:00
Christoph Oelckers 5acd7cf5e1 - SW: Stop music when ending game.
Fixes #205
2020-08-18 20:15:06 +02:00
Christoph Oelckers b417ad2f6d - 0 is a valid level number.
Fixes #206.
2020-08-18 20:12:04 +02:00
Christoph Oelckers aa5f42e5f4 - more header consolidation and cleanup.
In particular, this removes the pointless kTrue and kFalse constants.
2020-08-18 18:56:56 +02:00
Christoph Oelckers 4ea93ebccc Exhumed code cleanup
merging all AI headers and removing several unused files
2020-08-18 18:56:39 +02:00
Mitchell Richters 8d101a4a57 - SW: Properly fix the Uzi when reloading. 2020-08-18 22:48:58 +10:00
Mitchell Richters 471355dc2b - SW: Fix some typos in `pUziReload()`, fix some interpolation issues in `pUziClip()` and fix sequence of events in `InitWeaponUzi2()`. 2020-08-18 21:40:48 +10:00
Mitchell Richters a29d7bd3cd - SW: Change `pSpawnSprite()` x/y coordinates from int to double to preserve precision for some calls. 2020-08-18 21:39:20 +10:00
Mitchell Richters 7af5d26feb - SW: Fix the Uzi's reload interpolation issues. 2020-08-18 20:58:58 +10:00
Mitchell Richters 78e0e94f58 - SW: Fix interpolation issues with sword, fists and heart. 2020-08-18 20:49:12 +10:00
Mitchell Richters 5cc30ad7c6 - SW: Increase precision of x/y coordinates where possible. 2020-08-18 18:26:04 +10:00
Mitchell Richters d79c61d559 - SW: Interpolate between `ox`/`x` and `oy`/`y` coordinates in `pDisplaySprites()`. 2020-08-18 18:26:02 +10:00
Mitchell Richters df6f27530e - SW: Define `ox` and `oy` in `PANEL_SPRITEstruct` and back up panel sprite x/y coordinates where appropriate. 2020-08-18 18:26:00 +10:00
Mitchell Richters da2b1347ef - SW: Change `smoothratio` from int to double for storing returned result from `CalcSmoothRatio()` with full precision. 2020-08-18 18:25:58 +10:00
Mitchell Richters e8faca52a2 - SW: Prepare draw and panel code for interpolation of weapon's x/y coordinates. 2020-08-18 18:25:56 +10:00
Christoph Oelckers a535f62d4a - fixed: SW's intro cutscene must not terminate its sound.
Fixes #201.
2020-08-18 00:04:48 +02:00
Christoph Oelckers 65cb267d56 - save the cookie texts in a savegame and clear them on level exit. Also handle them on a per-player basis.
Fixes #196
2020-08-17 22:05:14 +02:00
Christoph Oelckers 9159855957 - SW: set the main view's projection after rendering the camera texture, not before.
Otherwise the main view will take over the projection settings from the camera texture.
Fixes #194.
2020-08-17 21:33:42 +02:00
Christoph Oelckers ba2ff12f5b - fixed summary screen properly this time.
Fixes #195
2020-08-17 21:19:18 +02:00
Christoph Oelckers 55de06ab2f - fixed a few incorrect text labels.
Fixes #193
2020-08-17 20:55:57 +02:00
Christoph Oelckers ca66e70d65 - print stats on secondary HUD. 2020-08-17 20:47:42 +02:00
Christoph Oelckers ebc16ffe14 - do not display ammo for fists and sword
Fixes #192
2020-08-17 20:43:31 +02:00
Christoph Oelckers 522d8af6ca - SW: implement the "end game" function.
Fixes #189
2020-08-17 20:38:46 +02:00
Christoph Oelckers 17f9bc8a8a - initiate a full game reset when respawning after death.
This was done with the old code but we now have to set the respective flag explicitly because the init code is inside the main loop, not outside.
Fixes #188
2020-08-17 20:30:44 +02:00
Christoph Oelckers 8011526e71 - SW: fixed crosshair size.
Fixes #186
2020-08-17 20:28:12 +02:00
Mitchell Richters b03450f200 - Repair minor Duke3D regression where `timerUpdateClock()` was no longer called in `newgame()` once 7bb6b6a1ee removed `handleevents()'.
Repairs issue when starting new games and the clock isn't right (particularly noticable on E1L1 start).
2020-08-17 21:53:47 +10:00
Mitchell Richters 77825b4927 - SW: Remove duplicate if statement line. 2020-08-17 21:11:53 +10:00
Mitchell Richters d0ed88221d - SW: Alt HUD positioning tweaks. 2020-08-17 21:10:40 +10:00
Christoph Oelckers d6701d91a3 - aded Alt. HUD icon tiles
Not tested yet, this merely uses the numbers from the item pickup function.
2020-08-17 01:06:29 +02:00
Christoph Oelckers f7291960c3 - draft version of the secondary fullscreen HUD.
All elements are present, but the icons are still missing because I do not know the proper numbers yet.
2020-08-16 23:52:44 +02:00
Christoph Oelckers 25e8636a60 - eliminated a few smaller headers. 2020-08-16 23:21:24 +02:00
Christoph Oelckers 736f1461ca - fixed the summary screen. 2020-08-16 23:00:05 +02:00
Christoph Oelckers 85538b467b - fixed some initialization issues with the new main loop.
Looks like all map starting cases are working now.
2020-08-16 22:45:19 +02:00
Christoph Oelckers 695d81f88c - main loop WIP. 2020-08-16 21:55:26 +02:00
Christoph Oelckers 60275c9b6b - started with SW's new main loop.
Intro and menu are done, the game loop is quite a mess, unfortunately.
2020-08-16 20:10:26 +02:00
Christoph Oelckers 57efb26567 - wrap Blood's main loop into an exception handler for recoverable errors. 2020-08-16 20:04:27 +02:00
Christoph Oelckers 01d9bde7f4 - more cleanup of game.cpp.
The game init code is done.
2020-08-16 19:11:04 +02:00
Christoph Oelckers baf1166319 - trying to bring order to game.cpp
Some reshuffling, plus moving the automap drawer to its own file.
2020-08-16 18:18:56 +02:00
Christoph Oelckers 78d3afb0bf - cleaning out more garbage. 2020-08-16 17:09:59 +02:00
Christoph Oelckers ab7774c6d7 - thinning out some garbage. 2020-08-16 16:57:42 +02:00
Christoph Oelckers a8b0839592 - switch SW to CCMD based input. 2020-08-16 16:00:40 +02:00
Christoph Oelckers 8c98d44620 - handle console-based map changes directly instead of the cheat handler.
This allows handling user maps again.
2020-08-16 14:54:33 +02:00
Christoph Oelckers 532b11467f - handle all level access and indexing through the mapinfo data.
No more level numbers will be stored in the game code.
2020-08-16 14:39:18 +02:00
Christoph Oelckers 9700b8435b - handle Blood's level progression by the actual level data, not some episode/level pair.
This should allow loading user maps again.
2020-08-16 13:49:28 +02:00
Christoph Oelckers 598ea99441 - simplify the music starting code in Blood. 2020-08-16 12:35:46 +02:00
Christoph Oelckers 0ac8568be0 - removed redundant fields from Blood's startup info struct. 2020-08-16 11:58:42 +02:00
Christoph Oelckers 90a4d0dcb8 - removed the non-functional user map handling.
This will have to be redone in a more flexible manner
2020-08-16 11:42:13 +02:00
Christoph Oelckers f9b953eeae - removed SW's network code. 2020-08-16 10:40:20 +02:00
Christoph Oelckers 7bb6b6a1ee - do not call handleEvents outside the main loop.
In other places I_GetEvent should be used to call the system's message pump and keep the app responsive, but all game side processing should be skipped.
2020-08-16 10:00:13 +02:00
Christoph Oelckers fbdc6c7a6c - removed dead Polymer handling in model code. 2020-08-16 09:36:32 +02:00
Christoph Oelckers 4b44e6e392 - removed redundant calls to timerUpdateClock. 2020-08-16 09:16:38 +02:00
Christoph Oelckers da38ad4554 - more dead code removal.
SW really has a lot of leftover commented out code...
2020-08-16 09:14:07 +02:00
Christoph Oelckers af2c836e54 - unused code cleanup. 2020-08-16 09:04:24 +02:00
Christoph Oelckers af4464ba16 - remove all sound precaching code in SW
We're loading all sounds at game startup anyway so there's no point to do this.
2020-08-16 08:46:51 +02:00
Christoph Oelckers ef78e8602a - major cleanup and consolidation of the screen/hud resizing code.
This is now being handled by the backend, except for the processing of the key bindings which cannot be done yet.
2020-08-16 02:55:50 +02:00
Christoph Oelckers 5cf54033ed - removed the demo code. 2020-08-15 22:31:44 +02:00
Christoph Oelckers deb9b74ce2 - got rid of all remaining rotatesprite calls in SW.
Also removed some dead code from player.cpp.
2020-08-15 22:04:37 +02:00
Christoph Oelckers 67b3a38fa3 - draw all menu elements with DrawTexture instead of rotatesprite 2020-08-15 21:09:21 +02:00
Christoph Oelckers 5e81f88907 - replaced SW's stats display with the shared version. 2020-08-15 21:03:42 +02:00
Christoph Oelckers 910ca69484 - migrated all of SW's text display to the backend and removed the various redundant printing functions. 2020-08-15 20:29:13 +02:00
Christoph Oelckers f0150569a4 - ported the load level screen and deleted some dead code in game.cpp 2020-08-15 16:41:08 +02:00
Christoph Oelckers aa8113cf06 - ported the level summary screens. Not hooked up yet. 2020-08-15 15:29:47 +02:00
Christoph Oelckers 8595b9fa47 -play SW's intro through the screen job framework. 2020-08-15 13:04:15 +02:00
Christoph Oelckers 3f9cc1412c - transitioning helper for screen jobs. 2020-08-15 10:55:21 +02:00
Christoph Oelckers 53cf248269 - added a few missing World Tour bits.
Looks like GDX missed the redefined new types of the old bosses.
Also guard the commentary sprites by a CVAR.
2020-08-15 10:25:30 +02:00
Christoph Oelckers a690f44fc8 - use constexpr for translation utilities 2020-08-15 10:22:07 +02:00
Christoph Oelckers c3ddde02b2 - use consistent types in FileReader's ReadInt* functions. 2020-08-15 07:33:21 +02:00
Christoph Oelckers 3d4177fbb2 - fixed return type of FileReader::ReadUInt64.
fixes #181.
2020-08-14 23:56:31 +02:00
Christoph Oelckers ff38cfe179 - open the in-game menu only when really inside a game and actually playing.
Fixes #182
This isn't foolproof but it's probably the best that can be done.
2020-08-14 22:41:32 +02:00
Christoph Oelckers 2403e8cb2c - fixed RRRA summary screens. 2020-08-14 22:31:54 +02:00
Christoph Oelckers 37ea207d5a - fixed another one of those stupidly badly designed iterator loops.
Fixes #176.
2020-08-14 21:49:12 +02:00
Christoph Oelckers 52ddac21b0 - fixed RR's transition to its final map. 2020-08-14 21:30:09 +02:00
Christoph Oelckers 3455610031 - base palette cleanup.
Avoid passing this anywhere in the client code. It should only be set right before rendering the 3D view and the only code using the base palette should be the 3D renderer and hud_drawsprite.
Also make the palette override CVARs 3D view only in debug mode.
2020-08-14 21:18:14 +02:00
Christoph Oelckers 249c5b5734 - removed some dead code. 2020-08-14 21:12:32 +02:00
Christoph Oelckers 19635c7bdf - render Blood's choking hands in the 3D view.
This may not be faithful but it looks a lot less buggy than placing these on top of the entire HUD.
2020-08-14 21:08:28 +02:00
Christoph Oelckers 66cb7f61a4 - fixed rendering on narrow screens with an aspect ratio less than 4:3 and removed some parts that are no longer needed. 2020-08-14 21:01:27 +02:00
Christoph Oelckers a5d9886aa9 - cleaned up the remnants of the old statusbar code. 2020-08-14 00:56:34 +02:00
Christoph Oelckers 67c340b573 - ported the inventory bar.
Now the panel system is only used for displaying the weapons.
2020-08-14 00:38:27 +02:00
Christoph Oelckers 70b2215f4e - ported the minibar HUD. 2020-08-13 22:37:58 +02:00