Commit graph

70 commits

Author SHA1 Message Date
Daniel Gibson
4f74c15afe Make sure MAX_OSPATH has sane size; fix some typos 2022-01-16 06:02:40 +01:00
Daniel Gibson
ae63021d00 Add absolute mouse mode and refactor mouse grabbing code
There were lots of places in the code that called Sys_GrabInput(),
some of them each frame.
Most of this is unified in events.cpp now, in handleMouseGrab() which
is called once per frame by Sys_GenerateEvents() - this makes reasoning
about when the mouse is grabbed and when not a lot easier.
Sys_GrabInput(false) still is called in a few places, before operations
that tend to take long (like loading a map or vid_restart), but
(hopefully) not regularly anymore.

The other big change is that the game now uses SDLs absolute mouse mode
for fullscreen menus (except the PDA which is an ugly hack), so the
ingame cursor is at the same position as the system cursor, which
especially helps when debugging with `in_nograb 1` and should also help
if someone wants to integrate an additional GUI toolkit like Dear ImGui.
2022-01-10 00:46:32 +01:00
Daniel Gibson
dcbe0b172e Print SDL2 "video driver" at startup 2021-11-21 03:13:35 +01:00
Daniel Gibson
5e4e1d61be Merge branch 'debugger' 2021-07-16 02:21:16 +02:00
HarrievG
6e8b6a6773 - automatically enable com_enableDebuggerServer when launching the debugger from a game which does not have the debugger server running 2021-07-05 10:09:28 +02:00
HarrievG
e32b178fd1 - setting com_debuggerSupported=false in style. 2021-07-03 01:33:46 +02:00
HarrievG
b80de2b89b - correctly reset com_debuggerSupported 2021-07-03 01:22:36 +02:00
HarrievG
784f1d567c - Moved debugger intialistion after GameDll load
- DebuggerServer will not intialize when the additional function FT_UpdateDebugger is not set
2021-07-03 01:14:49 +02:00
HarrievG
61019b97ff rename functionType for debugger 2021-07-01 09:07:35 +02:00
HarrievG
ebf53cdc21 rev feedback v1. 2021-07-01 01:09:15 +02:00
HarrievG
d4db77b9ed - Unbreaking Game and GameEdit API / ABI for game debugger use 2021-06-28 23:38:38 +02:00
Daniel Gibson
8eb91c79cb Force SDL to minimize the window when focus is lost, fix #360
This was changed in SDL 2.0.14 and causes problems on several platforms
and window managers.
Fix taken from Yamagi Quake II
2021-06-20 03:59:30 +02:00
Daniel Gibson
40fa8a7dfa Fix script debugging when server is running on Linux
the script paths were wrong, on Linux they were like
"pak000.pk4/script/doom_util.script" while on Windows it's only
"script/doom_util.script".
Fixed idFileSystemLocal::OSPathToRelativePath() to skip ...pk4/

also fixed GCC compile error in Common.cpp
2021-06-19 21:30:26 +02:00
HarrievG
8a455c3c7a - Debugger server can be toggled with : com_enableDebuggerServer [1 / 0]
- Added com_dbgClientAdr for debugger server to connect to
- Added com_dbgServerAdr for the debugger client to connect to
2021-06-19 21:30:26 +02:00
HarrievG
85167fa180 - fixed deadlock fix for debugger server 2021-06-17 05:44:23 +02:00
HarrievG
3ce93c7749 - Debuggersever now always builds, but is disabled by default in runtime.
- use com_enableDebuggerServer=1 to enable debugger server.
2021-06-17 05:44:23 +02:00
HarrievG
cd9284d876 - Debugger is guarded behind tools. 2021-06-17 05:44:23 +02:00
HarrievG
7a2ccee330 debugger 2021-06-17 05:44:23 +02:00
Daniel Gibson
1b2baf43ad Add information about dhewm3 build to savegames
like the dhewm3 version and the OS and architecture of the dhewm3
version that created the savegame.
Also added an internalSavegameVersion so be independent of BUILD_NUMBER

