summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/rendutil.cpp
Commit message (Collapse)AuthorAgeFilesLines
* util/ioprocs.cpp: Added wrappers for common patterns. (#11608) Vas Crabb2024-02-251-2/+1
| | | | | emu/diimage.h: Removed fread overloads that allocate memory for output. util/core_file.cpp: Changed output size of load to size_t.
* Allow loading PNG/JPEG/MS DIB bitmaps from Lua, and cleanup. Vas Crabb2023-04-131-115/+116
| | | | | | | | | | | Use VirtualAlloc rather than VirtualProtect on Windows to change page protection, as the latter can cause severe performance issues with some antivirus software. Added noexcept to lots of hash- and bitmap-related things, and added a little more error checking. Yes, I realise it will abort if an allocation fails while printing a log message, but if you get to that point, you're probably screwed already.
* rendutil.cpp: API cleanup + minor related OSD render cleanups AJR2022-01-221-93/+83
|
* util: Further API cleanups: (#8661) Vas Crabb2021-10-051-16/+17
| | | | | * 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.
* emu/rendutil.cpp: Use setjmp/longjmp for libjpeg error unwinding. Vas Crabb2021-06-291-70/+90
| | | | | Apparently Linux AArch64 has issues with throwing exceptions across C function frames.
* srcclean in preparation for 0.226 release branch Vas Crabb2020-10-251-1/+1
|
* Fix MSVC build Aaron Giles2020-10-071-2/+2
|
* Various improvements to image file handling: Vas Crabb2020-10-081-98/+221
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Cleaned up bitmap API. Vas Crabb2020-09-271-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>.
* emu/rendlay.cpp: Added parameter animation and state masks. Vas Crabb2020-09-161-1/+2
| | | | | | | | | | | | | | | | | | | 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: correct some file headers (nw) hap2020-06-191-1/+1
|
* fixed some clang-tidy warnings (nw) (#6197) Oliver Stöneberg2020-01-221-3/+3
| | | | | | | | | | | | | | * fixed some bugprone-throw-keyword-missing clang-tidy warnings (nw) * fixed some modernize-use-nullptr clang-tidy warnings (nw) * fixed some readability-delete-null-pointer 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 readability-redundant-string-cstr clang-tidy warnings (nw)
* Make osd_printf_* use util/strformat semantics. Vas Crabb2019-09-261-1/+1
| | | | | | | | | | | | | | | | | (nw) This has been a long time coming but it's here at last. It should be easier now that logerror, popmessage and osd_printf_* behave like string_format and stream_format. Remember the differences from printf: * Any object with a stream out operator works with %s * %d, %i, %o, %x, %X, etc. work out the size by magic * No sign extending promotion to int for short/char * No widening/narrowing conversions for characters/strings * Same rules on all platforms, insulated from C runtime library * No format warnings from compiler * Assert in debug builds if number of arguments doesn't match format (nw) Also removed a pile of redundant c_str and string_format, and some workarounds for not being able to portably format 64-bit integers or long long.
* Use boolean not bool for libjpeg functions Ryan Schmidt2018-10-111-1/+1
| | | Fixes build failure.
* that doesn't require an instance (nw) Vas Crabb2017-09-031-2/+1
|
* rendlay image_component: detect image format(png) before loading image. No ↵ hap2017-09-021-0/+34
| | | | PNG error message anymore when loading JPG. (nw)
* png: make it not leak memory by default, and look a but more like C++ Vas Crabb2017-08-131-29/+30
|
* png: support 16-bit samples Vas Crabb2017-08-131-8/+8
|
* More PNG handling overhaul: Vas Crabb2017-08-121-107/+25
| | | | | | | * Unify code for copying PNG data into bitmap for MAME and pngcmp * Fix upsampling of monochrome PNGs (need to splat across byte) * Add support for greyscale+alpha * Detect more unsupported conditions rather than just behaving badly
* add minimal support for reading Adam7 interlaced PNG Vas Crabb2017-08-121-96/+146
| | | | | | | | | | | | | (nw) This is the path of least resistance, and I plan to fix it up later, I just wanted to get it to actually work first. Decompression and unfiltering is fully supported, at least for all the pixel formats that previously worked. Expanding 1/2/4bpp to 8bpp should work properly, too. Bitmap mapping for Adam7 is only implemented in rendutil.cpp which is whate everything in MAME uses. The function in png.cpp (used by pngcmp) has not been updated. At some point I'll unify at least one of the functions in rendutil.cpp with the one in png.cpp and we can go from three functions that need to do the mapping down to two at the most.
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-46/+46
| | | | | | | | | | | | * New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h" * Get rid of import of cstdint types to global namespace (C99 does this anyway) * Remove the cstdint types from everything in emu * Get rid of U64/S64 macros * Fix a bug in dps16 caused by incorrect use of macro * Fix debugcon not checking for "do " prefix case-insensitively * Fix a lot of messed up tabulation * More constexpr * Fix up many __names
* Revert "Added IS_ENABLED, so we have compiler check for non used part, it is ↵ Miodrag Milanovic2016-11-121-1/+1
| | | | | | checked but not compiled in (nw)" This reverts commit c0407f073bf7afe26407c4add5cfeaf7104913c9.
* Added IS_ENABLED, so we have compiler check for non used part, it is checked ↵ Miodrag Milanovic2016-11-111-1/+1
| | | | | | but not compiled in (nw) false and true now used instead of integer where used as bool
* more TRUE/FALSE cleanup (nw) Miodrag Milanovic2016-10-221-1/+1
|
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-46/+46
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* some bool <-> int not needed conversions, also cleaned drivenum.* was using ↵ Miodrag Milanovic2016-10-211-11/+11
| | | | memset for clearing vector (nw)
* tagged_list to unordered_map for slots (nw) Miodrag Milanovic2016-06-181-4/+3
|
* Made the way jpeglib.h is included more pretty Julian Sikorski2016-06-151-1/+1
|
* Procedural texture for vectors in HLSL ImJezze2016-06-051-1/+1
| | | | | | * added simple procedural texture for vectors with rounded line ends and beam smoothness * added optional -vector_beam_smooth option * removed -antialias option, antialiasing is now always applied, except for plain D3D
* Moved extension of vector lines to where it belongs (nw) ImJezze2016-05-221-11/+29
|
* Visual Studio compile fix. (nw) dankan18902016-03-281-6/+3
|
* Move jpeglib.h include where it belongs. No need to include this in couriersud2016-03-281-1/+1
| | | rendutil.h.
* rendutil render_load_jpeg: removed unneeded check, deallocate bitmap on error hap2016-03-281-10/+3
|
* moved emu/ui/util render_load_jpeg to emu/rendutil hap2016-03-271-0/+90
| | | | This also adds simple support for loading JPG in external artwork
* Make osd_file a polymorphic class that's held with smart pointers Vas Crabb2016-03-141-2/+2
| | | | | | | | | | | | | | | Make avi_file a class that's held with smart pointers, encapsulate various AVI I/O structures Make zip_file and _7z_file classes rather than having free functions everywhere Hide zip/7z class implementation behind an interface, no longer need to call close() to send back to the cache Don't dump as much crap in global namespace Add solaris PTY implementation Improve variable expansion for SDL OSD - supports ~/$FOO/${BAR} syntax Rearrange stuff so the same things are in file module for all OSDs Move file stuff into its own module 7z/zip open and destruct are still not thread-safe due to lack of interlocks around cache access Directory functions still need to be moved to file module SDL OSD may not initialise WinSock on Windows
* Initial import of MEWUI to MAME [Dankan1890] Dankan18902016-02-041-2/+2
|
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-5/+5
|
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+731