Commit graph

290 commits

Author SHA1 Message Date
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
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
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
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
8595b9fa47 -play SW's intro through the screen job framework. 2020-08-15 13:04:15 +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
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
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
aef59ef523 - migrated SW cheats to the generic system, removed the more pointless of SWP's cheats and filled in a few blanks. 2020-08-12 22:24:51 +02:00
Christoph Oelckers
2dad86a304 - made some adjustments to DMessageBoxMenu to handle screens that must close the menu before performing their option.
Fixes #173. The "End Game" menu option needs this.
2020-08-12 19:04:19 +02:00
Christoph Oelckers
2d545767ef - completely clear all texture data when setting a frame size.
SMK tries to draw a texture from it before the first frame has been rendered. This ensures that it gets a fully black frame.
Fixes #167.
2020-08-12 01:32:05 +02:00
Christoph Oelckers
57edd370a7 - fixed: When quitting the game, first clear the menu.
This is to ensure that the menu stack is empty.
Fixes 170
2020-08-12 01:15:03 +02:00
Christoph Oelckers
85364c2bb6 - let all video players respect the SoundEnabled setting.
Fixes #164.
2020-08-11 19:52:54 +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
b1c8046470 - fixed dimming checks for menu.
Now with proper game state management this can be done better.
2020-08-10 20:43:51 +02:00
Mitchell Richters
4c74c172e3 - fix screenjob.cpp PlayVideo() returning after stripping drive letter without checking whether it was able to re-open the file thereafter successfully.
Fixes #128.
2020-08-10 21:15:17 +10:00
Christoph Oelckers
d3df4e580c - do not restart one-page image scrollers with Enter
Instead go back one menu level.

Fixed #129
2020-08-10 01:12:53 +02:00
Christoph Oelckers
0492c5f4d3 - optimized reverb settings.
Fixes #124
2020-08-09 13:26:48 +02:00
Christoph Oelckers
596367f10f - Screenblend fixes. 2020-08-07 22:00:43 +02:00
Christoph Oelckers
3e8ff96e6b - added workaround for DukeDC's ending cutscene which was abusing undefined behavior in the original code. 2020-08-05 22:57:45 +02:00
Christoph Oelckers
454e0e36c9 - added a sound for advancing multi-screen menus.
Fixes #100.
2020-08-05 00:32:29 +02:00
Christoph Oelckers
d526c6401f - use the generic cheat system for Blood. 2020-08-03 20:51:31 +02:00
Christoph Oelckers
724c811de3 - Moved message storage to the map records. 2020-08-03 20:16:32 +02:00
Christoph Oelckers
35a5c4e23c - undid hardcoded coupling of Mapinfo slots with episode/level pairs in Blood.
This both lifts the imposed limit of 16 levels and will allow dynamic management of global mapinfo data.
2020-08-03 20:11:30 +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
Christoph Oelckers
dea0804f9a - how could this compile? 2020-08-03 19:14:33 +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
e434df5328 - always play menu sounds by calling M_MenuSound to check the menu_sounds CVAR. 2020-08-02 22:16:26 +02: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
3a32e8840f - ported Blood's status bar to the Status bar class.
Now it allows downscaling just like Duke's.
2020-08-02 13:35:34 +02:00
Christoph Oelckers
cc8798f6e2 - preparations for rendering Blood's status bar through the Statusbar class. 2020-08-02 08:39:51 +02:00
Christoph Oelckers
347ed51036 - refactored Blood's main loop.
* moved Smacker video playing code into the backend, so now all games can play all supported video formats
* logos and level intro/exit videos use ScreenJob
2020-07-29 23:18:08 +02:00
Christoph Oelckers
b49d04fd6e - fixed: The video player did not check the sound CVARs.
Fixes #58
2020-07-28 21:05:14 +02:00
Mitchell Richters
158fd46581 - change Duke's synchronized_input to CVAR cl_syncinput. 2020-07-28 21:38:28 +10: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
Christoph Oelckers
4836744d26 - language update. 2020-07-26 23:27:39 +02:00
Christoph Oelckers
c0d46f6a69 - implemented proper scaling for the status bar.
Addresses #2.
2020-07-26 23:06:27 +02:00
Christoph Oelckers
102f473821 - clear the input state before starting a cutscene to ensure that it won't get skipped by residual input data. 2020-07-26 19:55:06 +02:00
Christoph Oelckers
c8cde7fb3b - stop sound in all paths of the ANM player.
Fixes #36.
2020-07-26 18:02:24 +02:00
Christoph Oelckers
775eabcd3d - fixed incorrect 'twodonly' flag set for the base palettes.
This let the palette creator skip all translations for the water and slime palette. Fixes #28.
2020-07-26 17:56:33 +02:00
Christoph Oelckers
af970b091e - set proper game state after ending the level summary screen.
Fixes #20.
2020-07-26 12:43:32 +02:00