Commit Graph
233 Commits
Author SHA1 Message Date
libretroadmin f0b97a2e90 Remove the standalone frontends
The libretro core is the frontend, and the headless tools are the test and
debugging hosts. The Windows, UWP, Android, iOS, macOS and SDL apps, the UI
framework and imgui go, along with what only they used: the Win32 debugger
hooks (g_frameMutex, the shutdown lock), JNI thread attachment, the Android
text drawer, RAIntegration, Discord, recent files, game installs, tilt input,
the audio resamplers, the control mapper, memstick moving and the remote ISO
and upload server modes. The web server keeps the debugger. The MSVC, Gradle
and ndk-build projects go too.
2026-10-09 04:56:10 +02:00
libretroadmin d56b453891 Replace zlib, zstd, libchdr, libzip and libpng with libretro-common
Deflate, zlib and gzip streams go through rinflate and rdeflate, zstd
through rzstd, CHD images through rchd, zip archives through
rzip_archive and PNG through rpng. The bundled libraries, their build
glue and the system-library options are gone; adler32 and uncompress
keep zlib's ABI for the prebuilt FFmpeg archives that still call them.
libretro-common is one CMake library that the core, the headless tool
and the unit tests all link.

The reads take shorter paths on the way. CHD decodes straight from the
loader's reads and a range of blocks at a time, and a file read at any
alignment decodes into place; CSO keeps one inflate stream instead of
one per block; a plain ISO serves a file read with one read of its exact
bytes; a stored zip member is read in place and a deflated one through
restart points rather than a copy of the whole image in memory; zip
members decode into the caller's buffer; sequential reads through the
frontend's VFS skip the seek, which also keeps its buffering.

libretro/test reads one image as ISO, CSO, CHD and zip through the block
devices, boots each, and checks the codecs against Python-made vectors;
a CI job runs it.
2026-10-08 14:14:38 +02:00
Henrik RydgårdandClaude Opus 5.5 93f57a4f38 GPU: Delete copy operations on classes that own resources
These own GPU objects, memory or refcounts in their destructors (or assert
there that they were torn down), so a copy would double-free. Nothing copies
them today; this keeps it that way. The manager base classes cover every
backend's subclass.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 10:33:32 -06:00
Henrik Rydgård 52a16ea365 Make TempImage act a bit more robustly. 2026-09-29 10:16:08 -06:00
Henrik Rydgård 8e40e811c2 Merge pull request #22064 from hrydgard/fix-gpu-render-audit-bugs
Common audit: Fix GPU-related bugs
2026-08-10 00:04:33 +02:00
Henrik Rydgård abb57c620f Adjust some log levels 2026-08-09 22:10:54 +02:00
Henrik RydgårdandClaude Sonnet 5 1a9f2f827f DrawBuffer::V(): don't overflow verts_ in release builds
The only guard against writing past the fixed 65536-entry verts_
array was _dbg_assert_msg_, which is compiled out entirely outside
_DEBUG - a large enough single batch (e.g. Circle()/CircleSegment()
with a big segment count, or a large UI list without an intervening
Flush()) silently corrupted the heap in release builds. Added a real
bounds check that drops the vertex instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L4QAoxV2KY7ek4PcZw3WvY
2026-08-09 21:31:22 +02:00
Henrik RydgårdandClaude Sonnet 5 ef87fe2e74 ManagedTexture: fix file buffer leak on failed image decode
TextureLoadTask::Run() only freed the VFS-read file buffer on the
success path - a corrupt/truncated image in a texture pack or
replacement texture directory (valid magic, bad payload) leaked the
whole file's bytes on every load attempt.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L4QAoxV2KY7ek4PcZw3WvY
2026-08-09 21:31:22 +02:00
Henrik Rydgård 8cd7e1b2c0 Delete all support for Qt
Our Qt backend has long been left behind and doesn't even support Vulkan
currently. There would be a lot of work to make it viable, and I don't
think anyone is really interested.

ImGui on SDL will soon fulfill the need for a more classic user interface
with a menu bar on Linux, and on Mac we already have a native UI.
2026-08-08 18:18:28 +02:00
Henrik Rydgård a7b1b319ce Limit PNG decode dimensions to prevent decompression bombs
pngLoadPtr allocated the decoded buffer directly from attacker-controlled
PNG IHDR dimensions with no upper bound, so browsing a crafted game icon
or savedata could trigger a multi-gigabyte allocation.

- Add maxWidth/maxHeight parameters to pngLoadPtr (default 8192x8192)
  and reject images larger than the limits.
- Thread the limits through LoadTextureLevelsFromFileData,
  CreateTextureFromFileData, and CreateTextureFromFile.
