Skip to content

Commit

Permalink
Merge pull request #38 from OpenDriver2/develop-SoapyMan
Browse files Browse the repository at this point in the history
PC control schemes, fast loading screens
  • Loading branch information
SoapyMan authored Dec 1, 2020
2 parents a61d38c + ca6b590 commit ac8bddd
Show file tree
Hide file tree
Showing 63 changed files with 1,675 additions and 965 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 5.3.{build}
version: 5.4.{build}

branches:
only:
Expand Down
37 changes: 33 additions & 4 deletions data/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@
# dataFolder=REDRIVER2
# dataFolder=.

[kbcontrols_game]
cross=up
square=down
circle=right shift
triangle=space
up=up
down=down
left=left
right=right
start=escape
select=c
l1=right ctrl
r1=L
l2=J
r2=K

[kbcontrols_menu]
cross=return
square=q
circle=w
triangle=escape
start=escape
up=up
down=down
left=left
right=right
start=e
select=r

[render]
windowWidth=1280
windowHeight=720
Expand All @@ -11,8 +40,8 @@ bilinearFiltering=0
pgxpZbuffer=0

[game]
drawDistance=1200
drawDistance=1800
freeCamera=1
driver1music=0
widescreenOverlays=0
userChases=RacingFreak,Snoopi,Olanov,Vortex,Fireboyd78
fastLoadingScreens=1
widescreenOverlays=1
driver1music=0
8 changes: 4 additions & 4 deletions src_rebuild/GAME/C/BOMBERMAN.C
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ void HandleThrownBombs(void)
// [D] [T]
void DrawThrownBombs(void)
{
int iVar1;
BOMB *bomb;
int i;
MATRIX object_matrix;
Expand Down Expand Up @@ -634,7 +633,7 @@ void ExplosionCollisionCheck(CAR_DATA *cp, EXOBJECT *pE)
LONGVECTOR reaction;
LONGVECTOR lever;

isCar = (cp != &car_data[CAMERA_COLLIDER_CARID]);
isCar = (cp != &car_data[TANNER_COLLIDER_CARID]);

if (player[0].playerType == 2 || isCar)
{
Expand Down Expand Up @@ -754,10 +753,11 @@ void ExplosionCollisionCheck(CAR_DATA *cp, EXOBJECT *pE)
}
}

DamageCar(cp, cd, &collisionResult, strikeVel);
if(isCar)
DamageCar(cp, cd, &collisionResult, strikeVel);

displacement = FIXEDH(lever[0] * collisionResult.surfNormal.vx + lever[1] * collisionResult.surfNormal.vy + lever[2] * collisionResult.surfNormal.vz);
displacement = FIXEDH(((lever[0] * lever[0] + lever[2] * lever[2]) - displacement * displacement) * car_cosmetics[cp->ap.model].twistRateY) + 0x1000;
displacement = FIXEDH(((lever[0] * lever[0] + lever[2] * lever[2]) - displacement * displacement) * car_cosmetics[cp->ap.model].twistRateY) + 4096;

if (strikeVel < 0x7f001)
denom = (strikeVel * 4096) / displacement;
Expand Down
4 changes: 2 additions & 2 deletions src_rebuild/GAME/C/CAMERA.C
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ int CameraCollisionCheck(void)
sphere = scr_z * 3 - 382;

do {
cellx = camera_position.vx + (count % 3) * MAP_REGION_SIZE*MAP_REGION_SIZE - MAP_REGION_SIZE*MAP_REGION_SIZE + units_across_halved >> 11;
cellz = camera_position.vz + (count / 3) * MAP_REGION_SIZE*MAP_REGION_SIZE - MAP_REGION_SIZE*MAP_REGION_SIZE + units_down_halved >> 11;
cellx = (camera_position.vx + (count % 3) * MAP_REGION_SIZE*MAP_REGION_SIZE - MAP_REGION_SIZE*MAP_REGION_SIZE + units_across_halved) / MAP_CELL_SIZE;
cellz = (camera_position.vz + (count / 3) * MAP_REGION_SIZE*MAP_REGION_SIZE - MAP_REGION_SIZE*MAP_REGION_SIZE + units_down_halved) / MAP_CELL_SIZE;

if (gCameraDistance > 0)
{
Expand Down
61 changes: 49 additions & 12 deletions src_rebuild/GAME/C/CARS.C
Original file line number Diff line number Diff line change
Expand Up @@ -2351,6 +2351,44 @@ char GetCarPalIndex(int tpage)
}


// decompiled code
// original method signature:
// void /*$ra*/ ProcessPalletLump(char *lump_ptr /*$a0*/, int lump_size /*$a1*/)
// line 1970, offset 0x00019f44
/* begin block 1 */
// Start line: 1971
// Start offset: 0x00019F44
// Variables:
// int total_cluts; // $v0
// int clutValue; // $s1
// int tpageindex; // $s2
// int texnum; // $s3
// int palette; // $s4
// int clut_number; // $v1
// unsigned short clutTable[320]; // stack offset -680
// char *buffPtr; // $s0

/* begin block 1.1 */
// Start line: 2013
// Start offset: 0x00019FD0
/* end block 1.1 */
// End offset: 0x00019FD0
// End Line: 2013
/* end block 1 */
// End offset: 0x0001A094
// End Line: 2034

/* begin block 2 */
// Start line: 8209
/* end block 2 */
// End Line: 8210

/* begin block 3 */
// Start line: 3940
/* end block 3 */
// End Line: 3941


// [D]
void ProcessPalletLump(char *lump_ptr, int lump_size)
{
Expand All @@ -2367,41 +2405,40 @@ void ProcessPalletLump(char *lump_ptr, int lump_size)
int total_cluts;
int clut_number;

if (*(int*)lump_ptr == 0 || *(int*)(lump_ptr + 4) == -1)
total_cluts = *(int*)lump_ptr;

if (total_cluts == 0)
return;

buffPtr = (int*)(lump_ptr + 4);
clutTablePtr = (u_short*)clutTable;

do
while (*buffPtr != -1)
{
palette = buffPtr[0];
texnum = buffPtr[1];
tpageindex = buffPtr[2];
total_cluts = buffPtr[3];
clut_number = buffPtr[3];

clut_number = GetCarPalIndex(tpageindex);

if (total_cluts == -1)
if (clut_number == -1)
{
// store clut
LoadImage(&clutpos, (u_long*)(buffPtr + 4));

clutValue = GetClut(clutpos.x, clutpos.y);

*clutTablePtr = clutValue;
clutTablePtr += 1;
*clutTablePtr++ = clutValue;

IncrementClutNum(&clutpos);

buffPtr += 12;
}
else
{
clutValue = clutTable[total_cluts];
// use stored clut
clutValue = clutTable[clut_number];
buffPtr += 4;
}

civ_clut[clut_number][texnum][palette + 1] = clutValue;
civ_clut[GetCarPalIndex(tpageindex)][texnum][palette + 1] = clutValue;
}
while (*buffPtr != -1);
}
2 changes: 1 addition & 1 deletion src_rebuild/GAME/C/CELL.C
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ PACKED_CELL_OBJECT* GetNextPackedCop(CELL_ITERATOR* pci)
pci->pcd++;
num = pci->pcd->num;

if ((num & 0x4000) != 0)
if (num & 0x4000)
return NULL;

ppco = cell_objects + (num & 0x3fff);
Expand Down
Loading

0 comments on commit ac8bddd

Please sign in to comment.