Commit Graph

49 Commits

Author SHA1 Message Date
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
4d9ff9cdc6 Fix some one-off spellos 2024-09-03 13:26:51 +02:00
Jan Engelhardt
96c787bfb2 Fix spello "interative why" 2024-09-03 13:26:51 +02:00
Jan Engelhardt
b14470bbff Fix spello "independan.." 2024-09-03 13:26:51 +02:00
Louis Gombert
dd6e684712
Merge pull request #555 from jengelh/collide
Resolve out-of-bounds in PolyCollideObject [ASAN]
2024-09-02 21:03:32 +02:00
Jan Engelhardt
cb5c2913b2 Resolve out-of-bounds access in fvi_room
Possibly fixes #530.

physics/findintersection.cpp:4711:64: runtime error: index -1 out of bounds for type 'fvi_face_room_list [200]'
=================================================================
SIGNAL 11 caught, aborting
2024-08-31 11:21:09 +02:00
Jan Engelhardt
9e03622b24 Resolve out-of-bounds in PolyCollideObject
(Observed in Retribution level 7 while interacting with an Old
Scratch robot.) Potentially might fix issue #530.

fvi_moveobj=-1
fvi_moveobj=101
fvi_moveobj=235
fvi_moveobj=374
fvi_moveobj=-378
fvi_moveobj=-378
fvi_moveobj=-374
==59260==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000003c8f058 at pc 0x0000012857fc bp 0x7ffffb094c50 sp 0x7ffffb094c48
READ of size 1 at 0x000003c8f058 thread T0
    f0  PolyCollideObject(object*) $GIT/physics/newstyle_fi.cpp:370
    f1  check_hit_obj(int) $GIT/physics/findintersection.cpp:3483
    f2  fvi_rooms_objs $GIT/physics/findintersection.cpp:4398
    f3  fvi_FindIntersection(fvi_query*, fvi_info*, bool) $GIT/physics/findintersection.cpp:2812
    f4 AquireElectricalTarget(object*) $GIT/Descent3/WeaponFire.cpp:1189
    f5 CreateAndFireWeapon(vector*, vector*, object*, int) $GIT/Descent3/WeaponFire.cpp:1326
    f6 FireWeaponFromObject(object*, int, int, bool, bool) $GIT/Descent3/WeaponFire.cpp:1887
    f7 WBFireBattery(object*, otype_wb_info*, int, int, float) $GIT/Descent3/robotfire.cpp:149
    f8 FireWeaponFromPlayer(object*, int, int, bool, float) $GIT/Descent3/WeaponFire.cpp:3004
    f9 DoFlyingControl(object*) $GIT/Descent3/object.cpp:2450
    f10 ObjDoFrame(object*) $GIT/Descent3/object.cpp:2668
    f11 ObjDoFrameAll() $GIT/Descent3/object.cpp:2988
    f12 GameFrame() $GIT/Descent3/GameLoop.cpp:2980
    f13 GameSequencer() $GIT/Descent3/gamesequence.cpp:1221
    f14 PlayGame() $GIT/Descent3/game.cpp:834
    f15 MainLoop() $GIT/Descent3/descent.cpp:555
    f16 Descent3() $GIT/Descent3/descent.cpp:508
    f17 oeD3LnxApp::run() $GIT/Descent3/sdlmain.cpp:151

0x000003c8f058 is located 52 bytes after global variable 'last_heartbeat' defined in '$GIT/Descent3/multi.cpp:9459:16' (0x3c8f020) of size 4
0x000003c8f058 is located 8 bytes before global variable 'guard variable for MultiSendHeartbeat()::last_heartbeat' defined in '$GIT/Descent3/multi.cpp:9459:16' (0x3c8f060) of size 8
2024-08-30 05:25:11 +02:00
Jan Engelhardt
201b88c9aa Resolve out-of-bounds access in AIDoMemFrame
As level 1's in-engine cutscene runs, an OOB happens after about 3s.

