mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-09-28 09:58:07 +03:00
emscripten: minor refactoring
- Remove the use of EXPORTED_FUNCTIONS in favor of EMSCRIPTEN_KEEPALIVE - SDL_Delay is no longer aliased to emscripten_sleep
This commit is contained in:
@@ -42,7 +42,6 @@ elseif (EMSCRIPTEN)
|
||||
"SHELL:-s ALLOW_MEMORY_GROWTH=1"
|
||||
"SHELL:-s NO_EXIT_RUNTIME=1"
|
||||
"SHELL:-s ASYNCIFY_ADD=\"['NACT::execute()']\""
|
||||
"SHELL:-s EXPORTED_FUNCTIONS=\"['_main','_ags_setAntialiasedStringMode']\""
|
||||
"SHELL:-s EXTRA_EXPORTED_RUNTIME_METHODS=\"['getValue','addRunDependency','removeRunDependency']\"")
|
||||
|
||||
else() # NOT (ANDROID OR EMSCRIPTEN)
|
||||
|
||||
+3
-2
@@ -12,9 +12,10 @@
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#include <emscripten.h>
|
||||
#define SDL_Delay emscripten_sleep
|
||||
#else
|
||||
#define EMSCRIPTEN_KEEPALIVE
|
||||
#endif
|
||||
|
||||
#define FONT_RESOURCE_NAME "MTLc3m.ttf"
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
#include <emscripten/html5.h>
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
void ags_setAntialiasedStringMode(int on);
|
||||
}
|
||||
|
||||
SDL_Window* g_window;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
@@ -543,7 +543,7 @@ uint16 AGS::convert_hankaku(uint16 code)
|
||||
|
||||
extern "C" {
|
||||
|
||||
void ags_setAntialiasedStringMode(int on) {
|
||||
void EMSCRIPTEN_KEEPALIVE ags_setAntialiasedStringMode(int on) {
|
||||
antialias = on != 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -489,7 +489,11 @@ void NACT::wait_after_open_menu()
|
||||
void NACT::sys_sleep(int ms) {
|
||||
pump_events();
|
||||
ags->update_screen();
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_sleep(ms);
|
||||
#else
|
||||
SDL_Delay(ms);
|
||||
#endif
|
||||
}
|
||||
|
||||
// WinMainとのインターフェース
|
||||
|
||||
@@ -418,4 +418,6 @@ protected:
|
||||
uint16 cali2() override;
|
||||
};
|
||||
|
||||
extern "C" void ags_setAntialiasedStringMode(int on);
|
||||
|
||||
#endif // _NACT_H_
|
||||
|
||||
Reference in New Issue
Block a user