Force Feeback:

- fix, don't save global effects settings in car specific settings section
- actually use engineRevving force multiplier

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

Former-commit-id: da41e83f1d5177e2bc02ae2c455de537f9094b89
Former-commit-id: 3454334bd2de854546fbc0994ef8bddb9a455d0a
This commit is contained in:
madbad 2016-07-11 18:50:54 +00:00
parent 3ef5dd8328
commit 4c3a4a1843

View file

@ -169,9 +169,19 @@ void ForceFeedbackManager::saveConfiguration(){
// iterator2->first = key (effect parameter name)
// iterator2->second = value (effect value)
std::string effectPath = effectsSectionPathSpecific;
std::string effectPath = "";
if ( iterator->first.compare("globalEffect") == 0){
//save global setting in the default section
effectPath.append("/forceFeedback/default/effectsConfig/");
effectPath.append(iterator->first.c_str());
}else{
//save other settings in car specific section
effectPath.append(effectsSectionPathSpecific);
effectPath.append("/");
effectPath.append(iterator->first.c_str());
}
//remove the first slash
effectPath.erase(0,1);
@ -395,7 +405,7 @@ int ForceFeedbackManager::engineRevvingEffect(tCarElt* car, tSituation *s){
GfLogInfo("Sign: (%i)\n", this->effectsConfig["engineRevvingEffect"]["previousSign"]);
//force acting on the front wheels
effectForce = 50000 / (int)car->_enginerpm * 2 * this->effectsConfig["engineRevvingEffect"]["previousSign"];
effectForce = 50000 / (int)car->_enginerpm * 2 * this->effectsConfig["engineRevvingEffect"]["previousSign"] * this->effectsConfig["engineRevvingEffect"]["multiplier"] / 1000;
GfLogInfo("RPM: (%i)\n", (int)car->_enginerpm);
GfLogInfo("Efect: (%i)\n", effectForce);