- Limit game icons to 256x128 in GameInfoCache and IconCache.
2026-08-01 11:41:24 +02:00
Henrik Rydgård 487195acd1 Likely buildfix for CLANG64 on Windows
Fixes #21850
2026-06-22 18:55:35 +02:00
Henrik Rydgård d101abd35f Have AI fix its own bugs 2026-06-16 11:39:24 +02:00
Henrik Rydgård 2b821037d7 SDL3_ttf work 2026-06-16 11:39:24 +02:00
Henrik Rydgård 8649fec2a6 Turn off color emoji (D2D text rendering) on Windows 7. See #21834 2026-06-15 08:37:09 +02:00
Henrik Rydgård 0501dc4ec1 Just minor optimizations 2026-06-13 13:34:41 +02:00
Henrik Rydgård c5931ea690 Unify more shader uniform update code, fix bug in fallback for Uint8x3ToFloat4. 2026-06-13 10:14:39 +02:00
Kevin Reinholz d6060d4b3b Build fixes for clang on FreeBSD 2026-05-31 13:27:45 -07:00
Eric Warmenhoven 42c32db7f5 fix libretro build 2026-05-20 11:00:51 -04:00
Henrik Rydgård b2faec0533 Windows: Restore the GDI-based text drawer, use it if RenderDoc is attached
The D2D-based text renderer requires a D3D11 context, which confuses
RenderDoc (it doesn't permit multiple 3D APIs in the same process).

So, let's restore the old GDI renderer and use it if RenderDoc is attached.

See #21638
2026-05-20 10:25:29 +02:00
Henrik Rydgård 3aa4714ce0 Merge draw_text_win with draw_text_uwp. 2026-05-18 14:11:22 +02:00
Henrik Rydgård a5b110b47e Fix problem with fallback fonts looking too bold 2026-05-16 10:25:04 +02:00
Henrik Rydgård f551ac2d81 Memory handling fixes in draw_text_uwp 2026-05-04 22:34:44 +02:00
Henrik Rydgård 771f2b3fe0 Avoid creating zero-size fonts (seems to be because of an init order problem during app switching) 2026-04-28 22:18:16 +02:00
Henrik Rydgård b02c184829 Add more error checking, correct caret positioning 2026-04-27 21:08:40 +02:00
Henrik Rydgård a147e1644b Apply paranoid error checks in TextDrawerCocoa::MeasureStringInternal 2026-04-27 20:57:28 +02:00
Henrik Rydgård 2b946094a9 Warning fixes 2026-03-10 12:19:27 +01:00
myzhan af7384e8e4 Fix font rendering after window resizing on SDL(linux) 2026-03-05 13:34:38 +08:00
Henrik Rydgård e50199ad0a Fix the gemini-written video player to actually work 2026-02-26 09:33:26 +01:00
Henrik Rydgård 4f4de447dd Apply minor cleanups from #21171 2026-02-09 13:08:44 +01:00
Henrik Rydgård c77f68d005 Some additional fixes in TextDrawerSDL 2026-01-27 20:10:40 +01:00
Henrik Rydgård 24283d3e7f Fix memory leak in TextDrawerSDL (sigh, variable shadowing) 2026-01-27 20:05:24 +01:00
Henrik Rydgård 68a8ba856f Warning fix, delete unused code 2026-01-24 10:43:48 +01:00
Henrik Rydgård 3c4adc3e66 Fix a number of Android Studio lint warnings, a bad jni return type and an memory leak 2026-01-21 18:43:47 +01:00
Henrik Rydgård 6478f0dcad SDL: Fix measuring of multi-line strings.
Also, a small related optimization on Windows.
2026-01-21 13:57:51 +01:00
刘皓 fde7821b77 Merge branch 'master' into libretro-vfs 2026-01-08 11:59:20 -05:00
刘皓 295ac0e9f6 Merge branch 'master' into libretro-vfs 2026-01-02 12:58:27 -05:00
Henrik Rydgård cadbe3a2e0 Speedup text rendering on Android slightly, eliminate possible assert 2026-01-02 14:20:20 +01:00
Henrik Rydgård 8724f40c12 DrawText: Clamp strings to sane sizes. 2026-01-01 14:23:57 +01:00
刘皓 5716cbd41d Use the libretro VFS interface in libretro builds 2026-01-01 00:24:01 -05:00
Henrik Rydgård 1ea93e2913 Small refactor of text rect measurement. Add move/resize icons 2025-11-27 11:50:22 +01:00
Henrik Rydgård acd8cf70d0 SDL: Load font from VFS instead of using a file path.
Hopefully helps #21014
2025-11-24 00:55:12 +01:00
Henrik Rydgård 666808fb8c SDL: Correct font size handling 2025-11-23 22:26:32 +01:00
Henrik Rydgård bc17b7c822 iOS buildfix, SDL buildfix 2025-11-23 11:42:43 +01:00
Henrik Rydgård 1ae6d0f9f6 Installer script fix 2025-11-23 11:11:18 +01:00
Henrik Rydgård d1f6da81cb Add stb_rect_pack library, use it to pack our atlases way faster 2025-11-15 15:26:06 +01:00
Henrik Rydgård 915a88df60 AtlasGen: Separate pack and resolve steps 2025-11-15 15:26:06 +01:00
Henrik Rydgård 55d53bd29a Handle devices with really extreme DPIs. Fixes #21001
I thought I did this already but apparently not, or it got lost in a
branch.
2025-11-15 15:26:06 +01:00
Henrik Rydgård 8052c15f61 Fix references to the old font files 2025-11-14 10:10:44 +01:00
Henrik Rydgård bc024da16c More tweaks 2025-11-10 16:02:21 +01:00
Henrik Rydgård bf5e524243 Add multi-font support to the final text-rendering backend (SDL_ttf) 2025-11-09 08:52:21 +01:00