Commit graph

60 commits

Author SHA1 Message Date
刘皓
81b94d1498
Remove dependency on SDL headers in libretro builds
I'd already removed the SDL static libraries from libretro builds for
portability, but kept the headers to make it easier to port the codebase
to libretro. Eventually it was time to stop using the SDL headers as a
crutch.
2025-03-29 12:37:07 -04:00
刘皓
f4659619b0
Fix Audio.bgm_stop in libretro builds
Now it actually stops the audio instead of doing nothing.

Also, calling `Audio.bgm_stop` was causing a crash in Emscripten due to
an exception being thrown internally in OpenAL Soft and C++ exceptions
being disabled when targeting Emscripten. Shouldn't happen anymore.
2025-02-08 16:48:59 -05:00
刘皓
c42949713d
Start integrating the audio code into libretro builds 2025-01-27 00:34:52 -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
21fac5a946 Autohide mouse cursor after half a second 2023-10-17 04:38:05 -05:00
Amaryllis Kulla
fae7fa9c4e
Update ancurio's copyright notice (#29) 2023-10-04 15:07:34 -04:00
Struma
158c988399 Make macOS happy. 2022-07-04 06:22:07 -04:00
Struma
5f4b644bd0 switch to a (mostly) functioning GameController API 2022-07-03 21:36:48 -04:00
Struma
342f30069f Add Mouse4, Mouse5 and scroll wheel bindings 2022-07-03 11:53:40 -04:00
Struma
35d776abd7 Make sure joysticks connected at startup are detectable by ruby 2021-08-21 03:52:50 -04:00
Struma
9920de87f8 Make json config accessible from System::CONFIG 2021-06-22 18:32:39 -04:00
Struma
f1f5f99133 Have window resizing functions properly wait on each other 2021-05-21 17:13:53 -04:00
Struma
699ffc0245 Support Retina displays 2021-05-21 16:28:51 -04:00
Struma
69a89cf87f sync thread access to text input buffer 2021-03-08 06:20:43 -05:00
Struma
1683483170 Make FPS counter a little more accurate 2021-03-01 01:51:15 -05:00
Struma
653eb0118b Remove haptic code 2021-02-23 17:25:07 -05:00
Struma
7db1c1219e Prefix mkxp-z preprocessor definitions with MKXPZ_ 2020-12-31 14:50:07 -05:00
Struma
0179e6a75b Revert "Remove haptics code"
Some part of this completely breaks the frame limiter.
I do not know which part
2020-12-25 19:41:16 -05:00
Struma
d565650975 Remove haptics code
It never worked anyway, as far as anyone knew, and is probably
not a feature anyone particularly needs.
2020-12-25 12:01:41 -05:00
Struma
a17258fbf0 Fix ALCdevice typedef for openal >=1.20.1 2020-03-11 13:57:30 -04:00
Inori
1e63c65c73 Setup GL context in main thread (macOS 10.15 requires it) 2019-10-17 08:44:21 -04:00
Inori
582eee853b Test controller rumble support 2019-09-19 01:33:04 -04:00
Inori
4e7e7b740a Add MKXP.show_settings 2019-09-17 01:42:50 -04:00
Inori
939c601aea Add Input.joystick 2019-09-16 23:10:46 -04:00
Inori
ac28861587 Add text input functionality to Input module 2019-09-05 23:57:10 -04:00
Inori
6b007ed8d9 Implement Graphics.center 2019-08-31 12:55:03 -04:00
Inori
6f2a9d66cb Rename window from event thread 2019-08-31 01:41:04 -04:00
Inori
3c157daf34 Reposition window from event thread 2019-08-31 00:31:17 -04:00
Jonas Kulla
3ea24bd757 EventThread: Make system cursor visible over black aspect ratio bars
Should be less confusing for the player.
2017-04-08 18:45:24 +02:00
Jonas Kulla
7c6a2b2c62 Pause RGSS execution when moving into background on Android
Assuming that there is enough memory for mkxp to stay in the
background and that the OS doesn't kill the process, this should
allow smooth resuming after moving back into the foreground.

