Skip to content

Commit

Permalink
some alpha tricks
Browse files Browse the repository at this point in the history
  • Loading branch information
averrin committed Sep 21, 2017
1 parent 1e45d3e commit d031d6d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,9 @@ class Application {
for (auto r : ends) {
if (std::count(used.begin(), used.end(), r) == 0) {
sw::Spline line;
line.setColor(r->state->color);
sf::Color col = r->state->color;
col.a = 150;
line.setColor(col);
line.setThickness(4);
nextBorder(r, &used, &line, &ends);

Expand Down Expand Up @@ -783,7 +785,7 @@ class Application {
col.g = g / s;
col.b = b / s;
}
int a = 255 * (region->getHeight(region->site) + 1.6) / 3;
int a = 255 * (region->getHeight(region->site) + 1.6) / 3 + (rand() % 8 - 4);
if (a > 255) {
a = 255;
}
Expand Down
10 changes: 10 additions & 0 deletions src/utils.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "mapgen/utils.hpp"

namespace mg {
double getDistance(Point p, Point p2) {
double distancex = (p2->x - p->x);
double distancey = (p2->y - p->y);

return std::sqrt(distancex * distancex + distancey * distancey);
}
};

0 comments on commit d031d6d

Please sign in to comment.