Commit graph

251 commits

Author SHA1 Message Date
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
Daniel Gibson
8554487bf5 Dhewm3SettingsMenu: Get rid of obscureBindingEntries list
they're part of the regular list now. this will help with the actual
binding implementation I'll merge next
2024-05-22 19:46:38 +02:00
Daniel Gibson
809bbfcccf Workaround for missing " or " string in Doom3 demo for Windows
The original binding menu uses #str_07183 between keys - this
should be " or ", but in the windows demo that entry is missing
in strings/english.lang
2024-05-22 19:46:38 +02:00
Daniel Gibson
9e4fe84eb8 Dhewm3SettingsMenu: some more joystick settings, stub of a binding menu
I actually did this before the prototyping of a keybindings menu
in the imgui example code, so the prototype is actually based on this.
I'll merge the code from the prototype back once it's done.
2024-05-22 19:46:38 +02:00
Daniel Gibson
c9a8901dbd ImGui: Improve integration, use scalable font, Control Options menu 2024-05-22 19:46:38 +02:00
Daniel Gibson
86be2eb513 initial support for DPI scaling of imgui 2024-05-22 19:46:38 +02:00
Daniel Gibson
ffaf135758 Start ImGui-based settings menu
the integration of that at least, the menu is still a stub
2024-05-22 19:46:38 +02:00
Daniel Gibson
c0c82e763a Initial ImGui integration in the engine
still a bit hacky, but shows imgui windows that can be clicked etc
2024-05-22 19:46:38 +02:00
Daniel Gibson
f4446ca666 Bump version to 1.5.4pre
this is not 1.5.3 anymore.
2024-05-22 19:46:19 +02:00
Daniel Gibson
a454d965a2 dhewm3 1.5.3 2024-03-29 01:41:04 +01:00
Daniel Gibson
d6c0bb2003 Make it build and work on old PPC Macs again (#568)
also added the changelog entry for in_namePressed
2024-03-27 01:04:11 +01:00
Daniel Gibson
9ccce9b4b6 in_namePressed: Only print key name on down events; document it 2024-03-25 02:39:34 +01:00
Biel Bestué de Luna
3504e693bf added a simple printing of the key/button pressed (#567)
added a simple helper print method to know what key/button is being pressed,
controlled via a bool cvar "in_namePressed" 1 or 0.
I tested it and it works with keyboard, mouse and gamepad.
2024-03-25 02:39:12 +01:00
Daniel Gibson
fac06f0421 1.5.3 RC2 2024-03-17 04:25:29 +01:00
Daniel Gibson
f6f654ee53 minizip: re-add doom3-specific changes 2024-02-12 05:05:31 +01:00
Daniel Gibson
954620e1b3 minizip/unzip.cpp: restore TRYFREE() macro
reverting this upstream commit:
384e50eea4
so we can still use a custom allocator
2024-02-12 05:03:02 +01:00
Daniel Gibson
2595a2dbe6 Update minizip source to latest code from zlib development branch
commit f56ad0aafa868303ce324ae8d45675570c66b050 from 2024-01-23
"Note termination of returned strings in contrib/minizip/unzip.h."

this is the code as it is upstream, the next commit will add some
doom3-specific changes
2024-02-12 04:51:14 +01:00
Daniel Gibson
8a3e0a328f 1.5.3 RC1 2024-02-04 21:57:44 +01:00
Daniel Gibson
5b8e67762b Also allow using "Pad Y" for leftclick in menus 2024-01-22 05:50:45 +01:00
Daniel Gibson
9e8d399257 Further gamepad improvements
- the gamepad button (or trigger) bound to attack (fire) now always
  acts like the left mouse button in menus
- Display correct button name for "Back" button on Playstation-like
  gamepads, even depending on whether it's PS3-like ("Select") or
  PS4/5-like ("Share")
- Log some more information about detected gamepads
2024-01-18 19:53:45 +01:00
Daniel Gibson
e7eb7d17fe Improve Nintendo Pro Controller support
and some general gamepad support improvements, like logging the
detected gamepad name and type
2024-01-18 06:09:33 +01:00