void GameWorldBase::RecalcBQAroundPointBig(const MapPoint pt) { // Point and radius 1 RecalcBQAroundPoint(pt); // And radius 2 for(unsigned i = 0; i < 12; ++i) RecalcBQ(GetNeighbour2(pt, i)); }
unsigned char PreviewMinimap::CalcShading(const MapPoint pt, const std::vector<unsigned char>& altitudes) const { int altitude = altitudes[GetMMIdx(pt)]; MapPoint tmp = MakeMapPoint(GetNeighbour(Point<int>(pt), Direction::NORTHEAST), map_width, map_height); int A = altitudes[GetMMIdx(tmp)] - altitude; tmp = MakeMapPoint(GetNeighbour2(Point<int>(pt), 0), map_width, map_height); int B = altitudes[GetMMIdx(tmp)] - altitude; tmp = MakeMapPoint(GetNeighbour(Point<int>(pt), Direction::WEST), map_width, map_height); int C = altitudes[GetMMIdx(tmp)] - altitude; tmp = MakeMapPoint(GetNeighbour2(Point<int>(pt), 7), map_width, map_height); int D = altitudes[GetMMIdx(tmp)] - altitude; int shadingS2 = 64 + 9 * A - 3 * B - 6 * C - 9 * D; if(shadingS2 > 128) shadingS2 = 128; else if(shadingS2 < 0) shadingS2 = 0; return shadingS2; }