emscripten: Make load_mincho_font() return bool

This commit is contained in:
kichikuou
2025-02-02 14:25:36 +09:00
parent d063655b25
commit dccd75113b
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ static int fsize; // フォントの大きさ
int dt_setfont(int type, int size) {
#ifdef __EMSCRIPTEN__
if (type == FONT_MINCHO) {
if (load_mincho_font() != OK)
if (!load_mincho_font())
type = FONT_GOTHIC;
}
#endif
+1 -1
View File
@@ -468,7 +468,7 @@ void commandZZ13() {
int num = getCaliValue();
#ifdef __EMSCRIPTEN__
if (num == FONT_MINCHO) {
if (load_mincho_font() != OK)
if (!load_mincho_font())
num = FONT_GOTHIC;
}
#endif
+2 -2
View File
@@ -235,7 +235,7 @@ bool font_get_antialias(void) {
}
#ifdef __EMSCRIPTEN__
EM_ASYNC_JS(int, load_mincho_font, (void), {
await xsystem35.load_mincho_font();
EM_ASYNC_JS(bool, load_mincho_font, (void), {
return await xsystem35.load_mincho_font();
});
#endif
+1 -1
View File
@@ -43,7 +43,7 @@ extern struct SDL_Surface *font_get_glyph(const char *str_utf8);
extern SDL_Rect font_draw_glyph(int x, int y, const char *str_utf8, uint8_t col);
#ifdef __EMSCRIPTEN__
extern int load_mincho_font(void);
extern bool load_mincho_font(void);
#endif
#endif /* __FONT_H__ */