fixes #344
2021-02-21 06:05:47 +01:00
Daniel Gibson
5e7019ebfe Support reproducible builds, fixes #172
If REPRODUCIBLE_BUILD is enabled in CMake, the code will not use
__DATE__ or __TIME__ macros, but instead hardcoded values.

Wherever __DATE__ or __TIME__ were previously used, we now use
ID__DATE__ and ID__TIME__, which are either set to hardcoded values or
to __DATE__ and __TIME__ in neo/framework/Licensee.h.
2020-07-13 01:33:40 +02:00
Daniel Gibson
504b572ae4 Update sounds at ~60Hz instead of ~10Hz, fixes #141
For some reason sounds were only updated/started about every 100ms,
which could lead to delays of up to around 100ms after a sound gets
started (with idSoundEmitterLocal::StartSound()) until OpenAL is finally
told to play the sound.
Also, the actual delay drifted over time between 1ms and 100ms, as the
sound ticks weren't a fixed multiple of the (16ms) gameticks - and the
sound updates didn't even happen at the regular 92-94ms intervals they
should because they run in the async thread which only updates every
16ms...
Because of this, the machine gun and other rapid firing weapons sounded
like they shot in bursts or left out shots occasionally, even though
they don't.
Anyway, now sound is updated every 16ms in the async thread so delays
are <= 16ms and hopefully less noticeable.

You can still get the old behavior with com_asyncSound 2 if you want.
2020-07-12 04:43:53 +02:00
Daniel Gibson
9a95a2a1cf Building with editor support (on Win w/ VS2017) works \o/
Editor also seems to start, didn't test much further.

Only tested 32bit Windows, I fear the editor code isn't 64bit clean..

I hope I haven't broken anything elsewhere..
2019-01-13 22:52:28 +01:00
Daniel Gibson
42886f0e4b Modify check for Demo version to not break Game DLL ABI
Changing idSession would break the interface for Game DLLs, making the
existing ports of Mods incompatible.
Luckily we have idCommon::GetAdditionalFunction() for cases like this..

Also added a check for WEAPON_NETFIRING in idWeapon::EnterCinematic(),
I got an Assert() there in Debug builds.

Running the Demo seems to work now, at least I could finish it without
any problems (ignoring some warnings in the console)
2019-01-07 15:06:59 +01:00
Daniel Gibson
593141651a Fix ModWiki links in --help text, link Mods page in README 2018-12-21 04:49:00 +01:00
Daniel Gibson
d6773d304f Work around SDL bug that causes little freezes, see #188 2018-11-20 14:19:11 +01:00
Daniel Gibson
4a94ec0ac0 Output --help text to Console window on Windows
(that Console thing they wrote for the dedicated server which is also used
by Sys_Error())
2018-11-10 20:28:02 +01:00
Daniel Gibson
519cc68b0e idCommon::SetCallback() and GetAdditionalFunction() - for Mods
This is an ugly hack that allows both exporting additional functions
(incl. methods via static function + void* userArg) to Game DLLs
and setting callback functions from the Game DLL that the Engine will
call, without breaking the Game API (again after this change).
This is mostly meant for replacing ugly hacks with SourceHook and
similar and mods (yes, this is still an ugly hack, but less ugly).

See the huge comment in Common.h for more information.

Right now the only thing implemented is a Callback for when images
are reloaded (via reloadImages or vid_restart) - Ruiner needs that.

Also increased GAME_API_VERSION to 9, because this breaks the A[PB]I
(hopefully after the next release it won't be broken in the foreseeable
 future)
2018-09-30 05:06:20 +02:00
Daniel Gibson
9e2b73bff6 Implement --help cmdline arg, set version to 1.4.2pre
if --help or -h or -help or -? or /? is passed as commandline argument,
the help is printed (to stdout) and then the game quits.
The help shows some helpful commandline arguments, including how to
tell the engine where to find the game data, how to set the resolution
and more
2018-09-03 04:11:46 +02:00
Daniel Gibson
04266eee5e Make console history persistent
The console history is saved to a file on quit and restored after
starting the game.
So the commands entered in the console the last times the game was run
are still available in the console-history, just like commands that
were just entered.
2012-11-13 23:21:38 +01:00
Daniel Gibson
768fdb5707 Load base game's gamelib if mod has no own gamelib
Some mods/mappacks have their own game dir (fs_game) but no own gamelib.
Doom3 defaulted to the base game dll (I think), so we should do the same.

