forked from Ports/perfect_dark
port: add wide HUD centering option for ultrawide displays
This commit is contained in:
1 parent
e0249067b9
commit
7cd3dafaa4
6 files changed
+53
-21
No files matched your search
+12
-2
@@ -1646,14 +1646,24 @@ static void gfx_sp_geometry_mode(uint32_t clear, uint32_t set) {
|
||||
}
|
||||
|
||||
static inline void gfx_update_aspect_mode(void) {
|
||||
const uint32_t side = rsp.aspect_mode & G_ASPECT_CENTER_EXT;
|
||||
|
||||
rsp.aspect_scale = rsp.aspect_mode ? (4.f / 3.f) : gfx_current_window_dimensions.aspect_ratio;
|
||||
if (rsp.aspect_mode == G_ASPECT_LEFT_EXT) {
|
||||
|
||||
if (side == G_ASPECT_LEFT_EXT) {
|
||||
rsp.aspect_ofs = 1.f - 3.f * gfx_current_dimensions.aspect_ratio / 4.f;
|
||||
} else if (rsp.aspect_mode == G_ASPECT_RIGHT_EXT) {
|
||||
} else if (side == G_ASPECT_RIGHT_EXT) {
|
||||
rsp.aspect_ofs = 3.f * gfx_current_dimensions.aspect_ratio / 4.f - 1.f;
|
||||
} else {
|
||||
rsp.aspect_ofs = 0.f;
|
||||
}
|
||||
|
||||
if (side && (rsp.aspect_mode & G_ASPECT_WIDE_EXT)) {
|
||||
constexpr float c = 16.f / 9.f;
|
||||
if (gfx_current_dimensions.aspect_ratio > c) {
|
||||
rsp.aspect_ofs *= c / gfx_current_dimensions.aspect_ratio;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void gfx_sp_extra_geometry_mode(uint32_t clear, uint32_t set) {
|
||||
|
||||
Reference in new issue
Block a user