Skip to content

Commit 1867105

Browse files
authored
Merge pull request #15 from OpenDriver2/develop-SoapyMan
Develop soapy man
2 parents addfa2f + 109ecfa commit 1867105

28 files changed

+902
-982
lines changed

appveyor.yml

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

33
branches:
44
only:

changelog.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
REDRIVER2 4.2 alpha
1+
## Changelog since Oct 12 2000 (1.0 release build)
22

3-
Changelog since Oct 12 2000
4-
5-
Gameplay:
3+
### Gameplay:
64
- Improved cop AI batter logic to better balance difficulty
75
- Restored Tanner felony (can be seen in two Vegas missions)
86
- Cops no longer can see player if on different heights
@@ -13,8 +11,10 @@ Gameplay:
1311
- Restored Tanner drowning movement in water
1412
- Fixed Tanner sitting on chairs
1513
- Easier jump in "Boat Jump"
14+
- Featured Driver Madness community chases by **Olanov, VortexStory, RacingFreak, Snoopi, Fireboyd78** and **SoapyMan**
1615

17-
Effects/Visuals:
16+
### Effects/Visuals:
17+
- In-game cutscene subtitles
1818
- Improved draw distance and resolved glitches
1919
- Restored street lamp damage
2020
- Restored street light trails
@@ -25,13 +25,13 @@ Effects/Visuals:
2525
- Restored car engine smoke
2626
- Leaves are now affected properly by player car and chased car
2727

28-
Film Director:
28+
### Film Director:
2929
- Fix camera invalidation bugs
3030
- Added variable zoom for non-locked tripod camera
3131
- Added target height adjustment to locked tripod camera
3232
- Improved chase camera, restored height and distance editing
3333

34-
Other:
34+
### Other:
3535
- PC version now automatically saves undercover campaign progress
3636
- PC version now has command line arguments
3737
- Memory card overlay removed

data/config.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ pgxpZbuffer=0
1414
drawDistance=1200
1515
freeCamera=1
1616
driver1music=0
17+
widescreenOverlays=0
1718
userChases=RacingFreak,Snoopi,Olanov,Vortex,Fireboyd78

src_rebuild/EMULATOR/EMULATOR.C

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,24 @@ void Emulator_SetupClipMode(const RECT16& rect)
13871387
#endif
13881388
}
13891389

