summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/rendfont.cpp
Commit message (Collapse)AuthorAgeFilesLines
* rendfont.cpp: Modest refactoring AJR2022-02-051-49/+71
| | | | | | | - Use ioprocs classes rather than emu_file in various helper functions - Make save_cached take an already-open file (like load_cached) rather than a filename - Make load_cached_bdf take a std::string_view - Change some osd_printf_warnings to osd_printf_info
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-8/+8
| | | | | | | | | 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.
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-141-3/+3
| | | | | | | | | | * osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h * sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration * gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset * emucore.h: Remove obsolete typedef
* Much more core std::string_view modernization AJR2021-01-201-0/+1
| | | | | | | | | | | | | | | - 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
* 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
* rendfont.cpp: Convert another function to std::string_view AJR2020-12-121-20/+15
| | | | * cmddata.h: Remove long-disused UI button color tables
* C++17 string handling updates (without charconv so as not to break GCC 7) AJR2020-12-081-12/+8
| | | | | | - 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
* Cleaned up bitmap API. Vas Crabb2020-09-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: correct some file headers (nw) hap2020-06-191-1/+1
|
* fixed some clang-tidy warnings (nw) (#6197) Oliver Stöneberg2020-01-221-1/+1
| | | | | | | | | | | | | | * 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)
* Resolve [[nodiscard]] warning from c_str() call. Billy Robert O'Neal III2019-08-231-1/+1
| | | | | | | | In C++98/03, basic_string::c_str() was allowed to be a reallocation to insert the null terminator. MAME is ensuring this actually happens with a do-nothing call to c_str(). In C++11 and later, this is prohibited, and the string is mandated to be always null terminated. As a result Visual C++ marks c_str() with [[nodiscard]], triggering a warning here for discarding the result. (I don't know of any C++03 implementation that actually reallocates here, but just in case this code actually targeted such an implementation I've just suppressed the warning for now. If MAME only targets C++11 or later, we should fix it by deleting the line.)
* make rectangle work better with constexpr, change many things to use ↵ Vas Crabb2018-07-281-4/+3
| | | | designated getters/setters (nw)
* coretmpl: add an associative LRU cache with map-like behaviour Vas Crabb2016-12-151-279/+1102
| | | | | | | | | | | | | | selmenu: use LRU cache so icons don't all need to be reloaded on scroll uismall.bdf: set default character for missing glyphs rendfont.cpp: * encapsulate many BDF and BDC handling details * make file I/O 64-bit clean, check for allocation errors * more solid BDF parser with error messages and trace logging * fix heap smash when building bitmaps for BDF fonts * extend BDC format to support high planes and default character * render default character if glyph not found for BDF/BDC
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-28/+28
| | | | | | | | | | | | * 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-3/+3
| | | | | | 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-3/+3
| | | | | | but not compiled in (nw) false and true now used instead of integer where used as bool
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-28/+28
| | | | | 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
* use standard types uintptr_t, char16_t and char32_t instead of FPTR, ↵ Miodrag Milanovic2016-10-221-7/+7
| | | | utf16_char, unicode_char (nw)
* dynamic_buffer is just std::vector<UINT8> (nw) Miodrag Milanovic2016-10-211-2/+2
|
* quick fixes to some more stuff that isn't supplementary plane clean Vas Crabb2016-08-031-9/+15
|
* fixed clang (nw) Miodrag Milanovic2016-07-311-0/+2
|
* std::min and std:max instead of MIN and MAX, also some more macros converted ↵ Miodrag Milanovic2016-07-311-2/+2
| | | | to inline functions (nw)
* Cleanups and version bumpmame0173 Miodrag Milanovic2016-04-271-2/+2
|
* Various cleanups suggested by static analyzer (nw) Miodrag Milanovic2016-04-241-1/+1
|
* Cleanup (nw) Miodrag Milanovic2016-04-201-3/+3
|
* attempt to fix hap issue (nw) David Haywood2016-03-311-2/+13
|
* Cleanups and version bump Miodrag Milanovic2016-03-301-1/+1
|
* Make a proper BDF out of uismall font - no need to try and load an orphaned BDC Vas Crabb2016-03-211-19/+0
|
* Fix bdc loading and fullpath TTF loading Vas Crabb2016-03-201-22/+23
|
* Added uismall.bdc and way to load it for those that wish to use it still (nw) Miodrag Milanovic2016-03-201-1/+19
|
* Move font enumeration to OSD, separate font name from display name as needed ↵ Vas Crabb2016-03-171-17/+9
| | | | for OSX
* Make osd_file a polymorphic class that's held with smart pointers Vas Crabb2016-03-141-7/+7
| | | | | | | | | | | | | | | 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-15/+111
|
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-27/+27
|
* More cleanups (nw) Miodrag Milanovic2015-11-111-1/+1
|
* Some cleanups and init fixes with help of ReSharper C++ (nw) Miodrag Milanovic2015-11-111-1/+0
|
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+767