x=0 object[x].type=4
x=1 object[x].type=18
x=2 object[x].type=255
$GIT/physics/findintersection.cpp:2196:80: runtime error: index 255 out of bounds for type 'unsigned char [26]'
$GIT/physics/findintersection.cpp:2196:80: runtime error: load of address 0x00000475a97f with insufficient space for an object of type 'uint8_t'
==28871==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000475a97f at pc 0x000001242275 bp 0x7fffc1ced720 sp 0x7fffc1ced718
READ of size 1 at 0x00000475a97f thread T0
    f0 fvi_QuickDistObjectList(vector*, int, float, short*, int, bool, bool, bool, bool) $GIT/physics/findintersection.cpp:2196
    f1 AIDoMemFrame $GIT/Descent3/AImain.cpp:6066
    f2 AIDoFrame(object*) $GIT/Descent3/AImain.cpp:6187
    f3 ObjDoFrame(object*) $GIT/Descent3/object.cpp:2674
    f4 ObjDoFrameAll() $GIT/Descent3/object.cpp:2988
    f5 GameFrame() $GIT/Descent3/GameLoop.cpp:2980
    f6 GameSequencer() $GIT/Descent3/gamesequence.cpp:1221
    f7 PlayGame() $GIT/Descent3/game.cpp:834
    f8 MainLoop() $GIT/Descent3/descent.cpp:555
    f9 Descent3() $GIT/Descent3/descent.cpp:508
    f10 oeD3LnxApp::run() $GIT/Descent3/sdlmain.cpp:151

0x00000475a97f is located 30 bytes after global variable 'FVI_always_check_ceiling' defined in '$GIT/physics/findintersection.cpp:888:6' (0x475a960) of size 1
  'FVI_always_check_ceiling' is ascii string ''
0x00000475a97f is located 33 bytes before global variable 'fvi_visit_list' defined in '$GIT/physics/findintersection.cpp:895:5' (0x475a9a0) of size 51
2024-08-30 02:37:15 +02:00
Thomas Roß
7b71873a69 [Cleanup] Removed function declarations that are not implemented. 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
7ba009b811 Isolate rtperformance module
Update rtperformance module, minor cleanups.
2024-07-28 16:50:42 +03: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
9e3563de4d Isolate model submodule
Isolate model from rest of the project, minor cleanups.
2024-07-28 16:50:42 +03: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
743f782815
Merge pull request #453 from Lgt2x/remove-intellivibe
Remove intellivibe interface
2024-06-23 18:06:25 +03:00
Louis Gombert
fa2061dc76 Remove intellivibe interface
Intellivibe is an interface for VRF's Tactile Feedback System hardware, now discontinued.
2024-06-22 03:20:26 +02: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
9416458f9c Cleanup mono debugging code
Remove unused mono debug code.
2024-06-03 01:40:33 +03: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
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
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
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
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
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
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
Jacob Coby
147078b3a6 Fix controls on aarch64
Cast the rotation values to a short before assigning to the tangles
struct to avoid the FCVTZU instruction which strips the negative sign
from kicking in.

Fixes #161
2024-04-26 17:07:24 -04:00
Louis Gombert
c486919477 Fix -Wtautological-pointer-compare 2024-04-21 20:24:31 +02:00
Louis Gombert
491db4254a Fix -Wdangling-else 2024-04-21 20:24:31 +02:00
Louis Gombert
466a142ba3 Fix -Wcomment 2024-04-21 20:24:31 +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
C.W. Betts
57078ae4b5 Change most sprintf to snprintf.
This also includes vsprintf to vsnprintf.
2024-04-19 12:31:28 -06: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
Jeff Slutter
69a2e15625 Committing local fixes and changes I had. 2024-04-16 22:53:28 -05: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
c6640cc631 clang-format on everything. 2024-04-16 12:56:40 -06:00
Edu Garcia
8e350a6c5d minimal changes for compilation (including linking) under Windows 2024-04-16 14:45:15 +01:00
Kevin Bentley
df209742fc Initial import 2024-04-15 21:43:29 -06:00