Re #307 Added/fixed comments / traces + removed commented code
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3380 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: f39439297eab68754868e03c309c256876d237e9 Former-commit-id: 635bde20250f8dee1ff969bda1f6d32cf8204e1c
This commit is contained in:
parent
9e84675839
commit
0ab3ae9e67
4 changed files with 35 additions and 31 deletions
|
@ -2307,7 +2307,7 @@ GfParmListRemoveElt (void *handle, const char *path, const char *key)
|
|||
}
|
||||
|
||||
|
||||
/** Remove a section element with given name of a list.
|
||||
/** Rename a section element to a given name.
|
||||
@ingroup paramslist
|
||||
@param handle handle of parameters
|
||||
@param path path of list
|
||||
|
|
|
@ -317,8 +317,6 @@ class cGrCarCamInside : public cGrPerspCamera
|
|||
speed[2] = car->pub.DynGCg.vel.z;
|
||||
|
||||
Speed = car->_speed_x * 3.6;
|
||||
|
||||
//grRain.drawPrecipitation(1, up[2], 0.0, 0.0, eye[2], eye[1], eye[0], Speed);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -707,9 +705,6 @@ class cGrCarCamFront : public cGrPerspCamera
|
|||
speed[2] = car->pub.DynGCg.vel.z;
|
||||
|
||||
Speed = car->_speed_x * 3.6;
|
||||
|
||||
//grRain.drawPrecipitation(1, up[2], 0.0, 0.0, eye[2], eye[1], eye[0], Speed);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -755,9 +750,6 @@ protected:
|
|||
speed[2] = car->pub.DynGCg.vel.z;
|
||||
|
||||
Speed = car->_speed_x * 3.6;
|
||||
|
||||
//grRain.drawPrecipitation(1, eye[0], up[0], up[1], eye[0], eye[1], eye[2], Speed);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -818,9 +810,6 @@ class cGrCarCamUp : public cGrPerspCamera
|
|||
speed[2] = car->pub.DynGCg.vel.z;
|
||||
|
||||
Speed = car->_speed_x * 3.6;
|
||||
|
||||
//grRain.drawPrecipitation(1, eye[0], up[0], up[1], eye[0], eye[1], eye[2], Speed);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -890,9 +879,6 @@ class cGrCarCamCenter : public cGrPerspCamera
|
|||
speed[2] = 0;
|
||||
|
||||
Speed = car->_speed_x * 3.6;
|
||||
|
||||
//grRain.drawPrecipitation(1, eye[0], up[0], up[1], eye[0], eye[1], eye[2], 0);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -919,8 +905,6 @@ class cGrCarCamLookAt : public cGrPerspCamera
|
|||
center[1] = centery;
|
||||
center[2] = centerz;
|
||||
|
||||
//grRain.drawPrecipitation(1, eye[0], up[0], up[1], eye[0], eye[1], eye[2], 0);
|
||||
|
||||
switch (axis) {
|
||||
case 0:
|
||||
up[0] = 0;
|
||||
|
@ -1006,8 +990,6 @@ class cGrCarCamRoadNoZoom : public cGrPerspCamera
|
|||
speed[0] = 0.0;
|
||||
speed[1] = 0.0;
|
||||
speed[2] = 0.0;
|
||||
|
||||
//grRain.drawPrecipitation(1, eye[0], up[0], up[1], eye[0], eye[1], eye[2], 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1111,8 +1093,6 @@ class cGrCarCamRoadFly : public cGrPerspCamera
|
|||
center[1] = (car->_pos_Y);
|
||||
center[2] = (car->_pos_Z);
|
||||
|
||||
//grRain.drawPrecipitation(1, eye[0], up[0], up[1], eye[0], eye[1], eye[2], 0);
|
||||
|
||||
// avoid going under the scene
|
||||
height = grGetHOT(eye[0], eye[1]) + 1.0;
|
||||
if (eye[2] < height) {
|
||||
|
@ -1204,8 +1184,6 @@ class cGrCarCamRoadZoom : public cGrPerspCamera
|
|||
speed[0] = 0.0;
|
||||
speed[1] = 0.0;
|
||||
speed[2] = 0.0;
|
||||
|
||||
//grRain.drawPrecipitation(1, eye[0], up[0], up[1], eye[0], eye[1], eye[2], 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -422,38 +422,51 @@ initCars(tSituation *s)
|
|||
elt = s->cars[i];
|
||||
index = elt->index;
|
||||
hdle = elt->_paramsHandle;
|
||||
|
||||
// WARNING: This index hack on the human robot for the Career mode
|
||||
// does no more work with the new "welcome" module system
|
||||
// (the "normal" index has no more the 10 limit) ... TO BE FIXED !!!!!!!
|
||||
if (elt->_driverType == RM_DRV_HUMAN && elt->_driverIndex > 10)
|
||||
sprintf(idx, "Robots/index/%d", elt->_driverIndex - 11);
|
||||
else
|
||||
sprintf(idx, "Robots/index/%d", elt->_driverIndex);
|
||||
|
||||
grCarInfo[index].iconColor[0] = GfParmGetNum(hdle, idx, "red", (char*)NULL, GfParmGetNum(hdle, ROB_SECT_ARBITRARY, "red", NULL, 0));
|
||||
grCarInfo[index].iconColor[1] = GfParmGetNum(hdle, idx, "green", (char*)NULL, GfParmGetNum(hdle, ROB_SECT_ARBITRARY, "green", NULL, 0));
|
||||
grCarInfo[index].iconColor[2] = GfParmGetNum(hdle, idx, "blue", (char*)NULL, GfParmGetNum(hdle, ROB_SECT_ARBITRARY, "blue", NULL, 0));
|
||||
grCarInfo[index].iconColor[3] = 1.0;
|
||||
grInitCar(elt);
|
||||
if ((elt->_driverType == RM_DRV_HUMAN) && (grNbActiveScreens < GR_NB_MAX_SCREEN) &&(elt->_networkPlayer == 0))
|
||||
|
||||
// Pre-assign each human driver (if any) to a different screen
|
||||
// (set him as the "current driver" for this screen).
|
||||
if (grNbActiveScreens < GR_NB_MAX_SCREEN
|
||||
&& elt->_driverType == RM_DRV_HUMAN && !elt->_networkPlayer)
|
||||
{
|
||||
grScreens[grNbActiveScreens]->setCurrentCar(elt);
|
||||
GfLogTrace("Screen #%d : Assigned to %s\n", grNbActiveScreens, elt->_name);
|
||||
grNbActiveScreens++;
|
||||
}
|
||||
}
|
||||
|
||||
// Load the real number of active screens.
|
||||
grNbActiveScreens = (int)GfParmGetNum(grHandle, GR_SCT_DISPMODE, GR_ATT_NB_SCREENS, NULL, 1.0);
|
||||
|
||||
// Initialize the cameras for all the screens.
|
||||
for (i = 0; i < GR_NB_MAX_SCREEN; i++) {
|
||||
grScreens[i]->initCams(s);
|
||||
}
|
||||
|
||||
TRACE_GL("initCars: end");
|
||||
|
||||
// Initialize other stuff.
|
||||
grInitSmoke(s->_ncars);
|
||||
grInitSound(s, s->_ncars);
|
||||
grTrackLightInit();
|
||||
|
||||
// Setup the screens (= OpenGL viewports) inside the physical game window.
|
||||
grAdaptScreenSize();
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -394,33 +394,46 @@ void cGrScreen::loadParams(tSituation *s)
|
|||
int i;
|
||||
class cGrCamera *cam;
|
||||
const char *carName;
|
||||
|
||||
|
||||
// Initialize the screen "current car" if not already done.
|
||||
sprintf(path, "%s/%d", GR_SCT_DISPMODE, id);
|
||||
|
||||
if (!curCar) {
|
||||
|
||||
// Load the name of the "current driver", and search it in the race competitors.
|
||||
carName = GfParmGetStr(grHandle, path, GR_ATT_CUR_DRV, "");
|
||||
for (i = 0; i < s->_ncars; i++) {
|
||||
if (!strcmp(s->cars[i]->_name, carName)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Found : this is the "current driver".
|
||||
if (i < s->_ncars) {
|
||||
curCar = s->cars[i];
|
||||
|
||||
// Not found, and screen id OK => "current driver" = competitors[screen id].
|
||||
} else if (id < s->_ncars) {
|
||||
curCar = s->cars[id];
|
||||
|
||||
// Not found and screen id not usable => "current driver" = competitors[0].
|
||||
} else {
|
||||
curCar = s->cars[0];
|
||||
}
|
||||
|
||||
GfLogTrace("Screen #%d : Assigned to %s\n", id, curCar->_name);
|
||||
}
|
||||
|
||||
// Load "current camera" settings (attached to the "current car").
|
||||
sprintf(path2, "%s/%s", GR_SCT_DISPMODE, curCar->_name);
|
||||
|
||||
curCamHead = (int)GfParmGetNum(grHandle, path, GR_ATT_CAM_HEAD, NULL, 9);
|
||||
camNum = (int)GfParmGetNum(grHandle, path, GR_ATT_CAM, NULL, 0);
|
||||
mirrorFlag = (int)GfParmGetNum(grHandle, path, GR_ATT_MIRROR, NULL, (tdble)mirrorFlag);
|
||||
curCamHead = (int)GfParmGetNum(grHandle, path2, GR_ATT_CAM_HEAD, NULL, (tdble)curCamHead);
|
||||
camNum = (int)GfParmGetNum(grHandle, path2, GR_ATT_CAM, NULL, (tdble)camNum);
|
||||
mirrorFlag = (int)GfParmGetNum(grHandle, path2, GR_ATT_MIRROR, NULL, (tdble)mirrorFlag);
|
||||
|
||||
|
||||
// Retrieve the "current camera".
|
||||
cam = GF_TAILQ_FIRST(&cams[curCamHead]);
|
||||
curCam = NULL;
|
||||
while (cam) {
|
||||
|
@ -431,8 +444,8 @@ void cGrScreen::loadParams(tSituation *s)
|
|||
cam = cam->next();
|
||||
}
|
||||
|
||||
if (curCam == NULL) {
|
||||
// back to default camera
|
||||
// Back to the default camera if not found (and save it as the new current one).
|
||||
if (!curCam) {
|
||||
curCamHead = 0;
|
||||
curCam = (cGrPerspCamera*)GF_TAILQ_FIRST(&cams[curCamHead]);
|
||||
GfParmSetNum(grHandle, path, GR_ATT_CAM, NULL, (tdble)curCam->getId());
|
||||
|
@ -459,7 +472,7 @@ void cGrScreen::initCams(tSituation *s)
|
|||
// TODO: This formula is more consistent, but it prevents the sky dome from being visible.
|
||||
//fovFactor *= grSkyDomeDistance / grSkyDomeNeutralFOVDistance;
|
||||
}
|
||||
GfLogTrace("Screen #%d : Factor of visibility = %3.2f\n", id, fovFactor);
|
||||
GfLogTrace("Screen #%d : Factor of visibility = %.2f\n", id, fovFactor);
|
||||
|
||||
if (boardCam == NULL) {
|
||||
fakeWidth = (int)((float) scrw * 600 / (float) scrh);
|
||||
|
|
Loading…
Reference in a new issue