Skip to content

Commit

Permalink
Merge pull request #753 from LoboEire/master
Browse files Browse the repository at this point in the history
Rough autoscaling for intermission texts
  • Loading branch information
dashodanger authored Dec 8, 2024
2 parents f258978 + 8ffb8dc commit f880e2d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions source_files/edge/f_finale.cc
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,28 @@ static void TextWrite(void)
h = h * txtscale;
}

//Autoscale if there are too many lines of text to fit onscreen
float TempHeight = StringLines(finale_text) * h;
if (TempHeight > 200)
{
//Too big, need to scale
float TempScale = 1.0f;

TempScale = 200.0f / TempHeight;
txtscale = TempScale;
HUDSetScale(txtscale);

//Need to recalculate this
h = 11; // set a default
if (style->fonts_[t_type])
{
HUDSetFont(style->fonts_[t_type]);
h = style->fonts_[t_type]->NominalHeight();
h = h + (3 * txtscale); // bit of spacing
h = h * txtscale;
}
}

int cy = h;

char line[200];
Expand Down

0 comments on commit f880e2d

Please sign in to comment.