summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/font
Commit message (Collapse)AuthorAgeFilesLines
* font_sdl3.cpp: Fix messed up comment. [skip ci] arbee2026-02-071-1/+1
|
* sdl3: Fix font lookup. [R. Belmont] arbee2026-02-071-20/+20
|
* Initial support for SDL3. [R. Belmont, Vas Crabb] arbee2026-02-072-2/+391
| | | | | | | | | * SDL3 is the default for macOS targets. Linux/Windows can build with OSD=sdl3 while we wait for better distro support for SDL3. Both X11 and Wayland sessions are fully supported on Linux. * SDL3 -sound=sdl supports both input and output. All other video, sound, and input functionality should otherwise be the same for now. SDL 3.4+ multiple keyboard/mouse support is planned.
* osd: Various cleanup and fixes: Vas Crabb2025-05-211-14/+16
| | | | | | | | | | | | * osd/interface/audio.h: Implemented movable and swappable patterns (reduces allocation and copying). * monitor/monitor_module.h: Got rid of a C string pointer, avoid the need for a static string object. * sound/sound_module.cpp: Moved default implementation stuff out of the header, use algorithm library in place of memcpy. * sound/pa_sound.cpp: Fixed a non-const global that should be const. * monitor/monitor_dxgi.cpp: Fixed an object leak. * Cleaned up some use of COM and COM-like things.
* emscripten: fixes to get bgfx working (#13255) algestam2025-02-061-4/+1
| | | | | | | | | * Emscripten: Fixes to get BGFX working * Move emscripten specific setup into an #elif statement * Fix indentation * emscripten: remove no longer link option DEMANGLE_SUPPORT
* font_sdl: better fix for variable-length array Patrick Mackinlay2023-02-011-1/+1
|
* font_sdl: avoid variable-length array Patrick Mackinlay2023-02-011-3/+2
|
* osd: Turned video modules into actual modules, fixed various issues. Vas Crabb2023-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't ignore the return status of OSD module initialisation. Attempt to fall back to an alternate module if the selected module fails to initialise. Log more useful diagnostic information at verbose level. Fixed BGFX crash on exit after toggling fullscreen. Also persist more settings than just the selected chains across toggling fullscreen. Turned video modules into OSD modules in the same sense as all the other OSD modules. They now use the same selection/fallback mechanism as all the other modules without special extra code in the OSD implementations. Untangled some object ownership mess. Windows own renderers, OSD objects own windows. Fixed a refrence loop that caused the first window object to always leak. Don't create renderer object until after underlying window has been created. Fixed issues with order of creation/destruction when toggling fullscreen or changing prescale in fullscreen with -switchres in SDL builds. Use more smart pointers in BGFX and Direct3D render modules. Most of the code now reutrns a smart pointer when handing over ownership or a naked pointer when retaining ownership. Fixed a few leaks and simplified cleanup code. Encapsulated various OSD modules better.
* Various input and OSD refactoring: Vas Crabb2023-01-295-17/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Miscellaneous fixes and refactoring: Vas Crabb2023-01-281-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ui/analogipt.cpp: Fixed bar graph display for fields with ranges that wrap through zero. emu/inputdev.cpp: Separateed analog axis deadzone and switch threshold settings, reduced default deadzone, and fixed a potential division by zero if the deadzone and saturation settings are equal. emu/ioport.cpp: Fixed behaviour of absolute analog fields where range passes through zero - it previously only worked for specific combinations of mask, minimum and default. Removed a workaround from universal/getaway.cpp that is no longer necessary. emu/input.cpp: Fixed unintuitive behaviour when an absolute field is assigned an OR combination of a relative control folled by an absolute control (e.g. Mouse X or Joy 1 LSX). Also fixed reading axis input sequences where an axis code is followed by a switch code (these can only be produced by manually editing configuration files, not through MAME's UI), and fixed the returned type when multiple relative axes sum to zero. osd/modules/input_dinput.cpp: Fixed hat switches being stuck in up position when input is suspended in the background taito/taitoio_yoke.cpp: Give throttle control a distinct type, and don't auto-centre. osd: Added option to select MIDI provider module (currently only PortMidi and the dummy module are available). Also put various things in namespaces, and fixed builds including SDL sound module with native Windows OSD. emu/validity.cpp: Added check to catch I/O port fields using UI input types. emu/inpttype.ipp: Renamed inputs that were causing confusion. "Bill" and "Track" were causing confusion for translators and hence likely causing confusion for many users, especially those who are not native English speakers. "Track" as an abbreviation for "Trackball" was frequently being mistranslated, e.g. in the sense of a CD track selection button or even in the sense of a railway track. There's no reason to abbreviate it. "Bill" in the US English sense as a banknote is too ambiguous and was causing confusion for translators. It's better to use the less ambiguous "Banknote". Corrected Greek translations of "Trackball". Don't run GitHub Actions on issue template changes.
* util/corestr.cpp: Changed core_stricmp to take std::string_view parameters. ↵ npwoods2022-09-152-3/+3
| | | | | (#10287) Note that the implementation is still not UTF-8 aware.
* Patched up some gaps in functionality and fixed some bugs. Vas Crabb2022-09-021-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ui: Added some missing functionality: * Added an option to copy input device IDs to the relevant menus. * Added an item for setting the software lists files path (-hashpath) to the folder setup menu. * Allow pasting text from clipboard in most places that allow typing (searching, entering filenames, entering barcodes). * Changed the software selection menu heading to be a bit less misleading. * Made barcode menu less eager to rebuild itself unnecessarily, and removed some confusing and apparently pointless code. Exposed more Lua bindings: * Added low-level palette objects. * Added indexed bitmap types. * Added a bitmap method for extracting pixels from a rectangular area as a packed binary string. * Changed screen device pixels method to return width and height in addition to the pixels. osd: Added some functionality and cleaned up a little: * Added a function for copying text to the clipboard. * Moved function for converting Windows error codes to standard error conditions to winutil.cpp so it can be used from more places. * Removed duplicate declaration of osd_get_clipboard_text and made the function noexcept (including fixing implementations). * Made macOS implementation of osd_get_clipboard_text skip the encoding conversion if it finds UTF-8 text first. * Changed the default -uimodekey setting so it doesn't lose the "not shift" that stops the default from interfering with UI paste. Various bug fixes: * util/unicode.cpp: Fixed the version of utf8_from_uchar that returns std::string blowing up on invalid codepoints. * util/bitmap.h: Fixed wrapping constructors for indexed bitmaps taking the wrong parameter type (nothing was using them before). * util/bitmap.cpp: Fixed potential use-after-free issues with bitmap palettes. * emu/input.cpp, emu/inputdev.cpp: Log 1-based device numbers, matching what's shown in the internal UI and used in tokens in CFG files. * emu/emumem.cpp: Added the bank tag to a fatal error message where it was missing. docs: Reworked and expanded documentation on configuring stable controller IDs. For translators, the changes are quite minor: * There's a menu item for copying a device ID to the clipboard, and associated success/failure messages. * There's the menu item for setting the software list file search path. * One of the lines in the software selection menu heading has changes as it could be interpreted as implying it showed a software list name.
* Clean up #includes in src/osd (#10029) ajrhacker2022-07-044-5/+10
| | | | | * Clean up #includes in src/osd * render/bgfx/view.cpp: Add license header
* Remove OSD_UWP from rest of code Miodrag Milanovic2021-10-261-5/+1
|
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-3/+3
| | | | | | | | | 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-143-5/+5
| | | | | | | | | | * 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-202-5/+5
| | | | | | | | | | | | | | | - 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
* Low-level #include overhaul AJR2021-01-023-3/+0
| | | | | | | - 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.
* font_windows.cpp: include unicode.h Ivan Vangelista2020-12-151-1/+2
|
* Cleaned up bitmap API. Vas Crabb2020-09-273-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>.
* font_osx.cpp: Why does Apple even have these macros? They're not expected to ↵ AJR2020-04-081-2/+2
| | | | be defined on older MacOS versions... (nw)
* Mac: Use Arial Unicode MS as the default font (fixes missing glyphs in many ↵ arbee2020-04-081-1/+25
| | | | layouts) and fixed deprecation warnings [R. Belmont]
* Revert "fixed some modernize-use-equals-default clang-tidy warnings (… (#6360) Oliver Stöneberg2020-04-081-1/+1
| | | | | | | * Revert "fixed some modernize-use-equals-default clang-tidy warnings (nw)" This reverts commit 54486ab9 * fixed merge error
* fixed some modernize-use-equals-default clang-tidy warnings (nw) (#6237) Oliver Stöneberg2020-01-301-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)
* Make osd_printf_* use util/strformat semantics. Vas Crabb2019-09-263-7/+7
| | | | | | | | | | | | | | | | | (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.
* Fix Solaris 2.11 (non-Oracle) Rick V2019-08-191-1/+1
|
* dwrite: noticed an error msg with missing \n (nw) hap2018-12-141-1/+1
|
* log failure to get glyph, but keep drawing (nw) Vas Crabb2017-08-081-3/+0
|
* font_osx: handle fonts where space glyphs return a null bounding box (e.g. ↵ Vas Crabb2017-08-061-43/+64
| | | | | | Hiragino family) restore ability to localise info box headings
* log some failures (nw) Vas Crabb2017-08-051-28/+37
|
* Use proper font metrics on OSX rather than trying to guess advance from ↵ Vas Crabb2017-08-051-67/+38
| | | | | | glyph box Update most of Japanese translation
* Move special windows.h include directives to build defines (nw) Brad Hughes2016-12-282-2/+0
|
* first srcclean pass (nw) Vas Crabb2016-12-251-1/+1
|
* Merge pull request #1749 from bradhugh/dynamic_api Vas Crabb2016-12-021-41/+21
|\ | | | | Created DYNAMIC_API macros for dynamic bind helper classes
| * Update name of DYNAMIC_API macros (nw) Brad Hughes2016-12-011-20/+20
| |
| * Simpler low-cost implementation making modules and function pointers class ↵ Brad Hughes2016-11-211-23/+21
| | | | | | | | members instead (nw)
| * Changing singleton to be thread safe (nw) Brad Hughes2016-11-201-3/+3
| |
| * Update dwrite debugging functions with DYNAMIC_API (nw) Brad Hughes2016-11-201-9/+3
| |
| * Update DirectWrite font provider to use DYNAMIC_API (nw) Brad Hughes2016-11-201-31/+19
| |
* | srcclean (nw) Vas Crabb2016-11-271-1/+1
|/
* UWP: Different default font. Tahoma not available on XBOX (nw) Brad Hughes2016-11-141-1/+6
|
* Small cleanup (nw) Miodrag Milanovic2016-11-111-1/+1
|
* simplified memory allocation for osd_module (nw) Miodrag Milanovic2016-11-111-0/+2
|
* More UWP work - the UI actually renders (nw) Brad Hughes2016-11-101-2/+2
|
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-222-23/+23
| | | | | 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-225-9/+9
| | | | utf16_char, unicode_char (nw)
* Bulk renaming of Windows string conversion functions Nathan Woods2016-10-032-5/+5
| | | | | utf8_from_[a|w|t]string ==> osd::text::from_[a|w|t]string [a|w|t]string_from_utf8 ==> osd::text::to_[a|w|t]string
* Adding new string conversion overloads Nathan Woods2016-10-011-1/+1
| | | | [a|w|t|utf8]_from_[a|w|t|utf8_]string(xyz.c_str()) seems to be common enough to justify overloads. Also, I'm explicitly assuming that it is legal to override the NUL pointer within a C++ basic_string (e.g. - s[s.size()] = '\0'). As far as I can tell, this seems to be legal - please don't shoot if I am wrong.
* Fix compile for DirectWrite font provider and make it compile with normal ↵ Brad Hughes2016-09-161-39/+42
| | | | windows build