returns scaled line width
| 828 | |
| 829 | // returns scaled line width |
| 830 | int RenderHUDGetTextLineWidth(const char *string) { |
| 831 | float aspect_x; |
| 832 | int str_width_curfont = grtext_GetLineWidth(string); |
| 833 | |
| 834 | if (grtext_GetFont() == HUD_FONT) { |
| 835 | aspect_x = ((float)grtext_GetLineWidthTemplate(&Hud_font_template, string)) / ((float)str_width_curfont); |
| 836 | } else { |
| 837 | aspect_x = 1.0f; |
| 838 | } |
| 839 | |
| 840 | if (aspect_x == 1.0f) { |
| 841 | aspect_x = aspect_x * DEFAULT_HUD_WIDTH / Max_window_w; |
| 842 | } |
| 843 | |
| 844 | return (int)((str_width_curfont * aspect_x)); |
| 845 | } |
| 846 | |
| 847 | // returns scaled text height |
| 848 | int RenderHUDGetTextHeight(const char *string) { |
no test coverage detected