Commit Graph

200 Commits

Author SHA1 Message Date
Azamat H. Hackimov
974c703906 Reordering dd_sndlib and dd_lnxsound into sndlib
Consolidate all sound related code into one module.
2024-05-22 22:03:43 +03:00
Louis Gombert
f5d5ea947b
Merge pull request #367 from winterheart/lnxcontroller
Reordering linux modules, cleanup code
2024-05-22 18:37:18 +00:00
Louis Gombert
e66c359947
Merge pull request #340 from MaddTheSane/visibility
Hide module symbols by default
2024-05-22 17:39:11 +00:00
Thomas Roß
56288c819e Merge branch 'main' into win-x64 2024-05-21 00:54:53 +02:00
JeodC
e4e1963364 Get executable path for -useexedir 2024-05-20 11:40:14 -04:00
Thomas Roß
7033fd5d96 Merge branch 'main' into win-x64
# Conflicts:
#	lib/win/win32app.h
#	win32/winapp.cpp
2024-05-19 16:25:33 +02:00
Thomas Roß
5e580b3f6c [WinApp] Fixed missing initialization of m_MsgFn array in ctor.
Rewrote the C-style array to std::array while at it.
2024-05-19 13:23:15 +02:00
Azamat H. Hackimov
20d38d7367 Use C99 standard vsnprintf() function 2024-05-19 12:40:50 +03:00
Azamat H. Hackimov
3fa32ff386 Reorder headers related to linux module 2024-05-19 12:21:43 +03:00
Azamat H. Hackimov
bde23461ea Replace non-portable itoa with sprintf
Minor fixes and header cleanup.
2024-05-19 02:34:09 +03:00
Thomas Roß
4072dcb3bd
Merge branch 'DescentDevelopers:main' into win-x64 2024-05-17 20:06:34 +02: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
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ß
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
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
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
C.W. Betts
446ead20d6 Make plug-ins and modules only export select symbols. 2024-05-13 01:22:40 -06:00
Thomas Roß
e9a8755da7 [WindowMode] Prevent application window to minimize when the game is inactive. 2024-05-10 17:08:21 +02: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
Edu García
7ccc38e64f restore renderer_type numbering to avoid issues when loading config 2024-05-09 22:58:51 +01:00
Edu García
80c207d41c save screenshots as PNG 2024-05-09 22:46:17 +01:00
Edu García
5d8affda0e small bitmap code cleanup 2024-05-09 22:43:04 +01:00
Edu Garcia
1f94e623b2
Merge pull request #315 from Arcnor/renderer-refactor
Renderer refactor
2024-05-09 13:15:22 +01:00
Edu García
fbd6350917 more software renderer code removal 2024-05-09 12:11:49 +01:00
JeodC
a4ab78192c Join license header with historical commentrs
Join the license header with historical comments using a separator so IDEs can correctly parse the initial header.

