Complete disaster-recovery snapshot: engine/game source, game data assets, VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive. Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false, no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
94 lines
1.8 KiB
C++
94 lines
1.8 KiB
C++
#pragma warning (disable:4786)
|
|
#include <utils\utils.h>
|
|
#include "map.hpp"
|
|
#include "move.hpp"
|
|
#include "movezone.hpp"
|
|
#include "movecell.hpp"
|
|
|
|
|
|
bool CalcPath (std::stack<PATHELEMENT> *dest,CPoint rstart,CPoint rend,int depth,bool followshort)
|
|
{
|
|
std::stack<PATHCELLELEMENT> one;
|
|
std::stack<PATHZONEELEMENT> zone;
|
|
CPoint curpoint;
|
|
|
|
CalcPathZone (&zone,rstart,rend);
|
|
curpoint = rstart;
|
|
|
|
while (!zone.empty ())
|
|
{
|
|
if (zone.size ()==1)
|
|
{
|
|
CCellPath *path;
|
|
CPoint start,end;
|
|
|
|
const PATHZONEELEMENT& temp = zone.top ();
|
|
|
|
start.x = temp.sx;
|
|
start.y = temp.sy;
|
|
path = new CCellPath (curpoint,start,temp.sarea,temp.darea,temp.dir);
|
|
path->CalcPath ();
|
|
|
|
dest->push (PATHELEMENT (temp,path));
|
|
curpoint = path->EndPoint ();
|
|
|
|
start.x = temp.dx;
|
|
start.y = temp.dy;
|
|
path = new CCellPath (curpoint,start,rend);
|
|
path->CalcPath ();
|
|
dest->push ((PATHELEMENT (PATHZONEELEMENT (start.x,start.y,start.x,start.y,0,0,-1),path)));
|
|
zone.pop ();
|
|
}
|
|
else
|
|
{
|
|
CCellPath *path;
|
|
CPoint start;
|
|
|
|
const PATHZONEELEMENT& temp = zone.top ();
|
|
|
|
start.x = temp.sx;
|
|
start.y = temp.sy;
|
|
path = new CCellPath (curpoint,start,temp.sarea,temp.darea,temp.dir);
|
|
path->CalcPath ();
|
|
|
|
dest->push (PATHELEMENT (temp,path));
|
|
zone.pop ();
|
|
curpoint = path->EndPoint ();
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
void DoPathTick (void)
|
|
{
|
|
}
|
|
|
|
void InitMoveData (void)
|
|
{
|
|
InitMoveCellData ();
|
|
InitMoveZoneData ();
|
|
}
|
|
|
|
#if 0
|
|
bool PATHELEMENT::operator< (const PATHELEMENT& p1) const
|
|
{
|
|
if (p1.x < x)
|
|
return false;
|
|
if (x < p1.x)
|
|
return true;
|
|
if (p1.y < y)
|
|
return false;
|
|
if (y < p1.y)
|
|
return true;
|
|
return true;
|
|
}
|
|
|
|
bool PATHELEMENT::operator== (const PATHELEMENT& p1) const
|
|
{
|
|
if ((p1.x == x) && (p1.y == y))
|
|
return true;
|
|
return false;
|
|
}
|
|
#endif
|