Commit graph

85 commits

Author SHA1 Message Date
刘皓
ced3e697bd
Fix Graphics.fadeout/.fadein causing screen flashing in libretro builds 2025-04-18 11:54:23 -04:00
刘皓
35ffaff26e
Add bindings for snap_to_bitmap in libretro builds 2025-04-17 00:00:03 -04:00
刘皓
8c16bc0092
Implement config loading in libretro builds 2025-04-11 23:12:05 -04:00
刘皓
299650159f
Implement changing the frame rate in libretro builds 2025-04-10 16:51:25 -04:00
刘皓
b1f1fb7571
Make Graphics.transition a no-op in libretro builds when not frozen 2025-04-05 21:37:27 -04:00
刘皓
d60b23781b
Implement Graphics.transition binding and related bindings in libretro builds 2025-04-05 14:35:43 -04:00
刘皓
efde7d527d
Change the macros in graphics.cpp temporarily for testing purposes in libretro builds 2025-02-26 23:55:36 -05:00
刘皓
3c878ef4c1
Set all OpenGL state again every frame in libretro builds, not just the viewport
Since the libretro frontend can do whatever to the OpenGL state between
frames, we can't make any assumptions about the state at the beginning
of a frame.
2025-02-26 17:58:41 -05:00
刘皓
c01917cac8
Set OpenGL viewport every frame in libretro builds 2025-02-26 12:48:01 -05:00
刘皓
9f33a0acea
Implement image loading in libretro builds 2025-02-25 12:53:57 -05:00
刘皓
20c8f6d463
Get Graphics::update() working (probably) in libretro builds 2025-02-19 18:16:08 -05:00
Splendide Imaginarius
fa80e5b24a
Merge pull request #207 from WaywardHeart/memory-leaks
Fix some more memory leaks and improve behavior of disposed objects
2024-09-03 01:36:48 +00:00
Splendide Imaginarius
d2d46b282e
Merge pull request #152 from Eblo/movie-audio-termination-bugfix
Check for audioThreadTermReq in movie audio thread
2024-08-30 13:08:29 +00:00
Wayward Heart
99ad4fa636 Throw exceptions for Resets and Exits instead of directly raising.
While this does close small memory leaks, this is mostly for threading reasons. We're not supposed to call rb_raise with the gvl released, and calling rb_raise prevents GFX_UNLOCK from being called, which would cause problems for any games that want to call graphical operations in multiple threads should the user reset.

We're also now calling Graphics.__reset__ and Audio.__reset__ via eval instead of directly calling the functions, in case a game wants to hook them.
2024-08-02 09:26:51 -05:00
Splendide Imaginarius
568abc7b26 Remove framerate restrictions
If game devs want to use framerates outside of Enterbrain's arbitrary
restrictions, there's no reason for us to prevent it. Same reason we
don't restrict the resolution.

Fixes https://github.com/mkxp-z/mkxp-z/issues/64
2024-07-29 01:16:21 +00:00
Splendide Imaginarius
c12f00c537
Merge pull request #164 from WaywardHeart/snapToBitmap-composite
Graphics::snapToBitmap needs to call p->screen.composite()
2024-04-29 20:55:21 +00:00
Splendide Imaginarius
0d54b47040 Fix shState segfault 2024-03-21 21:31:45 +00:00
Splendide Imaginarius
58a3c36a10 Fix Hires mode with default resolution 2024-03-21 06:18:55 +00:00
Splendide Imaginarius
ebcb0e2486 Allow independent upscale/downscale interpolation methods 2024-03-21 03:03:08 +00:00
Splendide Imaginarius
a7841e978b
Merge pull request #168 from Splendide-Imaginarius/mkxp-z-lanczos-short-circuit-part1
Graphics: short-circuit shader interpolation
2024-03-18 10:27:14 +00:00
Splendide Imaginarius
4658487bb7
Merge pull request #86 from Eblo/graphics-transition-fps-bugfix
Graphics.transition average FPS bugfix
2024-03-17 03:49:10 +00:00
Splendide Imaginarius
37f40ab887 Graphics: short-circuit shader interpolation
Boosts framerate from ~35fps to ~95fps in the Lanzcos short-circuit case.
2024-01-24 00:06:40 +00:00
Wayward Heart
0a8b24a5ec Graphics::snapToBitmap needs to call p->screen.composite() 2024-01-22 09:32:57 -06:00
Eblo
a11a581a01
Check for audioThreadTermReq in movie audio thread 2024-01-13 21:16:20 -05:00
Splendide Imaginarius
7032dccbc7 Add Bitmap constructors that take a TEXFBO or an SDL_Surface
Refactor snapToBitmap to use it, and add ability to dump VX Atlas with it.
2023-11-27 22:47:24 +00:00
Splendide Imaginarius
6f20252e04 Movie: create Bitmap without Hires replacement
Fixes black screen when videos play when Hires mode is enabled.

