Commit Graph

38 Commits

Author SHA1 Message Date
Dethrace Labs fcd2ecffab SummCheckGameOver matching 2025-10-18 07:13:58 +13:00
Dethrace Labs f94aeddd5a DrawSummary matching 2025-10-18 07:13:58 +13:00
Dethrace Labs b6feda3b43 fixes cd audio not stopping during cutscenes 2025-10-01 14:34:21 +13:00
Dethrace Engineering Department ae1c221156
Reccmp batch 2 (#471)
* fixing next set of small diffs
2025-09-01 05:51:46 +12:00
Dethrace Engineering Department 65bc16a129
Support for compiling with MSVC 4.20 for binary matching (#465)
* fix some global vars

* make sound support optional

* removes LOG_TRACE calls

* now compiles under msvc 4.2

* removes unused functions, adds ignored functions to report

* bump BRender dependency

* adds docker container for running msvc 4.2

---------

Co-authored-by: Jeff Harris <jeff@1amstudios.com>
2025-07-30 13:27:18 +12:00
Anonymous Maarten a2cdd1f061
Support multiple platform drivers (#444)
* Start of supporting multiple platform drivers

* Remove dependency of null platform on SDL2

* cmake: support loading SDL2 dynamically

* Move CMake options to project root for SDL2::SDL2 access

* Don't link to OpenGL

* Move common dynamic loading to header

* Add SDL 1.2 platform

* Add SDL1 platform backend

* Remove accidental addition

* Try multiple platform drivers until we find a good one

* Fix sdl1 mouse

* Use my BRender fork FIXME FIXME FIXME REMOVEME REMOVEME REMOVEME

* Build dethrace supporting SDL1 on ci

* use dethrace-labs BRender fork
2025-05-03 23:44:46 +02:00
Szilárd Biró 1ef129a7bf
add AudioBackend_SetVolumeSeparate to the harness audio interface (#433) 2025-01-31 06:56:54 +13:00
Szilárd Biró 22369744bb
Big endian fixes - part 2 (#405)
* Big endian fix for S3LoadSample and Win32SetPaletteEntries

* Add the missing BR_ENDIAN_BIG guard to S3LoadSample

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* DRPixelmapDoubledCopy big endian fix

* big endian fix for the KEYBOARD.COK loading

* CalcLSChecksum big endian fix

* PrintScreenFile big endian fix

---------

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2024-10-15 08:28:57 +13:00
Bartosz Kurczyński 90971e9e56
Fixed: Non-spatial sound does not obey global sound effect's volume. Spatial sound is either too loud or to quiet. (#400) 2024-07-27 07:00:09 +12:00
Dethrace Engineering Department ec04a9c111
Fixes crash when not calling ma_audio_unint correctly (#397)
* fixes crash when not calling ma_audio_unint correctly

* adds check that we are not still playing the previous track
2024-07-21 03:01:41 +12:00
Dethrace Engineering Department 6e6ce12eb7
Original music (#393)
* adds support for GOG-format music ogg files

---------

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2024-07-17 06:53:42 +12:00
Dethrace Engineering Department af3019469a
Audio in cutscenes (#390)
* audio in cutscenes
2024-07-10 06:27:31 +12:00
Dethrace Engineering Department f9346d8b59
bump miniaudio to fix playback on recent macos (#382) 2024-07-05 12:53:41 +12:00
Anonymous Maarten 673244bb8c
Implement network (#366)
* SendCarData, ReceivedStartRace

* fixes heap overflow during join

* fixes access on possibly-null pDetails

* DoNetScores

* Fix cast warning of comparefn of qsort

* DisplayUserMessage

* Pack tNet_contents on 4 byte boundary so 32-bit and 64-bit Intel cpu get same struct lay-out

* Add a few static assertions to verify net message offsets

* Add dethrace Wireshark dissector (WIP)

* add dissector installation instructions

* Set wireshark info column

* Fix various typo's

* 4-byte align tNet_message_join as well + more dethrace.lua

* Add more assertions

* Fix network car choose loop

* player scores

* tidy

* mechanics

* Implement SortNetHeadAscending for 'Terminal Tag'

* Update WireShark dissector

* start of tNet_message_pedestrian dissector

* network player cars can see each other move

* netmsgid tidy ups

* dissector: print HOST/CLIENT in info column

* Don't allow hosting a game when starting dethrace with --no-bind

* fix oldd copy

* time_step is integer, fixes client car out of sync

* wasted, recover, kick player out

* NetSendPointCrush

* crushpoint, declarewinner

* network race summary wip

* Start and finish a game of tag/fox

* network fixes

* Players can now send love letters to each other

* Rewrite if's a bit

* Use enum values for GetMiscString and DoFancyHeadup

* Fix fox effect

* Fix fox/it effect at start of race

* Use KEYMAP_ enum values

* Disable address sanitizer and dr_dprintf logging

---------

Co-authored-by: Dethrace Labs <78985374+dethrace-labs@users.noreply.github.com>
2024-06-20 22:35:48 +02:00
Dethrace Engineering Department 6222f6994f
Software renderer (#363)
* BRender software rendering initial commit

* changes required for brender v1.3.2

* fixes missing selection rectangle in race summary screen

* fix track rendering, remove opengl bits

* adding BRender submodule

* enables mirror, bumps brender

* enable linux arm64 builds

* clang-format on all files

---------

Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
2024-06-14 19:52:09 +12:00
Anonymous Maarten 62bbf66deb
Fixes for Portuguese Carmageddon (#353)
* Fix bugs exposed by Portuguese Carmageddon

* Fixes for warnings/errors found in rec2

* Macos says "no"

* Last argument of _partSet can be a pointer

* feof is a macro dereferencing f on some systems

* Allow longer program_name in addr2ine

* Fix casing issue with sounds

French Carmageddon provides DATA/SOUND/fyeah1.WAV where it expects DATA/SOUND/FYEAH1.WAV

* tools: add encode capability to decode script

* Replace font id integers with enum

* Result of BrFileGetLine is not used

* Document the StripControls fix

Co-authored-by: Dethrace Engineering Department <78985374+dethrace-labs@users.noreply.github.com>

---------

Co-authored-by: Dethrace Engineering Department <78985374+dethrace-labs@users.noreply.github.com>
2024-05-28 12:59:37 +00:00
Dethrace Engineering Department 1c10b74141
Networking #1 - Lobby implemented (#335)
* Basic networking functions implemented to get the lobby functional

* Apply suggestions from code review

* PDNetObtainSystemUserName gets local system name

---------

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2023-07-05 14:18:52 +12:00
Dethrace Engineering Department 7d475fc117
Fixes player engine stumbling sound (#332)
* audio backend

* fixes stumbing sound at speed

* implements missing S3ChangePitchSpeed, tidies error codes

---------

Co-authored-by: Jeff Harris <jeff@1amstudios.com>
2023-07-04 07:40:44 +12:00
Anonymous Maarten 3f61e9b479
Fix damaged cars in action replay (#333)
* misc: use appropriate types

* Fix buffer overflow read when the_angle == DR_PI_OVER_2

Yes, this happened on my system.

* piping: extra debug

* appropriate type

* piping: read number of chunks correctly

* Always enable replay
2023-06-01 03:13:02 +00:00
Dethrace Engineering Department 3b0f32284a
Per-channel audio buffers from DOS executable (#329)
* implements DOS-style per channel audio
2023-05-19 11:58:41 +12:00
Dethrace Engineering Department 99473ffdf5
adds (void) to all functions taking no args (#318) 2023-05-02 23:07:01 +12:00
Anonymous Maarten 597de52fd3
Build dethrace with -Wstrict-prototypes (#314)
* Add HOOK_NORETURN to certain function declarations

This fixes the following warning:
warning: ‘noreturn’ function does return

* Fix -Wstrict-prototypes warnings

* Fix -Wstrict-prototypes warnings in S3

* harness: split null.h in null.h and null.c

* Move GLRenderer_ClearBuffers to previous location

* Whitespace fixes
2023-05-01 23:21:02 +00:00
Dethrace Engineering Department ef9e4d668d
Implements win95sys.c (#301)
* refactor to use win95sys instead of dossys

* added underscore to avoid conflict with windows functions
2023-04-18 22:50:05 +12:00
Dethrace Engineering Department 3a91a526c8
Implements quitgame function (#294)
* implements quitgame function

* updates IOPlatform_* function names
2023-04-01 15:40:40 +13:00
Artur Rojek 48b70bb8ff Fix NULL pointer dereference in S3CalculateRandomizedFields (#284)
If the sound has been muted (!gS3_enabled) during game data loading, it
is then possible to unmute it during gameplay and request a sound effect
which doesn't have a sample loaded (most prominent for pratcam sfx).
While logic in `S3StartSound` accommodates for such a case by loading
the missing sample, it first calls `S3CalculateRandomizedFields`, which
triggers a NULL pointer dereference on platforms with memory protection.
This bug is most likely an overlook from the DOS era.

Fix this by checking for NULL pointer before use.

Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
2023-02-22 11:11:59 +01:00
Anonymous Maarten 83ba373426
Use BRender macro's + floats + move around code blocks (#250) 2023-01-19 18:00:50 +01:00
Anonymous Maarten 5eebedfdc9
Add action replay (#230)
* Add replay

* Hide action replay behind --enable-replay

* Update src/DETHRACE/dr_types.h

* Compy OS_ALlocateACtionReplayBuffer from linux to macos

* Add missing macro

* Fix LengthOfSession for smudges

* Implement PipeInstantUnSmudge
2022-11-21 22:44:37 +01:00
Dethrace Engineering Department 1208a5061a
Fix sounds (#228)
* fixes sound volume and cutoff when too far away

* adds volume-multipler command line arg
2022-11-02 05:36:09 +13: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
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 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
Dethrace Engineering Department 94167e09c8
Recovery and Race Completed logic (#74)
* implements race completed, recovery logic

* fps limiter, better framebuffer handling
2022-01-25 22:32:11 +13:00
Jeff Harris 4754aea863
Enable more compiler errors (#50)
* Fixes clever text rendering
* Adds better compile errors
2021-05-02 22:32:38 +12:00
Jeff Harris d08ab2f0e7
Adds game main loop (#49)
* Adds game main loop, 2d rendering in game mode
2021-04-21 12:25:19 +12:00