- disabled another cache in pathfinder trying to hunt down xplatform out of synch

This commit is contained in:
Mark Vejvoda 2010-11-28 00:07:08 +00:00
parent ee249b8878
commit 664b2b1b7d
6 changed files with 33 additions and 26 deletions

View File

@ -38,7 +38,7 @@ namespace Glest{ namespace Game{
const int PathFinder::maxFreeSearchRadius= 10;
//const int PathFinder::pathFindNodesMax= 400;
const int PathFinder::pathFindNodesMax= 150;
const int PathFinder::pathFindNodesMax= 200;
const int PathFinder::pathFindRefresh= 10;
@ -112,7 +112,8 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu
UnitPathBasic *basicPath = dynamic_cast<UnitPathBasic *>(path);
Vec2i pos= basicPath->pop();
if(map->canMove(unit, unit->getPos(), pos, &lookupCacheCanMove)) {
//if(map->canMove(unit, unit->getPos(), pos, &lookupCacheCanMove)) {
if(map->canMove(unit, unit->getPos(), pos)) {
unit->setTargetPos(pos);
unit->addCurrentTargetPathTakenCell(finalPos,pos);
return tsMoving;
@ -122,7 +123,8 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu
UnitPath *advPath = dynamic_cast<UnitPath *>(path);
//route cache
Vec2i pos= advPath->peek();
if(map->canMove(unit, unit->getPos(), pos, &lookupCacheCanMove)) {
//if(map->canMove(unit, unit->getPos(), pos, &lookupCacheCanMove)) {
if(map->canMove(unit, unit->getPos(), pos)) {
advPath->pop();
unit->setTargetPos(pos);
return tsMoving;
@ -182,7 +184,8 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu
for(int bailoutX = -20; bailoutX <= 20 && ts == tsBlocked; ++bailoutX) {
for(int bailoutY = -20; bailoutY <= 20 && ts == tsBlocked; ++bailoutY) {
const Vec2i newFinalPos = finalPos + Vec2i(bailoutX,bailoutY);
if(map->canMove(unit, unit->getPos(), newFinalPos, &lookupCacheCanMove)) {
//if(map->canMove(unit, unit->getPos(), newFinalPos, &lookupCacheCanMove)) {
if(map->canMove(unit, unit->getPos(), newFinalPos)) {
ts= aStar(unit, newFinalPos, true);
}
}
@ -199,7 +202,8 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu
UnitPathBasic *basicPath = dynamic_cast<UnitPathBasic *>(path);
Vec2i pos= basicPath->pop();
if(map->canMove(unit, unit->getPos(), pos, &lookupCacheCanMove)) {
//if(map->canMove(unit, unit->getPos(), pos, &lookupCacheCanMove)) {
if(map->canMove(unit, unit->getPos(), pos)) {
unit->setTargetPos(pos);
unit->addCurrentTargetPathTakenCell(finalPos,pos);
}
@ -211,7 +215,8 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu
else if(dynamic_cast<UnitPath *>(path) != NULL) {
UnitPath *advPath = dynamic_cast<UnitPath *>(path);
Vec2i pos= advPath->peek();
if(map->canMove(unit, unit->getPos(), pos, &lookupCacheCanMove)) {
//if(map->canMove(unit, unit->getPos(), pos, &lookupCacheCanMove)) {
if(map->canMove(unit, unit->getPos(), pos)) {
advPath->pop();
unit->setTargetPos(pos);
}

View File

@ -37,8 +37,10 @@
#include "cache_manager.h"
#ifdef WIN32
#if defined(__WIN32__) && !defined(__GNUC__)
#include <eh.h>
#include <DbgHelp.h>
#endif
#include <dbghelp.h>
#endif
#include "leak_dumper.h"

View File

@ -90,7 +90,7 @@ private:
std::map<Vec2i,bool> cachedCloseResourceTargetLookupList;
time_t lastResourceTargettListPurge;
std::map<CommandClass,std::map<int,int> > cacheUnitCommandClassList;
//std::map<CommandClass,std::map<int,int> > cacheUnitCommandClassList;
// This cache stores the units free cell movement calcs during a world
// update of the faction
//std::map<int,std::map<Field, std::map<Vec2i,std::map<Vec2i, > > > localCacheForUnitCellMovement;

View File

@ -15,8 +15,8 @@
#include <windows.h>
#include <GL\gl.h>
#include <GL\glu.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <glprocs.h>
#define GLEST_GLPROC(X, Y) inline X( static a= wglGetProcAddress(a); return a;)

View File

@ -12,7 +12,7 @@
#ifdef WIN32
#include <io.h>
#include <DbgHelp.h>
#include <dbghelp.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <direct.h>

View File

@ -12,7 +12,7 @@
#include "platform_util.h"
#include <io.h>
#include <DbgHelp.h>
#include <dbghelp.h>
#include <cassert>
#include <algorithm>