Fixed some float/double/int conversion warnings under Windows

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@1948 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 098848ba9e75b7b5c0d85c8f7b49774f642cb957
Former-commit-id: 84222bd7534b6d693e046a76b5647b8be25edce4
This commit is contained in:
pouillot 2009-12-06 09:16:40 +00:00
parent 9e65426ffa
commit cf76fc1735
8 changed files with 38 additions and 38 deletions

View file

@ -872,7 +872,7 @@ void Driver::drive(tSituation *s)
car->_steerCmd = cmd_steer;
car->_gearCmd = cmd_gear;
car->_clutchCmd = cmd_clutch;
car->_lightCmd = cmd_light;
car->_lightCmd = (int)cmd_light;
return;
}
}
@ -942,7 +942,7 @@ void Driver::drive(tSituation *s)
cmd_steer = car->_steerCmd;
cmd_clutch = car->_clutchCmd;
cmd_gear = car->_gearCmd;
cmd_light = car->_lightCmd;
cmd_light = (float)car->_lightCmd;
}

View file

@ -872,7 +872,7 @@ void Driver::drive(tSituation *s)
car->_steerCmd = cmd_steer;
car->_gearCmd = cmd_gear;
car->_clutchCmd = cmd_clutch;
car->_lightCmd = cmd_light;
car->_lightCmd = (int)cmd_light;
return;
}
}
@ -942,7 +942,7 @@ void Driver::drive(tSituation *s)
cmd_steer = car->_steerCmd;
cmd_clutch = car->_clutchCmd;
cmd_gear = car->_gearCmd;
cmd_light = car->_lightCmd;
cmd_light = (float)car->_lightCmd;
}

View file

@ -872,7 +872,7 @@ void Driver::drive(tSituation *s)
car->_steerCmd = cmd_steer;
car->_gearCmd = cmd_gear;
car->_clutchCmd = cmd_clutch;
car->_lightCmd = cmd_light;
car->_lightCmd = (int)cmd_light;
return;
}
}
@ -942,7 +942,7 @@ void Driver::drive(tSituation *s)
cmd_steer = car->_steerCmd;
cmd_clutch = car->_clutchCmd;
cmd_gear = car->_gearCmd;
cmd_light = car->_lightCmd;
cmd_light = (float)car->_lightCmd;
}

View file

