Skip to content

Commit c2f1475

Browse files
committed
UILetterboxing: allow enabling letterboxing while in-game
1 parent 2b11a3f commit c2f1475

File tree

5 files changed

+31
-28
lines changed

5 files changed

+31
-28
lines changed

OutRun2006Tweaks.ini

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@ VSync = 1
2626
# Adjusts the UI scaling applied by the game
2727
# 0 = game default, stretches to screen ratio
2828
# 1 = 4:3 UI centered to middle of screen
29-
# 2 = mostly fixed scaling without stretching, based on Outrun Online Arcade
30-
#
31-
# NOTE: these modes will enable 4:3 letterboxing during menus, but in-game won't have any letterboxing
32-
# Outrun Online Arcade scaling required many manual code fixes, if you notice anything broken please let me know!
29+
# 2 = fixed UI scaling without stretching, based on Outrun Online Arcade
30+
# Outrun Online Arcade scaling required many manual code changes, please let me know if you notice anything broken!
3331
UIScalingMode = 0
3432

33+
# Adds 4:3 letterboxing to game menus, to address some graphical issues outside of the menus 4:3 display
34+
# 0 = disable all letterboxing
35+
# 1 = letterbox menus only, disabled when in-game
36+
# 2 = always letterbox (only recommended with UIScalingMode = 1)
37+
# NOTE: this letterboxing setting is only used when UIScalingMode above is set to 1 or above
38+
UILetterboxing = 1
39+
3540
# 1 - 16, 0 to leave it at games default.
3641
AnisotropicFiltering = 16
3742

README.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,36 @@ Latest builds can be found under the releases section: https://github.com/emoose
55

66
### Features
77
**Bugfixes:**
8-
- Prevents the "DEST" save corruption bug when trying to remap controls while having many dinput devices connected
9-
- Fixes C2C ranking scoreboards not updating on Steam and certain releases due to faulty anti-piracy checks
10-
- Pegasus animation's clopping sound effect will now end properly, without looping through whole session
11-
- Game can now load lens flare effect from correct path, restoring lens flare without needing to change game files
8+
- UI can now scale to different aspect ratios properly without stretching (requires `UIScalingMode = 2` in INI)
9+
- Prevents save corruption bug when remapping controls with many dinput devices connected
10+
- Fixed C2C ranking scoreboards not updating on Steam and other releases due to faulty anti-piracy checks
11+
- Pegasus animation's clopping sound effect will now end correctly
12+
- Lens flare effect now loads from correct path, without needing to change game files
1213
- Fixed Z-buffer precision issues that caused heavy z-fighting and distant object pop-in
13-
- Stage objects such as traffic cones will now only disappear once they're actually off-screen
14+
- Stage objects such as traffic cones now only disappear once they're actually off-screen
1415
- Fixes certain effects like engine backfiring which failed to appear when using controllers
15-
- Can hide text related to the now-defunct online service
16+
- Text related to the now-defunct online service can be hidden
1617

1718
**Enhancements:**
18-
- Adds a built-in framelimiter to prevent game from speeding up
19-
- Textures for the UI and the game scene can be dumped & replaced
19+
- Built-in framelimiter to prevent the game from speeding up
2020
- FPS can now be partially unlocked, drawing at unlocked FPS while game runs at 60FPS tickrate
21+
- UI and game scene textures can be dumped & replaced
2122
- Allows disabling vehicle LODs, reducing the ugly pop-in as they get closer
22-
- Restores XInput rumble code from the Xbox release, allowing gear shifts/drifts/crashes/etc to give feedback
23+
- Restored XInput rumble code from the Xbox release, allowing gear shifts/drifts/crashes/etc to give feedback
2324
- Xbox Series impulse triggers are supported and can be tweaked inside INI
24-
- Can force anisotropic filtering & enable transparency supersampling, greatly reducing aliasing around the edges of the track
25-
- Render resolution of reflections can be increased from the default 128x128
25+
- Anisotropic filtering & transparency supersampling can be forced, greatly reducing aliasing around the edges of the track
26+
- Reflection rendering resolution can be increased from the default 128x128
2627
- Game can now run in borderless windowed mode; mouse cursor will now be hidden while game is active
27-
- Automatically disables DPI scaling on the game window, fixing scaling issues with certain setups
28-
- Heavily reduced load times by disabling framelimiter/vsync during load screens
29-
- Allows skipping intro splash screens
28+
- Automatically disables DPI scaling on the game window, fixing certain scaling issues
29+
- Load times heavily reduced by disabling framelimiter/vsync during load screens
30+
- Music can now be loaded from uncompressed WAV or lossless FLAC files, if they exist with the same filename
31+
- Allows intro splash screens to be skipped
3032
- Music track can be changed mid-race via Q and E buttons, or Back/RS+Back on controller (`CDSwitcher` must be enabled in INI first)
3133

