Hide pathfinding debug render overlays.
This commit is contained in:
@@ -235,29 +235,34 @@ void Monster::Draw(){
|
||||
}
|
||||
game->view.DrawPartialRotatedDecal(GetPos()-vf2d{0,GetZ()},GetFrame().GetSourceImage()->Decal(),0,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,vf2d(GetSizeMult()*(GetFacingDirection()==RIGHT?-1:1),GetSizeMult()),GetBuffs(BuffType::SLOWDOWN).size()>0?Pixel{uint8_t(255*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration))),uint8_t(255*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration))),uint8_t(128+127*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration)))}:WHITE);
|
||||
|
||||
#pragma region Debug Pathfinding
|
||||
#ifdef _DEBUG
|
||||
if("debug_pathfinding"_I){
|
||||
for(float index=0.f;index<path.points.size();index+=0.01f){
|
||||
Pixel col=DARK_GREY;
|
||||
if(index<pathIndex){
|
||||
col=VERY_DARK_GREY;
|
||||
}
|
||||
if(index>pathIndex+1){
|
||||
col=GREY;
|
||||
}
|
||||
game->view.FillRectDecal(path.GetSplinePoint(index).pos,{1,1},col);
|
||||
}
|
||||
|
||||
for(float index=0.f;index<path.points.size();index+=0.01f){
|
||||
Pixel col=DARK_GREY;
|
||||
if(index<pathIndex){
|
||||
col=VERY_DARK_GREY;
|
||||
for(size_t counter=0;Pathfinding::sPoint2D&point:path.points){
|
||||
Pixel col=CYAN;
|
||||
if(counter<pathIndex){
|
||||
col=RED;
|
||||
}
|
||||
if(counter>pathIndex+1){
|
||||
col=YELLOW;
|
||||
}
|
||||
game->view.FillRectDecal(point.pos,{3,3},col);
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
if(index>pathIndex+1){
|
||||
col=GREY;
|
||||
}
|
||||
game->view.FillRectDecal(path.GetSplinePoint(index).pos,{1,1},col);
|
||||
}
|
||||
|
||||
for(size_t counter=0;Pathfinding::sPoint2D&point:path.points){
|
||||
Pixel col=CYAN;
|
||||
if(counter<pathIndex){
|
||||
col=RED;
|
||||
}
|
||||
if(counter>pathIndex+1){
|
||||
col=YELLOW;
|
||||
}
|
||||
game->view.FillRectDecal(point.pos,{3,3},col);
|
||||
counter++;
|
||||
}
|
||||
#endif
|
||||
#pragma endregion
|
||||
}
|
||||
void Monster::DrawReflection(float drawRatioX,float multiplierX){
|
||||
game->SetDecalMode(DecalMode::ADDITIVE);
|
||||
@@ -436,7 +441,7 @@ void Monster::PathAroundBehavior(float fElapsedTime){
|
||||
facingDirection=LEFT;
|
||||
}
|
||||
}else{
|
||||
if(pathIndex>=path.points.size()){
|
||||
if(pathIndex>=path.points.size()-1){
|
||||
//We have reached the end of the path!
|
||||
pathIndex=0;
|
||||
targetAcquireTimer=0;
|
||||
|
||||
Reference in New Issue
Block a user