mirror of
https://github.com/holub/mame
synced 2025-04-24 09:20:02 +03:00
Adding minimum width/height options; defaulting to '0' so there is no change in behavior (the menubar branch will have different defualts)
This commit is contained in:
parent
d80d26245c
commit
4b7c39ba40
@ -105,6 +105,8 @@ const options_entry emu_options::s_option_entries[] =
|
||||
{ OPTION_GAMMA "(0.1-3.0)", "1.0", OPTION_FLOAT, "default game screen gamma correction" },
|
||||
{ OPTION_PAUSE_BRIGHTNESS "(0.0-1.0)", "0.65", OPTION_FLOAT, "amount to scale the screen brightness when paused" },
|
||||
{ OPTION_EFFECT, "none", OPTION_STRING, "name of a PNG file to use for visual effects, or 'none'" },
|
||||
{ OPTION_MINIMUM_WIDTH, "0", OPTION_INTEGER, "minimum screen width" },
|
||||
{ OPTION_MINIMUM_HEIGHT, "0", OPTION_INTEGER, "minimum screen height" },
|
||||
|
||||
// vector options
|
||||
{ NULL, NULL, OPTION_HEADER, "CORE VECTOR OPTIONS" },
|
||||
|
@ -113,6 +113,8 @@ enum
|
||||
#define OPTION_GAMMA "gamma"
|
||||
#define OPTION_PAUSE_BRIGHTNESS "pause_brightness"
|
||||
#define OPTION_EFFECT "effect"
|
||||
#define OPTION_MINIMUM_WIDTH "minimum_width"
|
||||
#define OPTION_MINIMUM_HEIGHT "minimum_height"
|
||||
|
||||
// core vector options
|
||||
#define OPTION_ANTIALIAS "antialias"
|
||||
@ -279,6 +281,8 @@ public:
|
||||
float gamma() const { return float_value(OPTION_GAMMA); }
|
||||
float pause_brightness() const { return float_value(OPTION_PAUSE_BRIGHTNESS); }
|
||||
const char *effect() const { return value(OPTION_EFFECT); }
|
||||
int minimum_width() const { return int_value(OPTION_MINIMUM_WIDTH); }
|
||||
int minimum_height() const { return int_value(OPTION_MINIMUM_HEIGHT); }
|
||||
|
||||
// core vector options
|
||||
bool antialias() const { return bool_value(OPTION_ANTIALIAS); }
|
||||
|
@ -1232,10 +1232,22 @@ void render_target::compute_minimum_size(INT32 &minwidth, INT32 &minheight)
|
||||
for (layout_view::item *curitem = m_curview->first_item(layer); curitem != NULL; curitem = curitem->next())
|
||||
if (curitem->screen() != NULL)
|
||||
{
|
||||
// use a hard-coded default visible area for vector screens
|
||||
screen_device *screen = curitem->screen();
|
||||
const rectangle vectorvis(0, 639, 0, 479);
|
||||
const rectangle &visarea = (screen->screen_type() == SCREEN_TYPE_VECTOR) ? vectorvis : screen->visible_area();
|
||||
|
||||
// get visible area
|
||||
rectangle visarea = (screen->screen_type() == SCREEN_TYPE_VECTOR)
|
||||
? rectangle(0, 639, 0, 479) // use a hard-coded default visible area for vector screens
|
||||
: screen->visible_area();
|
||||
|
||||
// is our visible area too small? if so, we need to bump up the size
|
||||
float minimum_width = m_manager.machine().options().minimum_width();
|
||||
float minimum_height = m_manager.machine().options().minimum_height();
|
||||
INT32 factor = (INT32) ceil(MAX(minimum_width / visarea.width(), minimum_height / visarea.height()));
|
||||
factor = MAX(factor, 1);
|
||||
visarea.min_x *= factor;
|
||||
visarea.min_y *= factor;
|
||||
visarea.max_x *= factor;
|
||||
visarea.max_y *= factor;
|
||||
|
||||
// apply target orientation to the bounds
|
||||
render_bounds bounds = curitem->bounds();
|
||||
|
Loading…
Reference in New Issue
Block a user