Commit graph

271 commits

Author SHA1 Message Date
Daniel Gibson
c142dac6f7 Merge branch 'SDL3' 2024-10-29 03:26:57 +01:00
Daniel Gibson
7354fff406 Fix setting z_off64_t in minizconf.h
checking if Z_LARGE64 is defined doesn't make much sense because
that is from from zlib which this helps replace..
so on non-windows we always ran into the #define z_off64_t z_off_t
case which doesn't give us a 64bit offset on 32bit systems..
Should work better now.

fixes #622
2024-10-11 01:03:53 +02:00
Daniel Gibson
19f28e3c2d Fix more SDL3 compatibility problems
- use SDL_SetHint() to set the video driver to "dummy" for the
  dedicated server
- adjustments for some more functions that now return bool instead
  of int. I hope I found all cases of that now, at least in the generic
  and Linux code, may have to take a closer look at Windows- and Mac-
  specific code
2024-10-09 03:32:17 +02:00
Daniel Gibson
b3be9f7b31 Introduce and use sys_sdl.h to unify <SDL3/SDL.h> and <SDL.h> includes 2024-10-07 17:38:01 +02:00
Daniel Gibson
1a1962088d It builds with SDL3 and SDL2 and SDL1.2 (on Linux)
TextInput doesn't work with SDL3 yet, and non-Linux(-y) platforms
like macOS or Windows don't support SDL3 yet
2024-10-07 17:22:03 +02:00
Daniel Gibson
8863c36067 Bump version to 1.5.5pre 2024-08-16 01:29:59 +02:00
Daniel Gibson
2f9e52a804 Handle soft particles when loading graphics quality preset, #604
When applying the currently configured graphics quality preset
(it's set in the `com_machineSpec` CVar and applied with the
`execMachineSpec` command, or by using the menu), now soft particles
are disabled for all quality presets except for ultra, because this
feature has a noticeable impact on performance with some (slower) GPUs.
2024-08-16 00:25:34 +02:00
Daniel Gibson
6679490f0a bump version to 1.5.4 2024-08-03 01:47:27 +02:00
Daniel Gibson
c44c0ffda4 bump version to 1.5.4rc3 2024-07-30 02:41:45 +02:00
Daniel Gibson
b0d7c12404 Bump version to 1.5.4rc2 2024-07-29 02:57:04 +02:00
Daniel Gibson
a4f2d4ae55 Document +set fs_game_base in dhewm3 --help 2024-07-29 02:56:45 +02:00
Daniel Gibson
9c36d2f661 Mods menu: improve base and d3xp entries, set d3xp basemod for more mods
the base game entry is now called "Doom 3 (base game)" instead of
"dhewm3", which should be more obvious, and the d3xp entry now reads
"Resurrection Of Evil (d3xp)" instead of just "d3xp", which certainly
is clearer. d3xp now is also always second in the list (if installed)

Added the freshly supported perfected_roe and sikkmodd3xp mods to the
list of mods that need fs_game_base d3xp set, so they can be started
from the menu.

also added an entry for r_gammaInShader to Configuration.md
2024-07-27 22:11:59 +02:00
Daniel Gibson
4df8495d61 Document r_glDebugContext in Configuration.md; tiny fix in settings menu 2024-07-26 01:45:19 +02:00
Daniel Gibson
961b3f60bd Bump Version to 1.5.4rc1 2024-07-26 00:00:02 +02:00
Tom Kidd
ae6997aef5 On macOS, look for the game dylib in the app bundle 2024-07-25 06:09:25 +02:00
Daniel Gibson
2e0b093c79 Soft particles: Disable Particle Stage "softeningRadius" keyword
this avoid breaking the game DLL ABI (framework/DeclParticle.h is part
of the SDK), and for now doesn't make a difference, because that keyword
was introduced by TDM and thus is only used in their particle defs.

