Remove keepaspect and fullstretch members of osd_video_config

This commit is contained in:
AJR 2020-12-16 23:31:53 -05:00
parent f8edcb7c2e
commit 7d84852db6
9 changed files with 38 additions and 24 deletions

View File

@ -169,9 +169,7 @@ void mac_osd_interface::extract_video_config()
video_config.windowed = options().window();
video_config.prescale = options().prescale();
video_config.filter = options().filter();
video_config.keepaspect = options().keep_aspect();
video_config.numscreens = options().numscreens();
video_config.fullstretch = options().uneven_stretch();
// if we are in debug mode, never go full screen
if (machine().debug_flags & DEBUG_FLAG_OSD_ENABLED)

View File

@ -370,6 +370,7 @@ void mac_window_info::destroy()
// free the render target, after the textures!
machine().render().target_free(m_target);
m_target = nullptr;
}
@ -579,9 +580,13 @@ int mac_window_info::complete_create()
temp = m_windowed_dim;
}
else if (m_startmaximized)
temp = get_max_bounds(video_config.keepaspect );
{
temp = get_max_bounds(keepaspect());
}
else
temp = get_min_bounds(video_config.keepaspect );
{
temp = get_min_bounds(keepaspect());
}
// create the window .....
osd_printf_verbose("Enter mac_window_info::complete_create\n");

View File

@ -105,6 +105,15 @@ public:
return orientation_swap_xy ^ rotation_swap_xy;
};
bool keepaspect()
{
render_target *target = this->target();
if (target != nullptr)
return target->keepaspect();
else
return machine().options().keep_aspect();
}
virtual osd_dim get_size() = 0;
virtual osd_monitor_info *monitor() const = 0;
@ -253,9 +262,7 @@ struct osd_video_config
// global configuration
int windowed; // start windowed?
int prescale; // prescale factor
int keepaspect; // keep aspect ratio
int numscreens; // number of screens
int fullstretch; // fractional stretch
// hardware options
int mode; // output mode

View File

@ -175,9 +175,7 @@ void sdl_osd_interface::extract_video_config()
video_config.windowed = options().window();
video_config.prescale = options().prescale();
video_config.filter = options().filter();
video_config.keepaspect = options().keep_aspect();
video_config.numscreens = options().numscreens();
video_config.fullstretch = options().uneven_stretch();
#ifdef SDLMAME_X11
video_config.restrictonemonitor = !options().use_all_heads();
#endif

View File

@ -475,7 +475,7 @@ void sdl_window_info::destroy()
// free the render target, after the textures!
machine().render().target_free(m_target);
m_target = nullptr;
}
@ -681,9 +681,13 @@ int sdl_window_info::complete_create()
temp = m_windowed_dim;
}
else if (m_startmaximized)
temp = get_max_bounds(video_config.keepaspect );
{
temp = get_max_bounds(keepaspect());
}
else
temp = get_min_bounds(video_config.keepaspect );
{
temp = get_min_bounds(keepaspect());
}
// create the window .....

View File

@ -142,7 +142,6 @@ void windows_osd_interface::extract_video_config()
video_config.windowed = options().window();
video_config.prescale = options().prescale();
video_config.filter = options().filter();
video_config.keepaspect = options().keep_aspect();
video_config.numscreens = options().numscreens();
// if we are in debug mode, never go full screen

View File

@ -463,6 +463,7 @@ void uwp_window_info::destroy()
// free the render target
machine().render().target_free(m_target);
m_target = nullptr;
}
@ -952,8 +953,9 @@ void uwp_window_info::update_minmax_state()
RECT bounds;
// compare the maximum bounds versus the current bounds
osd_dim minbounds = get_min_bounds(video_config.keepaspect);
osd_dim maxbounds = get_max_bounds(video_config.keepaspect);
const bool keep_aspect = keepaspect();
osd_dim minbounds = get_min_bounds(keep_aspect);
osd_dim maxbounds = get_max_bounds(keep_aspect);
//GetWindowRect(platform_window<HWND>(), &bounds);
// if either the width or height matches, we were maximized
@ -980,7 +982,7 @@ void uwp_window_info::minimize_window()
{
assert(GetCurrentThreadId() == window_threadid);
osd_dim newsize = get_min_bounds(video_config.keepaspect);
osd_dim newsize = get_min_bounds(keepaspect());
// get the window rect
//RECT bounds;
@ -1001,7 +1003,7 @@ void uwp_window_info::maximize_window()
{
assert(GetCurrentThreadId() == window_threadid);
osd_dim newsize = get_max_bounds(video_config.keepaspect);
osd_dim newsize = get_max_bounds(keepaspect());
// center within the work area
osd_rect work = m_monitor->usuable_position_size();
@ -1033,7 +1035,7 @@ void uwp_window_info::adjust_window_position_after_major_change()
if (!fullscreen())
{
// constrain the existing size to the aspect ratio
if (video_config.keepaspect)
if (keepaspect())
newrect = constrain_to_aspect_ratio(newrect, WMSZ_BOTTOMRIGHT);
}

View File

@ -150,7 +150,6 @@ void windows_osd_interface::extract_video_config()
video_config.windowed = options().window();
video_config.prescale = options().prescale();
video_config.filter = options().filter();
video_config.keepaspect = options().keep_aspect();
video_config.numscreens = options().numscreens();
// if we are in debug mode, never go full screen

View File

@ -850,6 +850,7 @@ void win_window_info::destroy()
// free the render target
machine().render().target_free(m_target);
m_target = nullptr;
}
@ -1308,7 +1309,7 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR
case WM_SIZING:
{
RECT *rect = (RECT *)lparam;
if (video_config.keepaspect && !(GetAsyncKeyState(VK_CONTROL) & 0x8000))
if (keepaspect() && !(GetAsyncKeyState(VK_CONTROL) & 0x8000))
{
osd_rect r = window->constrain_to_aspect_ratio(RECT_to_osd_rect(*rect), wparam);
rect->top = r.top();
@ -1681,8 +1682,9 @@ void win_window_info::update_minmax_state()
RECT bounds;
// compare the maximum bounds versus the current bounds
osd_dim minbounds = get_min_bounds(video_config.keepaspect);
osd_dim maxbounds = get_max_bounds(video_config.keepaspect);
const bool keep_aspect = keepaspect();
osd_dim minbounds = get_min_bounds(keep_aspect);
osd_dim maxbounds = get_max_bounds(keep_aspect);
GetWindowRect(platform_window(), &bounds);
// if either the width or height matches, we were maximized
@ -1709,7 +1711,7 @@ void win_window_info::minimize_window()
{
assert(GetCurrentThreadId() == window_threadid);
osd_dim newsize = get_min_bounds(video_config.keepaspect);
osd_dim newsize = get_min_bounds(keepaspect());
// get the window rect
RECT bounds;
@ -1732,7 +1734,7 @@ void win_window_info::maximize_window()
{
assert(GetCurrentThreadId() == window_threadid);
osd_dim newsize = get_max_bounds(video_config.keepaspect);
osd_dim newsize = get_max_bounds(keepaspect());
// center within the work area
osd_rect work = m_monitor->usuable_position_size();
@ -1764,7 +1766,7 @@ void win_window_info::adjust_window_position_after_major_change()
if (!fullscreen())
{
// constrain the existing size to the aspect ratio
if (video_config.keepaspect)
if (keepaspect())
newrect = constrain_to_aspect_ratio(newrect, WMSZ_BOTTOMRIGHT);
// restrict the window to one monitor and avoid toolbars if possible