- disabled the stopcommand throttling for now to see if performance is still ok
This commit is contained in:
parent
3ed636aae2
commit
56bc84923a
|
@ -37,6 +37,7 @@ namespace Glest{ namespace Game{
|
||||||
|
|
||||||
const int UnitPathBasic::maxBlockCount= GameConstants::updateFps / 2;
|
const int UnitPathBasic::maxBlockCount= GameConstants::updateFps / 2;
|
||||||
const int updateUnitForStopCommandFrameCount = 40;
|
const int updateUnitForStopCommandFrameCount = 40;
|
||||||
|
const bool updateUnitForStopCommandFrameCountEnabled = false;
|
||||||
|
|
||||||
UnitPathBasic::UnitPathBasic() {
|
UnitPathBasic::UnitPathBasic() {
|
||||||
this->blockCount = 0;
|
this->blockCount = 0;
|
||||||
|
@ -1106,17 +1107,18 @@ bool Unit::needToUpdate() {
|
||||||
if(newProgress >= 1.f) {
|
if(newProgress >= 1.f) {
|
||||||
return_value = true;
|
return_value = true;
|
||||||
|
|
||||||
if(currSkill->getClass() != scDie) {
|
if(updateUnitForStopCommandFrameCountEnabled == true) {
|
||||||
if(currSkill->getClass() == scStop) {
|
if(currSkill->getClass() != scDie) {
|
||||||
return_value = false;
|
if(currSkill->getClass() == scStop) {
|
||||||
uint32 framesSinceLastCheck = (game->getWorld()->getFrameCount() - this->getLastStopCommandCheckFrame());
|
return_value = false;
|
||||||
if(this->getLastStopCommandCheckFrame() <= 0 ||
|
uint32 framesSinceLastCheck = (game->getWorld()->getFrameCount() - this->getLastStopCommandCheckFrame());
|
||||||
framesSinceLastCheck >= updateUnitForStopCommandFrameCount) {
|
if(this->getLastStopCommandCheckFrame() <= 0 ||
|
||||||
return_value = true;
|
framesSinceLastCheck >= updateUnitForStopCommandFrameCount) {
|
||||||
|
return_value = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return return_value;
|
return return_value;
|
||||||
|
@ -1210,18 +1212,17 @@ bool Unit::update() {
|
||||||
if(currSkill->getClass() != scDie) {
|
if(currSkill->getClass() != scDie) {
|
||||||
progress = 0.f;
|
progress = 0.f;
|
||||||
return_value = true;
|
return_value = true;
|
||||||
if(currSkill->getClass() == scStop && this->anyCommand() == false) {
|
if(updateUnitForStopCommandFrameCountEnabled == true) {
|
||||||
return_value = false;
|
if(currSkill->getClass() == scStop && this->anyCommand() == false) {
|
||||||
uint32 framesSinceLastCheck = (game->getWorld()->getFrameCount() - this->getLastStopCommandCheckFrame());
|
return_value = false;
|
||||||
if(this->getLastStopCommandCheckFrame() <= 0 ||
|
uint32 framesSinceLastCheck = (game->getWorld()->getFrameCount() - this->getLastStopCommandCheckFrame());
|
||||||
framesSinceLastCheck >= updateUnitForStopCommandFrameCount) {
|
if(this->getLastStopCommandCheckFrame() <= 0 ||
|
||||||
this->setLastStopCommandCheckFrame(game->getWorld()->getFrameCount());
|
framesSinceLastCheck >= updateUnitForStopCommandFrameCount) {
|
||||||
return_value = true;
|
this->setLastStopCommandCheckFrame(game->getWorld()->getFrameCount());
|
||||||
|
return_value = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if(return_value == true) {
|
|
||||||
// printf("\n\n\n@@@@@@@@@@@@@@@ Unit [%s - %d] current skill [%s]\n",this->getFullName().c_str(),this->getId(),currSkill->getName().c_str());
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
progress= 1.f;
|
progress= 1.f;
|
||||||
|
|
Loading…
Reference in New Issue