forked from dhewm/dhewm3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hacks for replacing some #defines in scripts
Note: A simpler approach would be replacing "#define GAME_FPS 60" and the similar defines for GAME_FRAMETIME and CHAINGUN_FIRE_SKIPFRAMES in the scripts with other values based on com_gameHz, for example to "#define GAME_FPS 144". However, that would have two disadvantages: 1. When changing com_gameHz, you'll have to reload the scripts 2. This changes the checksum of the scripts, so each time you change com_gameHz the checksum changes and your old savegames stop working. Luckily the scripts already have functions (that are implemented in the gamecode) that expose the FPS and FrameTime: sys.getTicksPerSecond() and sys.getFrameTime() So now we modify the #defines to call those functions instead. That will still break *old* savegames, but at least savegames made from now on will still work no matter what you set com_gameHz to. TODO: A problem with this approach is that the time sys.getFrameTime() returns is scaled when in slow motion, so I'll probably have to add another function for that This code is partly based on code from Stradex' "Add com_gameHz to play with higher HZ/FPS" PR: dhewm#297
- Loading branch information
1 parent
01d778c
commit 23bf43a
Showing
1 changed file
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters