diff --git a/modules/NIGHTDLL/sactcg.c b/modules/NIGHTDLL/sactcg.c index 99a527c..33ad11f 100644 --- a/modules/NIGHTDLL/sactcg.c +++ b/modules/NIGHTDLL/sactcg.c @@ -210,7 +210,8 @@ int nt_scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, char *cTex // 勝手に出ていいのかな? if (strlen(cText) == 0) return OK; - agsurface_t *glyph = ags_drawStringToSurface(FONT_GOTHIC, wSize, cText); + ags_setFont(FONT_GOTHIC, wSize); + agsurface_t *glyph = ags_drawStringToSurface(cText); i = malloc(sizeof(cginfo_t)); i->type = CG_SET; i->no = wNumCG; @@ -244,7 +245,8 @@ int nt_scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFi } sprintf(s, ss, wValue); - agsurface_t *glyph = ags_drawStringToSurface(FONT_GOTHIC, wSize, s); + ags_setFont(FONT_GOTHIC, wSize); + agsurface_t *glyph = ags_drawStringToSurface(s); i = malloc(sizeof(cginfo_t)); i->type = CG_SET; diff --git a/modules/SACT/sactcg.c b/modules/SACT/sactcg.c index 7be93f0..d6ae4af 100644 --- a/modules/SACT/sactcg.c +++ b/modules/SACT/sactcg.c @@ -208,7 +208,8 @@ int scg_create_text(int wNumCG, int wSize, int wR, int wG, int wB, int wText) { // 勝手に出ていいのかな? if (v_strlen(wText -1) == 0) return OK; - agsurface_t *glyph = ags_drawStringToSurface(FONT_GOTHIC, wSize, v_str(wText -1)); + ags_setFont(FONT_GOTHIC, wSize); + agsurface_t *glyph = ags_drawStringToSurface(v_str(wText -1)); i = malloc(sizeof(cginfo_t)); i->type = CG_SET; i->no = wNumCG; @@ -242,7 +243,8 @@ int scg_create_textnum(int wNumCG, int wSize, int wR, int wG, int wB, int wFigs, } sprintf(s, ss, wValue); - agsurface_t *glyph = ags_drawStringToSurface(FONT_GOTHIC, wSize, s); + ags_setFont(FONT_GOTHIC, wSize); + agsurface_t *glyph = ags_drawStringToSurface(s); i = malloc(sizeof(cginfo_t)); i->type = CG_SET; diff --git a/modules/lib/drawtext.c b/modules/lib/drawtext.c index 12db666..fc24be9 100644 --- a/modules/lib/drawtext.c +++ b/modules/lib/drawtext.c @@ -60,7 +60,8 @@ int dt_setfont(int type, int size) { int dt_drawtext(surface_t *sf, int x, int y, char *buf) { int sx, sy, sw, sh; - agsurface_t *glyph = ags_drawStringToSurface(ftype, fsize, buf); + ags_setFont(ftype, fsize); + agsurface_t *glyph = ags_drawStringToSurface(buf); if (glyph == NULL) return 0; sx = x; sy = y; @@ -89,7 +90,8 @@ int dt_drawtext(surface_t *sf, int x, int y, char *buf) { int dt_drawtext_col(surface_t *sf, int x, int y, char *buf, int r, int g, int b) { int sx, sy, sw, sh; - agsurface_t *glyph = ags_drawStringToSurface(ftype, fsize, buf); + ags_setFont(ftype, fsize); + agsurface_t *glyph = ags_drawStringToSurface(buf); if (glyph == NULL) return 0; sx = x; sy = y; diff --git a/src/ags.c b/src/ags.c index e5f0b72..144f9fa 100644 --- a/src/ags.c +++ b/src/ags.c @@ -409,11 +409,9 @@ int ags_drawString(int x, int y, const char *src, int col) { return w; } -agsurface_t *ags_drawStringToSurface(int type, int size, const char *str) { - FONT *font = nact->ags.font; - font->sel_font(type, size); +agsurface_t *ags_drawStringToSurface(const char *str) { char *utf8 = sjis2utf(str); - agsurface_t *sf = font->get_glyph(utf8); + agsurface_t *sf = nact->ags.font->get_glyph(utf8); free(utf8); return sf; } diff --git a/src/ags.h b/src/ags.h index 9f6573b..8cafdde 100644 --- a/src/ags.h +++ b/src/ags.h @@ -224,7 +224,6 @@ extern void ags_whiteOut(int rate, boolean flg); extern void ags_fader_callback(); /* フォント関連 */ - typedef enum { FONT_X11, FONT_FT2, @@ -236,6 +235,7 @@ enum FontType { FONT_MINCHO, }; extern void ags_setFont(int type, int size); +extern agsurface_t *ags_drawStringToSurface(const char *str); /* カーソル関係 */ extern void ags_setCursorType(int type); @@ -249,7 +249,6 @@ extern void ags_setAntialiasedStringMode(boolean mode); extern boolean ags_getAntialiasedStringMode(); extern void ags_fader(ags_faderinfo_t *); extern void ags_autorepeat(boolean bool); -extern agsurface_t *ags_drawStringToSurface(int type, int size, const char *str); #define RGB_RMASK15 0x7c00 #define RGB_GMASK15 0x03e0