@ -26,7 +26,7 @@
#undef TEST_ROTATION
const tdble aMax = 0.35; /* */
const tdble aMax = 0.35f; /* */
void
SimCarConfig(tCar *car)
@ -55,17 +55,17 @@ SimCarConfig(tCar *car)
car->carElt->priv.collision_state.force[0] = 0.0;
}
car->dimension.x = GfParmGetNum(hdle, SECT_CAR, PRM_LEN, (char*)NULL, 4.7);
car->dimension.y = GfParmGetNum(hdle, SECT_CAR, PRM_WIDTH, (char*)NULL, 1.9);
car->dimension.x = GfParmGetNum(hdle, SECT_CAR, PRM_LEN, (char*)NULL, 4.7f);
car->dimension.y = GfParmGetNum(hdle, SECT_CAR, PRM_WIDTH, (char*)NULL, 1.9f);
overallwidth = GfParmGetNum(hdle, SECT_CAR, PRM_OVERALLWIDTH, (char*)NULL, car->dimension.y);
car->dimension.z = GfParmGetNum(hdle, SECT_CAR, PRM_HEIGHT, (char*)NULL, 1.2);
car->dimension.z = GfParmGetNum(hdle, SECT_CAR, PRM_HEIGHT, (char*)NULL, 1.2f);
car->mass = GfParmGetNum(hdle, SECT_CAR, PRM_MASS, (char*)NULL, 1500);
car->Minv = 1.0 / car->mass;
gcfr = GfParmGetNum(hdle, SECT_CAR, PRM_FRWEIGHTREP, (char*)NULL, .5);
gcfrl = GfParmGetNum(hdle, SECT_CAR, PRM_FRLWEIGHTREP, (char*)NULL, .5);
gcrrl = GfParmGetNum(hdle, SECT_CAR, PRM_RRLWEIGHTREP, (char*)NULL, .5);
gcfr = GfParmGetNum(hdle, SECT_CAR, PRM_FRWEIGHTREP, (char*)NULL, .5f);
gcfrl = GfParmGetNum(hdle, SECT_CAR, PRM_FRLWEIGHTREP, (char*)NULL, .5f);
gcrrl = GfParmGetNum(hdle, SECT_CAR, PRM_RRLWEIGHTREP, (char*)NULL, .5f);
car->statGC.y = - (gcfr * gcfrl + (1 - gcfr) * gcrrl) * car->dimension.y + car->dimension.y / 2.0;
car->statGC.z = GfParmGetNum(hdle, SECT_CAR, PRM_GCHEIGHT, (char*)NULL, .5);
car->statGC.z = GfParmGetNum(hdle, SECT_CAR, PRM_GCHEIGHT, (char*)NULL, .5f);
car->tank = GfParmGetNum(hdle, SECT_CAR, PRM_TANK, (char*)NULL, 80);
car->fuel = GfParmGetNum(hdle, SECT_CAR, PRM_FUEL, (char*)NULL, 80);
@ -334,11 +334,11 @@ SimCarUpdateSpeed(tCar *car)
tdble fi;
tdble as = sqrt(car->airSpeed2);
if (as<0.1) {
fi = 99.9;
fi = 99.9f;
} else {
fi = 100000 * delta_fuel / (as*SimDeltaTime);
}
tdble alpha = 0.1;
tdble alpha = 0.1f;
car->carElt->_fuelInstant = (1.0-alpha)*car->carElt->_fuelInstant + alpha*fi;
}
angles.x = car->DynGCg.pos.ax;

View file

@ -224,9 +224,9 @@ SimCarCollideZ(tCar *car)
car->rot_mom[i] = 2.0*car->mass * SIGN(car->rot_mom[i]);
}
}
car->rot_mom[SG_X]*=.999;
car->rot_mom[SG_Y]*=.999;
car->rot_mom[SG_Z]*=.999;
car->rot_mom[SG_X]*=.999f;
car->rot_mom[SG_Y]*=.999f;
car->rot_mom[SG_Z]*=.999f;
car->DynGC.vel.ax = car->DynGCg.vel.ax = -2.0f*car->rot_mom[SG_X] * car->Iinv.x;
car->DynGC.vel.ay = car->DynGCg.vel.ay = -2.0f*car->rot_mom[SG_Y] * car->Iinv.y;
car->DynGC.vel.az = car->DynGCg.vel.az = -2.0f*car->rot_mom[SG_Z] * car->Iinv.z;

View file

