Commit graph

91 commits

Author SHA1 Message Date
刘皓
58e6f71ef3
Make sure sandbox stack grows upwards in big-endian libretro builds 2025-05-10 19:23:43 -04:00
刘皓
3ba12e5672
Fix handling of big-endian platforms in libretro builds
In big-endian libretro builds, the WebAssembly memory is reversed, so no
byte-swapping is required to read from/write to WebAssembly memory
(which is little-endian).

However, that means the ways to get and set values in WebAssembly memory
are endianness-dependent, so I've added the correct such ways for
big-endian platforms.
2025-05-10 18:55:14 -04:00
刘皓
13c0657691
Handle current working directory properly in libretro builds
Any relative paths that the game tries to access in libretro builds will
now be relative to whatever is the current working directory in the Ruby
sandbox, which will also now be initialized to the game directory during
initialization. Before, all of the bindings that took paths were
hardcoded to prepend the path with the game directory.
2025-05-06 16:55:28 -04:00
刘皓
a0219e7c79
Implement loading animated GIF bitmaps in libretro builds 2025-05-03 11:07:55 -04:00
刘皓
2de7a050db
Use property binding helper macros in libretro builds 2025-04-30 15:47:02 -04:00
刘皓
6c83fbe180
Implement UTF-8 parsing for Bitmap.draw_text/.text_size in libretro builds 2025-04-19 23:37:39 -04:00
刘皓
ae0a7a7f87
Implement text shadow and outline in libretro builds 2025-04-19 11:53:53 -04:00
刘皓
b3976bf61e
Fix several bugs and missing bindings in libretro builds 2025-04-16 21:57:13 -04:00
刘皓
8c16bc0092
Implement config loading in libretro builds 2025-04-11 23:12:05 -04:00
刘皓
5a0a8b76bd
Implement solid text rendering in libretro builds 2025-04-04 21:55:30 -04:00
刘皓
23781a645b
Implement bindings for changing font size and color in libretro builds 2025-03-31 18:48:14 -04:00
刘皓
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
刘皓
c2aa007228
Fix text size calculation in libretro builds
Since I got rid of SDL in libretro builds, I can't use SDL_ttf, so I
have to implement text rendering somewhat more manually. I'm still
getting the hang of it.
2025-03-27 14:59:28 -04:00
刘皓
a6393d6301
Implement rudimentary FreeType-based font rendering in libretro builds
Yes, it's quite garbage, but I'll improve on it later. What's important
is that it helps get libretro builds to a testable state.
2025-03-05 17:11:39 -05:00
刘皓
740dfd51c9
Start integrating font code into libretro builds 2025-03-04 18:52:20 -05:00
刘皓
9f33a0acea
Implement image loading in libretro builds 2025-02-25 12:53:57 -05:00
刘皓
2029539ece
Replace pixman with pixman-region in libretro builds 2025-02-24 17:13:25 -05:00
刘皓
8a8860912a
Merge branch 'libretro-compat' into libretro 2025-02-21 23:56:52 -05:00
刘皓
071be23d74
Fix some bitmap and gl-meta bugs in libretro builds 2025-02-19 21:49:59 -05:00
刘皓
20c8f6d463
Get Graphics::update() working (probably) in libretro builds 2025-02-19 18:16:08 -05:00
刘皓
7e4484a640
Start integrating the OpenGL code for sprites into libretro builds 2025-02-18 23:12:42 -05:00
刘皓
1e42180fa2
Stub out more of the sprite bindings for binding-sandbox 2025-02-05 22:30:04 -05:00
刘皓
739185594e
Implement more of binding-sandbox 2025-01-22 11:52:10 -05:00
Splendide Imaginarius
7e9937b80f Bitmap: short-circuit shader/bilinear interpolation
Benchmark shows a speedup from 10.4s to 4.1s.
2024-10-23 22:36:00 +00:00
Wayward Heart
347ef9f53c Guard against disposed source bitmaps in Bitmap::addFrame 2024-08-02 09:26:51 -05:00
Splendide Imaginarius
3376730416
Merge pull request #198 from Splendide-Imaginarius/mkxp-z-memory-leak-fix
Fix memory leak when disposing a high-res Bitmap
2024-07-15 23:57:26 +00:00
Splendide Imaginarius
83647b947d Fix memory leak when disposing a high-res Bitmap 2024-07-02 22:52:15 +00:00
Wayward Heart
9221cc7ec2 Fix major memory leak in Bitmap::initFromSurface
c89f3d5bd7 accidentally completely removed the call to free the surface when successfully creating a texture.
2024-06-02 02:02:31 -05:00
Wayward Heart
477162d1d3 Ensure that fonts for hires bitmaps get deleted. 2024-06-02 01:51:59 -05:00
Wayward Heart
65aab17dba Release resources if we error in the Bitmap constructor. 2024-06-02 01:51:59 -05:00
Splendide Imaginarius
e929cfb7c7
Merge pull request #98 from WaywardHeart/transparent-blitting
Enable transparent blitting from megatextures.
2024-04-29 12:55:43 +00:00
Splendide Imaginarius
a15e4aff14
Merge pull request #178 from Splendide-Imaginarius/mkxp-z-sprite-lanczos
Implement smooth scaling for simple sprites
2024-04-02 03:44:55 +00:00
Wayward Heart
8b14894b6f Fix blitting with negative dimensions 2024-03-24 07:47:58 -05:00
Wayward Heart
cf762c77f1 Only draw text to the hires bitmap when Hires mode is enabled 2024-03-24 07:47:58 -05:00
Wayward Heart
46d9095129 Use gl.unpack_subimage when blitting megasurfaces to textures when available 2024-03-24 07:47:58 -05:00
Wayward Heart
7539a2f34b Use SDL_LowerBlitScaled/SDL_SoftStretchLinear instead of SDL_BlitScaled 2024-03-24 07:47:58 -05:00
Wayward Heart
e477007061 Use stretchBlt in drawText 2024-03-24 07:47:58 -05:00
Wayward Heart
c89f3d5bd7 Change the create Bitmap from surface constructor to always take ownership of the surface, and provide an option to leave it as a mega surface 2024-03-24 07:47:58 -05:00
Wayward Heart
bd01e11f56 Fix blitting from megatextures
Code mostly taken from the implementation in Bitmap::drawText
2024-03-24 07:47:57 -05:00
Splendide Imaginarius
1b3d1d96c4
Merge pull request #145 from WaywardHeart/deletedBitmaps
Guard against deleted bitmaps
2024-03-22 06:47:14 +00:00
Splendide Imaginarius
58d7ec8519 Implement smooth scaling for simple sprites 2024-03-22 04:35:06 +00:00
Wayward Heart
35d46e627d Guard against deleted bitmaps
Ruby is not guaranteed to delete bitmaps after any windows, sprites, etc that they are attached to. In the event that the attached object is not deleted before the next call to Graphics.update, this will most likely result in a segfault, as isDisposed() is not guaranteed to return true for a deleted bitmap.

Bitmap::invalid was added in an attempt to guard against this for sprites, but since the bitmap in question is deleted it's not guaranteed that the pointer actually points to null, which made the fix unreliable.
2024-01-10 09:41:00 -06:00
Wayward Heart
43ac2b35a1 Don't clamp Bitmap::blit
Bitmap::stretchBlt handles that now
2024-01-05 07:33:55 -06:00
Wayward Heart
2247f1d9b7 Shrink missized blits 2024-01-05 07:33:55 -06: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
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
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
a8e6338598 Convert solidFonts config option to be an array of fonts 2023-04-12 21:03:32 -04:00
Snowdream
843e54de2e deal with a couple warnings, make sure xcode project still builds 2022-07-22 13:12:29 -04:00