path: root/src/emu/render.h
Commit message (Collapse)AuthorAgeFilesLines
* render.cpp: Use simple_list instead of std::list for containers; remove old ↵ AJR13 days1-18/+5
| | | | remnants of "internal" debugger
* emu/render.cpp, emu/rendlay.cpp: Added scroll support for all elements. Vas Crabb2021-11-181-1/+1
* API cleanups and miscellaneous fixes. Vas Crabb2021-07-151-1/+1
| | | | | | | | | | | | | | | | emu/ioport.cpp: Allow controller files to override input sequences for inputs that don't use defaults, and to override the toggle setting for digital inputs. emu/config.cpp: Expose configuration level (mostly matters for controller files), improved verbose diagnostic messages, and moved a few things out of the global and preprocessor namespaces. docs: Added documentation for some controller configuration file features. The device mapping feature documentation will be merged in at some point. util/unicode.cpp, emu/input.cpp: API cleanups.
* Remove emualloc.* AJR2021-06-221-3/+0
* render: increase MAX_TEXTURE_SCALES a bit hap2021-05-081-1/+1
* render.h, rendlay.h: Dependency refactoring AJR2021-01-041-555/+3
| | | | | - render.h: Split out layout class declarations into rendlay.h, with some adjustments for the resulting incomplete types (std::reference_wrapper unfortunately does not allow these by C++17 rules) - rendlay.h: Move old header contents to layout/generic.h
* Add "Non-Integer Scaling" and "Keep Aspect" settings to UI video options ↵ AJR2020-12-171-0/+1
| | | | menu and remove SDL hotkeys for same
* -luaengine.cpp: Clean up render classes and expose screen image adjustments. Vas Crabb2020-12-131-2/+2
| | | | | | | | | | | | | | | | | | | | | * Started moving Lua class reference to docs. Expecting people to find the class reference material in the source isn’t going to help make it approachable. The docs allow longer explanations, better formatting, and cross reference links. * Added another layout scripting example to the docs. -goldnpkr.cpp: Minor clean-up. * Improved the short names for Witch Card and Witch Game clone sets. * Made Witch Up & Down artwork clickable. * Added working Video Klein sets where the parent is a working Video Klein set to the tiny subtarget. * Removed history from the header comment - we have version control for a readon.
* C++17 string handling updates (without charconv so as not to break GCC 7) AJR2020-12-081-1/+2
| | | | | | - render.cpp, rendlay.cpp, ui/ui.cpp, ui/menu.cpp: Change argument types for text processing functions from const char * to std::string_view - ui/menu.cpp: Add overloads of item_append omitting the frequently empty subtext argument - cheat.cpp: Remove some c_str() calls that became unnecessary a while ago
* Expose enough of the layout system to Lua to allow position and colour to be ↵ Vas Crabb2020-12-051-0/+14
| | | | animated.
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-14/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The things that were previously called device iterators are not iterators in the C++ sense of the word. This is confusing for newcomers. These have been renamed to be device enumerators. Several Lua methods and properties that previously returned tables now return lightweight wrappers for the underlying objects. This means creating them is a lot faster, but you can't modify them, and the performance characteristics of different operations varies. The render manager's target list uses 1-based indexing to be more like idiomatic Lua. It's now possible to create a device enumerator on any device, and then get subdevices (or sibling devices) using a relative tag. Much more render/layout functionality has been exposed to Lua. Layout scripts now have access to the layout file and can directly set the state of an item with no bindings, or register callbacks to obtain state. Some things that were previously methods are now read-only properties. Layout files are no longer required to supply a "name". This was problematic because the same layout file could be loaded for multiple instances of the same device, and each instance of the layout file should use the correct inputs (and in the future outputs) for the device instance it's associated with. This should also fix video output with MSVC builds by avoiding delegates that return things that don't fit in a register.
* -unidasm: Allow input piped from stdin by specifying a bare hyphen as the ↵ Vas Crabb2020-11-181-1/+4
| | | | | | | | | | filename. [AJR, Vas Crabb] -netlist: Give devices the C++17 namespace treatment. -Tidied up compiler warning options for 3rdparty. -emu/render.cpp: Exposed a few information view item properties.
* -Switch to building MAME as C++17. Vas Crabb2020-11-151-2/+2
| | | | | | | * Updated sol2 to 3.2.2 * Updated pugixml to 1.10 * Increased minimum clang version to 6 * Cleaned up some stuff that can use new features
* -emu/devfind: More cleanup/consistency changes. Vas Crabb2020-11-131-7/+25
| | | | | | | | | | | * Removed .mask(), as it’s not reliable in the general case. * Added asserts to things that assume power-of-two sizes. * Got rid of virtual qualifier on pointer-to-member operator. * Made helpers a bit more assertive about logging warnings. -emu/rendlay.cpp: Use delegates to avoid hot conditional branches. -docs: Finished off description of object finders and output finders.
* emu/rendlay.cpp: Draw disk components with area-based anti-aliasing. Vas Crabb2020-10-141-2/+3
| | | | | Also fixed alpha blending within an element for rect and disk components.
* -emu/render.cpp: Load from all external artwork paths. Vas Crabb2020-10-131-8/+7
| | | | | | -emu/rendlay.cpp: Made real component drawing code a bit less gross. -emu/debugcon.cpp: Less screaming now that things aren't macros.
* Various improvements to image file handling: Vas Crabb2020-10-081-69/+11
| | | | | | | | | | | | | | | | | | | | | | | | Moved MS DIB parser out of ICO file reader and made it available for artwork and layout images. Added more efficient I/O and better error checking for JPEG file loading (MAME will no longer exit immediately on a bad JPEG file). Made caller responsible for opening files for loading images, to avoid decompressing images used in ZIP/7z artwork multiple times. Added support for JPEG and Windows DIB to picture_image_device. Added support for SVG image files in external artwork. Added support for using I/O port value for animation state and masking animation state values. Made bounds elements more flexible in layouts. Reworked headers to reduce dependencies. Updated layout file format documentation.
* -emu/rendlay.cpp: Allow item animation. Vas Crabb2020-10-051-31/+56
| | | | -cgang.cpp: Make internal artwork more fun.
* emu/rendlay.cpp: Pre-load image components when changing video options. Vas Crabb2020-10-031-17/+24
* emu/render.cpp: Consider that screens can be hidden when choosing a default ↵ Vas Crabb2020-10-031-4/+5
| | | | view.
* Got rid of global_alloc/global_free. Vas Crabb2020-10-031-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The global_alloc/global_free functions have outlived their usefulness. They don't allow consistently overriding the default memory allocation behaviour because they aren't used consistently, and we don't have standard library allocator wrappers for them that we'd need to use them consistently with all the standard library containers we're using. If you need to change the default allocator behaviour, you can override the new/delete operators, and there are ways to get more fine-grained control that way. We're already doing that to pre-fill memory in debug builds. Code was already starting to depend on global_alloc/global_free wrapping new/delete. For example some parts of the code (including the UI and Windows debugger) was putting the result of global_alloc in a std::unique_ptr wrappers without custom deleters, and the SPU sound device was assuming it could use global_free to release memory allocated with operator new. There was also code misunderstanding the behaviour of global_alloc, for example the GROM port cartridge code was checking for nullptr when a failure will actually throw std::bad_alloc. As well as substituting new/delete, I've made several things use smart pointers to reduce the chance of leaks, and fixed a couple of leaks, too.
* emu/rendlay.cpp: Added parameter animation and state masks. Vas Crabb2020-09-161-12/+34
| | | | | | | | | | | | | | | | | | | Components may have multiple bounds and/or color child elements with state attributes, allowing for piecewise linear position/size/colour animation. Components may have a statemask attribute, allowing for things like using external images to draw a multi-segment LED/VFD display without requiring dozens of outputs for the individual lines or thousands of images for all possible states. (Texture caching still never releases anything, so MAME can still exceed the maximum number of textures, but that’s a separate issue.) Image components with alpha now blend over previously drawn components. Layouts have been changed to use yes/no for inputraw to match what's used for flipx/flipy. External layouts with 1/0 will still work, but will complain.
* emu/render.cpp: Apply target orientation when mapping points to layout elements. Vas Crabb2020-09-121-20/+69
| | | | | | | | | Addresses MT07375. Also increase efficiency when layouts contain large numbers of non-interactive elements (e.g. thousands of matrix display dots). Also includes work in progress for future improvements.
* -Fix layout regressions in spacezap/ebases and ccompan. Vas Crabb2020-09-091-2/+2
| | | | | | -emu/rendlay.cpp: Actually add the group bounds calculation fix. -Update a few more layouts.
* Finished adding new mechanism for allowing parts of views to be hidden. Vas Crabb2020-09-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | Changed name of element to "collection" and initial visibility attribute to "visible", and added them to documentation. Also added them to Fixed issue with collection inside group, and improved initial view selection behaviour. Updated some internal layouts to demonstrate new features, including et3400, irrmaze, ltcasino, mekd3/mekd4, seawolf and vgmplay. Removed all uses of cpanel, marquee and overlay from internal layouts and removed them from to actively discourage use. Also cleaned up view names in layouts that were using them in place of spaces, and removed some superfluous name attributes on elements that won't do anything useful with an output value anyway. Made vgmplay cycle visualiser modes when visualiser screen is clicked. Fixed a copy/paste error in bus/rs232/hlemouse.cpp while I'm at it.
* -util/xmlfile: Escape attribute and element content. Vas Crabb2020-09-061-37/+74
| | | | | | | | | | | | | | | | | | | | The previous behaviour was unintuitive - parsing an XML file and writing it out immediately would produce invalid XML if the file contained any characters that needed escaping. It makes far more sense to escape on writing rather than expecting the user to escape input. -Add preliminary support for visibility toggles to artwork system. This allows the user to show/hide related elements in a view, with nesting. The view can specify whether elements are shown or hidden by default. Settings are saved per host window/screen per view. There is no way to set the initial visibility state on the command line. Legacy "Space Invaders cabinet model" layers are mapped onto visibility toggles. This is not stable yet. In particular, the XML element/attribute names have not been finalised. The new features have not been added to to prevent them from being used before they're finalised.
* ui: only warn about external artwork when it wasn't loaded (nw) hap2020-06-131-0/+2
* use C++ library includes (nw) firewave2020-01-221-1/+1
* Clean up render_screen_list code, replacing simple_list with std::list (nw) AJR2019-11-241-47/+4
* srcclean (nw) Vas Crabb2019-10-261-1/+1
* -bgfx: Do texture format conversion via a full-screen GPU pass. [Ryan Holtz] MooglyGuy2019-10-131-2/+3
* MT07379: better automatic group bounds behaviour Vas Crabb2019-08-201-0/+1
* render: more caching gone wrong (nw) Vas Crabb2019-07-061-1/+1
* Make layout format more flexible: Vas Crabb2019-07-061-71/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * There is no longer a concept of "layers" - there are only screens and elements. * Elements are now instantiated with <element ref="..."> * 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.
* (nw) Clean up the mess on master Vas Crabb2019-03-261-0/+2
| | | | | | | | | | | | | This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
* Revert "conflict resolution (nw)" andreasnaive2019-03-251-2/+0
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* hh_tms1k: added switches to simon layout, added buttons to zodiac layout, ↵ hap2019-03-231-0/+1
| | | | changed inputs to sliders in alphie (nw)
* layout: added "inputraw" parameter, for use with inputtag and inputmask. It ↵ hap2019-03-231-0/+1
| | | | sets the element state directly to the raw input data & mask. Example uses: 8 way joystick state, multi-bitmask dipswitch state. If you don't want it to respond to layout mouse clicks, add a dummy inputtag rect under it. (nw)
* fixup (nw) Vas Crabb2018-08-271-5/+5
* -bgfx: Improved rendering with artwork by 5-10x or more. [Ryan Holtz] mooglyguy2018-08-271-4/+7
* (nw) Further layout work: Vas Crabb2018-08-021-4/+11
| | | | | | | | * Allow <orientation> and <color> to work on group references * Fix some corner cases where group bounds could be miscalculated * Fix a corner case where MAME could incorrectly refuse to instantiate groups * Add more checks to * Document more of the layout format
* allow repeating elements and groups - useful if you need e.g. a lot of ↵ Vas Crabb2018-07-221-0/+11
| | | | numbered labels, but it limits's ability to check for invalid references as it can't evaluate expressions (nw)
* rendlay: allow user variables and repetition in layouts, also add a few more ↵ Vas Crabb2018-07-221-83/+98
| | | | predefined variables
* Allow per-device internal layouts and remove some more MCFG_ macros. Vas Crabb2018-07-161-6/+8
| | | | | | | | | | | Input and screen tags are now resolved relative to a layout's owner device. Easy way to demonstrate is with: mame64 intlc440 -tty ie15 Previously you'd only get the IE15 terminal's layout and you'd be unable to use the INTELLEC 4/40 front panel. Now you'll get the choice of layouts from both the system and the terminal device in video options.
* better handling for arbitrary numbers of screens (nw) Vas Crabb2018-03-121-0/+6
* Generate layouts for systems with three or more screens Vas Crabb2017-09-291-0/+1
* get rid of string hashes when fetching output values in layout rendering, too Vas Crabb2017-07-301-1/+2
* Add support for layout item groups, replace simple_list with more Vas Crabb2017-07-291-46/+109
| | | | | | | | | | | | | appropriate containers, remove misleading const qualifiers, reduce repeated XML walking. (nw) Groups aren't parameterised, so they aren't as useful as they could be (yes, it's on my TODO list). However, it's already useful for putting a common set of elements in multiple views, potentially at different locations/scales. See intlc44.lay and intlc440.lay for examples of the level of copypasta this can eliminate. Be aware that groups with explicit bounds don't clip thair content, it's only used for calucating the transform matrix.
* reduce weight of render.h by moving component specialisation declarations ↵ Vas Crabb2017-07-281-224/+23
| | | | into rendlay.cpp
* convenience macro for enum bitwise operators (nw) Vas Crabb2017-07-221-1/+1