- updated caching for explorecells to be smarter and also remove old items if the cache gets too large (hits a threshold)
This commit is contained in:
parent
3d62ba1089
commit
432343572f
|
@ -47,12 +47,12 @@ MaxLights=3
|
||||||
;MasterServerExternalPortList=80,143,587,21,110,25,443,993,995
|
;MasterServerExternalPortList=80,143,587,21,110,25,443,993,995
|
||||||
Masterserver=http://megaglest.pepper.freeit.org/masterserver/
|
Masterserver=http://megaglest.pepper.freeit.org/masterserver/
|
||||||
MasterServerExternalPortList=61357,80,143,587,21,110,25,443,993,995
|
MasterServerExternalPortList=61357,80,143,587,21,110,25,443,993,995
|
||||||
NetPlayerName=newbie
|
NetPlayerName=SoftCoder
|
||||||
NetworkConsistencyChecks=true
|
NetworkConsistencyChecks=true
|
||||||
PhotoMode=false
|
PhotoMode=false
|
||||||
RefreshFrequency=75
|
RefreshFrequency=75
|
||||||
ScreenHeight=768
|
ScreenHeight=960
|
||||||
ScreenWidth=1024
|
ScreenWidth=1670
|
||||||
ServerIp=172.20.100.101
|
ServerIp=172.20.100.101
|
||||||
ServerPort=61357
|
ServerPort=61357
|
||||||
ShadowAlpha=0.2
|
ShadowAlpha=0.2
|
||||||
|
@ -68,5 +68,5 @@ StencilBits=0
|
||||||
Textures3D=1
|
Textures3D=1
|
||||||
UnitParticles=true
|
UnitParticles=true
|
||||||
UserData_Root=mydata/
|
UserData_Root=mydata/
|
||||||
Windowed=false
|
Windowed=true
|
||||||
; === propertyMap File ===
|
; === propertyMap File ===
|
||||||
|
|
|
@ -48,6 +48,7 @@ World::World(){
|
||||||
Config &config= Config::getInstance();
|
Config &config= Config::getInstance();
|
||||||
|
|
||||||
ExploredCellsLookupItemCache.clear();
|
ExploredCellsLookupItemCache.clear();
|
||||||
|
ExploredCellsLookupItemCacheTimerCount = 0;
|
||||||
|
|
||||||
techTree = NULL;
|
techTree = NULL;
|
||||||
fogOfWarOverride = false;
|
fogOfWarOverride = false;
|
||||||
|
@ -750,7 +751,9 @@ time_t ExploredCellsLookupItem::lastDebug = 0;
|
||||||
void World::exploreCells(const Vec2i &newPos, int sightRange, int teamIndex){
|
void World::exploreCells(const Vec2i &newPos, int sightRange, int teamIndex){
|
||||||
// Experimental cache lookup of previously calculated cells + sight range
|
// Experimental cache lookup of previously calculated cells + sight range
|
||||||
if(difftime(time(NULL),ExploredCellsLookupItem::lastDebug) >= 10) {
|
if(difftime(time(NULL),ExploredCellsLookupItem::lastDebug) >= 10) {
|
||||||
printf("In [%s::%s Line: %d] ExploredCellsLookupItemCache.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,ExploredCellsLookupItemCache.size());
|
ExploredCellsLookupItem::lastDebug = time(NULL);
|
||||||
|
//printf("In [%s::%s Line: %d] ExploredCellsLookupItemCache.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,ExploredCellsLookupItemCache.size());
|
||||||
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] ExploredCellsLookupItemCache.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,ExploredCellsLookupItemCache.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ok we limit the cache size doe to possible RAM constraints when
|
// Ok we limit the cache size doe to possible RAM constraints when
|
||||||
|
|
Loading…
Reference in New Issue
Block a user