Commit graph

324 commits

Author SHA1 Message Date
刘皓
5048efe1b4
Merge branch 'dev' into libretro 2025-07-03 22:09:46 -04:00
Splendide Imaginarius
75f9caadbb Fix misspelling of "occurred" 2025-07-03 22:31:40 +00:00
刘皓
b7b5e23e18
Implement system bindings in libretro builds 2025-06-03 23:06:05 -04:00
刘皓
addf927922
Merge branch 'misc-fixes' into libretro 2025-06-03 11:36:20 -04:00
刘皓
f1cb1fc533
Change Input::getClipboardText() to return std::string instead of const char * 2025-06-03 11:35:27 -04:00
刘皓
ede42dbb1b
Fix serialization of Tilemap::Autotiles and TilemapVX::BitmapArray in libretro builds, for real this time 2025-05-27 19:11:58 -04:00
刘皓
551206e7b4
Don't set private data if an exception has occurred in the bindings 2025-05-20 18:58:44 -04:00
刘皓
79199ccd7a
Allow json5pp to report syntax errors and bad casts even with -fno-exceptions 2025-05-17 22:57:31 -04:00
刘皓
83a6b7a1f1
Re-add missing GFX_LOCK/GFX_UNLOCK calls in binding-sandbox 2025-05-17 19:41:43 -04:00
刘皓
c18e7e28a3
Fix free being called on null pointer in Graphics.snap_to_bitmap in standalone builds 2025-05-17 18:20:17 -04:00
刘皓
2f589e1cf4
Fix compilation errors in binding/ in standalone builds 2025-05-17 17:21:51 -04:00
刘皓
a40f6e7659
Fix some compiler warnings in libretro builds 2025-05-01 11:58:43 -04:00
刘皓
2a1b4ca46b
Merge branch 'misc-fixes' into libretro 2025-04-26 18:34:49 -04:00
刘皓
8d1bcd124e
Fix possible buffer overflow in stringify bindings for Color and Tone 2025-04-26 18:14:23 -04:00
刘皓
d60b23781b
Implement Graphics.transition binding and related bindings in libretro builds 2025-04-05 14:35:43 -04:00
刘皓
cb302d2475
Fix implementation of OBJ_INIT_COPY for Ruby < 1.9 2025-03-18 18:41:28 -04:00
刘皓
5c0e06eaf4
Use vcs_tag to get Git version instead of run_command
This way Meson will automatically keep the Git hash updated as you make
new Git commits, rather than forcing you to reconfigure the build again
every time you make a new commit to keep the commit hash updated.

(cherry picked from commit b9bb3535ae)
2025-02-27 23:41:40 -05:00
Splendide Imaginarius
711f9a4553
Merge pull request #158 from Nathan-MV/plugin-script
Some checks failed
Automatic Build / Ubuntu 22.04 x86_64 (push) Failing after 5s
Automatic Build / Ubuntu 22.04 arm64 (push) Failing after 3s
Automatic Build / Ubuntu 22.04 armv6 (push) Failing after 3s
Automatic Build / Ubuntu 22.04 armv7 (push) Failing after 2s
Automatic Build / Ubuntu 22.04 power8le (push) Failing after 2s
Automatic Build / Ubuntu 22.04 armv7-neon (push) Failing after 2s
Automatic Build / Ubuntu 22.04 power9le (push) Failing after 2s
Automatic Build / Ubuntu 22.04 riscv64 (push) Failing after 2s
Automatic Build / Ubuntu 22.04 s390x (push) Failing after 2s
Automatic Build / Windows (push) Has been cancelled
Automatic Build / macOS (push) Has been cancelled
Postload Scripts
2024-10-26 19:41:41 +00:00
Nathan-MV
17f9ec9c19 postload scripts 2024-10-26 14:24:32 +00:00
Nathan-MV
f27018912c fix conflicts with #207 2024-09-29 11:51:23 +00:00
Snowdream
d4bf2123a9 T++ CSVs do not have headers, don't try to read 'em 2024-09-29 11:43:30 +00:00
Snowdream
ab2f477031 Correctly parse CSVs with newlines within quoted strings 2024-09-29 11:43:30 +00:00
Snowdream
7c066151ff Add a function to parse CSV files to multidimensional arrays. 2024-09-29 11:43:30 +00:00
Wayward Heart
f17c5c3a05 Don't raise if the game attempts to retrieve the autotiles/bitmaps from a disposed Tilemap. 2024-09-02 15:22:41 -05:00
Wayward Heart
cf43cf005b Don't store Exception objects' messages on the stack. 2024-08-27 22:20:36 -05:00
Wayward Heart
130375b6d8 Properly handle uninitialized and reinitialized objects
In RGSS, uninitialized disposable objects (and Fonts, sort of) are technically disposed, and other objects (Tone, Color, Rect, and Table) are created with all values set to 0. It's also possible to reinitialize them, although reinitializing disposables leaks memory.

