Commit Graph

56 Commits

Author SHA1 Message Date
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
Azamat H. Hackimov
b9da6b59ff Isolate physics module
Update physics module, minor cleanups, remove unused code.
2024-07-28 16:50:42 +03: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
Louis Gombert
78d62aa5b5 Set SDL_OpenAudioDevice allowed_changes flag to 0 for Windows compatibility.
Per the SDL2 doc, the 0 flag means that SDL will handle any difference between the hardware audio data format and the game's
2024-06-29 18:28:22 +02:00
Louis Gombert
ca079d8dd5 Remove unused sound lib files 2024-06-29 18:28:22 +02:00
Louis Gombert
91c18fefc5 Windows SDL2 compilation 2024-06-29 18:21:37 +02:00
Azamat H. Hackimov
59487976f6 Isolate misc module
Isolate misc module for better dependency handling.
2024-06-27 01:26:35 +03:00
Azamat H. Hackimov
db8aa64d2f Make mem module isolated from project
Properly define MEM_USE_RTL definition only for mem library. Link other dependant modules with mem.
2024-06-20 00:43:51 +03:00
Azamat H. Hackimov
c41c3a7cb1 Replace Global* memory functions
Replace Global* memory functions with mem_* equivalents from mem.h, remove compatibility functions on Linux / macOS platforms.
2024-06-15 22:07:45 +03:00
Azamat H. Hackimov
9416458f9c Cleanup mono debugging code
Remove unused mono debug code.
2024-06-03 01:40:33 +03:00
Louis Gombert
97f718047d
Merge pull request #409 from GravisZro/fix/sdlsound
Only close SDL audio if it's open.
2024-06-01 20:54:04 +00:00
Louis Gombert
6d3a4c3e7f
Merge pull request #408 from GravisZro/remove/unusedpredefs
Code cleanup: Add one macro, remove five others
2024-06-01 20:51:41 +00:00
GravisZro
d822ae99a7 Only close SDL audio if it's open.
There wasn't anything preventing D3 from trying to close an invalid device id.
2024-05-31 14:13:00 -04:00
GravisZro
bfe52bc983 Add one macro, remove five others
- Add macro PRIMARY_HOG to define the hardcoded hog filename to load.
- Replace instances of "LINUX" with "__LINUX__"
- Remove these macros entirely because they are (now) unused
  - LINUX
  - _REENRANT
  - __32BIT__
- Removed from CMakeFile.txt because they are in linux_fix.h
  - _MAX_PATH=260
  - _MAX_FNAME=256
2024-05-31 12:05:12 -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
Azamat H. Hackimov
a0929aefe2 Rename ddio_common to ddio 2024-05-24 22:18:14 +03:00
Azamat H. Hackimov
6bc3c71a83 Reordering ddio_common module
Merge ddio_lnx and ddio_win into ddio_common module.
2024-05-24 22:17:44 +03:00
GravisZro
6a9ddd8736 Replace _vsnprintf/vsnprintf with std::vsnprintf 2024-05-24 08:52:59 -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
3dcd21b717 Replace "unsigned short" with "uint16_t" 2024-05-23 23:03:29 -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
Louis Gombert
a1a8056afc
Merge pull request #355 from GravisZro/fix/64bit
64-bit fixes
2024-05-23 07:21:36 +00:00
GravisZro
9ebd567178 Utilize Windows types
For whatever reason they decided to switch a bunch of Windows types to their
underlying types which causes problems when replacing possibly problematic
32-bit long types. This restores the use of the Windows defined types.
2024-05-22 18:30:56 -04:00
GravisZro
dec9de7456 64-bit fixes
Switch all the (u)long types to (u)int32_t where appropriate.
2024-05-22 18:14:45 -04:00
Azamat H. Hackimov
dd309d220c Update SDL Audio API usage to version 2 2024-05-22 22:03:46 +03:00
Azamat H. Hackimov
ed8d9f870d Make diverted class lnxsound virtual methods override 2024-05-22 22:03:46 +03:00
Azamat H. Hackimov
0e936d6cac General cleanup in sdlsound.cpp
Minor fixes and enhancements.
2024-05-22 22:03:46 +03:00
Azamat H. Hackimov
283e003b73 Reorganize ddsndgeometry code
Split linux geometry class implementation into own file, rename directx geometry.cpp to ds3dgeometry.cpp
2024-05-22 22:03:46 +03:00
Azamat H. Hackimov
45ac1cc78a Cleanup headers in sndlib
Moving common macros into ssl_lib.h
2024-05-22 22:03:46 +03:00
Azamat H. Hackimov
3bd07d1f7e Reordering dependant on sndlib modules
Properly include and reuse produced static lib in other components.
2024-05-22 22:03:46 +03:00
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
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
3440667e93 remove unused code (mainly windows.h) 2024-05-07 23:45:33 +01: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
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
Jeod
8770ea4626
Merge pull request #158 from DanielGibson/fix-141
Fix crash in hlsSystem::ComputePlayInfo(), #141
2024-04-24 19:49:51 -04:00
Daniel Gibson
923bf4bbbf Debug version of TERRAIN_REGION() that checks for invalid values
and improved comments in Play2dSound and ComputePlayInfo()
2024-04-24 22:28:26 +02: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
Daniel Gibson
41c4578f5c Fix crash in hlsSystem::ComputePlayInfo(), #141
sound_seg was -1, which crashes in BOA_INDEX(sound_seg) on 64bit
platforms (by pure luck it doesn't seem to crash on 32bit platforms)

It makes sense to catch this problem much earlier in Play3dSound(),
to avoid executing all the superfluous
2024-04-23 22:32:04 +02:00
Thomas Otto
00389c50ea Some more CMake white space formatting
- tabs to spaces
 - use Unix line endings everywhere
 - newline at end of file
 - remove trailing white space
 - no space between keywords and opening parenthesis
 - use 2 spaces to indent
2024-04-21 11:46:32 +02:00
Kevin Bentley
1f45163248 Updated source to reflect the license that this code is released under. 2024-04-20 09:57:49 -06:00
Louis Gombert
c2b71b8147 Standardize CMake formatting
lowercase function names, blocks indent
2024-04-20 14:45:49 +02:00
C.W. Betts
7d7f5bf896 Quiet Clang Static Analyzer warnings.
Most of the warnings were caused by uninitialized values. Some were in plug-ins that didn't have a break in a switch, causing the memory to be deleted twice.
2024-04-19 17:42:17 -06:00