Skip to content

Commit

Permalink
Add paw color configuration
Browse files Browse the repository at this point in the history
Applying #24 for #25.
  • Loading branch information
kuroni committed Jan 1, 2020
1 parent 6d2cbe8 commit a0510bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ void create_config()
},
"osu": {
"mouse": true,
"paw": [255, 255, 255],
"key1": [90],
"key2": [88],
"smoke": [67],
Expand Down
7 changes: 7 additions & 0 deletions src/osu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Json::Value left_key_value, right_key_value, smoke_key_value, wave_key_value;
int osu_x, osu_y, osu_h, osu_v;
int offset_x, offset_y;
int horizontal, vertical;
int paw_r, paw_g, paw_b;
double scale;
bool is_mouse, is_letterbox, is_left_handed;
sf::Sprite bg, up, left, right, device, smoke, wave;
Expand Down Expand Up @@ -40,6 +41,10 @@ bool init()
// getting configs
is_mouse = data::cfg["osu"]["mouse"].asBool();

paw_r = data::cfg["osu"]["paw"][0].asInt();
paw_g = data::cfg["osu"]["paw"][1].asInt();
paw_b = data::cfg["osu"]["paw"][2].asInt();

bool chk[256];
std::fill(chk, chk + 256, false);
left_key_value = data::cfg["osu"]["key1"];
Expand Down Expand Up @@ -266,6 +271,8 @@ void draw()
{
fill[i].position = sf::Vector2f(pss2[i], pss2[i + 1]);
fill[i + 1].position = sf::Vector2f(pss2[52 - i - 2], pss2[52 - i - 1]);
fill[i].color = sf::Color(paw_r, paw_g, paw_b, 255);
fill[i + 1].color = sf::Color(paw_r, paw_g, paw_b, 255);
}
window.draw(fill);

Expand Down

0 comments on commit a0510bd

Please sign in to comment.