Skip to content

Commit

Permalink
Working sign locations
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Oct 11, 2010
1 parent 9053120 commit 9052bc4
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 159 deletions.
18 changes: 12 additions & 6 deletions src/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,19 @@ void color::blend(const color &other) {

// pull color down towards black
void color::darken(uint8_t f) {
r -= ((r * f) / 0xff);
g -= ((g * f) / 0xff);
b -= ((b * f) / 0xff);
if (r - f < 0x0) r = 0x0;
else r -= f;
if (g - f < 0x0) g = 0x0;
else g -= f;
if (b - f < 0x0) b = 0x0;
else b -= f;
}

void color::lighten(uint8_t f) {
r += ((r * f) / 0xff);
g += ((g * f) / 0xff);
b += ((b * f) / 0xff);
if (r + f > 0xff) r = 0xff;
else r += f;
if (g + f > 0xff) g = 0xff;
else g += f;
if (b + f > 0xff) b = 0xff;
else b += f;
}
2 changes: 2 additions & 0 deletions src/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct settings_t {
bool binary;
bool debug;
bool use_split;
bool striped_terrain;
bool show_players;
std::set<std::string> show_players_set;
bool show_coordinates;
Expand Down Expand Up @@ -90,6 +91,7 @@ struct settings_t {
this->show_players = false;
this->show_coordinates = false;
this->require_all = false;
this->striped_terrain = false;
this->rotation = 0;
this->binary = false;
this->night = false;
Expand Down
Loading

0 comments on commit 9052bc4

Please sign in to comment.