Commit Graph

91 Commits

Author SHA1 Message Date
Jan Engelhardt
61439b379d net: resolve 1 instance of -Wdelete-incomplete
Descent3/multi_dll_mgr.cpp:974:43: warning: deleting "void*" is
undefined [-Wdelete-incomplete]

(``delete`` requires that types are _complete_, so as to find the
right destructor to call; ``void`` is incomplete by definition.)
2024-11-06 18:19:08 +01:00
Jan Engelhardt
48953868df build: resolve 101 instances of -Wunused-variable 2024-11-04 22:20:18 +01:00
Jan Engelhardt
71772b9c9c Add "final" marker to a number of classes
Devirtualization is an optimization in the generated assembly: when a
class C is polymorphic but also final, ``((C *)ptr)->func()`` can be
turned from an indirect into a static call.
2024-11-03 23:39:37 +01:00
Louis Gombert
f6faeaacb7
Merge pull request #637 from winterheart/cmake-makehogs
Optimize making HOG files
2024-10-29 20:05:57 +00:00
Azamat H. Hackimov
44806e77f0 Restore proper module names for netgames
Using names as defined in Steam installation.
2024-10-27 22:04:00 +03:00
Azamat H. Hackimov
39b205b957 Optimize building of HOG files and netgames libraries
Don't force building HOG files if dependency files are up-to-date.
Simplify building libraries by copying them into Descent3 directory.
2024-10-21 16:56:40 +03:00
Azamat H. Hackimov
1f1b0d2d88 Convert some functions of Mission.cpp to std::fs::path 2024-10-18 02:06:52 +03:00
Louis Gombert
7ca92bd1bd
Merge pull request #614 from winterheart/ddebug-update
ddebug submodule update
2024-10-05 17:21:19 +02:00
Azamat H. Hackimov
51da6aaae8 Remove HEAPCHECK() macro as unused 2024-10-05 05:21:41 +03:00
Azamat H. Hackimov
0e959cb4de Change error message for Int3() 2024-10-05 05:18:51 +03:00
Jason Yundt
90e897918a Add start parameter to FindArg()
Before this change, the FindArg() function was well suited for finding
command-line options that only appear once. It’s very resonable for
FindArg() to only support arguments that appear one time because Descent
3 doesn’t have any command-line options that should be specified
multiple times. For example, it would be pretty pointless to do
something like this:

  Descent3 -useexedir -useexedir

or something like this:

  Descent3 -aspect 1.0 -aspect 1.6

It does, however, sometimes makes sense to repeat command-line options for
other applications. For example, you can specify -e multiple times when
running grep [1]:

  grep -e pattern1 -e pattern2 file.txt

The main motivation behind this change is to make it easier to create a
future commit. That future commit will add a command-line option named
“-additionaldir”. -additionaldir will be similar to grep’s -e flag. In
other words, it will make sense to do this:

  Descent3 -additionaldir /home/user/dir1 -additionaldir /home/user/dir2

Adding a start parameter to FindArg() now will make it easier for that
future commit parse the multiple occurrences of -additionaldir.

Unfortunately, there is one drawback to this change. In Descent3/args.h,
I gave the start parameter a default value of 1. Giving the start
parameter a default value allowed me to add the start parameter without
having to change most of the calls to the FindArg() function. There was
one situation where I had to change how FindArg was called, though.
DLLFindArg is a pointer to the FindArg() function. You cannot give
function pointers default arguments [2]. As a result,
FindArg("-someargument") works, but DLLFindArg("-someargument") does
not. Instead, you have to write DLLFindArg("-someargument", 1) which is
a little bit annoying.

