|
|
|
@ -141,9 +141,25 @@ void Minimap::Reset(){ |
|
|
|
|
for(const ZoneData&zone:game->GetZones().at("EndZone")){ |
|
|
|
|
vf2d ringPos=zone.zone.pos/game->GetCurrentMapData().TileSize; |
|
|
|
|
vf2d ringSize=zone.zone.size/game->GetCurrentMapData().TileSize; |
|
|
|
|
vf2d ringCenter=ringPos+ringSize/2; |
|
|
|
|
for(int y=0;y<=ringSize.y;y++){ |
|
|
|
|
for(int x=0;x<=ringSize.x;x++){ |
|
|
|
|
minimap.Sprite()->SetPixel(ringPos+vi2d{x,y},GREEN); |
|
|
|
|
float ringRadiusX=ringSize.x/2; |
|
|
|
|
float ringRadiusY=ringSize.y/2; |
|
|
|
|
float distanceFromCenterX=abs(ringCenter.x-(ringPos.x+x)); |
|
|
|
|
float distanceFromCenterY=abs(ringCenter.y-(ringPos.y+y)); |
|
|
|
|
|
|
|
|
|
if(distanceFromCenterX<ringRadiusX&&distanceFromCenterY<ringRadiusY){ |
|
|
|
|
for(int shadowY=-1;shadowY<=1;shadowY++){ |
|
|
|
|
for(int shadowX=-1;shadowX<=1;shadowX++){ |
|
|
|
|
if(shadowX==0&&shadowY==0)continue; |
|
|
|
|
if(minimap.Sprite()->GetPixel(ringPos+vi2d{x+shadowX,y+shadowY})!=GREEN){ |
|
|
|
|
minimap.Sprite()->SetPixel(ringPos+vi2d{x+shadowX,y+shadowY},BLACK); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
minimap.Sprite()->SetPixel(ringPos+vi2d{x,y},GREEN); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|