|
|
@ -452,17 +452,18 @@ void FaceBall::RegenerateMinimap(){ |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
MapSquare&square=map.at(y).at(x); |
|
|
|
MapSquare&square=map.at(y).at(x); |
|
|
|
vf2d squareLoc = vf2d{x*minimapGridSize.x,y*minimapGridSize.y}; |
|
|
|
vf2d squareLoc = vf2d{x*minimapGridSize.x,y*minimapGridSize.y}; |
|
|
|
|
|
|
|
uint8_t transparency=uint8_t((1-(float(dist)/MAP_VISIBILITY))*255); |
|
|
|
if (square.wallN){ |
|
|
|
if (square.wallN){ |
|
|
|
DrawLine(squareLoc,squareLoc+vf2d{1.f,0.f}*minimapGridSize,{255,255,255,uint8_t((1-(float(dist)/MAP_VISIBILITY))*255)}); |
|
|
|
DrawLine(squareLoc,squareLoc+vf2d{1.f,0.f}*minimapGridSize,Pixel{255,255,255,transparency}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (square.wallS){ |
|
|
|
if (square.wallS){ |
|
|
|
DrawLine(squareLoc+vf2d{0,1.f}*minimapGridSize,squareLoc+vf2d{1,1}*minimapGridSize,{255,255,255,uint8_t((1-(float(dist)/MAP_VISIBILITY))*255)}); |
|
|
|
DrawLine(squareLoc+vf2d{0,1.f}*minimapGridSize,squareLoc+vf2d{1,1}*minimapGridSize,Pixel{255,255,255,transparency}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (square.wallE){ |
|
|
|
if (square.wallE){ |
|
|
|
DrawLine(squareLoc+vf2d{1,0}*minimapGridSize,squareLoc+vf2d{1,1}*minimapGridSize,{255,255,255,uint8_t((1-(float(dist)/MAP_VISIBILITY))*255)}); |
|
|
|
DrawLine(squareLoc+vf2d{1,0}*minimapGridSize,squareLoc+vf2d{1,1}*minimapGridSize,Pixel{255,255,255,transparency}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (square.wallW){ |
|
|
|
if (square.wallW){ |
|
|
|
DrawLine(squareLoc,squareLoc+vf2d{0,1}*minimapGridSize,{255,255,255,uint8_t((1-(float(dist)/MAP_VISIBILITY))*255)}); |
|
|
|
DrawLine(squareLoc,squareLoc+vf2d{0,1}*minimapGridSize,Pixel{255,255,255,transparency}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (hasMapUpgrade){ |
|
|
|
if (hasMapUpgrade){ |
|
|
|
for (Enemy&e:enemies){ |
|
|
|
for (Enemy&e:enemies){ |
|
|
@ -479,6 +480,16 @@ void FaceBall::RegenerateMinimap(){ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
float dist = std::sqrtf(std::pow(player.GetPos().x-exitCoords.x,2)+std::pow(player.GetPos().z-exitCoords.y,2)); |
|
|
|
|
|
|
|
if (tagsRemaining>0){ |
|
|
|
|
|
|
|
vf2d squareLoc = vf2d{exitCoords.x*minimapGridSize.x,exitCoords.y*minimapGridSize.y}; |
|
|
|
|
|
|
|
uint8_t transparency=uint8_t((1-(float(dist)/MAP_VISIBILITY))*255); |
|
|
|
|
|
|
|
DrawLine(squareLoc,squareLoc+vf2d{1.f,0.f}*minimapGridSize,Pixel{DARK_RED.r,DARK_RED.g,DARK_RED.b,transparency}); |
|
|
|
|
|
|
|
DrawLine(squareLoc+vf2d{0,1.f}*minimapGridSize,squareLoc+vf2d{1,1}*minimapGridSize,Pixel{DARK_RED.r,DARK_RED.g,DARK_RED.b,transparency}); |
|
|
|
|
|
|
|
DrawLine(squareLoc+vf2d{1,0}*minimapGridSize,squareLoc+vf2d{1,1}*minimapGridSize,Pixel{DARK_RED.r,DARK_RED.g,DARK_RED.b,transparency}); |
|
|
|
|
|
|
|
DrawLine(squareLoc,squareLoc+vf2d{0,1}*minimapGridSize,Pixel{DARK_RED.r,DARK_RED.g,DARK_RED.b,transparency}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
FillCircle(vi2d{int(exitCoords.x*minimapGridSize.x+0.5*minimapGridSize.x),int(exitCoords.y*minimapGridSize.x+0.5*minimapGridSize.y)},3,MAGENTA*(1-(float(dist)/MAP_VISIBILITY))); |
|
|
|
SetDrawTarget(nullptr); |
|
|
|
SetDrawTarget(nullptr); |
|
|
|
mapDecal->Update(); |
|
|
|
mapDecal->Update(); |
|
|
|
} |
|
|
|
} |
|
|
|