[1]: <https://www.gnu.org/software/grep/manual/html_node/Matching-Control.html>
[2]: <https://stackoverflow.com/a/9760710/7593853>
2024-09-29 12:53:49 -04:00
Azamat H. Hackimov
3b83d493e2 Sync DMFC debug functionality with core codebase 2024-09-24 23:03:02 +03:00
Azamat H. Hackimov
cc9e054509 Avoid using ASSERT in interface headers 2024-09-24 23:03:02 +03:00
Louis Gombert
b33cc21dce
Merge pull request #587 from winterheart/module-fixes
Update module, add logger module
2024-09-18 22:18:13 +02:00
Louis Gombert
ef113543ab Merge WinController and lnxcontroller files
move controller IO processing to the DDIO module
2024-09-18 22:32:09 +02:00
Azamat H. Hackimov
4f4ab3bd20 Isolate module submodule 2024-09-17 23:16:58 +03:00
Louis Gombert
dfc192ac81
Merge pull request #548 from pzychotic/fix-errors
Fix small collection of errors
2024-09-08 22:41:46 +02:00
Thomas Roß
582869bc50 [DMFC] Fixed missing va_end calls in case of function early outs 2024-09-07 16:58:08 +02:00
Jan Engelhardt
5f0bdf8184 Fix spello "it's" 2024-09-03 13:26:51 +02:00
Jan Engelhardt
38b835a03b Fix spello "its" 2024-09-03 13:26:51 +02:00
Jan Engelhardt
a3a31c77a2 Fix spello "seperate.." 2024-09-03 13:26:51 +02:00
Louis Gombert
60c5dbf1fe CMake: add all headers to target sources
This can help with CMake IDE integration and file indexing.
2024-08-09 17:09:14 +02:00
Louis Gombert
ae5840f314
Merge pull request #502 from winterheart/modules-split
Splitting submodules of project
2024-07-30 23:17:47 +02:00
Louis Gombert
fc2268d629 DMFC: declare external DMCFStringTable, DMFCStringTableSize, _DMFCErrorString, basethis and DMFCGetString only when needed 2024-07-28 17:52:01 +02:00
Azamat H. Hackimov
b9da6b59ff Isolate physics module
Update physics module, minor cleanups, remove unused code.
2024-07-28 16:50:42 +03:00
Azamat H. Hackimov
7b31572d05 Isolate grtext submodule
Isolate grtext from rest of the project, minor cleanups.
2024-07-28 16:50:42 +03:00
Azamat H. Hackimov
91354d5b9a
Merge pull request #492 from tophyr/pr/posix-defines
Use `POSIX` instead of `__LINUX__` for general OS checks
2024-07-15 23:33:10 +03:00
Chris Sarbora
de6deea5b8
Fixup only remaining non-comment __LINUX__ reference in srcs 2024-07-12 18:18:39 -05:00
Chris Sarbora
3da53e567f
Programmatically replace all __LINUX__ with POSIX
Steps:
```sh
srcs=$(mktemp)
find . -name "*.cpp" -or -name "*.c" -or -name "*.h" -or -name "*.hpp" -or -name "*.cc" -or -name "*.hh" > $srcs
xargs sed -i 's/ifndef __LINUX__/if !defined(POSIX)/' < $srcs
xargs sed -i 's/ifdef __LINUX__/if defined(POSIX)/' < $srcs
xargs sed -i 's/defined(__LINUX__)/defined(POSIX)/' < $srcs
```
2024-07-12 18:11:54 -05:00
Azamat H. Hackimov
1ae023a13b Enumerate all DLL functions manually
Enumerate DLL functions to ease tying functions in main and DLL sides in code.
2024-07-09 02:08:25 +03:00
Azamat H. Hackimov
45aa389f68 Move content from dmfcdllinit.h
Simplify code.
2024-07-08 11:15:18 +03:00
Azamat H. Hackimov
0bae89dd05 Fix runtime error on creating multiplayer game
Update dll typedefs to reflect cfile API changes.
2024-07-08 11:15:18 +03:00
Thomas Roß
12ec7c50c7 [CMake] Enabled the CMake property USE_FOLDERS to provide a more structured project list in IDEs with the help of set(CMAKE_FOLDER "...") calls. 2024-07-03 19:55:04 +02:00
Thomas Roß
9b8d61d16a [Netgames] Use size_t when catching strlen() return type and other buffer calculations.
This fixes alot of warnings of type C4267 '=': conversion from 'size_t' to 'int', possible loss of data.
2024-06-29 21:58:34 +02:00
Thomas Roß
85dce8bef1 [DMFC] Fixed wrong type in forward declaration.
This fixes alot of warnings of type C4099 'PInfo': type name first seen using 'struct' now seen using 'class'.
2024-06-29 21:55:09 +02:00
Azamat H. Hackimov
59487976f6 Isolate misc module
Isolate misc module for better dependency handling.
2024-06-27 01:26:35 +03:00
Thomas Roß
113e7eaaaa [DMFC] Removed preprocessor definition DMFC_DLL and related code, because we build DMFC as static lib and don't need any of that dllexport/import stuff anymore. 2024-06-16 16:56:20 +02:00
GravisZro
4e599257a0 Replace _finite with std::isfinite
A simple drop in replacement that is multiplatform which means the
defintion in `linux_fix.h` is no longer required.
2024-06-02 14:50:51 -04:00
GravisZro
f7ae658fe2 Modernize struct/enum/unions type declarations 2024-05-30 03:35:17 -04:00
GravisZro
9cf9781369 Properly format/use variadic macros 2024-05-24 20:57:17 -04:00
GravisZro
5e5e0c99c3 Replace "short" with "int16_t" and fix missing headers 2024-05-23 23:49:31 -04:00
GravisZro
aebe1bbbb6 Replace "ushort" with "uint16_t" and fix missing includes 2024-05-23 23:16:40 -04:00
GravisZro
26b7776f43 Replace "ubyte" with "uint8_t" 2024-05-23 23:07:26 -04:00
GravisZro
9d3e361a35 Replace "sbyte" with "int8_t" 2024-05-23 23:05:05 -04:00
GravisZro
cc67b9230a Replace "signed short" with "int16_t" 2024-05-23 23:04:15 -04:00
GravisZro
3dcd21b717 Replace "unsigned short" with "uint16_t" 2024-05-23 23:03:29 -04:00
GravisZro
a00639be24 Replace "signed char" with "int8_t" 2024-05-23 22:59:50 -04:00
GravisZro
1618040db5 Replace "unsigned char" with "uint8_t" 2024-05-23 22:58:46 -04:00
GravisZro
a3a3797067 Replace "uint" with "uint32_t" 2024-05-23 22:57:25 -04:00
GravisZro
2147cfa68b Replace "unsigned int" with "uint32_t" 2024-05-23 22:51:16 -04:00