Commit Graph

704 Commits

Author SHA1 Message Date
Thomas Roß
11af2e7ec0 [Sound] Fixed array access with negative m_sound_index.
No idea why this doesn't crash in current builds, maybe just corrupts some memory if we get into if-statement?!
2024-05-15 20:16:31 +02:00
Thomas Roß
435b1f48bb [Win,hog] Load the newly created d3-win.hog after all other hog files from the original game.
The last library opened with cf_OpenLibrary() will be the first to be searched for DLLs. This way we make sure to load our x64 DLLs before the x86 versions from the original game data.
2024-05-15 20:13:28 +02:00
Thomas Roß
1bf84737e5 [Scripts] Dllexport script entry points. 2024-05-15 20:09:18 +02:00
Thomas Roß
57c8347853 [Win,x64] Activated the compilation of scripts and netgames for Windows.
We now need native x64 versions of it.
2024-05-15 20:00:39 +02:00
Thomas Roß
0c09eed1b7 [Win,x64] Replaced inline assembly for int3 with debug_break() to fix compile errors in x64 builds. 2024-05-15 19:55:45 +02:00
Thomas Roß
6ecafd9e68 [Win,x64] Fixed WinApi types and function calls.
Lots of these truncated 64bit pointer or handle types to 32bit.
2024-05-15 19:52:01 +02:00
Thomas Roß
bac882c7d6 [Win,x64] Disabled some 'mono' debugger stuff due to compile errors in x64. 2024-05-15 19:46:01 +02:00
Thomas Roß
caf1981015 [Win,x64] Disabled callstack and exception info logging due to compile errors in x64. 2024-05-15 19:44:41 +02:00
Thomas Roß
0b877524a3 [Win,x64] Removed unused code that won't compile in x64. 2024-05-15 19:42:11 +02:00
Thomas Roß
2e4d25e4ee [DirectX] Updated DirectX SDK to August 2007 version.
This is one of the last versions still containing DirectDraw + DirectSound and also has x64 support.
2024-05-15 19:39:01 +02:00
Azamat H. Hackimov
ad7c384581
Merge pull request #348 from pzychotic/fix-screenshot-crash
Fixed double delete/free in rend_Screenshot().
2024-05-15 10:42:56 +03:00
Louis Gombert
72c0a46dcc Fix -Wnull-conversion using explicit false 2024-05-15 00:18:44 +02:00
Louis Gombert
979cc58e67 Fix -Wnon-c-typedef-for-linkage warning using C++ struct declaration syntax 2024-05-15 00:07:49 +02:00
Louis Gombert
c1db7c70de Fix double extern qualifier warning in idmfc.h
Functions declared in idmfc.h were prefixed by both macros `EXTERN` and `DLLEXPORT`. `EXTERN` expands to `extern "C"` for C++ code, and `DLLEXPORT` expands to `extern "C"` for C++ or `extern` for C code, making up two `extern` qualifiers for C++ code. We now only use DLLEXPORT macro.
2024-05-14 23:51:08 +02:00
Louis Gombert
f1d46017f5 Fix compiler warning -Wimplicit-const-int-float-conversion using explicit casts 2024-05-14 23:33:17 +02:00
Louis Gombert
213ef87652 Fix mixer option index without A3D 2024-05-14 23:10:17 +02:00
Jeod
fd3f171777
Merge pull request #341 from Lgt2x/remove-spdlog 2024-05-14 15:56:00 -04:00
Thomas Roß
9204b075ed [Renderer] Fixed double delete/free in rend_Screenshot(). 2024-05-14 21:24:01 +02:00
Louis Gombert
86c8681afb
Merge pull request #344 from MaddTheSane/patch-1
Add missing va_end calls
2024-05-14 14:39:49 +02:00
Louis Gombert
959da14ff5 Remove spdlog dependency, keep the logging module 2024-05-14 14:12:03 +02:00
Louis Gombert
13711c3036 Remove Aureal support
D3 used to support Aureal 3-Dimensional sound cards, providing 3D spatial audio. The hardware and drivers is outdated, so all support in code has been removed, including UI mixer setting.

Read more about A3D here: https://en.wikipedia.org/wiki/Aureal_Semiconductor#A3D
2024-05-14 00:56:34 +02:00
C.W. Betts
6ea2633600
Update DallasFuncs.cpp
Add missing va_end calls
2024-05-13 16:04:36 -06:00
Louis Gombert
dc138e4912 Remove DDAccess.h header, and associated DD_ACCESS_RING definition
This definition was used to control the accessibility of some class members, changing protected qualifiers to public. This introduced unnecessary coupling between components and headers.

All conditional access specifiers have been set to public, which should not be a problem given the low number of classes that actually used affected members. Another albeit more complex solution could have been to use friend classes.
2024-05-13 23:21:05 +02:00
Jeod
07262f6fef
Merge pull request #338 from JeodC/renderdistance
Bump MAX_CELLS_TO_RENDER
2024-05-13 09:08:15 -04:00
C.W. Betts
446ead20d6 Make plug-ins and modules only export select symbols. 2024-05-13 01:22:40 -06:00
Azamat H. Hackimov
71244290e0
Merge pull request #333 from Jayman2000/minor-hog-id-detection-improvements
Minor improvements to `cf_OpenLibrary()`’s HOG2 id detection code
2024-05-13 04:18:24 +03:00
Jason Yundt
d5e893fcb4 Prevent potential uninitialized memory access
Before this change, cf_OpenLibrary() did something along the lines of
this:

  char id[4];
  fread(id, 4, 1, fp);
  strncmp(id, "HOG2", 4);

