Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bf1aa0b
- fix brake light pool brightness values (thanks @Natsu235)
SoapyMan Aug 27, 2025
c91805f
#209 overlay: fix multiplayer CTF misaligned flag counter
SoapyMan Aug 27, 2025
d44f770
- add decompiled birds code from Driver 1, adjust so it works
SoapyMan Sep 12, 2025
ddfee61
- try fix CI build on Windows
SoapyMan Sep 12, 2025
58e1f40
- remove comment
SoapyMan Oct 3, 2025
3bdd6bb
- spool: don't ping out secret cars in PrepareSecretCar
SoapyMan Oct 3, 2025
c9b59e1
- event: opening secret car gate in rio now triggers spool
SoapyMan Oct 3, 2025
07c1753
Load all base car models into memory (as permanent textures are alrea…
SoapyMan Oct 3, 2025
adc519f
- fix missing levelSpecCosmetics change
SoapyMan Oct 3, 2025
8f39a42
- fix Caine's cash missing limo
SoapyMan Oct 3, 2025
7cc25af
- if mission takes civ car as cop car, re-add it again as civ car
SoapyMan Oct 3, 2025
3c9b2d4
- Caine's cash to have pickup truck instead of thunderbird on additio…
SoapyMan Oct 3, 2025
7982381
- rename missionResidentCarModels -> residentCarModels
SoapyMan Oct 3, 2025
a5f1e3a
- fix FEGetHiresBakedQuad buffer underflow
SoapyMan Oct 4, 2025
c09b639
- fix incorrect change causing buffer overflow
SoapyMan Oct 4, 2025
1b5565a
- fix out of bounds issue on Car bomb getaway
SoapyMan Oct 5, 2025
073ff66
- replace InitSpecSpool hardcoding with less hardcoding
SoapyMan Oct 5, 2025
c1a9e29
- fix Lenny gets caught traffic vehicles
SoapyMan Oct 5, 2025
75ec6e9
- fix regression
SoapyMan Oct 7, 2025
9865bc0
- change build files folder, add vscode generator support
SoapyMan Nov 16, 2025
2c522d3
- fix compile/link for linux amd64
SoapyMan Nov 16, 2025
cda23a5
- fix windows build
SoapyMan Nov 16, 2025
f37a4da
- fix PVSDecode undefined behaviour on MSVC and visibility issue on G…
SoapyMan Nov 16, 2025
6417ae9
- update build files: build linux x86_64 executable
SoapyMan Nov 16, 2025
dbc609b
- flatpak off
SoapyMan Nov 17, 2025
c7fb06a
- fix regression (thanks @Natsu235)
SoapyMan Nov 19, 2025
8fb32c3
- event: preserve trains collision on wrap/restart
SoapyMan Dec 13, 2025
4e95f6d
- fix tanner shadow appearance on linux Release build
SoapyMan Jan 4, 2026
f2aff50
- fix compilation with Emscripten, make it more effortless; fix crashes
SoapyMan Jan 4, 2026
6943115
- fix latest version crashing on emscripten in Demo mode
SoapyMan Jan 4, 2026
4e3fdf4
- fix subtitles not working when running from CD image
SoapyMan Jan 4, 2026
8651e2f
- optimize & fix broken light pools on emscripten version
SoapyMan Jan 4, 2026
9267734
- fix headlights disappearing in bumper view (WTF)
SoapyMan Jan 5, 2026
0479fdf
- add config.ini mentioning options for screenWidth/screenHeight
SoapyMan Jan 25, 2026
517219a
- fix mission 39 regression with helicopter texture
SoapyMan Jan 25, 2026
691522e
- improve sprite lighting hardcoding code
SoapyMan Jan 25, 2026
013689b
- restore AutoDirect when running quick replay
SoapyMan Jan 25, 2026
655765d
- fix game completion override when going to director/quick replay
SoapyMan Jan 25, 2026
a2994f6
- better pause mode fix
SoapyMan Jan 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor/Build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set SDL2_DIR=%windows_sdl2_dir%

premake5 vs2019

cd project_vs2019_windows
cd build

set config=Debug:Release:Release_dev
for %%c in (%config::= %) do (
Expand Down
27 changes: 2 additions & 25 deletions .appveyor/Build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,10 @@ set -ex
# Configure
cd "$APPVEYOR_BUILD_FOLDER/src_rebuild"
./premake5 gmake2
cd project_gmake2_linux
cd build

# Build
for config in debug_x86 release_x86 release_dev_x86
for config in debug_x64 release_x64 release_dev_x64
do
make config=$config -j$(nproc)
done

cd ${APPVEYOR_BUILD_FOLDER}

# Creating flatpak directories
mkdir -p "${APPVEYOR_BUILD_FOLDER}/.flatpak/lib" "${APPVEYOR_BUILD_FOLDER}/.flatpak/data" "${APPVEYOR_BUILD_FOLDER}/.flatpak/bin"
find ${APPVEYOR_BUILD_FOLDER}/src_rebuild/bin/Release -name 'REDRIVER2*' -exec cp -t ${APPVEYOR_BUILD_FOLDER}/.flatpak/bin {} +

# Copy missing libraries in the runtime
for lib in libjpeg libopenal
do
cp -Lf $(ldd "${APPVEYOR_BUILD_FOLDER}/src_rebuild/bin/Release/REDRIVER2" | awk '/ => / { print $3 }' | grep ${lib}) "${APPVEYOR_BUILD_FOLDER}/.flatpak/lib"
done

cp -r "${APPVEYOR_BUILD_FOLDER}/data" "${APPVEYOR_BUILD_FOLDER}/.flatpak/"

# Editing metadatas with the current version
export APPVEYOR_BUILD_DATE=$(date "+%Y-%m-%d")
sed -i -e "s/V_VERSION/$APPVEYOR_BUILD_VERSION/g" -e "s/V_DATE/$APPVEYOR_BUILD_DATE/g" .flatpak/io.github.opendriver2.Redriver2.appdata.xml

# Build the flatpak
flatpak-builder --user --install build io.github.opendriver.redriver2.yaml --force-clean --arch=x86_64
flatpak build-bundle ~/.local/share/flatpak/repo io.github.opendriver2.Redriver2.flatpak io.github.opendriver2.Redriver2
rm -rf build/ .flatpak-builder/
16 changes: 3 additions & 13 deletions .appveyor/Install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,9 @@ sudo apt-get install -qq aptitude -y

# fix Ubuntu's broken mess of packages using aptitude
sudo aptitude install --quiet=2 \
libsdl2-dev:i386 \
libopenal-dev:i386 \
libjpeg-turbo8-dev:i386 \
libsdl2-dev \
libopenal-dev \
libjpeg-turbo8-dev \
flatpak flatpak-builder -y

# Setting XDG_DATA_DIRS environement variable for flatpak
export XDG_DATA_DIRS="/var/lib/flatpak/exports/share:${HOME}/.local/share/flatpak/exports/share:$XDG_DATA_DIRS"

# Adding the flathub repo
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

# Adding Platform/SDK for the Linux flatpak release
flatpak --user install flathub org.freedesktop.Platform/x86_64/22.08 -y
flatpak --user install flathub org.freedesktop.Sdk/x86_64/22.08 -y
flatpak --user install flathub org.freedesktop.Sdk.Compat.i386/x86_64/22.08 -y
flatpak --user install flathub org.freedesktop.Sdk.Extension.toolchain-i386/x86_64/22.08 -y
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*.code-workspace
.vscode/*
.vs/*
game/*
webdemo/*
PSXToolchain/GameSRC*
PSXToolchain/Overlay*
PSXToolchain/PsyQ/*
Expand All @@ -35,8 +37,9 @@ PSXToolchain/CDSrc/REDRIVER2.cue
PSXToolchain/CDSrc/*.txt
src_rebuild/dependencies/*
src_rebuild/.vs/*
src_rebuild/.vscode/*
src_rebuild/bin/*
src_rebuild/obj/*
src_rebuild/project_*
src_rebuild/build*
src_rebuild/*.make
src_rebuild/Makefile
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 7.8.{build}
version: 8.0.{build}

branches:
only:
Expand All @@ -18,13 +18,13 @@ environment:
# Dependency URLs
windows_premake_url: 'https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-windows.zip'
windows_jpeg_url: 'http://www.ijg.org/files/jpegsr9d.zip'
windows_openal_url: 'https://openal-soft.org/openal-binaries/openal-soft-1.21.1-bin.zip'
windows_sdl2_url: 'https://www.libsdl.org/release/SDL2-devel-2.0.20-VC.zip'
windows_openal_url: 'https://github.com/kcat/openal-soft/releases/download/1.23.1/openal-soft-1.23.1-bin.zip'
windows_sdl2_url: 'https://github.com/libsdl-org/SDL/releases/download/release-2.30.2/SDL2-devel-2.30.2-VC.zip'
linux_premake_url: 'https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-linux.tar.gz'
# Dependency Directories
windows_jpeg_dir: '%dependency_folder%\jpeg-9d'
windows_openal_dir: '%dependency_folder%\openal-soft-1.21.1-bin'
windows_sdl2_dir: '%dependency_folder%\SDL2-2.0.20'
windows_openal_dir: '%dependency_folder%\openal-soft-1.23.1-bin'
windows_sdl2_dir: '%dependency_folder%\SDL2-2.30.2'


install:
Expand Down
4 changes: 3 additions & 1 deletion data/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ pad2device=-1 # player 2 controller device; -1 for automatic assignment
[render]
windowWidth=1280
windowHeight=720
fullscreen=0 # enable full screen mode; it takes screen resolution
fullscreen=0 # enable full screen mode; it takes screen resolution when screenWidth && screenHeight are 0
screenWidth=0
screenHeight=0
pgxpTextureMapping=1
bilinearFiltering=1 # "smooth" textures
pgxpZbuffer=1 # full Z-buffer on PSX polygons
Expand Down
18 changes: 18 additions & 0 deletions linux_dev_prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# Install
export PREMAKE_URL="https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-linux.tar.gz"

curl "$PREMAKE_URL" -Lo premake5.tar.gz
tar xvf premake5.tar.gz
rm -f premake5.tar.gz

PREMAKE=$(pwd)/premake5

# Configure
cd "src_rebuild"
$PREMAKE gmake2
$PREMAKE vscode
cd project_gmake2_linux


10 changes: 9 additions & 1 deletion src_rebuild/Game/C/bcollide.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,12 +895,20 @@ int CarBuildingCollision(CAR_DATA *cp, BUILDING_BOX *building, CELL_OBJECT *cop,
{
if (model->flags2 & MODEL_FLAG_TREE)
{
int rnd;
VECTOR LeafPosition;
LeafPosition.vx = collisionResult.hit.vx;
LeafPosition.vy = -((rand() & 0xfe) + 600) - collisionResult.hit.vy;
LeafPosition.vy = -((rand() & 254) + 600) - collisionResult.hit.vy;
LeafPosition.vz = collisionResult.hit.vz;

AddLeaf(&LeafPosition, 3, 1);

rnd = rand();
if ((rnd & 1) == 0)
{
LeafPosition.vy -= 1100;
CreateBirds(&LeafPosition, (rnd >> 8) & 7);
}
}
else
{
Expand Down
16 changes: 9 additions & 7 deletions src_rebuild/Game/C/cars.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,22 @@ DENTUVS *gTempCarUVPtr;
DENTUVS gTempHDCarUVDump[MAX_CARS][MAX_DENTING_UVS];
DENTUVS gTempLDCarUVDump[MAX_CARS][MAX_DENTING_LOD_UVS];

CAR_MODEL NewCarModel[MAX_CAR_MODELS];
CAR_MODEL NewLowCarModel[MAX_CAR_MODELS];
CAR_MODEL NewCarModel[MAX_CAR_RESIDENT_MODELS];
CAR_MODEL NewLowCarModel[MAX_CAR_RESIDENT_MODELS];

MODEL* gCarLowModelPtr[MAX_CAR_MODELS];
MODEL* gCarDamModelPtr[MAX_CAR_MODELS];
MODEL* gCarCleanModelPtr[MAX_CAR_MODELS];
MODEL* gCarLowModelPtr[MAX_CAR_RESIDENT_MODELS];
MODEL* gCarDamModelPtr[MAX_CAR_RESIDENT_MODELS];
MODEL* gCarCleanModelPtr[MAX_CAR_RESIDENT_MODELS];

// pedestrian palette at 0 and next are cars
// model_id, texture_number, palette
u_short civ_clut[8][32][6];

#define MAX_CAR_POLYS (200 * 2) * MAX_CAR_RESIDENT_MODELS

int whichCP = 0;
int baseSpecCP = 0;
CAR_POLY carPolyBuffer[2001];
CAR_POLY carPolyBuffer[MAX_CAR_POLYS + 1];

char LeftLight = 0;
char RightLight = 0;
Expand Down Expand Up @@ -1065,7 +1067,7 @@ void buildNewCarFromModel(int index, int detail, char* polySrc, MODEL* model)

newNumPolys = whichCP;

for (i = 0; newNumPolys < 2000 && i < model->num_polys; i++)
for (i = 0; newNumPolys < MAX_CAR_POLYS && i < model->num_polys; i++)
{
ptype = *polyList;

Expand Down
10 changes: 5 additions & 5 deletions src_rebuild/Game/C/cars.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ extern CAR_DATA car_data[MAX_CARS + 2]; // all cars + Tanner cbox + Camera cbox
extern CAR_DATA* active_car_list[MAX_CARS];
extern unsigned char lightsOnDelay[MAX_CARS];

extern CAR_MODEL NewCarModel[MAX_CAR_MODELS];
extern CAR_MODEL NewLowCarModel[MAX_CAR_MODELS];
extern CAR_MODEL NewCarModel[MAX_CAR_RESIDENT_MODELS];
extern CAR_MODEL NewLowCarModel[MAX_CAR_RESIDENT_MODELS];

extern MODEL* gCarLowModelPtr[MAX_CAR_MODELS];
extern MODEL* gCarDamModelPtr[MAX_CAR_MODELS];
extern MODEL* gCarCleanModelPtr[MAX_CAR_MODELS];
extern MODEL* gCarLowModelPtr[MAX_CAR_RESIDENT_MODELS];
extern MODEL* gCarDamModelPtr[MAX_CAR_RESIDENT_MODELS];
extern MODEL* gCarCleanModelPtr[MAX_CAR_RESIDENT_MODELS];

extern int whichCP; // car poly counter
extern int baseSpecCP; // special car poly counter
Expand Down
61 changes: 35 additions & 26 deletions src_rebuild/Game/C/civ_ai.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct
} civPingTest;
#endif // DEBUG

char modelRandomList[] = { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 0, 1, 0, 4 };
char modelRandomList[16] = { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 0, 1, 0, 4 };
u_char reservedSlots[MAX_CARS] = { 0 };

int distFurthestCivCarSq = 0;
Expand Down Expand Up @@ -1595,7 +1595,7 @@ int PingOutAllSpecialCivCars(void)

do
{
if (lcp->controlType == CONTROL_TYPE_CIV_AI && MissionHeader->residentModels[lcp->ap.model] > 4)
if (lcp->controlType == CONTROL_TYPE_CIV_AI && residentCarModels[lcp->ap.model] > 4)
PingOutCar(lcp);

lcp++;
Expand Down Expand Up @@ -1786,22 +1786,19 @@ int CreateStationaryCivCar(int direction, int orientX, int orientZ, LONGVECTOR4*
unsigned char* slot;
CAR_DATA* newCar;
CAR_DATA* carCnt;
int model;
int model, i;
EXTRA_CIV_DATA civDat;
LONGQUATERNION tmpQ;

model = -1;

if (MissionHeader->residentModels[0] == externalModel)
model = 0;
else if (MissionHeader->residentModels[1] == externalModel)
model = 1;
else if (MissionHeader->residentModels[2] == externalModel)
model = 2;
else if (MissionHeader->residentModels[3] == externalModel)
model = 3;
else if (MissionHeader->residentModels[4] == externalModel)
model = 4;
for(i = 0; i < MAX_CAR_RESIDENT_MODELS; ++i)
{
if (residentCarModels[i] == externalModel)
{
model = i;
break;
}
}

if (model != -1)
{
Expand Down Expand Up @@ -2172,18 +2169,27 @@ int PingInCivCar(int minPingInDist)
}

// check if special car is loaded and add it to random list
if (specModelValid == 0 || allowSpecSpooling == 0 || MissionHeader->residentModels[4] == 12)
if ((specModelValid == 0 || allowSpecSpooling == 0 || residentCarModels[MAX_CAR_RESIDENT_MODELS - 1] == 12) && residentCarModels[MAX_CAR_RESIDENT_MODELS - 1] != 13)
{
#if MAX_CAR_RESIDENT_MODELS == 6
modelRandomList[15] = 4;
#else
modelRandomList[15] = 0;
#endif
modelRandomList[14] = 1;
}
else
{
modelRandomList[15] = 4;

#if MAX_CAR_RESIDENT_MODELS == 6
modelRandomList[14] = 4;
#else
modelRandomList[14] = 1;
#endif

if ((Random2(0) & 0x100) != 0)
modelRandomList[14] = 4;
modelRandomList[14] = MAX_CAR_RESIDENT_MODELS-1;
}

// another change for Caine's compound
Expand Down Expand Up @@ -2211,15 +2217,23 @@ int PingInCivCar(int minPingInDist)
}
else
{
model = modelRandomList[Random2(0) & 0xf];
model = modelRandomList[Random2(0) & 15];
}

// force spawn limo nearby in Caine's Cash
if (minPingInDist == 666)
model = 4;
model = MAX_CAR_RESIDENT_MODELS - 1;

#if MAX_CAR_RESIDENT_MODELS == 6
// [A] fix crashes on missing models
if(!gCarCleanModelPtr[model])
{
return 0;
}
#endif

// select car color palette
if (MissionHeader->residentModels[model] == 0 || MissionHeader->residentModels[model] > 4)
if (residentCarModels[model] == 0 || residentCarModels[model] > 4)
{
civDat.palette = 0;
}
Expand Down Expand Up @@ -2886,12 +2900,7 @@ void SetUpCivCollFlags(void)
hornchanflag[i] = GetFreeChannel();
SpuSetVoiceAR(hornchanflag[i], 27);

if (cp0->ap.model == 4)
sample = ResidentModelsBodge();
else if (cp0->ap.model < 3)
sample = cp0->ap.model;
else
sample = cp0->ap.model - 1;
sample = GetCarBankSample(cp0->ap.model);

// [A] use tracking sound
Start3DTrackingSound(hornchanflag[i], SOUND_BANK_CARS, sample * 3 + 2,
Expand Down Expand Up @@ -3298,7 +3307,7 @@ void CreateRoadblock(void)
noMoreCars = 0;
distAlongSegment = -5;
lbody = car_cosmetics[3].colBox.vz;
externalCopModel = MissionHeader->residentModels[3];
externalCopModel = residentCarModels[3];

// [A] use player instead of car
dir = player[0].dir;
Expand Down
4 changes: 2 additions & 2 deletions src_rebuild/Game/C/cop_ai.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ void ControlCopDetection(void)

if (player_position_known == 1 && first_offence == 0)
{
heading = GetCarDirectionOfTravel(&car_data[player[0].playerCarId]);
heading = GetPlayerDirectionOfTravel(&player[0]);

CopSay(Random2(2) % 2 + 10, heading);

Expand All @@ -961,7 +961,7 @@ void ControlCopDetection(void)
int rnd;
rnd = Random2(2);

heading = GetCarDirectionOfTravel(&car_data[player[0].playerCarId]);
heading = GetPlayerDirectionOfTravel(&player[0]);

if ((rnd == (rnd / 5) * 5) && (dx != LastHeading))
CopSay(rnd % 2 + 10, heading);
Expand Down
Loading