Skip to content

Commit

Permalink
Merge pull request #147 from OpenDriver2/develop-SoapyMan
Browse files Browse the repository at this point in the history
RC1 fixes
  • Loading branch information
SoapyMan authored Feb 4, 2022
2 parents 6fba273 + 6b780a8 commit acca6b1
Show file tree
Hide file tree
Showing 155 changed files with 2,568 additions and 24,936 deletions.
2 changes: 1 addition & 1 deletion .appveyor/Install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ curl "$linux_premake_url" -Lo premake5.tar.gz
tar xvf premake5.tar.gz

sudo apt-get update -qq -y
sudo apt-get install --no-install-recommends -y g++-7-multilib gcc-7-multilib
sudo apt-get install --no-install-recommends -y gcc-multilib g++-multilib
sudo apt-get install -qq aptitude -y

# fix Ubuntu's broken mess of packages using aptitude
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src_rebuild/PsyCross"]
path = src_rebuild/PsyCross
url = https://github.com/OpenDriver2/PsyCross.git
Binary file removed PSXToolchain/CDSrc/licensea.dat
Binary file not shown.
2 changes: 2 additions & 0 deletions PSXToolchain/CDSrc/pack.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mkpsxiso.exe redriver2_cd.xml -y
pause
366 changes: 239 additions & 127 deletions PSXToolchain/CDSrc/redriver2_cd.xml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions PSXToolchain/CDSrc/unpack.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dumpsxiso.exe Driver2CD2.bin -s CD.xml
pause
2 changes: 2 additions & 0 deletions PSXToolchain/psx_build.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
echo off
cls
set REDRIVER_FOLDER=%cd%\..

rem Make a symlink
Expand Down
4 changes: 0 additions & 4 deletions PSXToolchain/psx_makecd.bat

This file was deleted.

10 changes: 6 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@ environment:
project_folder: '%APPVEYOR_BUILD_FOLDER%\\src_rebuild'
dependency_folder: '%APPVEYOR_BUILD_FOLDER%\dependencies'
# Dependency URLs
windows_premake_url: 'https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-windows.zip'
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.14-VC.zip'
linux_premake_url: 'https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-linux.tar.gz'
windows_sdl2_url: 'https://www.libsdl.org/release/SDL2-devel-2.0.20-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.14'
windows_sdl2_dir: '%dependency_folder%\SDL2-2.0.20'


install:
- git submodule init
- git submodule update
- cmd: '%APPVEYOR_BUILD_FOLDER%\.appveyor\Install.bat'
- sh: '${APPVEYOR_BUILD_FOLDER}/.appveyor/Install.sh'

Expand Down
10 changes: 6 additions & 4 deletions data/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ start=w
select=H

[cdfs]
image=install/Driver2CD1.bin
#image=install/Driver2CD1.bin
mode=1,2,2352 # track, mode, sector size. DO NOT MODIFY

[pad]
Expand All @@ -107,7 +107,10 @@ 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
screenWidth=1280 # screen resolution when fullscreen is on
screenHeight=720
vsync=1 # Prevents screen tearing in Full screen. Turn it off if you have framerate problems.
pgxpTextureMapping=1
bilinearFiltering=1 # "smooth" textures
pgxpZbuffer=1 # full Z-buffer on PSX polygons
Expand All @@ -121,5 +124,4 @@ freeCamera=1 # Press F7 in game to enable
fastLoadingScreens=1
widescreenOverlays=1 # set 1 to see map, bars and stats aligned to screen corners
driver1music=0 # put Driver 1's MUSIC.BIN as D1MUSIC.BIN to DRIVER2\SOUNDS folder
overrideContent=0 # this enables texture and car model modding
userChases=RacingFreak,Snoopi,Olanov,Vortex,Fireboyd78
overrideContent=0 # this enables texture and car model modding
9 changes: 2 additions & 7 deletions src_rebuild/DebugOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,8 @@ void DrawDebugOverlays()
gte_SetRotMatrix(&inv_camera_matrix);

SVECTOR a, b;
a.vx = ld.posA.vx - camera_position.vx;
a.vy = ld.posA.vy - camera_position.vy;
a.vz = ld.posA.vz - camera_position.vz;

b.vx = ld.posB.vx - camera_position.vx;
b.vy = ld.posB.vy - camera_position.vy;
b.vz = ld.posB.vz - camera_position.vz;
VecSubtract(&a, &ld.posA, &camera_position);
VecSubtract(&b, &ld.posB, &camera_position);

gte_ldv3(&a, &b, &b);

