From c38a3395e94e38a37cf6b8efdf9f49a5c9d415df Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 6 Jul 2019 00:23:20 +1000 Subject: Make layout format more flexible: * There is no longer a concept of "layers" - there are only screens and elements. * Elements are now instantiated with * Screens and elements can have explicit blending mode specified with blend="..." * Default blending mode for screens is "add" and default for other elements is "alpha" * Other supported modes are "none" and "multiply" * This removes the options to enable/disable layers individually - use views instead * Legacy layouts can still be loaded, and support won't be removed for at least a year The current artwork model is over-stretched. It's based on a Space Invaders cabinet model, and isn't applicable to a lot of the systems MAME emulates now. The fact that MAME has to switch to an "alternate" mode to deal with games like Golly! Ghost! without requiring pre-matted bitmaps shows that the Space Invaders model wasn't even adequate for general arcade use. It shows in that for a lot of the systems that heavily depend on artwork, people just seem to randomly choose layers for elements until they get something that works. Also, the fact that MAME will switch to an alternate (Golly! Ghost!) mode depending on the combination of elements is a trap for people learning to make artwork. There are cases that the current approach of implying the blending mode from the layer doesn't work with. Examples include LEDs behind diffusers (requires additive blending for layout elements), and mutliple stacked LCD panels (requires RGB multiplication for screens). For configurability, it's now a lot easier to make multiple views using groups. For example, if you want to make it possible to hide the control panel section of your layout, you can put the control panel elements in a group and create views with and without it. I will gradually migrate the internal artwork to use the new approach. I have an XSLT stylesheet that helps with this, but I'm not comfortable adding it because it isn't a complete solution and it still requires manul steps. I wanted to get the re-worked pointer handling done sooner so I could push them both at the same time, but unfortunately various things have prevented me from progressing as quickly as I wanted to. Sorry guys, that stuff's going to have to wait. --- scripts/build/complay.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'scripts/build') diff --git a/scripts/build/complay.py b/scripts/build/complay.py index b89ca98e19a..3f2a0d8b6b5 100644 --- a/scripts/build/complay.py +++ b/scripts/build/complay.py @@ -99,7 +99,8 @@ class LayoutChecker(Minifyer): SHAPES = frozenset(('disk', 'dotmatrix', 'dotmatrix5dot', 'dotmatrixdot', 'led14seg', 'led14segsc', 'led16seg', 'led16segsc', 'led7seg', 'led8seg_gts1', 'rect')) OBJECTS = frozenset(('backdrop', 'bezel', 'cpanel', 'marquee', 'overlay')) ORIENTATIONS = frozenset((0, 90, 180, 270)) - YESNO = frozenset(("yes", "no")) + YESNO = frozenset(('yes', 'no')) + BLENDMODES = frozenset(('none', 'alpha', 'multiply', 'add')) def __init__(self, output, **kwargs): super(LayoutChecker, self).__init__(output=output, **kwargs) @@ -445,11 +446,14 @@ class LayoutChecker(Minifyer): self.handlers.pop() def groupViewStartHandler(self, name, attrs): - if name in self.OBJECTS: - if 'element' not in attrs: - self.handleError('Element %s missing attribute element' % (name, )) - elif attrs['element'] not in self.referenced_elements: - self.referenced_elements[attrs['element']] = self.formatLocation() + if (name in self.OBJECTS) or ('element' == name): + refattr = 'ref' if 'element' == name else 'element' + if refattr not in attrs: + self.handleError('Element %s missing attribute %s' % (name, refattr)) + elif attrs[refattr] not in self.referenced_elements: + self.referenced_elements[attrs[refattr]] = self.formatLocation() + if ('blend' in attrs) and (attrs['blend'] not in self.BLENDMODES) and not self.VARPATTERN.match(attrs['blend']): + self.handleError('Element %s attribute blend "%s" is unsupported' % (name, attrs['blend'])) if 'inputtag' in attrs: if 'inputmask' not in attrs: self.handleError('Element %s has inputtag attribute without inputmask attribute' % (name, )) -- cgit v1.2.3-70-g09d2