From 97b60b1e20e209bc1fa4a8fb417e6a78335115dc Mon Sep 17 00:00:00 2001 From: Alwin Garside Date: Sun, 13 Mar 2016 15:30:30 +0100 Subject: [PATCH] Fixed emscripten build --- content.c | 2 ++ frontend/drivers/platform_emscripten.c | 1 + gfx/drivers/gl.c | 2 ++ gfx/drivers_context/emscriptenegl_ctx.c | 7 +++---- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/content.c b/content.c index 3bb8ba8cc1..448b02aea3 100644 --- a/content.c +++ b/content.c @@ -1760,8 +1760,10 @@ bool content_ctl(enum content_ctl_state state, void *data) content_ctl(CONTENT_CTL_STREAM_INIT, NULL); stream = (content_stream_t*)data; +#ifdef HAVE_ZLIB stream->crc = stream_backend->stream_crc_calculate( stream->a, stream->b, stream->c); +#endif } break; case CONTENT_CTL_LOAD: diff --git a/frontend/drivers/platform_emscripten.c b/frontend/drivers/platform_emscripten.c index 47c84df5c4..9cee89de8f 100644 --- a/frontend/drivers/platform_emscripten.c +++ b/frontend/drivers/platform_emscripten.c @@ -25,6 +25,7 @@ #include "../../retroarch.h" #include "../../runloop.h" #include "../frontend_driver.h" +#include "../../command_event.h" static void emscripten_mainloop(void) { diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 778703d737..13de7e9818 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -3841,6 +3841,7 @@ static uintptr_t gl_load_texture(void *video_data, void *data, { uintptr_t id = 0; +#ifdef HAVE_THREADS if (threaded) { custom_command_method_t func = video_texture_load_wrap_gl; @@ -3856,6 +3857,7 @@ static uintptr_t gl_load_texture(void *video_data, void *data, } return rarch_threaded_video_texture_load(data, func); } +#endif video_texture_load_gl((struct texture_image*)data, filter_type, &id); return id; diff --git a/gfx/drivers_context/emscriptenegl_ctx.c b/gfx/drivers_context/emscriptenegl_ctx.c index cff85953d1..ec577563b1 100644 --- a/gfx/drivers_context/emscriptenegl_ctx.c +++ b/gfx/drivers_context/emscriptenegl_ctx.c @@ -125,7 +125,7 @@ static void gfx_ctx_emscripten_destroy(void *data) static void *gfx_ctx_emscripten_init(void *video_driver) { #ifdef HAVE_EGL - EGLint width, height; + unsigned width, height; EGLint major, minor; EGLint n; static const EGLint attribute_list[] = @@ -173,14 +173,13 @@ static void *gfx_ctx_emscripten_init(void *video_driver) if (!egl_create_surface(&emscripten->egl, 0)) goto error; -#endif - eglQuerySurface(g_egl_dpy, g_egl_surf, EGL_WIDTH, &width); - eglQuerySurface(g_egl_dpy, g_egl_surf, EGL_HEIGHT, &height); + egl_get_video_size(&emscripten->egl, &width, &height); emscripten->fb_width = width; emscripten->fb_height = height; RARCH_LOG("[EMSCRIPTEN/EGL]: Dimensions: %ux%u\n", width, height); +#endif return emscripten;