1390+
void Emulator_GetPSXWidescreenMappedViewport(RECT16& rect)
1391+
{
1392+
float emuScreenAspect = float(windowWidth) / float(windowHeight);
1393+
1394+
float psxScreenW = activeDispEnv.disp.w;
1395+
float psxScreenH = activeDispEnv.disp.h;
1396+
1397+
rect.x = activeDispEnv.screen.x;
1398+
rect.y = activeDispEnv.screen.y;
1399+
1400+
rect.w = psxScreenW * emuScreenAspect * PSX_SCREEN_ASPECT; // windowWidth;
1401+
rect.h = psxScreenH; // windowHeight;
1402+
1403+
rect.x -= (rect.w - activeDispEnv.disp.w) / 2;
1404+
1405+
rect.w += rect.x;
1406+
}
1407+
13901408
void Emulator_SetShader(const ShaderID &shader)
13911409
{
13921410
#if defined(OGL) || defined(OGLES)

src_rebuild/EMULATOR/EMULATOR.H

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ extern void Emulator_SetPolygonOffset(float ofs);
201201
extern void Emulator_SetStencilMode(int drawPrim);
202202
extern void Emulator_EnableDepth(int enable);
203203

204+
extern void Emulator_GetPSXWidescreenMappedViewport(RECT16& rect);
205+
204206
extern void Emulator_LineSwapSourceVerts(VERTTYPE* &p0, VERTTYPE* &p1, unsigned char* &c0, unsigned char* &c1);
205207
extern void Emulator_GenerateLineArray(struct Vertex* vertex, VERTTYPE* p0, VERTTYPE* p1, ushort gteidx);
206208
extern void Emulator_GenerateVertexArrayTriangle(struct Vertex* vertex, VERTTYPE* p0, VERTTYPE* p1, VERTTYPE* p2, ushort gteidx);

src_rebuild/GAME/C/BOMBERMAN.C

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -144,48 +144,48 @@ void HandleThrownBombs(void)
144144
int dx, dz;
145145
VECTOR velocity;
146146

147-
if (gBombTargetVehicle == NULL)
148-
return;
149-
150-
ThrownBombDelay--;
151-
152-
if (ThrownBombDelay == -1)
147+
// throw bombs if we have vehicle
148+
if (gBombTargetVehicle)
153149
{
154-
ThrownBombDelay = Random2(0) % 45 + 8;
150+
ThrownBombDelay--;
155151

156-
bomb = &ThrownBombs[CurrentBomb++];
157-
CurrentBomb = CurrentBomb % MAX_THROWN_BOMBS;
152+
if (ThrownBombDelay == -1)
153+
{
154+
ThrownBombDelay = Random2(0) % 45 + 8;
158155

159-
bomb->flags = 1;
160-
bomb->active = 1;
156+
bomb = &ThrownBombs[CurrentBomb++];
157+
CurrentBomb = CurrentBomb % MAX_THROWN_BOMBS;
161158

162-
bomb->position.vx = gBombTargetVehicle->hd.where.t[0];
163-
bomb->position.vy = gBombTargetVehicle->hd.where.t[1] - 200;
164-
bomb->position.vz = gBombTargetVehicle->hd.where.t[2];
159+
bomb->flags = 1;
160+
bomb->active = 1;
165161

166-
velocity.vx = FIXEDH(gBombTargetVehicle->st.n.linearVelocity[0]);
167-
velocity.vy = 0;
168-
velocity.vz = FIXEDH(gBombTargetVehicle->st.n.linearVelocity[2]);
162+
bomb->position.vx = gBombTargetVehicle->hd.where.t[0];
163+
bomb->position.vy = gBombTargetVehicle->hd.where.t[1] - 200;
164+
bomb->position.vz = gBombTargetVehicle->hd.where.t[2];
169165

170-
bomb->velocity.vx = velocity.vx >> 10;
171-
bomb->velocity.vz = velocity.vz >> 10;
172-
bomb->velocity.vy = -(Long2DDistance(&bomb->position, (VECTOR *)player[0].pos) >> 7);
166+
velocity.vx = FIXEDH(gBombTargetVehicle->st.n.linearVelocity[0]);
167+
velocity.vz = FIXEDH(gBombTargetVehicle->st.n.linearVelocity[2]);
173168

174-
if ((rand() & 1) == 0)
175-
bomb->rot_speed = -bomb->velocity.vy;
176-
else
177-
bomb->rot_speed = bomb->velocity.vy;
169+
bomb->velocity.vx = velocity.vx >> 10;
170+
bomb->velocity.vz = velocity.vz >> 10;
171+
bomb->velocity.vy = -(Long2DDistance(&bomb->position, (VECTOR *)player[0].pos) >> 7);
178172

179-
if (bomb->velocity.vy < -100)
180-
bomb->velocity.vy = -100;
173+
if ((rand() & 1) == 0)
174+
bomb->rot_speed = -bomb->velocity.vy;
175+
else
176+
bomb->rot_speed = bomb->velocity.vy;
177+
178+
if (bomb->velocity.vy < -100)
179+
bomb->velocity.vy = -100;
180+
}
181181
}
182182

183183
bomb = ThrownBombs;
184184

185185
i = 0;
186186
while (i < MAX_THROWN_BOMBS)
187187
{
188-
if ((bomb->flags & 1) != 0)
188+
if (bomb->flags & 1)
189189
{
190190
bomb->position.vx += bomb->velocity.vx;
191191
bomb->position.vy += bomb->velocity.vy;
@@ -237,7 +237,7 @@ void HandleThrownBombs(void)
237237
}
238238
bomb++;
239239
i++;
240-
};
240+
}
241241
}
242242

243243

src_rebuild/GAME/C/CAMERA.C

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "INLINE_C.H"
2222
#include "LIBGTE.H"
2323
#include "MAP.H"
24+
#include "PEDEST.H"
2425

2526

2627
VECTOR gCameraOffset = { 0};
@@ -1006,11 +1007,13 @@ void PlaceCameraInCar(PLAYER *lp, int BumperCam)
10061007
{
10071008
_RotMatrixY(&inv_camera_matrix, 0x800);
10081009
_RotMatrixY(&inv_camera_matrix, (lp->headPos >> 16));
1009-
1010+
10101011
if (cp != NULL)
10111012
viewer_position.vz = -170;
1013+
else
1014+
_RotMatrixX(&inv_camera_matrix, -tannerLookAngle.vx);
10121015
}
1013-
1016+
10141017
MulMatrix0(&aspect, &inv_camera_matrix, &inv_camera_matrix);
10151018
InvertMatrix(&inv_camera_matrix, &camera_matrix);
10161019

src_rebuild/GAME/C/CARS.C

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ HUBCAP gHubcap;
4343
// active cars
4444
CAR_DATA* active_car_list[MAX_CARS];
4545
BOUND_BOX bbox[MAX_CARS];
46-
unsigned char lightsOnDelay[MAX_CARS];
46+
u_char lightsOnDelay[MAX_CARS];
47+
u_short civ_clut[8][32][6];
48+
4749