Also use .gitattributes to ensure all files are LF.
2024-05-08 14:41:19 -04:00
Edu García
7c362288ad [gl] extracted some common GPU rendering code (empty impls) 2024-05-08 17:47:21 +01:00
Edu García
a1900bc85b remove unused code (more Software renderer code) 2024-05-08 16:23:12 +01:00
Louis Gombert
fe6bf7bf32
Merge pull request #303 from Arcnor/deadcode-removal2
remove unused code (mainly windows.h)
2024-05-08 14:49:53 +02:00
Edu García
3440667e93 remove unused code (mainly windows.h) 2024-05-07 23:45:33 +01:00
C.W. Betts
c6da74b069
Mark functions and variables as static (#185)
* Begin by marking functions and variables as static when needed.

* More work.

* More work.

* More pokes.

* More work.

* More work.

* Initial work on the netgames.

* Revert changes to the license header on source files.

* clutter.cpp poke.

* One final poke.

* Move some declarations to headers:

Move paged_in_count and paged_in_num to gamesequence.h
Move DoneLightInstance and StartLightInstance to polymodel.h

* Look over the AI script/plug-ins.

* Going over the changes one last time.

* Fix rebase errors.

* More migration from bare statics to static inlines.
2024-05-07 23:35:28 +02:00
Edu Garcia
553f851714 remove unused code 2024-05-06 22:06:26 +01:00
Edu Garcia
a26ced7d4c remove unused serial code 2024-05-06 19:01:48 +01:00
Louis Gombert
0e69bf465f
Merge pull request #241 from icculus/ryan-sdl2-port
Initial SDL2 port
2024-05-06 08:57:20 +00:00
Jeod
52e66c3275
Merge pull request #233 from jcoby/64bit-fixes 2024-05-04 12:01:06 -04:00
Louis Gombert
d36af47214 Remove unused header dyna_svga.h 2024-05-03 19:43:41 -04:00
Louis Gombert
321145c28f Remove usage of DECLARE_POINTERS in dyna_curses.h 2024-05-03 19:43:41 -04:00
Louis Gombert
053aef798e Remove unused header dyna_pthread.h
This header is a duplicate of dyna_pthread.h in lnxmvelib/, and is never included anywhere
2024-05-03 19:43:41 -04:00
Jacob Coby
b64f17fb17 Merge branch '64bit-fixes' of github.com:jcoby/Descent3 into jcoby-64bit-fixes 2024-05-03 16:46:11 -04:00
Azamat H. Hackimov
5aca8b7e5a Reorganizing fix library 2024-05-03 16:22:35 -04:00
Ryan C. Gordon
b5d68319d5
Use SDL_assert on Linux/Mac. 2024-05-02 08:29:23 -04:00
Louis Gombert
10832ff91d
Merge pull request #237 from winterheart/remove-ipx
Remove IPX/SPX protocol support from netcode
2024-05-01 11:31:45 +00:00
Azamat H. Hackimov
b063f40b1a
Merge pull request #207 from Nakhr11n/pstring-refactor
Refactor CleanupStr in misc/pstring.cpp
2024-05-01 00:45:03 +03:00
bperris
27eadbf66b
Merge branch 'main' into new-log-system 2024-04-30 14:38:11 -04:00
Louis Gombert
3bdbdc196f
Merge pull request #204 from winterheart/split-debug-module-v2
Move debug functions to own module
2024-04-30 18:35:00 +00:00
Bryan Perris
b0e5754e96 Introduce spdlog logging system
* The game version is now printed via the log system rather than from within the loki_initialize function.
remove this line
2024-04-30 14:27:38 -04:00
Azamat H. Hackimov
ca83125abc Remove IPX/SPX protocol support from netcode
IPX/SPX stack is deprecated and has no support on modern systems.
2024-04-30 18:24:45 +00:00
Ryan C. Gordon
f8a4cb3cc0
More X11 removal.
This is all unused stuff, just doing a more-complete purge.
2024-04-30 13:04:15 -04:00
Ryan C. Gordon
6a18afab7c
Remove references to X11 and glX.
This is all in unused/unnecessary/leftover code, but the code wouldn't
build without Xlib headers on the system, which was forcing the Mac builds
to install xquartz.

This also removes renderer/SoftwareOpenGL*, which was _not_ a
software-rendered OpenGL, but just an older version of the same code that's
in HardwareOpenGL.cpp--old enough to still talk to glX directly, which is
what caught my attention.
2024-04-30 12:08:03 -04:00
Azamat H. Hackimov
2aece028d0 Move debug functions to own module
This commit is part of efforts to isolate subsystems of project into own modules.
2024-04-30 00:58:34 +03:00
Jacob Coby
5775abf198 Back out lib/directplay.h 2024-04-29 17:04:48 -04:00
Jacob Coby
497ac00a61 Back out networking.h 2024-04-29 16:43:35 -04:00
Oskar Strengbohm
ee12e3a5dd misc: pstring: Improve CleanupStr. 2024-04-29 22:11:57 +02:00
Azamat H. Hackimov
b0cef3ff0e
Merge pull request #197 from Nakhr11n/pstring
Refactor and remove unnecessary in misc/pstring.cpp and dependents.
2024-04-29 22:23:48 +03:00
Jacob Coby
fbb2fcb769 Revert pstypes.h 2024-04-29 14:56:58 -04:00
Jacob Coby
a6a6869a7e 64 Bit-Safe Updates
Imported Icculus' 64-bit changes.

Changes `[un]signed long` data types to `[un]signed int`.
2024-04-29 14:10:09 -04:00
C.W. Betts
61e9a42a73 Add virtual default destructors on a few abstract classes. 2024-04-29 15:28:30 +00:00
Oskar Strengbohm
f9fdfc22e8 misc: pstring: Remove unneccesary or unused functions. 2024-04-29 09:55:45 +02:00
Ryan C. Gordon
6c8977caf0
Heavy patching for compiler warnings.
The vast majority of this is fixing up `char *` that should be `const char *`
but a handful of other fixes, like potential buffer overflows that GCC
noticed, etc, were applied as well.

This removes `-Wno-write-strings` from CMakeLists.txt, as it is no longer
necessary, as there is no longer a flood of compiler warning spam when
building.

This does not fix all compiler warnings; there are still a handful, and they
are legitimate, but they can be dealt with in a future commit.
2024-04-29 00:18:56 -04:00
Azamat H. Hackimov
1926a77f19 Introducing git revision in source code
Git revision is generating on build time (not on configure time). In case of uncommited changes this revision will be marked as "dirty". If cmake cannot retrieve revision from git history (i.e. from packaged source code), cmake will attempt to read "git-hash.txt" from `PROJECT_SOURCE_DIR` (it will be generated on build time; after implementing packaging workflow it can be reworked).
Reworked main screen and console output to display proper version.
Version project now is 1.5.0 as previous PATCH value (500) was intended to be D3_RELEASE_BUILD_NO, autogenerated on compile time. As we switched to GIT_HASH, D3_RELEASE_BUILD_NO now useless.
2024-04-28 22:05:26 +03:00
Chris Sarbora
1bc5648a9a
Remove MacOS (Classic) code and all references (3/3)
At this point, all remaining references to `MACINTOSH` are either part
of multi-value conditionals that `unifdef` was unable to determine the
final value for, or a `#define`, or a comment. I manually go through the
files with a Ctrl+Shift+F search (ignoring legacy/, to preserve useful
historic knowledge) and clean up each usage.

As part of that search, I discovered `lib/mac/` which I deleted wholly.

Test Plan:
On Mac, build both Debug and Release
```
cmake --build --preset mac --config Debug
cmake --build --preset mac --config Release
```
2024-04-27 07:44:40 -07:00
Chris Sarbora
e6ba1906c9
Remove MacOS (Classic) code and all references (1/3)
The MACINTOSH define refers to MacOS Classic (not OS X) which we do not
plan to support. Rather than carry the cruft forever, let's delete it.

NOTE: legacy/ is unused but we're keeping it around, so MACINTOSH uses
there are left alone.

Process used for this commit:
```
git rm -r mac
find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" \) \
  -exec unifdef -UMACINTOSH -o {} {} \;
git restore legacy
git add .
```

Test Plan:
On Mac, build both Debug and Release
```
cmake --build --preset mac --config Debug
cmake --build --preset mac --config Release
```
2024-04-27 07:38:14 -07:00
Oskar Strengbohm
b54d22614d misc: Remove endian.cpp and lib/psendian.h
They were not used, and a better alternative is now lib/byteswap.h
2024-04-24 17:27:21 +02:00
Edu Garcia
a4f6405cea
Merge pull request #165 from winterheart/64bit-tests
Implementing C++ byteswap functions
2024-04-23 22:49:18 +01:00
Azamat H. Hackimov
4826c37a69 Add BUILD_INTERFACE to cfile module
Other modules that depends on it, can reuse includes on linking.
There some files formally not belonging any packages (lib directory), as workaround there temporary include_directories(cfile) on root of project. After migrating all modules this can be removed.
2024-04-24 00:41:02 +03:00
Azamat H. Hackimov
c275d359c7 Reapply "Cfile module update"
This reverts commit 066b436fd9.
2024-04-24 00:40:39 +03:00
Azamat H. Hackimov
c3e0102a4f Implementing C++ byteswap functions
Implementing byteswap functions by using "backported" from C++23 std::byteswap.
Adding unittests based on GoogleTests. To enable it add `-DBUILD_TESTING=ON` to cmake.
2024-04-23 21:18:07 +03:00
Jacob Coby
96ce6d2c73 Logging updates:
* Adds CMake Option
 * Adds LOGGER to the README
 * Removes MONO define in favor of LOGGER
2024-04-23 13:53:00 -04:00
Jacob Coby
9753f8367f Enable console logging if MONO or LOGGER is defined
Re-enable console logging on linux and mac builds with the -DMONO
option.

Rename overloaded Debug_ConsolePrintf function to
Debug_ConsolePrintfAt to fix macro expansion.

Adds -DLOGGER alias for -DMONO.

Implements #157
2024-04-23 09:07:20 -04:00
GravisZro
9a80863c7f Ensure STDCALL/STDCALLPTR is only invoked on x86
Prevent the code from trying to use stdcall for anything except (32-bit) x86 builds
because it's the only platform it's applicable for.
2024-04-21 22:24:50 -04:00
Daniel Gibson
94ce70bb89 AudioDecoder: Get rid of custom malloc/free functions
were never set anyway, and (the real) libacm doesn't support custom
allocators.
2024-04-21 18:25:52 +02:00
Kevin Bentley
44c4f867e8 Removed extraneous license 2024-04-20 10:15:38 -06:00
Kevin Bentley
1f45163248 Updated source to reflect the license that this code is released under. 2024-04-20 09:57:49 -06:00
C.W. Betts
57078ae4b5 Change most sprintf to snprintf.
This also includes vsprintf to vsnprintf.
2024-04-19 12:31:28 -06:00
Edu Garcia
066b436fd9
Revert "Cfile module update" 2024-04-19 13:57:55 +01:00
Louis Gombert
21fb443cb3
Merge pull request #74 from GravisZro/fix/warnings
Fix build warnings (NULL instead of '\0')
2024-04-19 11:21:14 +00:00
Azamat H. Hackimov
9b45091633 Rename/move cfile related files
Rename to lowercase and move headers to own directory.
2024-04-19 00:17:15 +03:00
GravisZro
b5632bbc3e Fix simple warnings
Most of these warnings are due to the use of NULL instead of 0 or NULL instead of '\0'.
Some are macro redefinitions. None of them are pointer storage related. Those will be
in another PR.
2024-04-18 15:13:35 -04:00
Dan Raviv
aaefe86a2a Fix cf_SetSearchPath bad memory access (tested on macOS) 2024-04-18 10:33:21 -07:00
Edu Garcia
316d50a706
Merge pull request #59 from Lgt2x/fix-hog-64
Fix HOG file entry parser in 64 bit architectures
2024-04-18 07:55:17 +01:00
Louis Gombert
622b8278dc Fix HOG file entry parser in 64 bit architectures
timestamp is 4 bytes in the file, but is read as an 8-bytes long when built on 64 bit architectures, screwing up the read offset
2024-04-18 08:23:22 +02:00
Matt Stephenson
e1af942a13 Use __aarch64__ instead of __arm64__ for Linux builds
Signed-off-by: Matt Stephenson <mstephenson6@users.noreply.github.com>
2024-04-18 01:34:24 -04:00
Azamat H. Hackimov
9e6ebbc8fb Remove dublicate byteswap.h
Linux-specific byteswap.h just includes BYTESWAP.H, so there no need platform-specific header.

Fixes "non-portable path to file" ([-Wnonportable-include-path]) warnings.
2024-04-18 03:20:36 +03:00
Azamat H. Hackimov
a6d90107bf Re-format with clang-format recently changed files 2024-04-18 00:46:57 +03:00
Thomas Otto
b909a4cf43 Convert min/max macros to std::min/max
Added explicit <float> or <int> template argument where needed.
Add -DNOMINMAX define for Windows.
2024-04-17 21:43:38 +02:00
Louis Gombert
4247f30c3d
Merge pull request #21 from th1000s/misc_linux
Linux build fixes: remove unused osMutex code and typedefs
2024-04-17 18:46:42 +00:00
Louis Gombert
4d181c8ab3
Merge pull request #20 from th1000s/cmake_unix
Set C++ to 17, and a few CMake fixes for Linux
2024-04-17 18:39:51 +00:00
Edu Garcia
c7898fae7e
Merge pull request #40 from jcoby/fix-mac-m-series
Apple M-Series Fixes
2024-04-17 17:03:48 +01:00
Jacob Coby
531e528c61 Apple M-Series Fixes
* Adds portable debug_break (https://github.com/scottt/debugbreak/)
 * Adds Brewfile for Homebrew deps
 * use isfinite() instead of finite()
 * Stub int3 code in mveasm
2024-04-17 09:09:22 -04:00
Jeff Slutter
69a2e15625 Committing local fixes and changes I had. 2024-04-16 22:53:28 -05:00
Thomas Otto
26266d625c Unix: set -std=c++17 explicitly
remove register keyword, add cstdint include
2024-04-17 01:38:18 +02:00
Thomas Otto
b58d3585bd Remove unused osMutex code
It was never Acquire'd, only Created and Destroyed; and it was
a stub on Linux and macOS.
2024-04-17 01:20:51 +02:00
Azamat H. Hackimov
38128ea134 Additional clang-format 2024-04-17 00:25:04 +03:00
Kevin Bentley
61be1317b2 More clanging 2024-04-16 14:46:12 -06:00
Kevin Bentley
7399b5a2f2 Fix CRLF line endings. 2024-04-16 14:21:35 -06:00
Dan Raviv
3f11c5d78e Movie handles avoid assuming pointer size is 32 bits 2024-04-16 13:02:45 -07:00
Kevin Bentley
c6640cc631 clang-format on everything. 2024-04-16 12:56:40 -06:00
Kevin Bentley
df209742fc Initial import 2024-04-15 21:43:29 -06:00