| 722 | } |
| 723 | |
| 724 | ImVec2 calcWindowSize(f32* fontScale, CaptionEnv env) |
| 725 | { |
| 726 | TFE_Settings_A11y* settings = TFE_Settings::getA11ySettings(); |
| 727 | *fontScale = s_screenHeight / 1024.0f; // Scale based on window resolution |
| 728 | *fontScale = (f32)fmax(*fontScale, 1); |
| 729 | |
| 730 | f32 maxWidth = MAX_CAPTION_WIDTH; |
| 731 | if (env == CC_GAMEPLAY) |
| 732 | { |
| 733 | *fontScale += (f32)(settings->gameplayFontSize * s_screenHeight / 1280.0f); |
| 734 | maxWidth += 100 * settings->gameplayFontSize; |
| 735 | } |
| 736 | else |
| 737 | { |
| 738 | *fontScale += (f32)(settings->cutsceneFontSize * s_screenHeight / 1280.0f); |
| 739 | maxWidth += 100 * settings->cutsceneFontSize; |
| 740 | } |
| 741 | *fontScale = (f32)fmax(*fontScale, 1); |
| 742 | if (s_currentCaptionFont != nullptr) *fontScale *= .7f; |
| 743 | |
| 744 | f32 windowWidth = s_screenWidth * 0.8f; |
| 745 | if (windowWidth > maxWidth) windowWidth = maxWidth; |
| 746 | ImVec2 windowSize = ImVec2(windowWidth, 0); // Auto-size vertically |
| 747 | return windowSize; |
| 748 | } |
| 749 | |
| 750 | s64 secondsToMicroseconds(f32 seconds) |
| 751 | { |
no test coverage detected