Commit Graph

149 Commits

Author SHA1 Message Date
Dethrace Engineering Department 7fff315643
Tidy up debug logging (#213)
* tidy up log output

* adds enable-diagnostics argument, disable by default
2022-10-18 13:07:58 +13:00
Anonymous Maarten d3efa46815
Add enum for FatalError + void-alize all functions taking no arguments (#202)
* Add enum for 1st FatalError argument

* Use enum values when calling FatalError

* Add explicit void to all functions not accepting any arguments
2022-10-16 21:20:04 +13:00
Anonymous Maarten 8cf6c7e931
Fix y-alignment of numbers in parts shop (#201) 2022-10-16 21:15:01 +13:00
Anonymous Maarten 1dab154c75
Fix amount of credits handed out in GotCredits (#198) 2022-10-16 21:13:39 +13:00
Anonymous Maarten 4689b4e9a6
Add totally repair car (#190)
* Implement TotallyRepairCar

* Implement ResetCarScreens

* Implement CarWorldOffFallenCheckThingy

* Implement MungeRearviewSky

* Add comment about BrModelUpdate(..., 0x3)
2022-10-16 21:11:51 +13:00
Anonymous Maarten bec1e51e02
Fix racer info (#185) 2022-10-16 21:09:30 +13:00
Anonymous Maarten 31afabce90
Oil spills (#171)
* Simplify FindFacesInBox

* Simplify FindFacesInBox

* Simplify ActorBoxPick

* Implement oil spills

* Simplify DRScenePick2D
2022-10-15 07:11:47 +13:00
Anonymous Maarten 6061fd1d5f
Implement ProcessLevitate (#196) 2022-10-14 20:52:05 +13:00
Anonymous Maarten e741362731
Fix out of bounds read + v_diff should not always be updated (#191) 2022-10-01 19:56:37 +13:00
Anonymous Maarten 3a9c037939
Fix pedestrian collision when floating very close to ped (#189)
* Fix pedestrian collision when floating very close to ped
2022-10-01 06:48:14 +13:00
Anonymous Maarten 24a08b2c9f
Fix signal handler for pie executables (#177)
* Disable pie on github actions

* Use dl_iterate_phdr to get base of elf
2022-10-01 06:29:03 +13:00
Dethrace Engineering Department 19ace40cb8
fixes bouncing lampposts and other odd physics things (#174) 2022-09-28 20:42:22 +13:00
Dethrace Engineering Department 76ea16aabe
fix damage not being applied when hitting walls (#164) 2022-09-28 20:41:52 +13:00
Anonymous Maarten db3d6ac91e
Implement edit functions + functions around camera + ... (#146)
* Fix SEGFAULT due to reading out of bounds (we were using wrong index)

* Use floats instead of doubles

* Implement all flicplay.c functions

* Compare ptr against NULL

* Implement TotalRepair

* Implement some edit functions

* Implement actor/special volume related edit functions

* Implement MungeSpecialVolume

* Implement a few depth functions

* Fix location of spawned actors (when SHIFT was not pressed)

Co-authored-by: Dethrace Engineering Department <78985374+dethrace-labs@users.noreply.github.com>
2022-09-28 20:40:53 +13:00
Anonymous Maarten b5ccfe7dd2
No more gcc/clang warnings (#169)
* Change type of DRPixelmapCleverText2 to char*

* Fix warnings emitted due to -Wreturn-type

* Fix BR_ONE_LS redefinition warning

* Fix warnings emitted by -Wparentheses

* Tag FatalError and PDFatalError with noreturn attribute, fixing -Wreturn-type warnings

* Fix string type of TransBrPixelmapText~

* Fix a few -Wmaybe-uninitialized warnings

* Fix -Wformat and -Wpointer-sign warnings in test_datafile.c

* Fix -Wshift-negative-value warning

* Fix -Wpointer-sign warning

* chdir is declared with attribute 'warn_unused_result'

* Fix -Wmaybe-uninitialized warning

* Fix -Warray-bounds warning

* Fix -Wmaybe-unitialized warning

* Fix -Wmaybe-unitialized warning

* Fix -Wmaybe-unitialized warning

* Fix -Wmaybe-unitialized warnings

* Fix a few -Wmaybe-uninitialized warnings

* cmake: unify warnings amongst gcc and clang

* fatalerror_fixup

* Fix -Wabsolute-value warning

* Fix all warnings when building with MinGW on Windows

* Fix warning caused by -Wimplicit-fallthrough

* Fix warnings caused by -Wcast-function-type

Fixes these types of warnings:
cast between incompatible function types from ‘br_uint_32 (*)(br_actor *, void *)’ {aka ‘unsigned int (*)(struct br_actor *, void *)’} to ‘intptr_t (*)(br_actor *, void *)’ {aka ‘long int (*)(struct br_actor *, void *)’} [-Wcast-function-type]

* Fix warning caused by -Wmissing-field-initializers

* Normalize direction_v vector and store in displacement
2022-09-24 17:42:58 +12:00
Anonymous Maarten 8e576ddbe3
Fix buffer overload when loading more then 100 pixelmaps on 64-bit system (#175) 2022-09-23 21:15:26 +12:00
Anonymous Maarten fc65625272
brender: don't override the row_bytes stored on disk (#167) 2022-09-23 20:52:40 +12:00
Anonymous Maarten b71d585583
Simplify code in ChooseNewObjective (#168) 2022-09-23 14:47:08 +12:00
Anonymous Maarten b7da8770b4
Fix IRandomBetween returning out-of-range numbers (#173) 2022-09-23 08:39:52 +12:00
Dethrace Engineering Department 370c7ca480
Implements TeleportOpponentToNearestSafeLocation (#165)
* implements TeleportOpponentToNearestSafeLocation
2022-09-16 21:19:16 +12:00
Anonymous Maarten 4bb4be17a4
Fix pedestrian edit functions segfaulting when path isn't created (#163)
Dropping a point in pedestrian edit mode would segfault otherwise.
CARM95.EXE also segfaults.

How to reproduce:
- enable Pedestrian edit mode
- F10 or F11 (+a few other)
2022-09-16 15:14:31 +12:00
Anonymous Maarten 25b796335d
Fix address sanitizer error when loading "Industrial Action" (#150)
* Move resource header check out of UserToRes to allow BrResCheck to fail

* Add BrResCheck and BrResSize to brender.h header (used while debugging)

* Skip OG code behavior of setting row_bytes to align to a 4 byte boundary
2022-09-16 15:13:11 +12:00
Anonymous Maarten 9ec9fb008f
Implement DoEndSummary2 (aka Damage Gallery) (#152)
* Implement DoEndSummary2 (aka Damage Gallery)

* Fix warnings emitted by -Wabsolute-value and -Wsometimes-uninitialized
2022-09-16 15:10:52 +12:00
Anonymous Maarten 4c6e3a325c
Use nearest_section in FindNearestGeneralSection (#162) 2022-09-16 15:09:41 +12:00
Anonymous Maarten 25ecaf7309
damage_magnitude_accumulator is only available when a car is oppo, net_human or local human (#160) 2022-09-16 08:43:37 +12:00
Dethrace Engineering Department e8a38f4a1a
fixes NextPratcamChunk (#155) 2022-09-12 10:32:28 +12:00
Anonymous Maarten 0081b02dec
Implement parts shop (#151)
* Change type of last argument of TransBrPixelmapText from 'signed char*' to 'char*'

* Implement parts shop
2022-09-12 06:16:01 +12:00
Anonymous Maarten 561e369ede
Implement pratcam (#148) 2022-09-11 20:37:23 +12:00
Dethrace Engineering Department de154693c9
implements processfrozen (#154) 2022-09-11 16:12:41 +12:00
Dethrace Engineering Department 5e05fc1c6b
Aggressive opponents (#153)
* implements crash earnings, fixes wasted message
2022-09-11 15:52:32 +12:00
Anonymous Maarten f99be5f57a
Fix buffer overflow when driving with full speed into noncar thing (#144) 2022-09-07 15:59:37 +12:00
Anonymous Maarten 519671f9e8
Refactor CMake build system (#119)
* Remove 'SCRATCH' file

* cmake: move as much as variable assignments after project()

* Embed version in dethrace executable

* Allow installing DethRace + create binary archive

* Use ashutoshvarma/setup-ninja github action for getting ninja

* cmake: group user configurable options

* cmake: building in debug mode will add -g

* cmake: provide dethrace_werror interface target + DETHRACE_WERROR cmake option

* Update SDL2 to latest release

* Rename dethrace_werror target to compile_with_werror

* Also add -Werror to dethrace
2022-09-05 14:22:59 +12:00
Anonymous Maarten 8a2167920e
Add support for fullscreen + never grab mouse + resize window (#140)
* Implement full-screen via ALT+ENTER

* Never grab mouse

* Allow resizable window + fix mouse when resizing/switching to full screen

* Keep aspect ratio of gl viewport when resizing window

* Fix mouse when resizing the window

* Fix off by one error
2022-09-05 09:59:00 +12:00
Anonymous Maarten b3bdbb2650
Little changes (#139)
* br_material.power is a br_scalar (=float)

* Implement FopRead_OLD_VERTICES

* Fix FopRead_OLD_MATERIAL_INDEX

* Use BR_ASIZE in appropriate places

* Use br_material* instead of intptr_t

* Reset resource parent after reading struct

* Use flags of correct type

* Use NULL instead of 0

* Ignore utf-8 errors when decoding carmageddon-"encrypted" files to utf-8
2022-09-02 12:50:55 +12:00
Willian c220ad0b5e
remove unused Windows HANDLE (#142) 2022-09-02 12:43:16 +12:00
Priit Laes 8c060fa1c7
gl: Relax GLSL requirement from 3.3 to 3.1 (#137)
* opengl: Bump to OpenGL 3.1 / GLSL 1.40
2022-08-31 15:01:20 +12:00
Szilárd Biró 20c2128b89
Big endian fixes (#135)
* BRender big endian fixes

* Game big endian fixes

* Replace BrSwap32 with BrHtoNL for load/save

* Detect endianness using CMake
2022-08-30 09:19:50 +12:00
Dethrace Engineering Department ee83724f8a
Opponents following race and cheat paths (#136)
* fix segfault, now hitting not implemented on ProcessPursueAndTwat

* opponents actually sort of driving

* remove cglm dependency

* opponents driving around generally working

* fully mapped out gEdit_funcs

* adds --i-am-cheating flag to allow skipping entering cheat code

* cleaned up ProcessFollowPath

* cleanup FollowCheatyPath, fixes crash in SmokeLine

Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
2022-08-29 15:21:57 +12:00
Anonymous Maarten 05f16d3066
Fix prototype(s) + function uses (#133) 2022-07-11 06:35:38 +12:00
Dethrace Labs 44df22a375 implement missing S3StopOutletSound 2022-06-03 17:40:06 +12:00
Dethrace Engineering Department 7730cf842e
Audio support (#130)
* 2d sound working in menus

* fix incorrect references to gIndexed_outlets

* 3d sound, pitch, pan, volume

* enable per-outlet pitch

* fix path length issues, compile warnings

* fixes hall of mirrors effect in smack videos

* fixes ped running away direction

* fixes horn by fixing S3GetChannelForTag

* fix master volume, uninitialized variable
2022-06-03 13:03:49 +12:00
Anonymous Maarten e97bc083d9
Add pedestrians + power-ups (#118)
* Add pedestrians

* Pedestrian tweaks

* glrenderer: add texture tranformation support for animated pedestrians

* Use Brender functions in more locations

* Implement CheckPileDriverBonus

* revert changes to CollideCamera2 except bugfix

* fix uninitialized variable

Co-authored-by: Dethrace Engineering Department <78985374+dethrace-labs@users.noreply.github.com>
Co-authored-by: Dethrace Labs <carmageddon.reversing@gmail.com>
2022-05-10 23:39:55 +12:00
Dethrace Engineering Department 1a884666ec
Offroad effects (#128)
* dust and bumpiness
2022-05-05 05:05:52 +12:00
Dethrace Engineering Department 63d8c37b44
Textured horizons (#127)
* implements horizon textures
2022-05-04 13:45:41 +12:00
Dethrace Engineering Department 2db34d2913
Implements "noncar" physics (#122)
* Noncar physics

* Noncar collision detection

* Noncar bending and snap-off working
2022-05-03 14:05:15 +12:00
Dethrace Engineering Department ffc117264f
flush buffers in EndScene (#126) 2022-05-02 08:48:35 +12:00
Dethrace Engineering Department 4491add68f
fixes #123 (#124) 2022-05-02 08:30:07 +12:00
Dethrace Engineering Department 3ea4dc83fa
Vehicle damage (#116)
* implement damage and repair

* clang format align trailing comments

* damage HUD

* wheel rotation damage wobbles
2022-04-01 10:52:09 +13:00
Anonymous Maarten 4115ce64eb
Detect CTRL/SHIFT/ALT + add control dialg + add end-of-race ranking screen + fixes (#113)
* Detect CTRL/SHIFT/ALT + add demo menu's

* Fix cockpit + fancy headup roll-in

* Align on bytes (glPixelStori)

* Fix AddressSanitizer error when mousing around (+introduce pixelmap dispatch)

* Fix moving around groovidelics/funkotronics (Found with AddressSanitizer)

* Fix out-of-bounds write when entering map (thx AddressSanitizer)

* Fix out-of-bounds read in BrPixelmapPixelSet through DimRectangle (thx AddressSanitizer)

* Allow moving around the 3d scene in map mode

* Let BrPixelmapFill make use of the dispatch table

* Modify view port to fix rendering in map mode

* Fix AddressSanitizer error when loading demo (loading cop cars)

* Don't use magic values

* Fix offset'ed depth effects when rendering to an offset window

* Implement edit mode (not all functions are added yet)

* Implement cockpit Look(Left|Forward|Right)

* Fix AddressSanitizer error in DoInstruments

* Fix wheel in cockpit when switching position

* Implement special volume actor creation for edit functions

* Add all edit options for MSVC

* Implement first screen of race summary

* Use dispatch for BrPixelmapText

* Use dispatch for BrPixelmapAllocateSub

* Make BrPixelmapDirectLock and BrPixelmapDirectUnlock use the dispatch table

* Don't print LOG_TRACE for BrDevLastBeginQuery to avoid spamming the console

* Implement BrDevLastBeginQuery and BrDevLastBeginSet

* Fix end-of-race for demo's + fix splatpack

* Add controls panel

* Rewrite SmokeLine a bit (there is an AddressSanitizer error at the 'if (*depth_ptr > z)' check, which this change does not fix

* Dispose cop cars => Fix playing multiple levels with cop cars in the same session

* Implement easy memory pixelmap methods

* Fix 2 errors with splatpack

* Fix MainMenuDone1 and MainMenuDone2
2022-03-30 15:03:46 +13:00
Anonymous Maarten 8cf723c669
Dispose track after race + get german localization running (#107)
* Implement DisposeTrack

* Implement LoadInterfaceStrings + DrawTranslations + fix german interface

* Recognize all flavours: full/demo/splatpack/splatpack demo/splatpack x-mas demo

* Fix input for demos
2022-03-28 08:49:52 +13:00