Codechange: Make a generic DrawRectOutline function from DrawOutline. (#11524)

This allows drawing an outline from Rect, not just constrained to a Widget's Rect. And reduces duplication a little.
This commit is contained in:
Peter Nelson
2023-11-30 18:10:07 +00:00
committed by GitHub
parent 33ba609290
commit 6f7153bf71
4 changed files with 19 additions and 10 deletions

View File

@@ -2146,10 +2146,7 @@ struct CargoesField {
int ypos1 = ypos + vert_inter_industry_space / 2;
int ypos2 = ypos + normal_height - 1 - vert_inter_industry_space / 2;
int xpos2 = xpos + industry_width - 1;
GfxDrawLine(xpos, ypos1, xpos2, ypos1, INDUSTRY_LINE_COLOUR);
GfxDrawLine(xpos, ypos1, xpos, ypos2, INDUSTRY_LINE_COLOUR);
GfxDrawLine(xpos, ypos2, xpos2, ypos2, INDUSTRY_LINE_COLOUR);
GfxDrawLine(xpos2, ypos1, xpos2, ypos2, INDUSTRY_LINE_COLOUR);
DrawRectOutline({xpos, ypos1, xpos2, ypos2}, INDUSTRY_LINE_COLOUR);
ypos += (normal_height - GetCharacterHeight(FS_NORMAL)) / 2;
if (this->u.industry.ind_type < NUM_INDUSTRYTYPES) {
const IndustrySpec *indsp = GetIndustrySpec(this->u.industry.ind_type);