summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/rendlay.cpp
Commit message (Collapse)AuthorAgeFilesLines
* rendlay: fix crash with rect element alpha of 0 < n < 1.0/255, hap2024-12-061-1/+5
| | | | misc: small cleanup
* emu/rendlay.cpp, ui/ui.cpp: Allow layout views to control pointer display. Vas Crabb2024-04-141-0/+40
|
* Initial touch input support: Vas Crabb2024-04-121-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Feed mouse/pen/touch pointer events through UI input manager with Win32 and SDL. * Started migrating UI code to use new API and reworking mouse/touch interaction. * emu/render.cpp: Support pressing multiple clickable layout items simultaneously. * emu/render.cpp: Allow UI elements to be drawn in any window. * emu/rendlay.cpp, luaengine_render.cpp: Added layout view events for pointer input. * ui/ui.cpp: Allow the UI handler to control pointer display. * ui/analogipt.cpp: Added mouse/touch and more keys for navigating field state list. * ui/menu.cpp: Use vertical swipe to scroll and horizontal swipe to adjust. * ui/menu.cpp: Draw after processing input - greatly improves responsiveness. * ui/menu.cpp: Ignore keyboard/gamepad input during pointer actions. * ui/selmenu.cpp: Made left/right info pane arrows repeat when held. * ui/selmenu.cpp: Use middle click to move keyboard focus. * ui/selmenu.cpp: Let filter list scroll if it's too tall, and use a bit of horizontal padding. * ui/selmenu.cpp: Improved divider sizing. * ui/state.cpp: Don't allow clicks to pass through the confirm deletion prompt to the menu. * ui/simpleselgame.cpp: Fixed error message display and graphics/sound status not showing. * ui/simpleselgame.cpp: Allow tap/click to dismiss error message. * ui/utils.cpp: Show UI for choice filters when there are no choices - it's less confusing. * modules/input/input_sdl.cpp: Made scaling for mouse scroll better match RawInput and DirectInput. * modules/input/input_rawinput.cpp: Added support for horizontal scroll axis. * modules/input/input_win32.cpp: Added support for scroll axes and more buttons to mouse/lightgun. * modules/debugger/debugimgui.cpp: Don't fight over events with the UI manager - it breaks menus. * osd/windows/window.cpp: Translate mouse position to window cooridinates for scroll wheel events. * osd/sdl/window.cpp: Supply last mouse position for scroll wheel events if possible. * scripts/build/complay.py: Made zero input mask an error - it was only being used to block clicks.
* rendlay: fix off-by-1 error with alpha blended disk element hap2024-03-181-12/+4
|
* rendfont: set minimum width of scaled bitmap for font chars used in .lay ↵ hap2024-03-111-4/+4
| | | | | | files to 1 if it's larger than 0.5, this prevents lowercase l and i not showing while the text label is still readable (I also tried rounding up everything but that's uglier overall), misc: small cleanup
* util/ioprocs.cpp: Added wrappers for common patterns. (#11608) Vas Crabb2024-02-251-10/+5
| | | | | emu/diimage.h: Removed fread overloads that allocate memory for output. util/core_file.cpp: Changed output size of load to size_t.
* emu/rendlay.cpp: Keep alpha channel intact when drawing text components. ↵ Devin Acker2023-12-071-12/+1
| | | | | (#11820) Improves appearance of text drawn over colors other than black.
* Added some additional layout functionality and script bindings. Vas Crabb2023-10-301-1/+52
| | | | | | Also corrected some copy/paste errors in documentation, and bumped documentation version as it now describes features that will appear in an upcoming release.
* rendlay: fix accumulated rounding error when drawing text hap2023-02-271-10/+10
|
* Various input and OSD refactoring: Vas Crabb2023-01-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | osd: Supply OSD object to modules on initialisation. Encapsulated some event handling in the OSD objects rather than leaving it in free functions. Put various stuff in namespaces. osd/modules/input: Enabled dinput, xinput and winhybrid modules for Windows SDL builds, and enabled background input for dinput and xinput (and by extension winhybrid) modules. Also fixed some COM and X11 resource leaks. osd/modules/input/input_sdl.cpp: Flipped SDL mouse button order to match Windows, and exposed vertical and horizontal scroll as Z and rZ axes. Moved SDL UI event handling out of input devices into OSD object. osd/modules/input_rawinput.cpp: Changed lightgun Z axis token so it's correctly identified as a relative axis (it maps to the scroll wheel equivalent). osd: Added an option to choose the network provider module. Mostly useful if you build with both TUN/TAP and pcap support included, or if you want to disable emulated networking completely. emu/input.cpp: Use a better strategy for assembling input code names that uses fewer temporary strings and doesn't require use of the non-Unicode-aware space trimming function (fixes MT08552). osd/modules/input_dinput.cpp: Improved polling logic. osd: Made various parts of the input code less dependent on concrete emu objects, and reduced inappropriately passing around the machine object. Made input modules less dependent on OSD implementation. Encapsulated some stuff and got rid of some vestigial newui and SDL1 support code. Cleaned up some interfaces. Moved OSD options classes to their own files. Prepare to remove main.h from emu.h - it's mostly used to get the application name, which the vast majority of emulated devices don't need to do.
* emu/rendlay.cpp: Fixed locale-sensitive number handling (fixes MT08521). Vas Crabb2022-11-291-2/+8
|
* Clean up whitespace with srcclean Vas Crabb2022-07-241-2/+2
|
* current mpu4 work + sorting (including progress to make m4andybt display ↵ David Haywood2022-07-041-2/+5
| | | | | | | | | correctly with existing layout) (#10015) * current mpu4 work + sorting (including progress to make m4andybt display correctly with existing layout) * do the invert in the layout instead for 7segs * fixes led extender strobes, allows output to be inverted
* bus/nubus: More Mac video card improvements. Vas Crabb2022-06-241-0/+3
| | | | | | | | | | | | | | | | Started implementing the Macintosh Display Card CRTC. It gives correct resolutions, although refresh rates are incorrect. Added machine configuration settings allowing several monitors to be selected. Implemented the Macintosh Display Card's packed RGB mode. The base/stride in RGB mode make more sense with this implemented. Cleaned up the code for the SuperMac Spectrum cards, and fixed the garbage at the bottom of the screen on the Spectrum/8. Put a layout with views for common monitor aspect ratios in a place where cards can use it. This is especially useful for the NuBus cards that can support portrait monitors.
* rendlay: fix possible color overflow on disk element hap2022-02-281-7/+7
|
* rendlay: remove led8seg_gts1 hap2022-02-261-69/+0
|
* Revert "rendlay: add optional alpha attribute to digit elements" hap2022-02-261-41/+11
| | | | This reverts commit d196d072ff54277a7c3ad0c5048f8fdc6b7e18c8.
* rendlay: add optional alpha attribute to digit elements hap2022-02-251-11/+41
|
* Remove fileio.h from emu.h AJR2022-02-111-0/+1
|
* 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.