Narrow dependency on font.h

This removes font.h dependency from header files such as ags.h and
nact.h. After this, font.h must be explicitly included in order to use
font functions.
This commit is contained in:
kichikuou
2020-08-08 22:52:47 +09:00
parent f31742a503
commit 3cecc58607
12 changed files with 27 additions and 26 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ static void Init(void) { /* 0 */
}
static void InitGame() { /* 1 */
nact->ags.font->antialiase_on = TRUE;
ags_setAntialiasedStringMode(TRUE);
sys_setHankakuMode(2);
nact->msgout = ntmsg_add;
+1 -1
View File
@@ -132,7 +132,7 @@ static void Init() {
sact.dmap = sf_create_pixel(sf0->width, sf0->height, 16);
// その他 System35 のデフォルト動作の変更
nact->ags.font->antialiase_on = TRUE;
ags_setAntialiasedStringMode(TRUE);
sys_setHankakuMode(2); // 全角半角変換無し
ags_autorepeat(FALSE); // key auto repeat off
+13 -2
View File
@@ -29,8 +29,8 @@
#include "portab.h"
#include "cg.h"
#include "graphics.h"
#include "font.h"
struct _FONT;
/* マウスカーソルの種類 */
#define CURSOR_ARROW 1
@@ -136,7 +136,7 @@ struct _ags {
boolean fullscree_is_on; /* if full-screen mode then true */
FONT *font; /* font device */
struct _FONT *font; /* font device */
agsurface_t *dib; /* main surface */
void (*eventcb)(agsevent_t *e); /* deliver event */
};
@@ -224,6 +224,17 @@ extern void ags_whiteOut(int rate, boolean flg);
extern void ags_fader_callback();
/* フォント関連 */
typedef enum {
FONT_X11,
FONT_FT2,
FONT_SDLTTF
} fontdev_t;
enum FontType {
FONT_GOTHIC,
FONT_MINCHO,
};
extern void ags_setFont(int type, int size);
/* カーソル関係 */
-11
View File
@@ -30,10 +30,6 @@
/* font の種類 */
#define FONTTYPEMAX 2
/* fontの名前 */
#define FONT_GOTHIC (0)
#define FONT_MINCHO (1)
struct agsurface;
struct _FONT {
@@ -71,13 +67,6 @@ extern FONT *font_x11_new();
/* デフォルトのフォント名 */
#define FONT_DEFAULTNAME_X "-*-*-medium-r-normal--%d-*-*-*-c-*-jisx0208.1983-0,-*-*-medium-r-normal--%d-*-*-*-c-*-jisx0201.1976-0,*"
// Font devices
typedef enum {
FONT_X11,
FONT_FT2,
FONT_SDLTTF
} fontdev_t;
#ifdef __EMSCRIPTEN__
int load_mincho_font(void);
#endif
-1
View File
@@ -27,7 +27,6 @@
#include "portab.h"
#include "graphics.h"
#include "scenario.h"
#include "font.h"
#include "s39ain.h"
#include "gameresource.h"
#include "selection.h"
+1 -1
View File
@@ -78,7 +78,7 @@ extern void sdl_delRegion(void *src);
extern void sdl_maskupdate(int sx, int sy, int w, int h, int dx, int dy, int func, int step);
/* フォント関連 */
extern void sdl_setFontDevice(FONT *f);
extern void sdl_setFontDevice(struct _FONT *f);
/* fader */
extern void sdl_fadeIn(int step);
+3 -2
View File
@@ -29,7 +29,8 @@
#include "portab.h"
#include "ags.h"
#include "font.h"
struct _FONT;
struct sdl_private_data {
SDL_Window *window;
@@ -47,7 +48,7 @@ struct sdl_private_data {
SDL_Rect view;
FONT *font;
struct _FONT *font;
boolean dirty;
+2 -2
View File
@@ -173,8 +173,8 @@ static void makeDIB(int width, int height, int depth) {
image_setdepth(sdl_dibinfo->depth);
}
void sdl_setFontDevice(FONT *f) {
sdl_font = f;
void sdl_setFontDevice(struct _FONT *f) {
sdl_font = f;
}
/* offscreen の設定 */
+1 -2
View File
@@ -29,7 +29,6 @@
#include "portab.h"
#include "image.h"
#include "xcore_image.h"
#include "font.h"
#include "cursor.h"
#include "ags.h"
@@ -71,7 +70,7 @@ extern void Xcore_maskupdate(int sx, int sy, int w, int h, int dx, int dy, int f
/* フォント関連 */
// extern FONT *Xcore_getFontDevice(void);
extern void Xcore_setFontDevice(FONT *f);
extern void Xcore_setFontDevice(struct _FONT *f);
/* fader */
extern void Xcore_fadeIn(int step);
+3 -2
View File
@@ -31,10 +31,11 @@
#include <X11/extensions/XShm.h>
#include "portab.h"
#include "font.h"
#include "ags.h"
#include "image.h"
struct _FONT;
/* dib/work image 情報 */
typedef struct {
XImage *ximg; /* XImage/ShmXImage 使用時の XImage */
@@ -63,7 +64,7 @@ struct xcore_private_data {
int dib_depth_candidate; /* DIB depth if required pixmap depth isnt 8 */
FONT *fontinfo; /* font object */
struct _FONT *fontinfo; /* font object */
boolean noSHM; /* dont have X-SHM extension */
+1 -1
View File
@@ -486,7 +486,7 @@ void x11_makeWorkImage(int w, int h) {
alloced = TRUE;
}
void Xcore_setFontDevice(FONT *f) {
void Xcore_setFontDevice(struct _FONT *f) {
x11_font = f;
}
+1
View File
@@ -62,6 +62,7 @@
#include "randMT.h"
#include "counter.h"
#include "ags.h"
#include "font.h"
#include "graphicsdevice.h"
#include "menu.h"
#include "music.h"