Commit Graph
66 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5 375fa0fc11 Misc correctness fixes
GetStringErrorMsg had the strerror_r result test backwards. The XSI variant returns
0 on success, so every successful lookup returned "Unknown error"; and under glibc
with _GNU_SOURCE the GNU variant is selected instead, which returns the message by
pointer and typically leaves the buffer untouched, so it returned an empty string.
Either way GetLastErrorMsg() was useless on Linux, Android and macOS. Pick the right
handling by overload resolution rather than guessing which signature we got.

KeyMap's "no gamepad button mapped to cancel" fallback pushed into confirmKeys
instead of cancelKeys - and pushed the confirm button. So unmapping cancel left no
gamepad way out of menus, and duplicated an entry in the confirm list.

ControlMapper::AddListener mutated listeners_ without taking mutex_, while
RemoveListener takes it and the input thread iterates the vector under it. Opening a
screen while an axis is moving could reallocate it mid-iteration. The comment about
piggybacking on a screenmanager mutex was stale - there isn't one.

Config's two std::stof calls on PostShaderSetting values ran on user-editable ini
text with no try/catch, so a malformed entry called std::terminate during startup
config load. Use the same checked sscanf that LoadGameConfig already uses.
(CmdLine.cpp and Compatibility.cpp have the same pattern; not touched here.)

The screenshot downscale path leaked its final buffer on every downscaled shot,
which savestate thumbnails hit on every save at 3x and above.

HandleUploadPost is registered unconditionally, so closing the Upload screen left an
unauthenticated file-write endpoint live for as long as anything else kept the server
up. Check the flag in the handler.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCPmm7FoQUoqrbMdhfqhQ2
2026-08-31 01:19:06 +02:00
Henrik Rydgård 5c340ccd09 Remove the concept of scaled/offset depth buffers. 2026-06-10 10:41:30 +02:00
Henrik Rydgård a317890c08 Remove the GPUDebugInterface class
Just a pointless extra layer in the class hiearchy, making it
unnecessarily hard to modify the interface.

Might as well hit GPUCommon directly.
2026-06-02 11:15:08 +02:00
Henrik Rydgård e0d6664e85 Fix issue with raw screenshots not always being cropped correctly
Fixes #21664
2026-05-12 10:12:41 +02:00
Henrik Rydgård 2b946094a9 Warning fixes 2026-03-10 12:19:27 +01:00
Henrik Rydgård 53c4f948d3 Tweak to screenshot popup message 2026-02-13 18:16:26 +01:00
Henrik Rydgård ae6ba469c1 Fix some more screenshot problems
Followup to #21249
2026-02-13 14:56:31 +01:00
Henrik Rydgård 386fc442a6 Rework the internal screenshot API, fix bug causing screenshotting to get stuck 2026-02-13 12:34:26 +01:00
Henrik Rydgård 88266eee50 Warning fixes, comments 2026-02-10 13:59:32 +01:00
Henrik Rydgård df2d00208e Improve screenshots in "Skip buffer effects" mode 2026-02-08 16:33:48 +01:00
Henrik Rydgård 947ddf865f Extract some duplicated code into a pngSave function 2025-09-15 11:46:54 -06:00
Henrik Rydgård a3a7807aac Fix crash when taking screenshots on a thread
Forgot that we only enable android JNI on "I/O" threads.

