Fixed emscripten build

This commit is contained in:
Alwin Garside 2016-03-13 15:30:30 +01:00
parent 82084205d8
commit 97b60b1e20
4 changed files with 8 additions and 4 deletions

View File

@ -1760,8 +1760,10 @@ bool content_ctl(enum content_ctl_state state, void *data)
content_ctl(CONTENT_CTL_STREAM_INIT, NULL); content_ctl(CONTENT_CTL_STREAM_INIT, NULL);
stream = (content_stream_t*)data; stream = (content_stream_t*)data;
#ifdef HAVE_ZLIB
stream->crc = stream_backend->stream_crc_calculate( stream->crc = stream_backend->stream_crc_calculate(
stream->a, stream->b, stream->c); stream->a, stream->b, stream->c);
#endif
} }
break; break;
case CONTENT_CTL_LOAD: case CONTENT_CTL_LOAD:

View File

@ -25,6 +25,7 @@
#include "../../retroarch.h" #include "../../retroarch.h"
#include "../../runloop.h" #include "../../runloop.h"
#include "../frontend_driver.h" #include "../frontend_driver.h"
#include "../../command_event.h"
static void emscripten_mainloop(void) static void emscripten_mainloop(void)
{ {

View File

@ -3841,6 +3841,7 @@ static uintptr_t gl_load_texture(void *video_data, void *data,
{ {
uintptr_t id = 0; uintptr_t id = 0;
#ifdef HAVE_THREADS
if (threaded) if (threaded)
{ {
custom_command_method_t func = video_texture_load_wrap_gl; 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); return rarch_threaded_video_texture_load(data, func);
} }
#endif
video_texture_load_gl((struct texture_image*)data, filter_type, &id); video_texture_load_gl((struct texture_image*)data, filter_type, &id);
return id; return id;

View File

@ -125,7 +125,7 @@ static void gfx_ctx_emscripten_destroy(void *data)
static void *gfx_ctx_emscripten_init(void *video_driver) static void *gfx_ctx_emscripten_init(void *video_driver)
{ {
#ifdef HAVE_EGL #ifdef HAVE_EGL
EGLint width, height; unsigned width, height;
EGLint major, minor; EGLint major, minor;
EGLint n; EGLint n;
static const EGLint attribute_list[] = 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)) if (!egl_create_surface(&emscripten->egl, 0))
goto error; goto error;
#endif
eglQuerySurface(g_egl_dpy, g_egl_surf, EGL_WIDTH, &width); egl_get_video_size(&emscripten->egl, &width, &height);
eglQuerySurface(g_egl_dpy, g_egl_surf, EGL_HEIGHT, &height);
emscripten->fb_width = width; emscripten->fb_width = width;
emscripten->fb_height = height; emscripten->fb_height = height;
RARCH_LOG("[EMSCRIPTEN/EGL]: Dimensions: %ux%u\n", width, height); RARCH_LOG("[EMSCRIPTEN/EGL]: Dimensions: %ux%u\n", width, height);
#endif
return emscripten; return emscripten;