Load rxdata async

This commit is contained in:
Varun Patil 2020-05-05 16:00:11 +05:30
parent ebe8d6f3bd
commit ba2e08ec55
3 changed files with 29 additions and 2 deletions

View file

@ -2,7 +2,16 @@
#include "file-helper.h"
#include <SDL_rwops.h>
#ifdef __EMSCRIPTEN__
#include "emscripten.hpp"
#endif
char* SDL_rw_file_helper::read() {
#ifdef __EMSCRIPTEN__
load_file_async_js(filename);
#endif
SDL_RWops *rw = SDL_RWFromFile(filename, "rb");
if (rw == NULL) return NULL;