Fixes #20139
2025-03-21 19:12:54 +01:00
Henrik Rydgård b421c0791f Perform screenshot processing (including image encode) on background tasks 2025-03-20 20:48:51 +01:00
Henrik Rydgård ae8f8c4abd Refactor TakeGameScreenshot a bit. 2025-03-20 17:41:44 +01:00
Henrik Rydgård 3ccd6d17c9 Reduce logspam from failed screenshots for savestates. Fixes #19946 2025-03-02 20:14:03 +01:00
Henrik Rydgård c91169e702 Restore removed <algorithm> includes.
Turns out these were needed after all. For some reason, on Windows and
Mac, <algorithm> gets auto-included by something else so I don't notice
when it's missing, and MSVC's include dependency tracker doesn't see it
either.
2024-12-19 09:53:07 +01:00
Henrik Rydgård 3e198c53b2 More include cleanup 2024-12-18 13:57:26 +01:00
Henrik Rydgård 0df2a40487 Remove the "GPUInterface" base class. Not really useful, GPUCommon is pretty much the same thing. 2024-12-02 11:12:14 +01:00
Henrik Rydgård 271d2b41fa Bugfix taking screenshots of rotated framebuffers, common in Vulkan on many Android devices 2024-11-07 10:17:56 +01:00
Henrik Rydgård e01ca5b057 Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
Henrik Rydgård d21fef52ae Allow taking screenshots in the app menu 2024-05-10 21:10:11 +02:00
Henrik Rydgård bac4a01209 Enforce a max size for save state screenshot regardless of resolution mode (auto, skipbuf etc). 2023-12-15 12:35:34 +01:00
Henrik Rydgård 797f88bf31 Fix ordering problem with screenshots that was causing crashes.
Fixes #17781
2023-08-23 19:03:33 +02:00
Henrik Rydgård 8b431b39ba Wrap the display globals in a struct (#16998)
* Wrap the display globals in a struct

Makes it easier to search/replace these, for future refactorings.

* Some renaming

* Qt buildfix, also fix the Qt build on Mac (got broken with battery changes)

* Attempt at buildfixing ios

* UWP buildfix
2023-02-25 13:09:44 +01:00
Unknown W. Brackets f44852bb18 Global: Cleanup virtual/override specifiers.
Also missing virtual destructors, hidden non-overrides, etc.
2022-12-10 21:13:36 -08:00
Unknown W. Brackets 3cc628beb4 GE Debugger: Copy images optionally with alpha.
Although, lots of apps don't support this.
2022-09-24 11:43:52 -07:00
Henrik Rydgård 025bcb1673 Introduce Path, start using it all over the place.
Still lots left to convert!

Convert GetSysDirectory to return Path.

More buildfixing

Remove unnecessary Path( constructors
2021-05-13 10:39:16 +02:00
Unknown W. Brackets 8a8328c431 Common: Move ColorConv to a more appropriate place. 2021-05-01 11:20:05 -07:00
Unknown W. Brackets 28a4057115 GPU: Rotate screenshot framebuffer per display. 2021-02-19 22:57:34 -08:00
Unknown W. Brackets e4ad514e42 Qt: Remove Qt-specific screenshot path. 2020-10-18 20:46:09 -07:00
Henrik Rydgård 4f43cff5ca Move fileutil, net, image loaders, ui to Common. (#13506)
* Move and rename file_util/fd_util to Common/File/FileUtil and DirListing

Let's also move net while we're at it.

Move the ZIM/PNG loaders over to Common.

Move the UI framework into Common

iOS buildfix

* Buildfix

* Buildfixes

* Apple buildfix

* This typo again..

* UWP buildfix

* Fix build of PPSSPPQt, such as it is (it's not in good condition...)

* Guess what? Another buildfix.
2020-10-04 20:48:47 +02:00
Henrik Rydgård 989e353482 Common.h shouldn't include Log.h.
Buildfixes

More buildfixes. Move JSON code to common.
2020-10-04 11:42:14 +02:00
Henrik Rydgård 0fcc0994b4 Recategorize some logging, in preparation for what's to come. 2020-08-15 11:51:22 +02:00
Henrik Rydgård c5e0b799d9 Remove category from _assert_msg_ functions. We don't filter these by category anyway.
Fixes the inconsistency where we _assert_ didn't take a category but
_assert_msg_ did.
2020-07-19 20:33:25 +02:00
orbea c8c7889f0f cmake: Improve building with the system libpng.
This also now requires at least libpng16 instead of libpng17.

v2: Require libpng17 on arm platforms.
v3: Fix the android and windows travis builds.
2020-03-22 18:43:51 -07:00
Henrik Rydgård eb3faf5370 Fix some further static analysis warnings 2019-06-18 01:08:25 +02:00
Unknown W. Brackets 554a85e6d8 GE Debugger: Save with alpha for PNGs. 2017-12-21 23:47:49 -08:00
Unknown W. Brackets b56aceb227 Core: Allow more formats for screenshot.
This allows depth and stencil formats too, so we can use for debugger
export.
2017-12-21 16:39:01 -08:00
Unknown W. Brackets 79dc857527 Core: Refactor screenshot saving.
So we can reuse the actual saving.
2017-12-21 15:44:49 -08:00
Henrik Rydgård 440e72d250 Clean up among the logs. Remove MASTER_LOG. 2017-03-06 13:10:23 +01:00
Henrik Rydgard 37646d67b7 Don't crash when trying to take screenshots outside a game. 2017-03-05 20:18:37 +01:00
Henrik Rydgard fcbc20f240 Small changes to make Common and Core build under my preliminary UWP setup. 2017-02-24 18:59:41 +01:00
Henrik Rydgard f1c96c056d Move all the GL/D3D9 FBO code into thin3d. 2017-02-06 11:40:16 +01:00
Unknown W. Brackets 4d0c457ddc Cleanup display vs. output screenshot terminology. 2016-09-25 16:35:43 -07:00
Unknown W. Brackets fa0e88f1b7 Add a flag to use the display vfb for screenshots.
This fixes proportions of reporting, savestate screenshots, and TAS
recording for PS1 ports, mainly.
2016-09-25 16:32:18 -07:00
Chris Burgener 7d089a0f76 Clean up various files 2016-09-03 19:23:17 -04:00
Unknown W. Brackets 6151f8ef9f Allow taking screenshots with a clamped size.
Sometimes 10x is a little on the big side.
2016-06-12 07:09:01 -07:00
Henrik Rydgard 7cb6192005 Rename the TransformPipeline files to DrawEngine, and GLES_GPU to GPU_GLES 2016-04-10 10:31:42 +02:00
Henrik Rydgard e611915a52 Rename some GPU classes and enums to fix some consistency issues between the backends. 2016-04-10 10:21:48 +02:00
Unknown W. Brackets 76ed1e10c4 Limit savestate screenshots to top left of screen.
Sometimes framebuffers have extra stuff outside, we don't need that in the
screenshot.  Fixes #8552.
2016-02-07 00:04:12 -08:00