Commit Graph

25 Commits

Author SHA1 Message Date
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
Anonymous Maarten d3ebbb6f1f
Visual Studio Fixes (#106)
* Visual Studio Fixes

* Disable flooring the frame period to 10ms

* Don't build with mingw on gha
2022-03-17 10:30:38 +13:00
Anonymous Maarten e2164d3377
Start checking checkpoints + laps (#103)
* Start counting laps

* Fix flashing checkpoints in map mode

* Clean up taken image after changecar dialog
2022-03-12 20:03:37 +13:00
Anonymous Maarten 6568a15103
Truckload of updates (#96)
* dethrace: implement all missing brucetrk functions

* brender: use sqrtf in macros to avoid double->float conversion

* dethrace: implement a few key callbacks (will crash further along the line)

* dethrace: start earning some money (display credits message)

* dethrace: create spark/shrapnel objects (no render yet)

* ALL IN ONE

* brender: implement 'easy' euler functions

* brender: implement BrMatrix4PreTransform and BrTransformToTransform

* brender: add TAU constand (=2*pi)

* brender: add FIXME/STUB to render function (+ implement it)

* brender: add a few functions to the global brender header

* Add DETHRACE_FIX_BUGS macro to the cmake build system to optionally fix bugs/compiler warnings

* dethrace: implement 2 crush functions

* dethrace: use floats in FindFace + re-use local stack variable

* tNet_contents is an enum: the header aliases the start of the other messages

* dethrace: stub PDMouseButtons

* dethrace: implement a few utility functions

* dethrace: implement ChangeSelectionTo + de-inline ResetInterfaceTimeout

* dethrace: use chars instead of magic values + add fix for compiler warning about number formatting

* dethrace: compare a pointer against a NULL pointer

* dethrace: implement a lot of powerup functions

* dethrace: implement a few piping functions

* dethrace: implement a few opponent functions

* dethrace: completely implement load/save (or so I hope :D)

* dethrace: implement a few oily functions

* dethrace: implement got/lose/periodic powerup proc array

* brender: add BrXXXFindHook functions to brender header

* dethrace: register callback functions on missing material/model/map/tables

* dethrace: compare pointers with pointers and ints with ints

* Hide powercallback typedefs behind #ifdef

* dethrace: implement Del/End/PgDn APO buy buttons logic

* Add BrDiagHandlerSet to brender.h

* dethrace: SwithToRealResolution/SwitchToLoresMode call PD functions

* Use correct type when comparing against characters.

* dethrace: implement writing out and disposing crush data

* dethrace: add NonFatalError + fix entry in gError_messages

* dethrace: implement StopCarSmoking and StopCarSmokingInstantly

* dethrace: implement SkidNoise + ScrapeNoise + DamageUnitWithSmoke + DamageUnit

* dethrace: InitCarSkidStuff -> use floats instead of doubles

* Add BrPixelmapCopy + BrPixelmapPixelSet to brender header

* dethrace: implement DisableCar

* dethrace: stub out a lot of functions in sound.c

* dethrace: load and dispose pratcam data

* dethrace: minor additions to flicplay.c

* skidmark: compare floats with floats

* dethrace: implement some functions to convert face materials for different wall texturing levels

* add stub BrPixelmapCopy function + add STUB_ONCE calls in other methods

* MungeForwardSky does nothing, I think

* Use macros to initialize variables in AllocateCamera

* Implement AdjustSkid + use floats

* DRStdioOpenRead: Compare pointer against NULL

* dethrace: Implement IncrementLap

* dethrace: implement ChangeAmbientPratcam

* Implement SortOutRecover

* Implement CheckHornLocal

* Use COUNT_OF in dethrace

* Draw arrow blip on map

* Implement DRPixelmapCopy

* Fix error code value

* Stub GotPowerupX

* Add ability to run the game/tests without signal handler, this allows a debugger to attach

* Don't save a game in PDFatalError

* Fix loadsave recopy arrays

Co-authored-by: Dethrace Engineering Department <78985374+dethrace-labs@users.noreply.github.com>
2022-03-02 17:15:59 +13:00
Anonymous Maarten 26fd105889
Various work for upstream (#93)
* dethrace: right align numbers in columns

* tools/progress.py: allow sorting on different keys

* brender: add BrPixelmapSave(Many)? to brender.h

* brender: add BrActorLoadMany and BrModelAddMany to brender.h

* brender: add BrWriteModeSet to brender.h header

* brender: define br_size_t as size_t

* brender: expose default order_table through header

* brender: sort tokens by value (and add _BRT_LAST_BUILTIN_TOKEN value)

* brender: diffusion factor of default material is 0.7

* brender; br_value_tag and br_lexer_token.v are unions

* brender: add all genclip functions

* brender: add all token functions

* brender: add assocarr functions

* brender: add lexer functions

* brender: add default model

* brender: add resource functions

* brender: fix BrMaterialAllocate

* brender: add logwrite functions

* brender: add brprintf functions

* brender: add missing file function (BrFileAttributes)

* brender: add BrAngleToDegrees define in br_defs.h

* brender: add image functions

* brender: implement all resreg functions

* brender: implement all pmnull methods

* dethrace: fix brender init string + other params

* brender: use BR_ASIZE when using pm_resourceClasses

* brender: implement all dbsetup functions

* dethrace: implement all input functions

* dethrace: implement various depth edit mode functions

* infra: add WARN_ONCE macro to avoid spamming the console

* dethrace: add enable/disable plingmaterials + add log message

* dethrace: Implement a few loading functions

* dethrace: implement PrintScreenFile + PrintScreen to write screen to BMP

* brender: 8 directories for image is a better default

* brender: Implement makeMeshFromBounds + add typedef for render callbacks

* brender: implement all functions in enables.c

* brender: implement all fwsetup functions

* brender: implement some prepmesh functions

* brender: implement all modsupt.c functions

* brender: use correct types in comparisons

* brender: add whitespace in brlists.c

* brender: actually return something in BrBoundsToMatrix34

* brender: implement all bswap functions

* brender: implement all brerxcept functions

* brender: Implement BrActorSearch + fix RenumberActor

'd' is the depth, it should be the same for all children

* dethrace: gMem_names contains empty strings instead of NULL

* dethrace: ServiceTheGame also does CheckMemory

* dethrace: implement DisposeActorMatrix + DisposeColumns

* dethrace: Implement TogglePedestrians + GetPedCount + GetPedPosition

* dethrace: implement a few superficial powerup functions

* dethrace: implement a few shading helper functions

* dethrace: implement a few world actor helper functions

* dethrace: InitNetGameplayStuff has empty implementation

* dethrace: implement + use DRPixelmapCentredText

* dethrace: display APO bars on HUD

* dethrace: do DoNewGameAnimation when starting a new race (=empty)

* dethrace: (Open|Close)Diagnostics are the first/last functions to run

* dethrace: implement RestoreCameraPosition

* dethrace: LoadOpponentMugShot does a MAMSLock

* dethrace: use enum value for gRace_over_reason

* dethrace: add withespace after LOG_TRACE

* dethrace: implement SetSmokeLastDamageLEvel + StealCar

* dethrace: implement ResetOilSpills

* dethrace: InitRace calls InitNetGameplayStuff

* dethrace: use COUNT_OF instead of magic number

* brender; br_value_tag and br_lexer_token.v are unions

* dethrace: implement options menu (missing graphics/controller/sound menu)

* dethrace: implement DrawRectangle + DrawRRectangle

* dethrace: implement (Set|Reset)NonFatalALlocationErrors + MAMSInitMem

* dethrace: Call MAMSInitMem() in InitialiseApplication

* dethrace: implement some flic accessor methods

* dethrace: implement getters to initialize the graphics options menu

* dethrace: implement graphics options menu

* dethrace: support saving options to file

* dethrace: implement AwardTime

* Add utility script to decode encrypted text file

* dethrace: implement Log2 + LoadDepthTable

* dethrace: replace number with their character equivalent

* dethrace: implement DimRectangle

Dimming the rectangles for the HUD is not working, because the renderer needs to write back to the back screen.

* dethrace: implement KillOldestQueuedHeadup

* resource: remove debug fflush

* modrend: fix comment

* depth: fix factor 2 bug

* loading: undefine BAIL_IF_NEGATIVE

* dbsetup: use macros for enabled types

* input: remove outdated comment
2022-02-23 13:58:24 +13:00
Dethrace Engineering Department 988891306d
Adds skidmarks (#78) 2022-01-28 13:27:21 +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
Dethrace Engineering Laboratory 73c799d573
Textures! (#69)
* textures working
* adds demo code
* fixes incorrect rotation
2022-01-18 09:16:24 +13:00
Dethrace Engineering Laboratory 6d21a1c480
BRender inline functions (#64)
* convert CollCheck to use inline BR functions

* convert CalcForce to use inline BR functions

* partial support for demo content

* harness interface tidy up

* cleaner platform handing
2021-10-04 12:37:23 +13:00
Jeff Harris 4608bdd8ca
Feature/collision detection (#60)
* most functions implemented, car disappears on collision?
* implements friction from collision, car no longer disappears
* removes -Werror compiler flag for DETHRACE directory
2021-09-21 13:09:18 +12:00
Jeff Harris 6a31e4f6a9
Fix/global vars ordering (#58)
* reordered global vars based on updated codegen, resolve duplicate symbols
2021-09-10 13:36:14 +12:00
Jeff Harris f1ed9ff522
Car control and physics attempt #1 (#57)
* correctly render track based on current view and yon factor

* some physics code

* rotate, translate, self centering steering

* Fix ordering of global variables

* ApplyPhysicsToCars

* car is moving somewhat

* fixes stumbling at low revs

* camera swings around properly when switching direction

* fix compile errors
2021-09-08 13:19:08 +12:00
Jeff Harris 6cc2db6201
Rendering our first 3d scene! (#52)
* 3d rendering working slightly

* lighting working but looks funny

* camera swoop working somehow

* 3d rendering working down to camera

* fix linux build
2021-07-17 07:08:06 +12: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
Jeff Harris 1ce611e9d8
Implements load race screen and grid selection screens! (#45)
* Load Race screen
* Grid Selection screen
* Loads race objects into memory
2021-03-25 06:51:35 +13:00
Jeff Harris f665dbf6cf
Implements Select Driver screen (#39)
* Adds driver select interface screen
2020-09-23 00:30:16 -07:00
Jeff Harris 7b7f691c45
Fix/update from new codegen (#38)
* removes duplicate comments in header files
* replaces offset, size, register comments with a single IDA format comment
2020-09-11 11:01:54 -07:00
Jeff Harris e54cf25a74
Feature/load races (#31)
* loading races, powerups, opponents
* runs all the way to end of initialization
2020-07-15 22:02:11 -07:00
Jeff Harris 77e404f141
Adds font rendering, makes low memory screen work (#30)
* Adds font rendering, makes low memory screen work
* fix tests without data directory
2020-07-08 21:08:55 -07:00
Jeff Harris 4995fe4979
Implements LoadModel (#24)
* cpoint.dat model loading working
* Simplify resource_header padding, fixes resource free callback to close files correctly
2020-05-17 14:59:41 -07:00
Jeff Harris efe0a8dbdc
clang format all files (#21) 2020-01-11 09:23:28 -08:00
Jeff Harris 57bf2c3dc4
compile DETHRACE and BRSRC13 separately. (#13)
* compile DETHRACE and BRSRC13 separately. Fixed some types wronly generated into dr_types.h

* Fix makefile ordering

* make gcc happy
2019-11-22 09:25:44 -08:00