OSG-HUD: add brake temps to tires widget

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

Former-commit-id: c163018b147eaddb29b7edfc75038322d06312e3
Former-commit-id: 90f7a38662b5ee38f2c3270952ba8edf5993689f
This commit is contained in:
madbad 2023-04-22 20:55:53 +00:00
parent 1e5526ac2a
commit ca124ab024

View file

@ -1662,8 +1662,6 @@ void SDHUD::Refresh(tSituation *s, const SDFrameInfo* frameInfo,
prevSteerAngle = angle;
// tires temps
for (int i = 0; i < 4; i++) { //for each tires
std::ostringstream tireName;
@ -1759,10 +1757,26 @@ void SDHUD::Refresh(tSituation *s, const SDFrameInfo* frameInfo,
hudTextElements[tireNameText.str().c_str()]->setText(temp.str());
//set brake temps
float brakeTemp = currCar->_brakeTemp(i);
tireNameText.str("");
tireNameText << "brake-" << tireName.str().c_str() << "-cold";
changeImageAlpha(hudImgElements[tireNameText.str().c_str()], 1.0);
tireNameText.str("");
tireNameText << "brake-" << tireName.str().c_str() << "-optimal";
changeImageAlpha(hudImgElements[tireNameText.str().c_str()], (brakeTemp*2));
tireNameText.str("");
tireNameText << "brake-" << tireName.str().c_str() << "-hot";
changeImageAlpha(hudImgElements[tireNameText.str().c_str()], ((brakeTemp-0.5)*2));
}
// tire wear
changeImageSize(hudImgElements["tire-fr-cold"], currCar->_tyreTreadDepth(0), "bottom", hudScale);
changeImageSize(hudImgElements["tire-fr-optimal"], currCar->_tyreTreadDepth(0), "bottom", hudScale);