mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 19:29:47 +02:00
try to see if this makes disabled network crc checking more performance freindly
This commit is contained in:
@@ -32,6 +32,7 @@ private:
|
||||
private:
|
||||
int lastNumber;
|
||||
std::vector<std::string> lastCaller;
|
||||
bool disableLastCallerTracking;
|
||||
|
||||
int rand(std::string lastCaller);
|
||||
|
||||
@@ -46,9 +47,9 @@ public:
|
||||
void setLastNumber(int value) { lastNumber = value; }
|
||||
|
||||
std::string getLastCaller() const;
|
||||
void clearLastCaller() { lastCaller.clear(); }
|
||||
//void clearLastCaller() { }
|
||||
void addLastCaller(std::string text) { lastCaller.push_back(text); }
|
||||
void clearLastCaller();
|
||||
void addLastCaller(std::string text);
|
||||
void setDisableLastCallerTracking(bool value) { disableLastCallerTracking = value; }
|
||||
};
|
||||
|
||||
}}//end namespace
|
||||
|
@@ -33,6 +33,7 @@ const int RandomGen::b= 150889;
|
||||
|
||||
RandomGen::RandomGen(){
|
||||
lastNumber= 0;
|
||||
disableLastCallerTracking = false;
|
||||
}
|
||||
|
||||
void RandomGen::init(int seed){
|
||||
@@ -56,6 +57,18 @@ std::string RandomGen::getLastCaller() const {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void RandomGen::clearLastCaller() {
|
||||
if(lastCaller.empty() == false) {
|
||||
lastCaller.clear();
|
||||
}
|
||||
}
|
||||
void RandomGen::addLastCaller(std::string text) {
|
||||
if(disableLastCallerTracking == false) {
|
||||
lastCaller.push_back(text);
|
||||
}
|
||||
}
|
||||
|
||||
int RandomGen::randRange(int min, int max,string lastCaller) {
|
||||
if(min > max) {
|
||||
char szBuf[8096]="";
|
||||
@@ -71,9 +84,6 @@ int RandomGen::randRange(int min, int max,string lastCaller) {
|
||||
snprintf(szBuf,8096,"In [%s::%s Line: %d] res < min || res > max, min = %d, max = %d, res = %d",__FILE__,__FUNCTION__,__LINE__,min,max,res);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
|
||||
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] min = %d, max = %d, res = %d\n",__FILE__,__FUNCTION__,__LINE__,min,max,res);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -93,9 +103,6 @@ float RandomGen::randRange(float min, float max,string lastCaller) {
|
||||
snprintf(szBuf,8096,"In [%s::%s Line: %d] res < min || res > max, min = %f, max = %f, res = %f",__FILE__,__FUNCTION__,__LINE__,min,max,res);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
|
||||
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] min = %f, max = %f, res = %f\n",__FILE__,__FUNCTION__,__LINE__,min,max,res);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user