Fixes #44
2012-11-13 23:14:57 +01:00
dhewg
227e8ee5c9 Add SDL2 support to framework/Common.cpp 2012-07-20 21:02:59 +02:00
dhewg
f120900000 SDL2's SDL_TimerID is not a pointer anymore 2012-07-20 17:34:38 +02:00
dhewg
368bf2819c Log the SDL version 2012-07-20 17:34:32 +02:00
dhewg
7f3fc825ed Get rid of GetCardCaps()
Useless now.
2012-07-20 00:13:04 +02:00
dhewg
2a3d07e174 More logging cleanup 2012-07-20 00:12:55 +02:00
dhewg
d2b7eac843 Get rid of Sys_SetFatalError()
Unnecessary.
2012-07-06 01:24:25 +02:00
dhewg
b58f51dbfa Get rid of Sys_FPU_StackIsEmpty()
Same as with Sys_FPU_GetState().
2012-07-06 01:06:53 +02:00
dhewg
0ccef1eba8 Get rid of Sys_FPU_GetState()
This was only implemented with MSVC style asm.
Comments suggest that it was used to help catch invalid FOV calculations,
which were probably only happening with ancient compiler bugs.
2012-07-06 01:06:53 +02:00
dhewg
65b13cb73e Use a more modern way to set the fpu precision 2012-07-06 01:06:51 +02:00
Andre d
7a5b8b1ec0 Remove (faulty/outdated) video ram detection 2012-07-04 22:47:38 +02:00
dhewg
be37221024 Rename game libraries to the game name
Never use "game" as library name, use the game name instead. This
allows d3xp/mods to coexist in a single (installation-)directory.

This paves the way for future `make install` or binary installers.

Additionally, the "mods" menu entry works from within the game gui.
2012-07-04 02:18:43 +02:00
dhewg
822f9d30b5 Always load the game library from known places
Never use the virtual filesystem, and never use binaries from
pk4 files. Instead, try the build folder and fall back to the
known installation folder.
2012-07-04 02:18:43 +02:00
dhewg
e55753e626 Introduce fs_configpath
Split fs_savepath for config files. This is in preparation for
moving the writable paths on *nix to $XDG_DATA_HOME and
$XDG_CONFIG_HOME.
Affected files: config.spec, *.cfg, doomkey, xpkey.
2012-07-03 21:12:58 +02:00
dhewg
3256783af1 Get rid of ID_DEMO_BUILD
There are no demo pk4s compatible to this 1.3.1 codebase.
2012-07-03 21:12:55 +02:00
dhewg
b7ce0ef149 CMake: Use config.h for BUILD_OS and BUILD_CPU
This fixes, among others, FreeBSD 64bit builds where the build
system used a "amd64" suffix and runtime "x86_64".
2012-01-14 15:19:12 +01:00
dhewg
6a1d6cb842 Always allow multiple instances 2012-01-08 12:24:58 +01:00
dhewg
1fed72fbb4 Get rid of Sys_DoPreferences()
The OSX backend was the only one utilizing this to set CVars
for the video mode.
Not required anymore since its now based on SDL.
2012-01-05 00:24:13 +01:00
dhewg
03d4833aa9 Use memory mapped async mixing on OSX
The OSX specific preferences dialog sets com_asyncSound to "1"
when OpenAL is used, do the same.
2012-01-05 00:24:13 +01:00
dhewg
6f8bb2dfc3 Remove file logging feature from Common.cpp
SDL already redirects stdout and stderr into files, this is not
required anymore.
2012-01-02 15:44:46 -05:00
dhewg
c0d625685d Gracefully shut down SDL on exit 2012-01-02 15:44:25 -05:00