Skip to content

Commit

Permalink
Have the BG Colors for Sample/Instr Panel customizable from Colors.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
bazz1tv committed Feb 20, 2021
1 parent d89ba82 commit c9d43a8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pc/shared/Colors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ void Colors::precompute(SDL_Surface *screen)

Interface::color[Interface::Type::patseqpanelBG] = SDL_MapRGB(screen->format, 95, 73, 103);
Interface::color[Interface::Type::songpanelBG] = SDL_MapRGB(screen->format, 72, 80, 114);
Interface::color[Interface::Type::instrpanelBG] = nearblack;
Interface::color[Interface::Type::samplepanelBG] = nearblack;
}

Uint32 Colors::subtract(Uint32 *c, Uint8 subval)
Expand Down
2 changes: 2 additions & 0 deletions pc/shared/Colors.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ struct Colors
//v0.2.1
patseqpanelBG,
songpanelBG,
instrpanelBG,
samplepanelBG,
SIZEOF
};
static Uint32 color[Type::SIZEOF];
Expand Down
2 changes: 1 addition & 1 deletion pc/tracker/Instrument_Panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ void Instrument_Panel::draw(SDL_Surface *screen/*=::render->screen*/)
/* First, draw the "Instruments" strings and top buttons */
// Need to draw this title with the same background color as the rect_bg
title.draw(screen, Colors::Interface::color[Colors::Interface::Type::text_fg],
true, false, false, Colors::nearblack);
true, false, false, Colors::Interface::color[Colors::Interface::Type::instrpanelBG]);
loadbtn.draw(screen);
savebtn.draw(screen);
dupbtn.draw(screen);
Expand Down
2 changes: 1 addition & 1 deletion pc/tracker/Sample_Panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void Sample_Panel::draw(SDL_Surface *screen/*=::render->screen*/)
/* First, draw the "Instruments" strings and top buttons */
// Need to draw this title with the same background color as the rect_bg
title.draw(screen, Colors::Interface::color[Colors::Interface::Type::text_fg],
true, false, false, Colors::nearblack);
true, false, false, Colors::Interface::color[Colors::Interface::Type::samplepanelBG]);
loadbtn.draw(screen);
savebtn.draw(screen);
clearbtn.draw(screen);
Expand Down
4 changes: 2 additions & 2 deletions pc/tracker/content_areas/Main_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,11 @@ void Main_Window::one_time_draw()

// Instrument Panel
// Draw the background rect
SDL_FillRect(::render->screen, &instr_rect_bg, Colors::nearblack);
SDL_FillRect(::render->screen, &instr_rect_bg, Colors::Interface::color[Colors::Interface::Type::instrpanelBG]);
instrpanel.one_time_draw();
// Sample Panel
// Draw the background rect
SDL_FillRect(::render->screen, &sample_rect_bg, Colors::nearblack);
SDL_FillRect(::render->screen, &sample_rect_bg, Colors::Interface::color[Colors::Interface::Type::samplepanelBG]);
samplepanel.one_time_draw();

patseqpanel.one_time_draw();
Expand Down

0 comments on commit c9d43a8

Please sign in to comment.