@ -24,15 +24,15 @@ SimDifferentialConfig(void *hdle, const char *section, tDifferential *differenti
{
const char *type;
differential->I = GfParmGetNum(hdle, section, PRM_INERTIA, (char*)NULL, 0.1);
differential->efficiency = GfParmGetNum(hdle, section, PRM_EFFICIENCY, (char*)NULL, 1.0);
differential->ratio = GfParmGetNum(hdle, section, PRM_RATIO, (char*)NULL, 1.0);
differential->bias = GfParmGetNum(hdle, section, PRM_BIAS, (char*)NULL, 0.1);
differential->dTqMin = GfParmGetNum(hdle, section, PRM_MIN_TQ_BIAS, (char*)NULL, 0.05);
differential->dTqMax = GfParmGetNum(hdle, section, PRM_MAX_TQ_BIAS, (char*)NULL, 0.80) - differential->dTqMin;
differential->dSlipMax = GfParmGetNum(hdle, section, PRM_MAX_SLIP_BIAS, (char*)NULL, 0.75);
differential->lockInputTq = GfParmGetNum(hdle, section, PRM_LOCKING_TQ, (char*)NULL, 300.0);
differential->viscosity = GfParmGetNum(hdle, section, PRM_VISCOSITY_FACTOR, (char*)NULL, 2.0);
differential->I = GfParmGetNum(hdle, section, PRM_INERTIA, (char*)NULL, 0.1f);
differential->efficiency = GfParmGetNum(hdle, section, PRM_EFFICIENCY, (char*)NULL, 1.0f);
differential->ratio = GfParmGetNum(hdle, section, PRM_RATIO, (char*)NULL, 1.0f);
differential->bias = GfParmGetNum(hdle, section, PRM_BIAS, (char*)NULL, 0.1f);
differential->dTqMin = GfParmGetNum(hdle, section, PRM_MIN_TQ_BIAS, (char*)NULL, 0.05f);
differential->dTqMax = GfParmGetNum(hdle, section, PRM_MAX_TQ_BIAS, (char*)NULL, 0.80f) - differential->dTqMin;
differential->dSlipMax = GfParmGetNum(hdle, section, PRM_MAX_SLIP_BIAS, (char*)NULL, 0.75f);
differential->lockInputTq = GfParmGetNum(hdle, section, PRM_LOCKING_TQ, (char*)NULL, 300.0f);
differential->viscosity = GfParmGetNum(hdle, section, PRM_VISCOSITY_FACTOR, (char*)NULL, 2.0f);
differential->viscomax = 1 - exp(-differential->viscosity);
type = GfParmGetStr(hdle, section, PRM_TYPE, VAL_DIFF_NONE);

View file

@ -84,22 +84,22 @@ ctrlCheck(tCar *car)
/* When the car is broken try to send it on the track side */
if (car->carElt->_state & RM_CAR_STATE_BROKEN) {
car->ctrl->accelCmd = 0.0;
car->ctrl->brakeCmd = 0.1;
car->ctrl->accelCmd = 0.0f;
car->ctrl->brakeCmd = 0.1f;
car->ctrl->gear = 0;
if (car->trkPos.toRight > car->trkPos.seg->width / 2.0) {
car->ctrl->steer = 0.1;
car->ctrl->steer = 0.1f;
} else {
car->ctrl->steer = -0.1;
car->ctrl->steer = -0.1f;
}
} else if (car->carElt->_state & RM_CAR_STATE_ELIMINATED) {
car->ctrl->accelCmd = 0.0;
car->ctrl->brakeCmd = 0.1;
car->ctrl->accelCmd = 0.0f;
car->ctrl->brakeCmd = 0.1f;
car->ctrl->gear = 0;
if (car->trkPos.toRight > car->trkPos.seg->width / 2.0) {
car->ctrl->steer = 0.1;
car->ctrl->steer = 0.1f;
} else {
car->ctrl->steer = -0.1;
car->ctrl->steer = -0.1f;
}
} else if (car->carElt->_state & RM_CAR_STATE_FINISH) {
/* when the finish line is passed, continue at "slow" pace */
@ -175,7 +175,7 @@ SimReConfig(tCarElt *carElt)
}
if (carElt->pitcmd.repair > 0) {
for (int i=0; i<4; i++) {
carElt->_tyreCondition(i) = 1.01;
carElt->_tyreCondition(i) = 1.01f;
carElt->_tyreT_in(i) = 50.0;
carElt->_tyreT_mid(i) = 50.0;
carElt->_tyreT_out(i) = 50.0;

View file

@ -1491,7 +1491,7 @@ ReadTrack3(tTrack *theTrack, void *TrackHandle, tRoadCam **camList, int ext)
}
i++;
}
pits->nPitSeg = MIN(pits->nMaxPits,(int)GfParmGetNum(TrackHandle, path2, TRK_ATT_MAX_PITS, (char*)NULL, pits->nMaxPits));
pits->nPitSeg = MIN(pits->nMaxPits,(int)GfParmGetNum(TrackHandle, path2, TRK_ATT_MAX_PITS, (char*)NULL, (tdble)pits->nMaxPits));
//GfOut("pits->nPitSeg: %d\n",pits->nPitSeg);
for (mSeg = pitStart->prev; mSeg != pitEnd->next->next; mSeg = mSeg->next) {