For now, EGL context loss is not handled.
2015-01-15 08:02:21 +01:00
Jonas Kulla
7003039e56 EventThread: Track touch state (maximum 4 fingers) 2015-01-03 19:18:52 +01:00
Jonas Kulla
146e0294b4 Add option to fix the framerate to the native screen refresh rate
Useful on mobile devices where using non-standard framerates
looks absolutely horrible and screen refresh rates vary highly.
2015-01-03 18:58:13 +01:00
Jonas Kulla
3411435138 Factor out some thread communication code (window size, bindings) 2015-01-02 01:41:23 +01:00
Jonas Kulla
7cbf81c83a Add 'printFPS' config entry to continuously print FPS to console
Useful on platforms that don't have window decorations.
2014-12-31 18:52:21 +01:00
Jonas Kulla
5974d05380 Create OpenAL device in main() and store in RGSSThreadData 2014-12-31 18:52:21 +01:00
David Salvisberg
90e1c09711 Added support for JHat events. 2014-12-31 16:39:28 +01:00
Jonas Kulla
4a8b0f30c8 MRI: Add 'System.raw_key_states' to query full keyboard state
Returns a byte array with all key states (0 = released,
1 = pressed) indexed via SDL_SCANCODE_* enums.
2014-10-20 10:27:01 +02:00
Jonas Kulla
dd73db2e9d Introduce F1 menu to reconfigure key bindings at runtime 2014-10-11 20:48:44 +02:00
Jonas Kulla
51a0f3903c Audio: Clean up threading and add AudioStream fadein (RGSS3) 2014-09-30 09:13:12 +02:00
Jonas Kulla
d223d83cbf Implement F12 game reset (MRI only)
Can be disabled with "enableReset=false".

While at it, also replace the flakey volatile bool flags
with proper atomics.
2014-09-26 06:25:47 +02:00
Jonas Kulla
f11cc182df Remove screenshot functionality
It was only meant for debugging and brought with it
unneeded platform dependant issues.
2014-04-16 13:48:45 +02:00
Jonas Kulla
8ed6de22a4 Input: Return const -20 mouse position when outside window 2014-01-05 01:15:33 +01:00
Jonas Kulla
5f16eef273 EventThread: Properly allocate SDL user event codes 2014-01-02 02:22:10 +01:00
Jonas Kulla
0a336ea315 Spacing 2014-01-02 00:17:31 +01:00
Edward Rudd
f8e8d704b5 use copy construction to pass the config along so the main constructor gets run once. 2013-12-31 17:23:15 -05:00
Jonas Kulla
2adf8ab265 Transition from QtCore to stdc++ / STL / boost
This looks like a pretty major change, but in reality,
80% of it is just renames of types and corresponding
methods.

The config parsing code has been completely replaced
with a boost::program_options based version. This
means that the config file format slightly changed
(checkout the updated README).

I still expect there to be bugs / unforseen events.
Those should be fixed in follow up commits.

Also, finally reverted back to using pkg-config to
locate and link libruby. Yay for less hacks!
2013-12-29 13:59:26 +01:00
Jonas Kulla
231e38ae8e Replace QVector, QList with std::vector, std::list
An exception is made of TexPool, which will need a
bit more testing before transitioning to std containers.

Also replace 'int' with 'size_t' where it is used only
as an array index.
2013-12-26 20:18:33 +01:00
Jonas Kulla
cb36a28b09 Add a very crude screenshot function (press F3)
Files are named after the current date+time (down to seconds),
and written to the gameFolder directory.
2013-12-20 09:17:15 +01:00
Jonas Kulla
ef2430e0c3 Sanitize #include statements
The general rule I'm aiming for is to <> include
system wide / installed paths / generally everything
that's outside the git managed source tree (this means
mruby paths too!), and "" include everything else,
ie. local mkxp headers.

The only current exception are the mri headers, which
all have './' at their front as to not clash with
system wide ruby headers. I'm leaving them be for now
until I can come up with a better general solution.
2013-12-04 17:48:37 +01:00
Jonas Kulla
8dd6b63fc4 EventThread: Mouse button IDs greater than 'SDL_BUTTON_X2' are possible 2013-10-29 08:54:57 +01:00