From c477678e601101d43728570038d79bfdb5a0774e Mon Sep 17 00:00:00 2001 From: Knaapchen Date: Wed, 16 Nov 2022 22:02:50 +0100 Subject: [PATCH] Added to_outside accessible for JavaScript to offset a pointer from the flyff client, solving a bug around text input --- fugg-client/src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fugg-client/src/main.cpp b/fugg-client/src/main.cpp index ebad226..7052245 100644 --- a/fugg-client/src/main.cpp +++ b/fugg-client/src/main.cpp @@ -67,8 +67,13 @@ void get_text(const std::string& text) { std::cout << text << " = \"" << result << "\"" << std::endl; } +uintptr_t to_outside(uint32_t ptr) { + return fugg::wasm::kMemory.address_of(ptr); +} + EMSCRIPTEN_BINDINGS(fugg) { emscripten::function("get_text", &get_text); + emscripten::function("to_outside", &to_outside); }; int main() {