Commit graph

75 commits

Author SHA1 Message Date
Mitchell Richters
76776d24d7 - All Games: Remove use of ClockTicks and replace with int. 2020-08-26 09:49:42 +10:00
Mitchell Richters
b883204f6a - All Games: Remove remaining use of totalclock and associated timing code. 2020-08-26 09:49:34 +10: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
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
faf23d8ff0 - proper defaults for Blood. 2020-08-25 00:01:33 +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
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
7859a29e95 - use global variables to track automap state
So far implemented in Duke/RR.
2020-08-24 19:31:43 +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
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
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
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
6a10a7f266 - changed the rules for dimming the menu to be more clear
It will no longer depend on the game state when the menu was opened but the current game state - only on the dedicated menu screen there's no dimming - everywhere else a dim gets applied.

Also renamed GS_DEMOSCREEN to GS_MENUSCREEN for clarity
2020-08-11 00:46:27 +02:00
Christoph Oelckers
0036402be8 - removed most of the network code in Blood.
Mainly to expose the parts that still get used in single player because there's some problems here that need addressing.
ENet is also gone now.
2020-08-03 20:06:27 +02:00
Mitchell Richters
348acf95e0 - change division of delta between currentTime and lastTime from 8 to 72 to ensure smoothratio doesn't clip at 65536.
* Divisor of delta is there so smoothratio always starts off with some kind of value. After 10 minutes at 1100 fps, closest final result to 65536 was:

ototalclk: 4573
totalclk: 4576
gametics: 33.333 ms
elapsedTime: 33.331 ms
ratio: 0.999938
result: 65531.941356
2020-08-03 10:00:06 +10:00
Christoph Oelckers
6a305748ff - removed some C cruft from compat.h. 2020-08-02 21:25:03 +02:00
Mitchell Richters
0c12436092 - change returned value for CalcSmoothRatio() from int to double and pass through to displayrest() for future use with displayweapon().
* `displayrooms()` ultimately should be adjusted as well. For now, just relying on integer truncation as this is just a proof of concept.

