Skip to content

Commit ac8bddd

Browse files
authored
Merge pull request #38 from OpenDriver2/develop-SoapyMan
PC control schemes, fast loading screens
2 parents a61d38c + ca6b590 commit ac8bddd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1675
-965
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 5.3.{build}
1+
version: 5.4.{build}
22

33
branches:
44
only:

data/config.ini

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,35 @@
22
# dataFolder=REDRIVER2
33
# dataFolder=.
44

5+
[kbcontrols_game]
6+
cross=up
7+
square=down
8+
circle=right shift
9+
triangle=space
10+
up=up
11+
down=down
12+
left=left
13+
right=right
14+
start=escape
15+
select=c
16+
l1=right ctrl
17+
r1=L
18+
l2=J
19+
r2=K
20+
21+
[kbcontrols_menu]
22+
cross=return
23+
square=q
24+
circle=w
25+
triangle=escape
26+
start=escape
27+
up=up
28+
down=down
29+
left=left
30+
right=right
31+
start=e
32+
select=r
33+
534
[render]
635
windowWidth=1280
736
windowHeight=720
@@ -11,8 +40,8 @@ bilinearFiltering=0
1140
pgxpZbuffer=0
1241

1342
[game]
14-
drawDistance=1200
43+
drawDistance=1800
1544
freeCamera=1
16-
driver1music=0
17-
widescreenOverlays=0
18-
userChases=RacingFreak,Snoopi,Olanov,Vortex,Fireboyd78
45+
fastLoadingScreens=1
46+
widescreenOverlays=1
47+
driver1music=0

src_rebuild/GAME/C/BOMBERMAN.C

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ void HandleThrownBombs(void)
294294
// [D] [T]
295295
void DrawThrownBombs(void)
296296
{
297-
int iVar1;
298297
BOMB *bomb;
299298
int i;
300299
MATRIX object_matrix;
@@ -634,7 +633,7 @@ void ExplosionCollisionCheck(CAR_DATA *cp, EXOBJECT *pE)
634633
LONGVECTOR reaction;
635634
LONGVECTOR lever;
636635

637-
isCar = (cp != &car_data[CAMERA_COLLIDER_CARID]);
636+
isCar = (cp != &car_data[TANNER_COLLIDER_CARID]);
638637

639638
if (player[0].playerType == 2 || isCar)
640639
{
@@ -754,10 +753,11 @@ void ExplosionCollisionCheck(CAR_DATA *cp, EXOBJECT *pE)
754753
}
755754
}
756755

757-
DamageCar(cp, cd, &collisionResult, strikeVel);
756+
if(isCar)
757+
DamageCar(cp, cd, &collisionResult, strikeVel);
758758

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

762762
if (strikeVel < 0x7f001)
763763
denom = (strikeVel * 4096) / displacement;

src_rebuild/GAME/C/CAMERA.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ int CameraCollisionCheck(void)
443443
sphere = scr_z * 3 - 382;
444444

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

449449
if (gCameraDistance > 0)
450450
{

src_rebuild/GAME/C/CARS.C

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,6 +2351,44 @@ char GetCarPalIndex(int tpage)
23512351
}
23522352

23532353

2354+
// decompiled code
2355+
// original method signature:
2356+
// void /*$ra*/ ProcessPalletLump(char *lump_ptr /*$a0*/, int lump_size /*$a1*/)
2357+
// line 1970, offset 0x00019f44
2358+
/* begin block 1 */
2359+
// Start line: 1971
2360+
// Start offset: 0x00019F44
2361+
// Variables:
2362+
// int total_cluts; // $v0
2363+
// int clutValue; // $s1
2364+
// int tpageindex; // $s2
2365+
// int texnum; // $s3
2366+
// int palette; // $s4
2367+
// int clut_number; // $v1
2368+
// unsigned short clutTable[320]; // stack offset -680
2369+
// char *buffPtr; // $s0
2370+
2371+
/* begin block 1.1 */
2372+
// Start line: 2013
2373+
// Start offset: 0x00019FD0
2374+
/* end block 1.1 */
2375+
// End offset: 0x00019FD0
2376+
// End Line: 2013
2377+
/* end block 1 */
2378+
// End offset: 0x0001A094
2379+
// End Line: 2034
2380+
2381+
/* begin block 2 */
2382+
// Start line: 8209
2383+
/* end block 2 */
2384+
// End Line: 8210
2385+
2386+
/* begin block 3 */
2387+
// Start line: 3940
2388+
/* end block 3 */
2389+
// End Line: 3941
2390+
2391+
23542392
// [D]
23552393
void ProcessPalletLump(char *lump_ptr, int lump_size)
23562394
{
@@ -2367,41 +2405,40 @@ void ProcessPalletLump(char *lump_ptr, int lump_size)
23672405
int total_cluts;
23682406
int clut_number;
23692407

2370-
if (*(int*)lump_ptr == 0 || *(int*)(lump_ptr + 4) == -1)
2408+
total_cluts = *(int*)lump_ptr;
2409+
2410+
if (total_cluts == 0)
23712411
return;
23722412

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

2376-
do
2416+
while (*buffPtr != -1)
23772417
{
23782418
palette = buffPtr[0];
23792419
texnum = buffPtr[1];
23802420
tpageindex = buffPtr[2];
2381-
total_cluts = buffPtr[3];
2421+
clut_number = buffPtr[3];
23822422

2383-
clut_number = GetCarPalIndex(tpageindex);
2384-
2385-
if (total_cluts == -1)
2423+
if (clut_number == -1)
23862424
{
2425+
// store clut
23872426
LoadImage(&clutpos, (u_long*)(buffPtr + 4));
23882427

23892428
clutValue = GetClut(clutpos.x, clutpos.y);
2390-
2391-
*clutTablePtr = clutValue;
2392-
clutTablePtr += 1;
2429+
*clutTablePtr++ = clutValue;
23932430

23942431
IncrementClutNum(&clutpos);
23952432

23962433
buffPtr += 12;
23972434
}
23982435
else
23992436
{
2400-
clutValue = clutTable[total_cluts];
2437+
// use stored clut
2438+
clutValue = clutTable[clut_number];
24012439
buffPtr += 4;
24022440
}
24032441

2404-
civ_clut[clut_number][texnum][palette + 1] = clutValue;
2442+
civ_clut[GetCarPalIndex(tpageindex)][texnum][palette + 1] = clutValue;
24052443
}
2406-
while (*buffPtr != -1);
24072444
}

src_rebuild/GAME/C/CELL.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ PACKED_CELL_OBJECT* GetNextPackedCop(CELL_ITERATOR* pci)
207207
pci->pcd++;
208208
num = pci->pcd->num;
209209

210-
if ((num & 0x4000) != 0)
210+
if (num & 0x4000)
211211
return NULL;
212212

213213
ppco = cell_objects + (num & 0x3fff);

0 commit comments

Comments
 (0)