This commit causes MiniFFI and FileInt objects to improperly raise disposed errors if used while uninitialized, but that feels acceptable to me.
2024-08-02 09:26:51 -05: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
Wayward Heart
a73f9ccc1f Prevent memory leaks from rb_raise
rb_raise calls longjmp, which bypasses C++ destructors, and also keeps the error for catch blocks from being unallocated if passed by reference, which we do for exceptions.

Some of the calls I left can still jump out of try blocks, which you're not supposed to do, but there shouldn't be any objects with destructors initialized at those points so it's probably fine.
2024-08-02 09:26:51 -05:00
Wayward Heart
23e9f6cb1c Move the GFX_LOCK/GFX_UNLOCK call for disposing into disposable.h.
It's currently not (much of) a problem because few or no games use multiple threads, but I believe that ruby can run its garbage collector while the GVL is released, which means that Graphics.update and Graphics.wait are currently not thread safe.

Moving the call to GFX_LOCK into dispose() should fix this.
2024-06-02 01:51:59 -05:00
Wayward Heart
477162d1d3 Ensure that fonts for hires bitmaps get deleted. 2024-06-02 01:51:59 -05:00
Splendide Imaginarius
b42c13a8ca
Merge pull request #163 from WaywardHeart/hang-on-close
Don't hang if the user closes the game while it's still initializing
2024-04-29 20:53:00 +00:00
Wayward Heart
9e8132ba25 Don't hang if the user closes the game while it's still initializing 2024-01-22 08:16:32 -06:00
Wayward Heart
67926b17f5 Use signals to dispose of the children of Viewports in RGSS1
The weak references method was throwing errors if the object id had already been recycled
2024-01-11 10:57:00 -06: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
Amaryllis Kulla
fae7fa9c4e
Update ancurio's copyright notice (#29) 2023-10-04 15:07:34 -04:00
Riley Pierce
0a28d4cf3c
add system.file_exist? (#19)
binding to the internal filesystem.exists, a less janky way of checking if a file exists in the path cache
2023-08-01 03:28:08 -04:00
Struma
ee8dc7e0fa make Input time functions return the correct type 2023-05-28 20:24:27 -04:00
Struma
39f7cb45b7 Adjust error messages for script load failure 2023-05-21 19:48:33 -04:00
Struma
b0d8e0b2ba Allow passing nil as a track to BGM functions 2023-05-20 14:54:09 -04:00
Struma
fa0e60b7fc Add git hash to System::VERSION
I don't really plan on putting out another "release tag" anytime soon,
so the hash for the current git commit is being added to the version string
to help tell the difference between one build and the other.
2023-05-19 08:49:32 -04:00
Struma
959e983884 Remove collected sprite IDs from their viewports 2023-05-08 23:38:54 -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
1cfbac0c41 clean up stuff + add multitrack setting to json 2023-04-23 20:38:35 -04:00
Struma
5d39805aeb bgm_play, bgm_stop and bgm_fade should default to stopping/fading all channels when no channel is specified 2023-04-22 10:22:26 -04:00
Struma
6e9e8a4075 allow multiple channels of BGM, and add functions to adjust playing BGM volume 2023-04-22 10:22:26 -04:00
Struma
c62a8dfd3a emplace bad 2023-04-12 22:53:18 -04:00
Struma
e91c470ea0 make config code slightly more readable 2023-04-12 22:28:03 -04:00
Struma
745dc3854f fix loading settings from json erasing other things set within the same session 2023-04-12 21:03:32 -04:00
Splendide Imaginarius
963bd856cf
Update JIT for Ruby v3.1.0+ (#7)
* Fix MJIT options for Ruby v3.1.0+

* Support YJIT
2023-03-03 08:56:23 -05:00