mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-23 23:33:45 +02:00
Fix Bitmap.blt
and Bitmap.stretch_blt
in libretro builds
Whoops, I accidentally switched these two functions!
This commit is contained in:
parent
7d557354da
commit
85025c5f33
2 changed files with 36 additions and 36 deletions
|
@ -149,41 +149,6 @@ namespace mkxp_sandbox {
|
|||
}
|
||||
|
||||
static VALUE blt(int32_t argc, wasm_ptr_t argv, VALUE self) {
|
||||
SANDBOX_COROUTINE(coro,
|
||||
VALUE destRectObj;
|
||||
VALUE srcObj;
|
||||
VALUE srcRectObj;
|
||||
int opacity;
|
||||
|
||||
VALUE operator()(int32_t argc, wasm_ptr_t argv, VALUE self) {
|
||||
BOOST_ASIO_CORO_REENTER (this) {
|
||||
destRectObj = ((VALUE *)(**sb() + argv))[0];
|
||||
srcObj = ((VALUE *)(**sb() + argv))[1];
|
||||
srcRectObj = ((VALUE *)(**sb() + argv))[2];
|
||||
if (argc > 3) {
|
||||
SANDBOX_AWAIT_AND_SET(opacity, rb_num2int, ((VALUE *)(**sb() + argv))[3]);
|
||||
}
|
||||
|
||||
Bitmap *src = get_private_data<Bitmap>(srcObj);
|
||||
if (src != NULL) {
|
||||
Rect *destRect = get_private_data<Rect>(destRectObj);
|
||||
Rect *srcRect = get_private_data<Rect>(srcRectObj);
|
||||
if (argc > 4) {
|
||||
GFX_GUARD_EXC(get_private_data<Bitmap>(self)->stretchBlt(destRect->toIntRect(), *src, srcRect->toIntRect(), opacity););
|
||||
} else {
|
||||
GFX_GUARD_EXC(get_private_data<Bitmap>(self)->stretchBlt(destRect->toIntRect(), *src, srcRect->toIntRect()););
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
)
|
||||
|
||||
return sb()->bind<struct coro>()()(argc, argv, self);
|
||||
}
|
||||
|
||||
static VALUE stretch_blt(int32_t argc, wasm_ptr_t argv, VALUE self) {
|
||||
SANDBOX_COROUTINE(coro,
|
||||
int x;
|
||||
int y;
|
||||
|
@ -219,6 +184,41 @@ namespace mkxp_sandbox {
|
|||
return sb()->bind<struct coro>()()(argc, argv, self);
|
||||
}
|
||||
|
||||
static VALUE stretch_blt(int32_t argc, wasm_ptr_t argv, VALUE self) {
|
||||
SANDBOX_COROUTINE(coro,
|
||||
VALUE destRectObj;
|
||||
VALUE srcObj;
|
||||
VALUE srcRectObj;
|
||||
int opacity;
|
||||
|
||||
VALUE operator()(int32_t argc, wasm_ptr_t argv, VALUE self) {
|
||||
BOOST_ASIO_CORO_REENTER (this) {
|
||||
destRectObj = ((VALUE *)(**sb() + argv))[0];
|
||||
srcObj = ((VALUE *)(**sb() + argv))[1];
|
||||
srcRectObj = ((VALUE *)(**sb() + argv))[2];
|
||||
if (argc > 3) {
|
||||
SANDBOX_AWAIT_AND_SET(opacity, rb_num2int, ((VALUE *)(**sb() + argv))[3]);
|
||||
}
|
||||
|
||||
Bitmap *src = get_private_data<Bitmap>(srcObj);
|
||||
if (src != NULL) {
|
||||
Rect *destRect = get_private_data<Rect>(destRectObj);
|
||||
Rect *srcRect = get_private_data<Rect>(srcRectObj);
|
||||
if (argc > 4) {
|
||||
GFX_GUARD_EXC(get_private_data<Bitmap>(self)->stretchBlt(destRect->toIntRect(), *src, srcRect->toIntRect(), opacity););
|
||||
} else {
|
||||
GFX_GUARD_EXC(get_private_data<Bitmap>(self)->stretchBlt(destRect->toIntRect(), *src, srcRect->toIntRect()););
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
)
|
||||
|
||||
return sb()->bind<struct coro>()()(argc, argv, self);
|
||||
}
|
||||
|
||||
static VALUE fill_rect(int32_t argc, wasm_ptr_t argv, VALUE self) {
|
||||
SANDBOX_COROUTINE(coro,
|
||||
Bitmap *bitmap;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#define WASM_PAGE_SIZE ((uint64_t)65536U)
|
||||
|
||||
#define WASM_MIN_PAGES ((uint32_t)2048U)
|
||||
#define WASM_MIN_PAGES ((uint32_t)4096U)
|
||||
|
||||
extern "C" bool wasm_rt_is_initialized(void) {
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue