* Some executables accept a -german command line option for a 'safe' environment
* Add ascii table for carmageddon, and use it when KEYBOARD.COK is not available
* Remove unneeded braces in input.c
* Use KEY_SHIFT_ANY instead of KEY_LSHIFT
* Remove empty line
* Move ascii tables to external header
* Make sure to treat extended ASCII as unsigned: they must be positive to avoid out-of-bounds texture access
* 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
When `SmokeLine` is called through `DrawTheGlow`, the calculated shade
table offset might result in a negative value. Subject to usual
arithmetic conversions, it is then treated as a large unsigned array
index. On 32-bit systems (e.g. OG builds for DOS, Windows 95), the
pointer arithmetic overflows and produces a negative index access,
simply grabbing game data a few bytes before the start of the table. On
64-bit platforms this instead results in page fault.
1. Keep table offset in a signed integer, making the negative values
explicit. This provides OG behavior for 64-bit builds.
2. Optionally, cap all negative values at 0, preventing underflows.
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
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>
* support for index_blend materials
* blended materials should not write to zbuffer
* remove reliance on glsl layout qualifiers
* tidy StripBlendedFaces
Strip map height is a 16 bit value. Cast to `br_uint_16 *`, so that the
upper 8 bits don't get lost.
This fixes cockpit image rendering for -hires mode, where said images
have heights exceeding 255px.
When searching for a particular headup slot, don't return on the first
empty hole, but rather try to find if the matching slot is in use.
This resolves a bug where two headups of the same type could end up
displayed on top of each other.
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
* Prevent clicking on racer scroll buttons when hidden (#262)
Fix a bug where racers could be scrolled in other view modes, messing up
the screen.
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Co-authored-by: Dethrace Engineering Department <78985374+dethrace-labs@users.noreply.github.com>
Resolve a bug in DRPixelmapRectangleShearedCopy, where source pixelmap
gets clipped along the shear, rather than vertically, at right-most edge
of the destination pixelmap.
While at it, also eliminate duplicate code - this part introduces no
logic changes.
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Flush framebuffer/depthbuffer after rendering the 3d scene. This allows
screen effects such as smoke, sparks or electro-bastard ray to display
correctly.
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Store the previous time credit in `gLast_time_credit_amount` instead of
`gLast_time_credit_headup`. The latter is supposed to hold the headup
slot number and gets overwritten with time unrelated values.
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
The Linux implementation of `OS_fopen` fails to close directories after
use, leaking the underlying file descriptors. Eventually, the limit of
allowed file descriptors per process is reached, causing subsequent
`opendir` failures, and leading to random game crashes.
Fix this issue by calling `closedir` once the directory can be disposed.
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Fix misaligned gear mask and a buffer overflow for cars which use more
than 8 gears, and thus pixelmaps other than HGEARS.PIX.
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
* Use Brender macro's in MungeClipPlane
* gNet_mode is an enum
* Create macro defining the area where pedestrians are considered active
* When respawning pedestrians, only animate the pedestrians that are in view
* Make the gl renderer aware of BR_MATF_TWO_SIDED and BR_MATF_ALWAYS_VISIBLE
Prevent the gl renderer from culling back-faced textures if the material
is two-sided or always visible.
Due to the wrong order of vertices in the model, oil spill object is
subject to back face culling, preventing it from being rendered. Set
the oil spill material as two-sided, allowing it to be displayed.
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>