summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/rendlay.cpp
Commit message (Collapse)AuthorAgeFilesLines
* A little more refactoring, and Coverity fixes: Vas Crabb2021-11-251-56/+2
| | | | | | | | | | * emu/ioport.h: Marked PORT_RESET deprecated. * emu/rendlay.cpp: Removed old dot matrix components. * emu/rendlay.cpp: Added warning message for reel components. * Changed a few more fruit machines to eliminate reel components; also made the reel lamps simpler and more efficient in these layouts. * emu, frontend: Fixed various errors reported by Coverity, one of which actaully breaks stuff.
* emu/render.cpp, emu/rendlay.cpp: Added scroll support for all elements. Vas Crabb2021-11-181-136/+411
|
* util: Further API cleanups: (#8661) Vas Crabb2021-10-051-6/+13
| | | | | * Turned `core_file` into an implementation of `random_read_write`. * Turned PNG errors into a standard error category. * Added a helper for generating what look like derived classes on-the-fly.
* -delegates: Fixed structure return with MSVC C++ ABI. Vas Crabb2021-09-211-4/+4
| | | | | | | | | | | | * Automatically use delegate_mfp_compatible to generate an adaptor for member functions that return non-scalar, non-reference types (partially addresses #8597). * Enabled the MSVC delegate implemenation for MSVC on AArch64. * Switched back to neater delegate types for layout item bounds and colour. -docs: Updated the example layout links to point to 0.235 - this means there's now an example of embedded SVG.
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-22/+19
| | | | | | | | | Added more modern generic I/O interfaces with implementation backed by stdio, osd_file and core_file, replacing io_generic. Also replaced core_file's build-in zlib compression with a filter. unzip.cpp, un7z.cpp: Added option to supply abstract I/O interface rather than filename. Converted osd_file, core_file, archive_file, chd_file and device_image_interface to use std::error_condition rather than their own error enums. Allow mounting TI-99 RPK from inside archives.
* 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.
* rendlay.cpp: Fix assertion failure with -D_GLIBCXX_ASSERTIONS AJR2021-06-131-1/+3
|
* rendlay.cpp: Increased precision of ellipse calculations. Vas Crabb2021-02-171-128/+162
| | | | | Also optimised drawing fully covered ellipse pixels and added a few comments.
* Much more core std::string_view modernization AJR2021-01-201-2/+12
| | | | | | | | | | | | | | | - Remove corestr.h from emu.h; update a few source files to not use it at all - Change strtrimspace, strtrimrightspace and core_filename_extract_* to be pure functions taking a std::string_view by value and returning the same type - Change strmakeupper and strmakelower to be pure functions taking a std::string_view and constructing a std::string - Remove the string-modifying version of zippath_parent - Change tag-based lookup functions in device_t to take std::string_view instead of const std::string & or const char * - Remove the subdevice tag cache from device_t (since device finders are now recommended) and replace it with a map covering directly owned subdevices only - Move the working directory setup method out of device_image_interface (only the UI seems to actually use the full version of this) - Change output_manager to use std::string_view for output name arguments - Change core_options to accept std::string_view for most name and value arguments (return values are still C strings for now) - Change miscellaneous other functions to accept std::string_view arguments - Remove a few string accessor macros from romload.h - Remove many unnecessary c_str() calls from logging/error messages
* render.h, rendlay.h: Dependency refactoring AJR2021-01-041-2/+4
| | | | | - 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
* Low-level #include overhaul AJR2021-01-021-7/+7
| | | | | | | - vecstream.h: Revert changes made in aa29519528cb3dbdbfac56819bea670ed8c56c5d. The std::string_view conversion has been made a non-member function (util::buf_to_string_view) and moved to coretmpl.h. - strformat.h: Remove the using declaration importing util::string_format into the global namespace. It has been moved to emucore.h and a few tool sources; other references have been qualified. - osdcore.h: Split out file, directory and path classes and methods to a new header (osdfile.h), Doxygenizing the documentation comments. - Disaggregate many #includes that were including other standard or custom headers. emu.h now includes basically the same things that it did, but other headers have been streamlined; for instance, emucore.h no longer stealth-includes osdcore.h several ways.
* Further additions of std::string_view AJR2021-01-011-162/+145
| | | | | | | - corefile.cpp, fileio.cpp: Change puts to take a std::string_view parameter - rendlay.cpp: Use std::string_view instead of bare pointers in various functions - vecstream.h: Add std::string_view conversion operator to obtain output buffer without needing to make it a C string with explicit null termination - xmlfile.cpp: Add get_attribute_string_ptr method that distinguishes between empty strings and absent attributes without falling back to C strings
* unicode.h: Updates AJR2020-12-151-3/+4
| | | | | - Remove from emu.h (except for UTF8_xxx macros, which have been transplanted to emucore.h since a lot of drivers use them) and osdepend.h - Add std::string_view overrides for uchar_from_utf8 and normalize_unicode
* -luaengine.cpp: Clean up render classes and expose screen image adjustments. Vas Crabb2020-12-131-3/+6
| | | | | | | | | | | | | | | | | | | | | * 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-30/+19
| | | | | | - 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/+41
| | | | animated.
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-70/+222
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove some deprecated instantiations of static constexpr members (MSVC ↵ Vas Crabb2020-11-151-3/+4
| | | | complains about them now)
* -Switch to building MAME as C++17. Vas Crabb2020-11-151-3/+3
| | | | | | | * 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
* rendlay.cpp: Set initial value for bounds callback, it can be called before ↵ Vas Crabb2020-11-131-0/+4
| | | | tags are resolved.
* -emu/devfind: More cleanup/consistency changes. Vas Crabb2020-11-131-70/+124
| | | | | | | | | | | * 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: Fixed one more place where disk drawing had error ↵ Vas Crabb2020-10-191-5/+6
| | | | accumulation issues.
* -emu/rendlay.cpp: Avoid another issue with floating point error accumulation ↵ Vas Crabb2020-10-191-21/+26
| | | | | | when drawing disk components. -fidel_dames.cpp: Draw buttons as single elements - improves appearance at small sizes.
* -3rdparty/expat: Update to 2.2.10." Vas Crabb2020-10-151-1/+1
| | | | -Fixed tiny build (missing s11c_bg_device) and unused lambda capture in emu/rendlay.cpp.
* emu/rendlay.cpp: Work around error accumulation issue that could cause hang ↵ Vas Crabb2020-10-141-5/+5
| | | | with x87 floating-point.
* -render.cpp: Fixed issue causing elements to be clipped on bottom/right. Vas Crabb2020-10-141-79/+64
| | | | | | -rendlay.cpp: Tidied up and optimised ellipse drawing code a little. -Reduced space between LEDs on several systems with matrix displays.
* emu/rendlay.cpp: Got rid of an unused capture that upsets clang. Vas Crabb2020-10-141-1/+1
|
* emu/rendlay.cpp: Fix accumulation error causing black pixels on certain ↵ Vas Crabb2020-10-141-14/+16
| | | | transparent colours.
* emu/rendlay.cpp: Draw disk components with area-based anti-aliasing. Vas Crabb2020-10-141-70/+312
| | | | | 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-169/+170
| | | | | | -emu/rendlay.cpp: Made real component drawing code a bit less gross. -emu/debugcon.cpp: Less screaming now that things aren't macros.
* Allow layout files to embed image data. Vas Crabb2020-10-091-54/+145
| | | | | | | | | Also improved symmetry of disk components, fixed positioning of components when fitting to the pixel grid, and fixed inherited color when item has no color specified. Removed the dotmatrix components from complay.py - there are more flexible ways to achieve the same thing.
* Various improvements to image file handling: Vas Crabb2020-10-081-102/+346
| | | | | | | | | | | | | | | | | | | | | | | | 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-172/+302
| | | | -cgang.cpp: Make internal artwork more fun.
* emu/rendlay.cpp: Pre-load image components when changing video options. Vas Crabb2020-10-031-24/+85
|
* emu/render.cpp: Consider that screens can be hidden when choosing a default ↵ Vas Crabb2020-10-031-1/+12
| | | | view.
* Got rid of global_alloc/global_free. Vas Crabb2020-10-031-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Cleaned up bitmap API. Vas Crabb2020-09-271-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made const-qualified pixel accessors (pix, pixt, raw_pixptr) return const-qualified references/pointers to pixesl, and added non-const versions. This makes bitmap more like standard library containers where const protects the content as well as the dimensions. Made the templated pixt accessor protected - having it public makes it too easy to inadvertently get a pointer to the wrong location. Removed the pix(8|16|32|64) accessors from the specific bitmaps. You could only use the "correct" one anyway, and having the "incorrect" ones available prevented explicit instantiations of the class template because the static assertions would fail. You can still see the pixel type in the bitmap class names, and you can't assign the result of &pix(y, x) to the wrong kind of pointer without a cast. Added fill member functions to the specific bitmap template, and added a explicit instantiations. This allows the bitmap size check to be skipped on most bitmap fills, although the clipping check is still there. Also fixed a couple of places that were trying to fill an indexed 16-bit bitmap with rgb_t::black() exposed by this (replaced with zero to get the same net effect). The explicit template instantiations in the .cpp file mean the compiler can inline the function if necessary, but don't need to generate a local out-of-line body if it chooses not to. Extended the size of the fill value parameter in the base bitmap class to 64 bits so it works correctly for 64-bit bitmaps. Fixed places where IE15 and VGM visualiser weren't accounting for row bytes potentially being larger than width. Fixed an off-by-one in an HP-DIO card where it was treating the Topcat cursor right edge as exclusive. Updated everything to work with the API changes, reduced the scope of many variables, added more const, and replaced a few fill/copy loops with stuff from <algorithm>.
* rendlay.cpp: Correct output alpha for rect and disk components. Vas Crabb2020-09-201-50/+61
| | | | | | This corrects alpha for cases when both the rect/disk and whatever it's drawing over are translucent, and also optimises for fully opaque and fully transparent pixels.
* -emu/rendlay.cpp: Small optimisation for opaque pixels in image component. Vas Crabb2020-09-191-1/+5
| | | | | | -machine/pc1512kb.cpp: Put \| and #~ on the right keys by default. -docs: Re-organised default keys, added P2-4 defaults, added mahjong panel diagram.
* emu/rendlay.cpp: Added parameter animation and state masks. Vas Crabb2020-09-161-228/+495
| | | | | | | | | | | | | | | | | | | 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 complay.py will complain.
* emu/render.cpp: Apply target orientation when mapping points to layout elements. Vas Crabb2020-09-121-28/+83
| | | | | | | | | 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.
* Remove last remaining uses of <background> elements in layouts, and print ↵ Vas Crabb2020-09-101-5/+15
| | | | warning messages on encountering deprecated elements.
* Updated most of the layouts using <bezel> elements Vas Crabb2020-09-091-4/+15
|
* -emu/rendlay.cpp: Fixed uninitialised variable breaking sdtor. Vas Crabb2020-09-091-9/+29
| | | | | | | | | | Also added some optional verbose logging for debugging group bounds calculation. -Updated another batch of layouts. Some chess layouts have had elements reordered in the XML to maintain stacking order when drawing.
* -Fix layout regressions in spacezap/ebases and ccompan. Vas Crabb2020-09-091-4/+5
| | | | | | -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-9/+10
| | | | | | | | | | | | | | | | | | | | | | Changed name of element to "collection" and initial visibility attribute to "visible", and added them to documentation. Also added them to complay.py. 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 complay.py 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-90/+231
| | | | | | | | | | | | | | | | | | | | 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 complay.py to prevent them from being used before they're finalised.
* ssystem3: added the new lcd screen to internal artwork hap2020-07-301-2/+2
|
* emu: correct some file headers (nw) hap2020-06-191-1/+1
|
* fixed some clang-tidy warnings (nw) (#6229) Oliver Stöneberg2020-01-291-3/+3
| | | | | | | | | | | | | | | | * fixed some readability-static-accessed-through-instance clang-tidy warnings (nw) * fixed some readability-redundant-string-cstr clang-tidy warnings (nw) * fixed some readability-redundant-control-flow clang-tidy warnings (nw) * fixed some modernize-use-nullptr clang-tidy warnings (nw) * fixed some performance-faster-string-find clang-tidy warnings (nw) * fixed some performance-for-range-copy clang-tidy warnings (nw) * fixed some performance-unnecessary-value-param clang-tidy warnings (nw)