* fix windows chdir behavior
* log panics to file and check for gl shading language
---------
Co-authored-by: Jeff Harris <jeff@1amstudios.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
* 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>
* Fix unittests with null renderer
* cmake: fix configuration when building from a non-git/non-release archive
* test: don't access freed memory
* cmake+ci: use libsdl-org/setup-sdl for SDL2 + create package with CMake
* Install all files to root + SDL2.dll
* windows: print strerror message on failure to open file
* Remove leading _ from _program_name
* A few windows functions can be static
* ci: Always upload artifact
* linux+macos: Print message on stderr when fopen fails
* Remove merge artifacts
* Remove stray '#include <stdio.h>'
The DOS version loads both low and high-res car icons: one is used for in-game icons, the other for use in the menus.
On Windows, only the high res car icons are used. This causes artifacts.
* 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>
* 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
* 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>