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
Azamat H. Hackimov
cc9e054509
Avoid using ASSERT in interface headers
2024-09-24 23:03:02 +03:00
Azamat H. Hackimov
a59503f881
Move pserror.h to ddebug module
2024-09-24 23:00:53 +03:00
Azamat H. Hackimov
39e128cb0f
Merge pull request #582 from jengelh/master
...
ASAN/UBSAN fixes
2024-09-21 21:25:46 +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
Azamat H. Hackimov
dc0cd880e4
Add logger module
...
Implementing separated logger module.
2024-09-18 22:50:08 +03:00
Jan Engelhardt
de0af3b10d
mem_malloc type triviality checks (6/8)
...
```
git grep -l mem_malloc | xargs perl -i -lpe 's{\((uint8_t) \*\)mem_malloc\((\S+)\)}{mem_rmalloc<$1>($2)}'
```
2024-09-16 22:12:13 +02:00
Jan Engelhardt
4d2fdb2316
mem_malloc type triviality checks (4/8)
...
```
git grep -l mem_malloc | xargs perl -i -lpe 's{\((\w+) \*\)mem_malloc\((\S+) \* sizeof\(\1\)\)}{mem_rmalloc<$1 *>($2)}'
```
2024-09-16 22:12:13 +02:00
Louis Gombert
705c67a1be
Merge pull request #546 from winterheart/logging
...
Enhance logging facility
2024-09-10 09:27:13 +02:00
Azamat H. Hackimov
ae8e1b4a48
Convert sndlib to use new logging facility
2024-09-10 03:00:25 +03:00
Jan Engelhardt
4ecac1570f
sndlib: avoid shifting negative values
...
sndlib/mixer.cpp:496:61: runtime error: left shift of negative value -1
sndlib/mixer.cpp:333:74: runtime error: left shift of negative value -1
sndlib/mixer.cpp:331:115: runtime error: left shift of negative value -2
x<<y is UB for y<0 or x<0. Using a multiply side-steps this (and compilers
optimize multiplies to the same ASM anyway).
2024-09-10 01:41:54 +02:00
Jan Engelhardt
30ef025e72
Resolve out-of-bounds-access in hlsoundlib
...
$GIT/sndlib/hlsoundlib.cpp:943:54: runtime error: index -1 out of bounds for type 'float [40]'
2024-09-09 10:46:24 +02:00
Jan Engelhardt
a3a31c77a2
Fix spello "seperate.."
2024-09-03 13:26:51 +02:00
Jan Engelhardt
b14470bbff
Fix spello "independan.."
2024-09-03 13:26:51 +02:00
Jan Engelhardt
234e666ce0
Fix spello "charactor"
2024-09-03 13:26:51 +02:00
Thomas Roß
7b71873a69
[Cleanup] Removed function declarations that are not implemented.
2024-08-20 20:03:02 +02:00
Thomas Roß
a57b8e17a8
[Sound] Deleted unused header files.
2024-08-20 20:03:02 +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
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