When we break the game ABI/API anyway (probably for high FPS support),
this commit can just be reverted
2024-07-25 04:05:51 +02:00
Daniel Gibson
724ab1727c Add settings for soft particles in menu, documentation, cleanups
r_skipDepthCapture is now called r_enableDepthCapture, and instead of
being a bool it's now an int with -1 meaning "enable if soft particles
are used"
2024-07-25 03:24:20 +02:00
Daniel Gibson
41eef54611 Merge soft particles from thedarkmod 2.04
don't really work, though
2024-07-25 03:24:20 +02:00
Daniel Gibson
10eee1eb43 map command without any arguments prints current map name 2024-07-25 02:47:33 +02:00
Daniel Gibson
9eff1d9be2 Dhewm3SettingsMenu: Rework resolution/windowed/MSAA part of Video Options
Now the CVars are set immediately and "Apply" only does
`vid_restart partial`, while "Reset" resets the CVars to the values
that were set when opening the menu.
This also works the other way around: Changing a CVar (in the console
or other menu or r_fullscreen with Alt-Enter) is immediately reflected
in the menu.

Furthermore, "fullscreen desktop" now is its own setting (=> can be set
even if windowed mode is selected), to accommodate switchting between
windowed and fullscreen with Alt-Enter
2024-06-12 22:47:43 +02:00
Daniel Gibson
44d19a4175 Implement GLimp_SetScreenParms() for "vid_restart partial"
"vid_restart partial" only changes the window size or its fullscreen
(or windowed) state, without recreating everything.
If that fails (or antialiasing settings have changed), it will fall back
to a full vid_restart (this behavior is different than original
 "vid_restart partial" that probably was implemented in Vanilla Doom3
 but not dhewm3)

This is used for Alt-Enter (which toggles between fullscreen and
windowed state) and when pressing the Apply button in the new Video Menu
2024-06-11 16:45:34 +02:00
Daniel Gibson
ac8eec932b Add r_windowResizable to configure if window is resizable
incl. setting in SettingsMenu