(Doesn't actually enable Hires Movie replacement yet.)

Thanks Eblo for reporting the bug.
2023-11-27 20:53:42 +00:00
Eblo
7a12e6ddcf
Graphics.transition average FPS bugfix
Move average FPS update logic into new function updateAvgFPS()
Call this during Graphics.transition so that the FPS counter does not erroneously drop
2023-10-31 09:36:41 -04:00
Splendide Imaginarius
3ecb09d050 Fold lanczos3Scaling config into smoothScaling
Thanks to Riley Pierce for the suggestion.

Fixes https://github.com/mkxp-z/mkxp-z/issues/73
2023-10-26 18:35:39 +00:00
Splendide Imaginarius
11a1fef1c3 Implement hi-res Bitmap replacement 2023-10-25 15:39:28 +00:00
Eblo
2894880550
Movie audio disposal bugfix
Put the audioThread check within the hasAudio conditional in the movie destructor
The order is significant, as trying to dispose of OpenAL objects before audioThread is complete can result in hanging
2023-10-10 21:27:15 -04:00
Eblo
6341772866
Only dispose of movie audio if the movie has audio (#27)
This fixes a crash that occurs when trying to dispose of audio when the movie does not have any
2023-10-08 22:33:12 -04:00
Amaryllis Kulla
fae7fa9c4e
Update ancurio's copyright notice (#29) 2023-10-04 15:07:34 -04:00
Struma
c9378cfaba update Input.repeat timing on each Graphics.update
Instead of updating the `Input.repeat?` frame timing every time
`Graphics.frame_rate=` is called, automatically set it to the
current average framerate (or close to it)
2023-07-06 23:58:18 -04:00
Struma
34ef0c34a5 make fixedAspectRatio do what it's supposed to 2023-05-10 22:22:50 -04:00
Struma
0072c19371 Multiple changes
+ Time is now measured in fractions of a second, not microseconds
+ Viewports in RGSS1 will now only retain weak references to their children
+ Invalid Sprite bitmaps found during Graphics.update will be treated as null
+ Bitmap#mega? and Bitmap#animated? are properly rescued
2023-05-03 23:00:06 -04:00
Struma
ffec966ad7 fix whatever 5c69aeaeab (r105961101) is about 2023-04-25 22:48:24 -04:00
Eblo
5c69aeaeab Convert movie playback to use OpenAL instead of SDL for audio
Use OpenAL instead of SDL for processing movie playback audio
Make sure video and audio are in sync based on playback position
General code cleanup of movie playback
2023-02-15 07:52:33 -05:00
Zorua
6007c45c8a Add Graphics.display_width & Graphics.display_height 2022-09-24 03:09:53 -04:00
Snowdream
58de823d41 Move rqWindowAdjust.set() to EventThread 2022-07-24 03:50:06 -04:00
Snowdream
dba559aafb Make Graphics thread-safety optional 2022-07-16 20:16:09 -04:00
Snowdream
b0e08f60bb Should actually check for integerScalingActive before rebuilding the buffer 2022-07-12 00:54:32 -04:00
Snowdream
2a7ac88668 Always rebuild int scale buffer on resize_screen 2022-07-12 00:41:55 -04:00
Snowdream
e5e5a3a5e0 update stored window values before resizing it 2022-07-09 05:20:41 -04:00
Struma
d4dc31af9e Add Graphics.resize_window 2022-07-05 08:42:26 -04:00
Struma
63442ee5d9 Correctly report Graphics.scale after HiDPI changes 2022-07-05 07:38:44 -04:00
Struma
45f870b86c Fix integer scaling bugs
- Black screen when resizing below 1x
- int scaling causing incorrectly scaled image after resize
- display offset being completely off without lastmile on macOS
2022-07-05 00:02:24 -04:00
Struma
4b46d6e47d remove commonDataPath and update mkxp.json to match the actual behavior 2022-07-04 11:18:22 -04:00
Struma
183cea7046 Fix reported mouse coordinates when scaled for HiDPI 2022-07-04 09:40:57 -04:00
Struma
158c988399 Make macOS happy. 2022-07-04 06:22:07 -04:00
Struma
2a7ff4b7f3 Bind new graphics functions ruby-side 2022-07-03 10:01:07 -04:00