# Conflicts:
#	source/core/gamecontrol.cpp
#	source/core/gamecontrol.h
2020-08-02 21:20:52 +02:00
Christoph Oelckers
18c3d9b240 - get the frame time right at the start of the frame, not when performing interpolations.
This is to factor think time out of the time span between frames and to avoid changes if the smoothratio gets calculated multiple times.
2020-08-02 21:16:01 +02:00
Mitchell Richters
3861064f62 - use 1/8 of delta time as initial elapsed time when calculating smoothratio on a new ototalclk.
* Pushes final result closer to 65536 and always ensures smoothratio never starts at 0.
2020-08-02 20:57:09 +02:00
Mitchell Richters
5000fde281 - restore legacy interpolation path behind CVAR cl_legacyintrpl.
* Hoping the old path being available will allow the new code to be merged.
* Applied offset to sum of `(totalclk - ototalclk)` of 0.5 to ensure calculated smoothratio under legacy path always returns a value.
* For the above, consider Duke 3D with 4 game tics per ticrate, the returned values would be:
0
16384
32768
49152
* With offset of 0.5, the following values are returned depending on how far advanced `totalclk` is from `ototalclk`:
8192
24576
40960
57344
2020-08-02 20:57:08 +02:00
Mitchell Richters
52d9fd4cda - add cl_debugintrpl CVAR to print interpolation information to the console.
* Also revert back to use of `xs_CRoundToInt()` that was accidentally removed previously.
2020-08-02 20:57:08 +02:00
Mitchell Richters
1cf857e788 - create an enum for MaxSmoothRatio and replace multiple hard-coded uses of '65536' constant. 2020-08-02 20:57:08 +02:00
Mitchell Richters
733f3aa490 - increase granularity of CalcSmoothRatio(). 2020-08-02 20:57:07 +02:00
Christoph Oelckers
371a808d9e - set MP taunt texts as CVAR defaults to ensure they won't get deleted by user actions. 2020-07-27 18:12:24 +02:00
Mitchell Richters
f67a53a7c0 - fix sound and music pausing with tweaks to updatePauseStatus(). Also removed unneeded game-side function. Fixes #11. 2020-07-26 17:20:53 +10:00
Christoph Oelckers
61f5247b71 -let's hope this will solve the pausing problem for good.
The checks for game pause were totally inconsistent, so now there is a utility function that tells whether the game is supposed to run or not.
pause can also take 3 values now - 0 for no pause, 1 for pause from opening the menu or console or 2 for hitting the pause button.
2020-07-21 22:46:26 +02:00
Christoph Oelckers
f9842fc4a8 - implemented running screen jobs from the main loop.
The entire game now has only one single place where videoNextPage gets called.
2020-07-20 18:43:48 +02:00
Christoph Oelckers
ea6c74d0e6 - transitioned the local input handler.
There wasn't anything EDuke32-specific in there - nearly everything mapped perfectly to JFDuke.
2020-07-15 19:48:04 +02:00
Christoph Oelckers
a9f152c1fe - added JFDuke's label type checker and did some cleanup on the CON init code.
Most importantly: Use dynamic buffers for managing the labels instead of hijacking some other storage space.
2020-07-15 12:34:42 +02:00
Christoph Oelckers
fedeec73c7 - cleaned out some unused parts of engine.cpp 2020-07-14 17:35:19 +02:00
Christoph Oelckers
117e78cb3b - removed clipshape feature as it is a feature of modern EDuke32 maps only. 2020-07-14 15:36:25 +02:00
Christoph Oelckers
f307b2a954 - removed the old Duke and RR subprojects.
These seriously stand in the way of backend cleanup that is needed to do a release based on the new code.
2020-07-14 13:09:34 +02:00
Christoph Oelckers
a93ed1e502 Merge branch 'master' into back_to_basics2
# Conflicts:
#	source/blood/src/view.cpp
#	source/core/gamecontrol.cpp
2020-07-14 12:57:38 +02:00
Christoph Oelckers
893686709b - removed the redundant rfreq factor from CalcSmoothRatio.
I never realized it was redundant when consolidating the interpolation math into one function - originally this was done in a way that it wasn't obvious.
This also eliminates the dependency on refreshFreq which never actually made any sense.
2020-07-14 12:32:59 +02:00
Christoph Oelckers
481ac965cf - reverted ClockTicks to an integer so that interpolation can be reimplemented without it affecting the global game timer.
The entire method at use here is essentially not correct. Interpolation should be handled independently of the game timer directly based on the underlying clock, like in ZDoom.
There's interpolation bugs in the Build games that cannot be fixed if totalclock is used for it, but if we use something else we do not need a fractional totalclock.
2020-07-14 11:52:38 +02:00
Christoph Oelckers
6b86d7606f - safety commit - does not compile! 2020-07-07 13:19:09 +02:00
Christoph Oelckers
39185300e7 - reimplemented cheats based on ZDoom's cheat parser. 2020-07-04 15:51:02 +02:00
Christoph Oelckers
d6e021a63d - statistics output 2020-07-03 21:44:57 +02:00
Christoph Oelckers
2e98b2f8da - quote cleanup. 2020-06-30 22:53:15 +02:00
Christoph Oelckers
99067f3bd6 - a small bit more is gone. 2020-06-23 21:12:15 +02:00
Christoph Oelckers
985fa2a159 - cheat and chat code from ZDoom.
Not active yet because it does not integrate with the current input code, but at least it's there now.

# Conflicts:
#	source/build/include/baselayer.h
2020-06-21 23:28:45 +02:00
Christoph Oelckers
99958342a9 - prepare the branch for adding new commits
# Conflicts:
#	source/core/gamecontrol.cpp
2020-06-21 20:59:16 +02:00
Christoph Oelckers
e9925eee0f - preparation work.
# Conflicts:
#	source/core/gamecontrol.cpp
2020-06-21 20:59:07 +02:00
Christoph Oelckers
76311cfcc9 - set proper minimal FPS rate for all games. 2020-06-20 10:46:51 +02:00
Christoph Oelckers
edd9f1773b - added the entry point for the ZScript compiler. 2020-06-14 19:20:04 +02:00
Christoph Oelckers
d4cdb31464 - backend update to make the ZScript compiler work. 2020-06-14 18:58:30 +02:00
Christoph Oelckers
ee98db589f - fixed the Exhumed startup to do proper fading of the publisher logos, which PCExhumed only implemented for the software renderer.
Made it faster than PCExhumed, though
2020-06-12 23:06:11 +02:00