Skip to content

Commit

Permalink
Add alpha values for background and paw
Browse files Browse the repository at this point in the history
  • Loading branch information
kuroni committed Jul 18, 2020
1 parent 427d626 commit 11dd2f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
}

int mode = data::cfg["mode"].asInt();
int red_value = data::cfg["decoration"]["rgb"][0].asInt();
int green_value = data::cfg["decoration"]["rgb"][1].asInt();
int blue_value = data::cfg["decoration"]["rgb"][2].asInt();

window.clear(sf::Color(red_value, green_value, blue_value));
Json::Value rgb = data::cfg["decoration"]["rgb"];
int red_value = rgb[0].asInt();
int green_value = rgb[1].asInt();
int blue_value = rgb[2].asInt();
int alpha_value = rgb.size() == 3 ? 255 : rgb[3].asInt();

window.clear(sf::Color(red_value, green_value, blue_value, alpha_value));
switch (mode) {
case 1:
osu::draw();
Expand Down
7 changes: 4 additions & 3 deletions src/osu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,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;
int paw_r, paw_g, paw_b, paw_a;
int paw_edge_r, paw_edge_g, paw_edge_b;
double scale;
bool is_mouse, is_letterbox, is_left_handed, is_enable_toggle_smoke;
Expand Down Expand Up @@ -48,6 +48,7 @@ bool init() {
paw_r = osu["paw"][0].asInt();
paw_g = osu["paw"][1].asInt();
paw_b = osu["paw"][2].asInt();
paw_a = osu["paw"].size() == 3 ? 255 : osu["paw"][3].asInt();

paw_edge_r = osu["pawEdge"][0].asInt();
paw_edge_g = osu["pawEdge"][1].asInt();
Expand Down Expand Up @@ -252,8 +253,8 @@ void draw() {
for (int i = 0; i < 26; i += 2) {
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);
fill[i].color = sf::Color(paw_r, paw_g, paw_b, paw_a);
fill[i + 1].color = sf::Color(paw_r, paw_g, paw_b, paw_a);
}
window.draw(fill);

Expand Down

0 comments on commit 11dd2f4

Please sign in to comment.