If fread() finishes successfully, then that code is fine. However,
fread() might encounter an error or bump into the end of a file. In
those scenarios, the value of id will not necessarily be initialized
[1]. In other words, when fread() fails, strncmp() might operate on
uninitialized memory.

This change makes sure that the value of id only gets used if fread()
succeeds. Additionally, this change fixes a GCC warning about ignoring
fread()’s return value.

[1]: <https://en.cppreference.com/w/cpp/io/c/fread>
2024-05-12 20:38:35 -04:00
Jason Yundt
e042925001 Stop using hard coded value for HOG2 id length
Before this change, cf_OpenLibrary() was inconsistent. Sometimes, it
would refer to the size of a HOG2 id using the literal 4. Other times it
would refer to the size of a HOG2 id using strlen(HOG_TAG_STR). There
was a good reason for this. Some compilers allow you to do this:

  char id[strlen(HOG_TAG_STR)];

Other compilers throw an error if you try to do that [1].

This commit makes cf_OpenLibrary() more consistent. It makes it so that
cf_OpenLibrary() always uses the same constant expression when referring
to HOG_TAG_STR’s length.

[1]: <https://devblogs.microsoft.com/oldnewthing/20221114-00/?p=107393>
2024-05-12 20:38:32 -04:00
Jeod
febc90c2d3
Merge pull request #329 from pzychotic/window-mode
Window mode
2024-05-12 16:48:03 -04:00
JeodC
439572a2a3 Bump MAX_CELLS_TO_RENDER
Bump max cells to 32678 from 8000, allowing a much larger render distance for outdoor terrain. This commit also fixes MAX_HORIZON_PIECES, which may have been broken during a clang-format.
2024-05-12 15:25:52 -04:00
Jeod
bb98a2eb03
Merge pull request #337 from Lgt2x/gamegauge-removal
Remove Gamegauge and -timetest command-line argument
2024-05-12 15:11:58 -04:00
Louis Gombert
196c155895 Remove Gamegauge and -timetest command-line argument
Gamegauge is an outdated 3D performance benchmark tool. The -timetest command was used to activate it. Read more about about it here: https://www.gamespot.com/articles/3d-gamegauge-explained/1100-2463688/
2024-05-12 18:32:46 +02:00
ziplantil
3a0ec74460 move md5 tests to md5/tests/ 2024-05-12 18:07:13 +03:00
ziplantil
9c1f6e4b73 fix 64n+56 bug 2024-05-12 18:07:13 +03:00
ziplantil
b12baa9715 add one more test; this feeds 60 bytes and tests 'overflow' in blocks 2024-05-12 18:07:13 +03:00
ziplantil
93ea1b7d42 replace md5 with custom implementation, with tests 2024-05-12 18:07:13 +03:00
Jeod
6a3e3060ed
Cleanup init.cpp (#334)
Cleans init.cpp. Removes a lot of outdated code and adds some extra messages for debugging.
2024-05-12 16:51:20 +02:00
Thomas Roß
2904af5762
Merge branch 'DescentDevelopers:main' into window-mode 2024-05-12 12:07:54 +02:00
Jeod
ed385adb59
Merge pull request #336 from Arcnor/fix_330_b
OpenGL fix for certain drivers/cards
2024-05-11 17:42:29 -04:00
Edu García
23abc42faa OpenGL fix for certain drivers/cards 2024-05-11 22:34:05 +01:00
Jeod
9e582a9245
Merge pull request #335 from JeodC/boanotvalid
Silence boa error
2024-05-11 10:51:07 -04:00
JeodC
a6bde8ce6d Silence boa error 2024-05-11 10:02:15 -04:00
Louis Gombert
0cba11c908
Merge pull request #328 from MaddTheSane/xcodeAsan
Quiet/fix a couple of static analyzer warnings as reported by Xcode.
2024-05-11 01:20:15 +02:00
C.W. Betts
d3a486ee24 Remove commented-out code. 2024-05-10 12:53:06 -06:00
Thomas Roß
2809da9a35 [Windows,Mouse] Restricted the mouse movement to the actual window area to prevent accidental focus loss by clicking outside the window. 2024-05-10 17:12:36 +02:00
Thomas Roß
e9a8755da7 [WindowMode] Prevent application window to minimize when the game is inactive. 2024-05-10 17:08:21 +02:00
C.W. Betts
1746a57688 Quiet another asan bug. 2024-05-09 21:15:18 -06:00
C.W. Betts
3bb0caafc4 Quiet/fix a couple of static analyzer warnings as reported by Xcode. 2024-05-09 21:02:44 -06:00
Edu Garcia
f793797088
Merge pull request #325 from Arcnor/png-screenshot
Save screenshots as PNG
2024-05-09 23:22:30 +01:00
Jeod
6f3cdd78f2
Merge pull request #321 from Arcnor/deadcode-removal5
more software renderer code removal
2024-05-09 18:15:05 -04:00