Re #307 Fixed MSVC 2005 warnings
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@4236 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 11a6c0b76bcc7cbbe27ca3f19a322a6c9a0a0263 Former-commit-id: bb66839ba4282f1482bc3d6de5e7aa16be2126e2
This commit is contained in:
parent
baa8d6f19e
commit
48b40d63cc
6 changed files with 20 additions and 19 deletions
|
@ -1107,7 +1107,7 @@ common_drive(const int index, tCarElt* car, tSituation *s)
|
|||
}
|
||||
|
||||
// automatically adjust throttle when auto-shifting
|
||||
if (HCtx[idx]->clutchtime > 0.0f && HCtx[idx]->autoClutch == true) {
|
||||
if (HCtx[idx]->clutchtime > 0.0f && HCtx[idx]->autoClutch) {
|
||||
double rpm = car->_speed_xy * car->_gearRatio[car->_gear + car->_gearOffset] / car->_wheelRadius(2);
|
||||
|
||||
car->_accelCmd += (rpm - car->_enginerpm) * 4 / car->_enginerpmRedLine;
|
||||
|
@ -1421,7 +1421,7 @@ drive_mt(int index, tCarElt* car, tSituation *s)
|
|||
if (ay0 < 0.33 && ay0 > -0.33 && ax0 > -0.5 && ax0 < -0.33)
|
||||
car->_gearCmd = 0;
|
||||
/* Extended 'N' area when using clutch to allow 'jumping' gears */
|
||||
if (ay0 < 0.33 && ay0 > -0.33 && ax0 > -0.5 && ax0 < 0.5 && HCtx[idx]->autoClutch == 0)
|
||||
if (ay0 < 0.33 && ay0 > -0.33 && ax0 > -0.5 && ax0 < 0.5 && !HCtx[idx]->autoClutch)
|
||||
car->_gearCmd = 0;
|
||||
|
||||
/* Neutral gear command */
|
||||
|
|
|
@ -62,7 +62,7 @@ typedef struct HumanContext
|
|||
bool seqShftAllowReverse;
|
||||
bool autoReverse;
|
||||
eDriveTrain driveTrain;
|
||||
int autoClutch;
|
||||
bool autoClutch;
|
||||
tControlCmd *cmdControl;
|
||||
bool mouseControlUsed;
|
||||
int lightCmd;
|
||||
|
|
|
@ -1097,7 +1097,7 @@ void LRaceLine::ComputeSpeed(int rl)
|
|||
double trlspeed = GetModD( tRLSpeed, i );
|
||||
double avspeed = GetModD( tAvoidSpeed, i );
|
||||
double avspeedx = GetModD( tAvoidSpeedX, i );
|
||||
int previ = ((i - 1) + Divs) % Divs;
|
||||
//int previ = ((i - 1) + Divs) % Divs;
|
||||
double cornerspeed = ((trlspeed > 0 ? trlspeed : CornerSpeed) + BaseCornerSpeed) * BaseCornerSpeedX * DefaultCornerSpeedX;
|
||||
|
||||
if (rl == LINE_MID)
|
||||
|
@ -1237,7 +1237,8 @@ void LRaceLine::ComputeSpeed(int rl)
|
|||
|
||||
for (int i = (Divs*2)-1; --i >= 0;)
|
||||
{
|
||||
int next = (i+1) % Divs, nnext = (i+2) % Divs, prev = ((i-1)+Divs) % Divs, index = i % Divs;
|
||||
int next = (i+1) % Divs, index = i % Divs;
|
||||
//int nnext = (i+2) % Divs, prev = ((i-1)+Divs) % Divs;
|
||||
double bd = brakedelay + GetModD( tRLBrake, index );
|
||||
if (rl == LINE_MID)
|
||||
{
|
||||
|
@ -1255,12 +1256,12 @@ void LRaceLine::ComputeSpeed(int rl)
|
|||
|
||||
if (BrakeMod > 1.0)
|
||||
{
|
||||
double friction = SRL[rl].tBrakeFriction[index];
|
||||
//double friction = SRL[rl].tBrakeFriction[index];
|
||||
|
||||
double dist = sqrt((SRL[rl].tx[next] - SRL[rl].tx[index]) * (SRL[rl].tx[next] - SRL[rl].tx[index]) +
|
||||
(SRL[rl].ty[next] - SRL[rl].ty[index]) * (SRL[rl].ty[next] - SRL[rl].ty[index]));
|
||||
|
||||
double slowrate = 15;//(15.0 - MIN(150.0, tSpeed[rf][next])/70.0)/2;
|
||||
//double slowrate = 15;//(15.0 - MIN(150.0, tSpeed[rf][next])/70.0)/2;
|
||||
tSpeed[rf][index] = MIN(tSpeed[rf][index], tSpeed[rf][next] + (/*slowrate * friction * */ (dist) * bd)/1000);
|
||||
}
|
||||
else if (BrakeMod > 0.5)
|
||||
|
@ -1820,7 +1821,7 @@ void LRaceLine::GetRaceLineData(tSituation *s, LRaceLineData *pdata)
|
|||
c1 /= sum;
|
||||
}
|
||||
|
||||
double ospeed = TargetSpeed, aspeed = ATargetSpeed;
|
||||
//double ospeed = TargetSpeed, aspeed = ATargetSpeed;
|
||||
ATargetSpeed = tSpeed[LINE_MID][avnext];//(1 - c0) * tSpeed[LINE_MID][avnext] + c0 * tSpeed[LINE_MID][avindex];
|
||||
data->avspeed = MAX(10.0, ATargetSpeed);
|
||||
if (!data->overtakecaution)
|
||||
|
|
|
@ -353,7 +353,7 @@ cGrSkidmarks::Update(const tCarElt* car, const double t)
|
|||
// routine grTrackHeightL(tTrkLocPos *p), similar to
|
||||
// TrTrackHeightL(), but which aim to give the height
|
||||
// of the graphical track.
|
||||
tdble z_adjust = 0.95;
|
||||
tdble z_adjust = 0.95f;
|
||||
tdble contact_z = car->priv.wheel[i].relPos.z - car->_wheelRadius(i)*z_adjust;
|
||||
|
||||
//One side
|
||||
|
@ -361,9 +361,9 @@ cGrSkidmarks::Update(const tCarElt* car, const double t)
|
|||
vtx[0] = car->priv.wheel[i].relPos.x - car->_tireHeight(i);
|
||||
// Because of backface culling the winding of the triangles matters.
|
||||
if (car->_speed_x > 0.0f) {
|
||||
vtx[1] = car->priv.wheel[i].relPos.y + (sling_right + 1.0)*car->_tireWidth(i) / 2.0;
|
||||
vtx[1] = car->priv.wheel[i].relPos.y + (sling_right + 1.0f)*car->_tireWidth(i) / 2.0f;
|
||||
} else {
|
||||
vtx[1] = car->priv.wheel[i].relPos.y + (sling_left - 1.0)* car->_tireWidth(i) / 2.0;
|
||||
vtx[1] = car->priv.wheel[i].relPos.y + (sling_left - 1.0f)* car->_tireWidth(i) / 2.0f;
|
||||
}//if car->_speed
|
||||
vtx[2] = contact_z;
|
||||
basevtx->add(vtx);
|
||||
|
@ -372,9 +372,9 @@ cGrSkidmarks::Update(const tCarElt* car, const double t)
|
|||
//vtx[0] = car->priv.wheel[i].relPos.x - car->_tireHeight(i);
|
||||
// Because of backface culling the winding of the triangles matters.
|
||||
if (car->_speed_x > 0.0f) {
|
||||
vtx[1] = car->priv.wheel[i].relPos.y + (sling_left - 1.0)* car->_tireWidth(i) / 2.0;
|
||||
vtx[1] = car->priv.wheel[i].relPos.y + (sling_left - 1.0f)* car->_tireWidth(i) / 2.0f;
|
||||
} else {
|
||||
vtx[1] = car->priv.wheel[i].relPos.y + (sling_right + 1.0)*car->_tireWidth(i) / 2.0;
|
||||
vtx[1] = car->priv.wheel[i].relPos.y + (sling_right + 1.0f)*car->_tireWidth(i) / 2.0f;
|
||||
}
|
||||
//vtx[2] = contact_z;
|
||||
basevtx->add(vtx);
|
||||
|
|
|
@ -42,8 +42,8 @@ SimAxleConfig(tCar *car, int index)
|
|||
|
||||
axle->arbSusp.spring.K = -axle->arbSusp.spring.K;
|
||||
|
||||
car->wheel[index*2].feedBack.I += axle->I / 2.0;
|
||||
car->wheel[index*2+1].feedBack.I += axle->I / 2.0;
|
||||
car->wheel[index*2].feedBack.I += axle->I / 2.0f;
|
||||
car->wheel[index*2+1].feedBack.I += axle->I / 2.0f;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -54,7 +54,7 @@ SimAxleUpdate(tCar *car, int index)
|
|||
tdble str = car->wheel[index*2].susp.x;
|
||||
tdble stl = car->wheel[index*2+1].susp.x;
|
||||
tdble delta = stl - str;
|
||||
tdble sgn = SIGN(delta);
|
||||
tdble sgn = (tdble)SIGN(delta);
|
||||
|
||||
axle->arbSusp.x = fabs(delta);
|
||||
tSpring *spring = &(axle->arbSusp.spring);
|
||||
|
|
|
@ -30,7 +30,7 @@ SimBrakeConfig(void *hdle, const char *section, tBrake *brake)
|
|||
brake->coeff = diam * 0.5f * area * mu;
|
||||
|
||||
brake->I = GfParmGetNum(hdle, section, PRM_INERTIA, (char*)NULL, 0.13f);
|
||||
brake->radius = diam/2.0;
|
||||
brake->radius = diam/2.0f;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -38,9 +38,9 @@ SimBrakeUpdate(tCar *car, tWheel *wheel, tBrake *brake)
|
|||
{
|
||||
brake->Tq = brake->coeff * brake->pressure;
|
||||
|
||||
brake->temp -= fabs(car->DynGC.vel.x) * 0.0001 + 0.0002;
|
||||
brake->temp -= fabs(car->DynGC.vel.x) * 0.0001f + 0.0002f;
|
||||
if (brake->temp < 0 ) brake->temp = 0;
|
||||
brake->temp += brake->pressure * brake->radius * fabs(wheel->spinVel) * 0.00000000005;
|
||||
brake->temp += brake->pressure * brake->radius * fabs(wheel->spinVel) * 0.00000000005f;
|
||||
if (brake->temp > 1.0) brake->temp = 1.0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue