Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Commit

Permalink
emscripten: Use MAIN_THREAD_EM_ASM_*
Browse files Browse the repository at this point in the history
Minimal changes for #77/#110
  • Loading branch information
Daft-Freak committed Apr 13, 2020
1 parent 96f0024 commit c91459b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/video/emscripten/SDL_emscriptenframebuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec

/* Send the data to the display */

EM_ASM_INT({
MAIN_THREAD_EM_ASM_INT({
var w = $0;
var h = $1;
var pixels = $2;
Expand Down
6 changes: 3 additions & 3 deletions src/video/emscripten/SDL_emscriptenmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Emscripten_CreateCursor(SDL_Surface* surface, int hot_x, int hot_y)
return NULL;
}

cursor_url = (const char *)EM_ASM_INT({
cursor_url = (const char *)MAIN_THREAD_EM_ASM_INT({
var w = $0;
var h = $1;
var hot_x = $2;
Expand Down Expand Up @@ -209,7 +209,7 @@ Emscripten_ShowCursor(SDL_Cursor* cursor)
curdata = (Emscripten_CursorData *) cursor->driverdata;

if(curdata->system_cursor) {
EM_ASM_INT({
MAIN_THREAD_EM_ASM_INT({
if (Module['canvas']) {
Module['canvas'].style['cursor'] = UTF8ToString($0);
}
Expand All @@ -218,7 +218,7 @@ Emscripten_ShowCursor(SDL_Cursor* cursor)
}
}
else {
EM_ASM(
MAIN_THREAD_EM_ASM(
if (Module['canvas']) {
Module['canvas'].style['cursor'] = 'none';
}
Expand Down
10 changes: 5 additions & 5 deletions src/video/emscripten/SDL_emscriptenvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ Emscripten_VideoInit(_THIS)
/* Use a fake 32-bpp desktop mode */
mode.format = SDL_PIXELFORMAT_RGB888;

mode.w = EM_ASM_INT_V({
mode.w = MAIN_THREAD_EM_ASM_INT({
return screen.width;
});

mode.h = EM_ASM_INT_V({
mode.h = MAIN_THREAD_EM_ASM_INT({
return screen.height;
});

Expand Down Expand Up @@ -185,10 +185,10 @@ Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect *
if (rect) {
rect->x = 0;
rect->y = 0;
rect->w = EM_ASM_INT_V({
rect->w = MAIN_THREAD_EM_ASM_INT({
return window.innerWidth;
});
rect->h = EM_ASM_INT_V({
rect->h = MAIN_THREAD_EM_ASM_INT({
return window.innerHeight;
});
}
Expand Down Expand Up @@ -365,7 +365,7 @@ Emscripten_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * di

static void
Emscripten_SetWindowTitle(_THIS, SDL_Window * window) {
EM_ASM_INT({
MAIN_THREAD_EM_ASM_INT({
if (typeof Module['setWindowTitle'] !== 'undefined') {
Module['setWindowTitle'](UTF8ToString($0));
}
Expand Down

0 comments on commit c91459b

Please sign in to comment.