32-
All the above can be toggled/customized via the OutRun2006Tweaks.ini file.
34+
All the above can be customized via the OutRun2006Tweaks.ini file.
3335

3436
FPS can be partially unlocked by increasing the `FramerateLimit` setting above 60 (or disabling it), with `FramerateUnlockExperimental` enabled.
35-
This will then lock the games tickrate to 60FPS while draw-rate itself is unlocked.
36-
(some things like animated textures & menu text may speed up with this, but the game speed itself will remain the same)
37+
This will then lock the games tickrate to 60FPS while draw-rate itself is unlocked, allowing game speed to stay consistent.
3738

3839
### Setup
3940
Since Steam/DVD releases are packed with ancient DRM that doesn't play well with DLL wrappers, this pack includes a replacement game EXE to run the game with.
@@ -46,8 +47,6 @@ To set it up:
4647
- Edit the `Outrun2006Tweaks.ini` to customize the tweaks to your liking (by default all tweaks are enabled)
4748
- Run the game, your desktop resolution will be used by default if `outrun2006.ini` file isn't present.
4849

49-
**If you have framerate issues where game doesn't run at your full FramerateLimit setting**, try adding `DX/WINDOWED = 1` to your `outrun2006.ini` file and check if it helps.
50-
5150
Steam Deck/Linux users may need to run the game with `WINEDLLOVERRIDES="dinput8=n,b" %command%` launch parameters for the mod to load in.
5251

5352
### Building

src/dllmain.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,8 @@ namespace Settings
155155

156156
UIScalingMode = ini.Get("Graphics", "UIScalingMode", std::move(UIScalingMode));
157157
UIScalingMode = std::clamp(UIScalingMode, 0, 2);
158-
// UILetterboxing won't be exposed in INI, but can be added there to disable it if needed
159-
// (letterboxing will only be active if UIScalingMode is set)
160158
UILetterboxing = ini.Get("Graphics", "UILetterboxing", std::move(UILetterboxing));
159+
UILetterboxing = std::clamp(UILetterboxing, 0, 2);
161160

162161
AnisotropicFiltering = ini.Get("Graphics", "AnisotropicFiltering", std::move(AnisotropicFiltering));
163162
AnisotropicFiltering = std::clamp(AnisotropicFiltering, 0, 16);

src/hooks_graphics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ class UILetterboxing : public Hook
11941194
*Game::current_mode == GameState::STATE_SMPAUSEMENU ||
11951195
(*Game::current_mode == GameState::STATE_START && *Game::game_start_progress_code == 65);
11961196

1197-
if (isInGame)
1197+
if (Settings::UILetterboxing == 1 && isInGame)
11981198
return; // disable letterboxing while in-game
11991199

12001200
// Backup existing cullmode and set to none, otherwise we won't get drawn
@@ -1237,7 +1237,7 @@ class UILetterboxing : public Hook
12371237

12381238
bool validate() override
12391239
{
1240-
return Settings::UILetterboxing && Settings::UIScalingMode > 0;
1240+
return Settings::UILetterboxing > 0 && Settings::UIScalingMode > 0;
12411241
}
12421242

12431243
bool apply() override

src/plugin.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ namespace Settings
6969
inline std::vector<std::pair<std::string, std::string>> CDTracks;
7070

7171
inline int UIScalingMode = 0;
72-
inline bool UILetterboxing = true;
72+
inline int UILetterboxing = 1;
7373
inline int AnisotropicFiltering = 16;
7474
inline int ReflectionResolution = 2048;
7575
inline bool TransparencySupersampling = true;

0 commit comments

Comments
 (0)