summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/render.c
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2014-03-02 13:21:32 +0000
committer Nathan Woods <npwoods@mess.org>2014-03-02 13:21:32 +0000
commit4b7c39ba4052b0d9b3d5214939b68c9742717423 (patch)
treed8ecbf20698a0e39a69fe9c4924c2f8105be0bad /src/emu/render.c
parentd80d26245cbc93c6ac53c791b66dbe7eb54d8847 (diff)
Adding minimum width/height options; defaulting to '0' so there is no change in behavior (the menubar branch will have different defualts)
Diffstat (limited to 'src/emu/render.c')
-rw-r--r--src/emu/render.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/emu/render.c b/src/emu/render.c
index 91f87f0c6e7..87b108a4c1c 100644
--- a/src/emu/render.c
+++ b/src/emu/render.c
@@ -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();