Expand Down
44 changes: 16 additions & 28 deletions src_rebuild/Game/ASM/rndrasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@ int Apply_InvCameraMatrixSetTrans(VECTOR_NOPAD* pos)
{
VECTOR vfc;
VECTOR vec;
VECTOR local;
SVECTOR local;
gte_stfc(&vfc);

local.vx = (pos->vx - vfc.vx) << 0x10 >> 0x10;
local.vy = (pos->vy - vfc.vy) << 0x10 >> 0x10;
local.vz = (pos->vz - vfc.vz) << 0x10 >> 0x10;
VecSubtract(&local, pos, &vfc);

#ifdef PSX
gte_ldlvl(&local);
gte_ldsv(&local);
gte_lcir();
gte_stlvl(&vec);
#else
Expand All @@ -67,15 +65,13 @@ int Apply_InvCameraMatrixAndSetMatrix(VECTOR_NOPAD* pos, MATRIX2* mtx)
{
VECTOR vfc;
VECTOR vec;
VECTOR local;
SVECTOR local;
gte_stfc(&vfc);

local.vx = (pos->vx - vfc.vx) << 0x10 >> 0x10;
local.vy = (pos->vy - vfc.vy) << 0x10 >> 0x10;
local.vz = (pos->vz - vfc.vz) << 0x10 >> 0x10;
VecSubtract(&local, pos, &vfc);

#ifdef PSX
gte_ldlvl(&local);
gte_ldsv(&local);
gte_lcir();
gte_stlvl(&vec);
#else
Expand All @@ -92,8 +88,6 @@ int Apply_InvCameraMatrixAndSetMatrix(VECTOR_NOPAD* pos, MATRIX2* mtx)
gte_SetRotMatrix(mtx);
gte_SetTransVector(&vec);



if (vec.vx >> 1 < 0)
return vec.vz - vec.vx;

Expand All @@ -103,19 +97,16 @@ int Apply_InvCameraMatrixAndSetMatrix(VECTOR_NOPAD* pos, MATRIX2* mtx)
// [D] [T]
int FrustrumCheck16(PACKED_CELL_OBJECT* pcop, int bounding_sphere)
{
VECTOR local;
local.vx = (pcop->pos.vx - camera_position.vx) << 0x10 >> 0x11;
local.vy = (pcop->pos.vy - camera_position.vy) << 0x10 >> 0x11;
local.vz = (pcop->pos.vz - camera_position.vz) << 0x10 >> 0x11;

gte_ldlvl(&local);
VECTOR result;
SVECTOR local;
VecSubtract(&local, &pcop->pos, &camera_position);

gte_ldsv(&local);
gte_llir();

VECTOR result;
gte_stlvnl(&result);

int ang = frustrum_matrix.t[0] - (bounding_sphere >> 1);
int ang = frustrum_matrix.t[0] - bounding_sphere;

if (ang <= result.vx && ang <= result.vy && ang <= result.vz)
return 0;
Expand All @@ -126,19 +117,16 @@ int FrustrumCheck16(PACKED_CELL_OBJECT* pcop, int bounding_sphere)
// [D] [T]
int FrustrumCheck(VECTOR* pos, int bounding_sphere)
{
VECTOR local;
local.vx = (pos->vx - camera_position.vx) << 0x10 >> 0x11;
local.vy = (pos->vy - camera_position.vy) << 0x10 >> 0x11;
local.vz = (pos->vz - camera_position.vz) << 0x10 >> 0x11;

gte_ldlvl(&local);
VECTOR result;
SVECTOR local;
VecSubtract(&local, pos, &camera_position);

gte_ldsv(&local);
gte_llir();

VECTOR result;
gte_stlvnl(&result);

int ang = frustrum_matrix.t[0] - (bounding_sphere >> 1);
int ang = frustrum_matrix.t[0] - bounding_sphere;

if (ang <= result.vx && ang <= result.vy && ang <= result.vz)
return 0;
Expand Down
4 changes: 0 additions & 4 deletions src_rebuild/Game/C/E3stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,6 @@ void FadeOutHiresScreen(void)
PutDispEnv(&disp);
PutDrawEnv(&draw);

//g_wireframeMode = 1;

DrawSync(0);
SetDispMask(1);

Expand Down Expand Up @@ -524,8 +522,6 @@ void SetPleaseWait(char *buffer)
ResetCityType();

#else
ResetCityType();

PsyX_EndScene();
#endif // PSX

Expand Down
1 change: 0 additions & 1 deletion src_rebuild/Game/C/ai.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef AI_H
#define AI_H


extern void StoreGameFlags(); // 0x0001BBB8
extern int TannerCanEnterCar(CAR_DATA *cp, int distToCarSq); // 0x0001BBE8
extern int TannerStuckInCar(int doSpeedCheck, int player_id); // 0x0001BA90
Expand Down
11 changes: 10 additions & 1 deletion src_rebuild/Game/C/camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ int CameraCollisionCheck(void)
// [D] [T]
void TurnHead(PLAYER *lp)
{
LPPEDESTRIAN pPlayerPed;

pPlayerPed = lp->pPed;

// [A] handle REDRIVER2 dedicated look back button
if ((paddCamera & CAMERA_PAD_LOOK_BACK) == CAMERA_PAD_LOOK_BACK || (paddCamera & CAMERA_PAD_LOOK_BACK_DED))
{
Expand Down Expand Up @@ -444,10 +448,15 @@ void PlaceCameraFollowCar(PLAYER *lp)

if(car_cos)
{
int addDist;

carheight = car_cos->colBox.vy * -3 + 85;

// [A] default just adds 248, but it's too close for big vehicles
addDist = MAX(248, car_cos->colBox.vy * 3);

if (gCameraMaxDistance == 0)
maxCameraDist = car_cos->colBox.vz * 2 + car_cos->colBox.vy + 248;
maxCameraDist = car_cos->colBox.vz * 2 + car_cos->colBox.vy + addDist;
else
maxCameraDist = gCameraMaxDistance;

Expand Down
Loading

0 comments on commit acca6b1

Please sign in to comment.