Skip to content

Commit

Permalink
Add missing PreloadFile implementation (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
Desdaemon authored Nov 4, 2024
1 parent 4b5b8c2 commit 8fc8ef1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/platform/emscripten/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ bool Emscripten_Interface::ResetCanvas() {
return DisplayUi != nullptr;
}

void Emscripten_Interface::PreloadFile(std::string dir, std::string path, bool graphic) {
auto* request = AsyncHandler::RequestFile(dir, path);
if (!request->IsReady()) {
request->SetGraphicFile(graphic);
request->Start();
}
}

// Binding code
EMSCRIPTEN_BINDINGS(player_interface) {
emscripten::class_<Emscripten_Interface>("api")
Expand Down

0 comments on commit 8fc8ef1

Please sign in to comment.