Commit Graph

554 Commits

Author SHA1 Message Date
Azamat H. Hackimov
bde23461ea Replace non-portable itoa with sprintf
Minor fixes and header cleanup.
2024-05-19 02:34:09 +03:00
Azamat H. Hackimov
cd1e33baa4 Move lnxcontroller to linux submodule 2024-05-19 02:31:50 +03:00
Jeod
56e61275ce
Merge pull request #358 from winterheart/cfile-enhance
Cfile enhance
2024-05-17 13:51:31 -04:00
Jeod
7fcd78e009
Merge pull request #362 from pzychotic/cleanup
Deleted left over VS project file.
2024-05-17 13:44:44 -04:00
Jeod
2c4f44ad92
Merge pull request #361 from pzychotic/fix-line-endings
Converted line endings to Unix format to match .gitattributes file
2024-05-17 13:44:17 -04:00
Thomas Roß
1973aed32e [Misc] Deleted left over VS project file. 2024-05-17 18:40:32 +02:00
Thomas Roß
aecd737df0 [Misc] Converted line endings to Unix format to match .gitattributes file. 2024-05-17 18:36:41 +02:00
Jeod
2c99aa82ca
Merge pull request #316 from ziplantil/new-md5
replace md5 with custom implementation, with tests
2024-05-17 11:44:09 -04:00
Azamat H. Hackimov
43caa3d53c CFILE: Remove throwing exception in cf_ReadBytes()
All functions, that uses cf_ReadBytes(), checks return size, but don't handle potential exceptions. That leads to segfaults on reading of damaged files (i.e. broken savegames).
2024-05-16 23:27:56 +03:00
Azamat H. Hackimov
c505df182b CFILE: Use smart pointers for entries of library 2024-05-16 23:12:07 +03:00
Azamat H. Hackimov
f123dbe770 Replacing raw pointer with shared_ptr in cfile. 2024-05-16 22:31:43 +03:00
Azamat H. Hackimov
b84678de96 Move HOG2 magic check into hogfile
Remove unused cf_ReadHogFileEntry() function.
2024-05-16 19:18:31 +03:00
Azamat H. Hackimov
6703b25d34 Minor fixes to cfile 2024-05-16 18:21:30 +03:00
Azamat H. Hackimov
0f694a4fc5
Merge pull request #345 from Lgt2x/remove-aureal
Remove Aureal support
2024-05-16 15:34:35 +03:00
Jeod
01db899f56
Merge pull request #342 from Lgt2x/remove-ddaccess
Remove DDAccess.h header, and associated DD_ACCESS_RING definition
2024-05-15 17:42:05 -04: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
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
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