With SDL 2.0.5 and newer this change is applied immediately,
2.0.0 to 2.0.4 need a vid_restart
(with SDL1.2 we don't support it at all)
2024-06-08 11:39:21 +02:00
Daniel Gibson
a6870cabfc minizconf.h: (hopefully) fix MinGW compatibility of z_off64_t 2024-06-08 10:44:02 +02:00
Daniel Gibson
28b753d50b Fix crash in Dhewm3SettingsMenu after switching fullscreen w/ Alt-Enter
Seems like calling ImGui::CalcTextSize() is only safe after
(or at the end of) NewFrame()
2024-06-07 13:39:51 +02:00
Daniel Gibson
cff73ff591 Dhewm3SettingsMenu: Remove testing printfs 2024-06-07 11:53:04 +02:00
Daniel Gibson
81d912ab4b Give Dhewm3SettingsMenu a sane default size and position 2024-06-04 10:32:28 +02:00
Daniel Gibson
c317e604c6 Improve minizconf.h; in CMake, don't use C++-compilerflags for plain C 2024-06-04 09:30:54 +02:00
Daniel Gibson
1b344d4b78 Replace zlib with integrated miniz
using amalgamated miniz 3.0.2 from https://github.com/richgel999/miniz
and minizconf.h from Yamagi Quake II:
https://github.com/yquake2/yquake2/blob/master/src/common/unzip/miniz/minizconf.h
2024-06-03 22:02:56 +02:00
Daniel Gibson
a9bee9f76e Fix build on Windows/MSVC
for some reason <algorithm> dragged in <cstdio> which chocked on the
use_idStr_snPrintf #defines from Str.h
"fixed" by including <algorithm> first
also shut up some compiler warnings about signed/unsigned mismatch
2024-06-03 19:25:50 +02:00
Daniel Gibson
5376c6d74c HighDPI support, hopefully 2024-06-03 14:49:23 +02:00
Daniel Gibson
cb5d988058 Fix SDL1.2 build and some runtime issues with SDL1.2 2024-06-02 15:40:09 +02:00
Daniel Gibson
67a0dc8c46 Dhewm3SettingsMenu: Save number of BindingColumns in a CVar
so it gets saved in the config

also added another Game Option and added separators to that menu
2024-06-02 15:39:18 +02:00
Daniel Gibson
10312f6998 Allow disabling Dear ImGui integration in CMake
and do it automatically when using SDL1.2, as it requires SDL2
(or SDL3 once we support it)
2024-06-02 14:07:29 +02:00
Daniel Gibson
ecee402927 Dhewm3SettingsMenu: properly handle playername encoding and length
ImGui uses UTF-8 for strings, Doom3 uses ISO8859-1, so the playername
must be translated.
Also it seems like the playername should have at least 40 chars,
at least that's the limit imposed by the original Doom3 menu
2024-06-02 13:18:37 +02:00
Daniel Gibson
30e4a9bb51 Dhewm3SettingsMenu: Add game options and m_invertLook 2024-06-02 07:20:11 +02:00
Daniel Gibson
50d7129b1c New input CVars: in_allowAlwaysRunInSP, m_invertLook
in_allowAlwaysRunInSP allows using in_alwaysRun and in_toggleRun
in Single Player (it'll still drain your stamina!)

m_invertLook allows inverting mouse look, both for up/down and
left/right, if you're into that kind of thing
2024-06-02 07:16:44 +02:00
Daniel Gibson
bd22f55f56 Dhewm3SettingsMenu: Support new sound CVars, show OpenAL info 2024-06-01 07:11:14 +02:00
Daniel Gibson
7b6fdc845a Dhewm3SettingsMenu: Add Audio Options, make Video Options nicer 2024-05-31 15:58:12 +02:00
Daniel Gibson
fcbc757615 Add optional "nores" argument to Com_ExecMachineSpec_f()
if set, the display resolution (r_mode) is not modified
2024-05-30 09:04:06 +02:00
Daniel Gibson
410d2791ae Dhewm3SettingsMenu: More video settings, a few other tweaks 2024-05-30 08:59:28 +02:00
Daniel Gibson
2aaaeb1456 Dhewm3SettingsMenu: Added VSync option 2024-05-30 05:55:53 +02:00
Daniel Gibson
139020f52b Dhewm3SettingsMenu: More video options 2024-05-30 05:02:59 +02:00
Daniel Gibson
0e341176d4 Dhewm3SettingsMenu: Start implementing video options 2024-05-30 05:00:52 +02:00
Daniel Gibson
7af7508a7f ImGui stuff: Some tweaks
* Binding menu makes sure that the AllBindingsMenu always gets focus
  when opened
* Give binding-related popups slightly rounder edges
* Move Game Options tab behind Video and Audio Options
* Make warning overlays a bit less translucent
2024-05-28 04:49:24 +02:00
Daniel Gibson
4bdee4f638 Dhewm3SettingsMenu: Improve cursor handling and opening menu ingame
Pause the game (with g_stopTime) when the settings menu is opened
while ingame, unpause it when it's closed.
If the menu is open while ingame and an ImGui window has focus,
the mouse cursor is shown. If the player clicks outside an ImGui window,
it gets unfocused and the cursor is hidden and the player can look
around. Pressing F10 (or whatever key is bound to "dhewm3Settings")
will give focus back to an open ImGui window, pressing it again then
will close the settings window, pressing it once again afterwards will
open the settings window again.

handleMouseGrab() (in sys/events.cpp) now checks if sys_imgui thinks
that a cursor should be shown (via D3::ImGuiHooks::ShouldShowCursor())
and if so, shows it and ungrabs the mouse. This, together with
D3::ImGuiHooks::NewFrame() checking ShouldShowCursor() to (unset)
ImGuiConfigFlags_NoMouseCursorChange, should prevent flickering cursor
problems that sometimes occurred when ImGui's SDL2 backend and dhewm3
disagreed on whether the cursor should be visible.
2024-05-28 04:49:24 +02:00
Daniel Gibson
c0b6660389 ImGui styles: Allow writing only changed values to C++ code 2024-05-26 03:56:28 +02:00
Daniel Gibson
894aa67a8f Dhewm3SettingsMenu: Add button to copy current style to clipboard as C++ 2024-05-25 18:16:00 +02:00
Daniel Gibson
53906538e6 Dhewm3SettingsMenu: Scroll within the tabs and similar tweaks 2024-05-24 17:05:37 +02:00
Daniel Gibson
2e8cbc1344 Allow saving ImGui Userstyles
You can pry X macros from my cold dead hands
2024-05-24 16:16:47 +02:00
Daniel Gibson
2892e416f5 Add keybinding menu to Dhewm3SettingsMenu
I first developed that as a prototype in
https://github.com/DanielGibson/dhewm3/blob/imgui/neo/libs/imgui/examples/example_sdl2_opengl2/main.cpp
there one can also find a commit history from writing that code, even
though not all commit messages are overly helpful :-p
2024-05-23 19:28:10 +02:00