4850
// decompiled code
4951
// original method signature:
@@ -2349,6 +2351,57 @@ char GetCarPalIndex(int tpage)
23492351
}
23502352

23512353

2354+
// [D]
2355+
void ProcessPalletLump(char *lump_ptr, int lump_size)
2356+
{
2357+
if (gDriver1Level) // [A]
2358+
return; // TODO: load Driver 1 civ palettes
2359+
2360+
ushort clutValue;
2361+
int *buffPtr;
2362+
int texnum;
2363+
int palette;
2364+
u_short *clutTablePtr;
2365+
u_short clutTable[320];
2366+
int tpageindex;
2367+
int total_cluts;
2368+
int clut_number;
2369+
2370+
if (*(int*)lump_ptr == 0 || *(int*)(lump_ptr + 4) == -1)
2371+
return;
2372+
2373+
buffPtr = (int*)(lump_ptr + 4);
2374+
clutTablePtr = (u_short*)clutTable;
2375+
2376+
do
2377+
{
2378+
palette = buffPtr[0];
2379+
texnum = buffPtr[1];
2380+
tpageindex = buffPtr[2];
2381+
total_cluts = buffPtr[3];
2382+
2383+
clut_number = GetCarPalIndex(tpageindex);
2384+
2385+
if (total_cluts == -1)
2386+
{
2387+
LoadImage(&clutpos, (u_long*)(buffPtr + 4));
2388+
2389+
clutValue = GetClut(clutpos.x, clutpos.y);
23522390

2391+
*clutTablePtr = clutValue;
2392+
clutTablePtr += 1;
23532393

2394+
IncrementClutNum(&clutpos);
2395+
2396+
buffPtr += 12;
2397+
}
2398+
else
2399+
{
2400+
clutValue = clutTable[total_cluts];
2401+
buffPtr += 4;
2402+
}
23542403

2404+
civ_clut[clut_number][texnum][palette + 1] = clutValue;
2405+
}
2406+
while (*buffPtr != -1);
2407+
}

src_rebuild/GAME/C/CARS.H

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ extern short BackWheelRotation[MAX_CARS];
3838
extern char LeftLight;
3939
extern char RightLight;
4040

41+
extern u_short civ_clut[8][32][6];
42+
4143
extern void plotNewCarModel(CAR_MODEL *car, int palette); // 0x00020C94
4244

4345
extern void plotCarPolyB3(int numTris, CAR_POLY *src, SVECTOR *vlist, plotCarGlobals *pg); // 0x000237B8

src_rebuild/GAME/C/CIV_AI.C

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "INLINE_C.H"
2828
#include "OVERLAY.H"
2929

30-
unsigned char speedLimits[3] = { 56, 97, 138 };
30+
const u_char speedLimits[3] = { 56, 97, 138 };
3131

3232
struct
3333
{
@@ -2767,6 +2767,17 @@ void InitCivCars(void)
27672767
roadblockDelay = roadblockDelayDiff[gCopDifficultyLevel] + (Random2(0) & 0xff);
27682768
PingOutCivsOnly = 0;
27692769
roadblockCount = roadblockDelay;
2770+
2771+
// [A] clear out other values
2772+
distFurthestCivCarSq = 0;
2773+
furthestCivID = 0;
2774+
makeLimoPullOver = 0;
2775+
limoId = 0;
2776+
playerNum = 0;
2777+
roadSeg = 0;
2778+
testNumPingedOut = 0;
2779+
currentAngle = 0;
2780+
closeEncounter = 3;
27702781
}
27712782

27722783

@@ -3258,7 +3269,7 @@ int PingInCivCar(int minPingInDist)
32583269
int lbody;
32593270
int lane;
32603271
int i;
3261-
int oldCookieCount;
3272+
u_char cookieCountStart;
32623273
uint retDistSq;
32633274
unsigned char* slot;
32643275

@@ -3397,15 +3408,15 @@ int PingInCivCar(int minPingInDist)
33973408
if (requestCopCar == 0 && cookieCount > 43)
33983409
cookieCount -= 25;
33993410

3400-
oldCookieCount = cookieCount;
3411+
cookieCountStart = cookieCount;
34013412

34023413
do {
34033414
if (cookieCount < maxCookies)
34043415
cookieCount++;
34053416
else
34063417
cookieCount = 0;
34073418

3408-
if (cookieCount == oldCookieCount)
3419+
if (cookieCount == cookieCountStart)
34093420
{
34103421
break;
34113422
}

0 commit comments

Comments
 (0)