diff --git a/modules/Gpx/effectcopy.c b/modules/Gpx/effectcopy.c index 8fb6f50..1365734 100644 --- a/modules/Gpx/effectcopy.c +++ b/modules/Gpx/effectcopy.c @@ -33,7 +33,7 @@ void gpx_effect(int no, struct sdl_effect *eff = sdl_effect_init(&rect, dst, dx, dy, src, sx, sy, type); if (!time) time = (no == SACT_EFFECT_CROSSFADE_DOWN || no == SACT_EFFECT_CROSSFADE_UP) ? 1150 : 2700; - ags_runEffect(time, FALSE, (ags_EffectStepFunc)sdl_effect_step, eff); + ags_runEffect(time, false, (ags_EffectStepFunc)sdl_effect_step, eff); sdl_effect_finish(eff); switch (no) { diff --git a/modules/MsgSkip/MsgSkip.c b/modules/MsgSkip/MsgSkip.c index 8aaec9d..f601e5a 100644 --- a/modules/MsgSkip/MsgSkip.c +++ b/modules/MsgSkip/MsgSkip.c @@ -13,7 +13,7 @@ #include "msgskip.h" #include "utfsjis.h" -static boolean valid; +static bool valid; static int action; static void Init() { diff --git a/modules/NIGHTDLL/NIGHTDLL.c b/modules/NIGHTDLL/NIGHTDLL.c index 1aad29e..b7057f1 100644 --- a/modules/NIGHTDLL/NIGHTDLL.c +++ b/modules/NIGHTDLL/NIGHTDLL.c @@ -51,7 +51,7 @@ static void NIGHTDLL_reset(void) { } static void InitGame() { /* 1 */ - ags_setAntialiasedStringMode(TRUE); + ags_setAntialiasedStringMode(true); sys_setHankakuMode(2); nact->msgout = ntmsg_add; diff --git a/modules/NIGHTDLL/night.h b/modules/NIGHTDLL/night.h index 1d9cd81..1d37e0f 100644 --- a/modules/NIGHTDLL/night.h +++ b/modules/NIGHTDLL/night.h @@ -55,7 +55,7 @@ struct _night { // msg char msgbuf[MSGBUFMAX]; - boolean zhiding; + bool zhiding; struct { void (* cbmove)(agsevent_t *); void (* cbrelease)(agsevent_t *); diff --git a/modules/NIGHTDLL/nt_graph.c b/modules/NIGHTDLL/nt_graph.c index 30e09d5..a34b0f1 100644 --- a/modules/NIGHTDLL/nt_graph.c +++ b/modules/NIGHTDLL/nt_graph.c @@ -179,15 +179,15 @@ void nt_gr_draw(int effectno) { // 全消し break; case 1: - nt_sp_update_all(TRUE); + nt_sp_update_all(true); break; default: if (night.waitskiplv > 1) { - nt_sp_update_all(TRUE); + nt_sp_update_all(true); break; } - //nt_sp_eupdate(effectno, effecttime, TRUE); - nt_sp_eupdate(effectno, 1000, TRUE); + //nt_sp_eupdate(effectno, effecttime, true); + nt_sp_eupdate(effectno, 1000, true); } } diff --git a/modules/NIGHTDLL/nt_msg.c b/modules/NIGHTDLL/nt_msg.c index d0d072b..e0f8419 100644 --- a/modules/NIGHTDLL/nt_msg.c +++ b/modules/NIGHTDLL/nt_msg.c @@ -95,7 +95,7 @@ void ntmsg_init() { sp->u.anime.interval = HAKANIM_INTERVAL; nt_sp_add_updatelist(sp); nt_sp_set_loc(sp, HAKANIM_LOC_X, HAKANIM_LOC_Y); - nt_sp_set_show(sp, FALSE); + nt_sp_set_show(sp, false); sp->update = nt_sp_draw_scg; @@ -131,14 +131,14 @@ void ntmsg_set_frame(int type) { switch(type) { case 0: - nt_sp_set_show(night.sp[SPNO_MSGBG], FALSE); - nt_sp_set_show(night.sp[SPNO_MSGFRAME_BG], FALSE); - nt_sp_set_show(night.sp[SPNO_MSGFRAME_FG], FALSE); + nt_sp_set_show(night.sp[SPNO_MSGBG], false); + nt_sp_set_show(night.sp[SPNO_MSGFRAME_BG], false); + nt_sp_set_show(night.sp[SPNO_MSGFRAME_FG], false); break; case 1: - nt_sp_set_show(night.sp[SPNO_MSGBG], TRUE); - nt_sp_set_show(night.sp[SPNO_MSGFRAME_BG], TRUE); - nt_sp_set_show(night.sp[SPNO_MSGFRAME_FG], TRUE); + nt_sp_set_show(night.sp[SPNO_MSGBG], true); + nt_sp_set_show(night.sp[SPNO_MSGFRAME_BG], true); + nt_sp_set_show(night.sp[SPNO_MSGFRAME_FG], true); gr_fill(sf, MSGFRAME_0_X, MSGFRAME_0_Y, MSGFRAME_0_WIDTH, MSGFRAME_0_HEIGHT, @@ -146,12 +146,12 @@ void ntmsg_set_frame(int type) { gr_fill_alpha_map(sf, MSGFRAME_0_X, MSGFRAME_0_Y, MSGFRAME_0_WIDTH, MSGFRAME_0_HEIGHT, 192); ntmsg_clear(SPNO_MSGFRAME_FG); - nt_sp_update_all(TRUE); + nt_sp_update_all(true); break; case 2: - nt_sp_set_show(night.sp[SPNO_MSGBG], TRUE); - nt_sp_set_show(night.sp[SPNO_MSGFRAME_BG], FALSE); - nt_sp_set_show(night.sp[SPNO_MSGFRAME_FG], TRUE); + nt_sp_set_show(night.sp[SPNO_MSGBG], true); + nt_sp_set_show(night.sp[SPNO_MSGFRAME_BG], false); + nt_sp_set_show(night.sp[SPNO_MSGFRAME_FG], true); gr_fill(sf, MSGFRAME_1_X, MSGFRAME_1_Y, MSGFRAME_1_WIDTH, MSGFRAME_1_HEIGHT, @@ -159,7 +159,7 @@ void ntmsg_set_frame(int type) { gr_fill_alpha_map(sf, MSGFRAME_1_X, MSGFRAME_1_Y, MSGFRAME_1_WIDTH, MSGFRAME_1_HEIGHT, 128); ntmsg_clear(SPNO_MSGFRAME_FG); - nt_sp_update_all(TRUE); + nt_sp_update_all(true); break; } @@ -221,7 +221,7 @@ int ntmsg_ana(void) { static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wFont, int wSpeed, int wLineSpace) { char *msg; sprite_t *sp; - boolean needupdate = FALSE; + bool needupdate = false; MyRectangle uparea = {0,0,0,0}; int savex; @@ -260,7 +260,7 @@ static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB mbuf, wColorR, wColorG, wColorB); - needupdate = TRUE; + needupdate = true; if (wSpeed > 0) { nt_sp_updateme_part(sp, @@ -269,7 +269,7 @@ static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB cw, wSize); nt_sp_update_clipped(); - needupdate = FALSE; + needupdate = false; // keywait delta = sdl_getTicks() - wcnt; @@ -424,7 +424,7 @@ static void setup_hakanim() { // メッセージ表示時のキー入力を促すアニメーション static void hakanim(int i) { sprite_t *sp; - boolean show; + bool show; sp = night.sp[SPNO_MSG_KEYANIM]; if (sp == NULL) return; @@ -434,7 +434,7 @@ static void hakanim(int i) { } else { sp->curcg = sp->cg2; } - sp->show = TRUE; + sp->show = true; nt_sp_updateme(sp); nt_sp_update_clipped(); diff --git a/modules/NIGHTDLL/nt_scenario.c b/modules/NIGHTDLL/nt_scenario.c index 2a2c8a1..3c87e67 100644 --- a/modules/NIGHTDLL/nt_scenario.c +++ b/modules/NIGHTDLL/nt_scenario.c @@ -107,9 +107,9 @@ void nt_sco_callevent(int ev) { } -boolean nt_sco_is_natsu() { - if (night.Month < 6 || night.Month > 9) return FALSE; - if (night.Month == 6 && night.Day < 11) return FALSE; - return TRUE; +bool nt_sco_is_natsu() { + if (night.Month < 6 || night.Month > 9) return false; + if (night.Month == 6 && night.Day < 11) return false; + return true; } diff --git a/modules/NIGHTDLL/nt_scenario.h b/modules/NIGHTDLL/nt_scenario.h index a151c6d..8014a47 100644 --- a/modules/NIGHTDLL/nt_scenario.h +++ b/modules/NIGHTDLL/nt_scenario.h @@ -3,7 +3,7 @@ extern void nt_sco_init(); extern int nt_sco_main(int mode); -extern boolean nt_sco_is_natsu(); +extern bool nt_sco_is_natsu(); extern void nt_sco_callevent(int ev); #endif /* __NT_SCENARIO_H__ */ diff --git a/modules/NIGHTDLL/nt_sound.c b/modules/NIGHTDLL/nt_sound.c index c4ef8a2..86b6ed5 100644 --- a/modules/NIGHTDLL/nt_sound.c +++ b/modules/NIGHTDLL/nt_sound.c @@ -10,7 +10,7 @@ struct _ntsnd { int no; int vol; int loop; - boolean waitend; + bool waitend; }; static struct _ntsnd ntsnd[10]; @@ -27,14 +27,14 @@ void nt_cd_play(int no) { } void nt_cd_stop(int msec) { - mus_mixer_fadeout_start(MIX_CD, msec, 0, TRUE); + mus_mixer_fadeout_start(MIX_CD, msec, 0, true); } -void nt_cd_mute(boolean mute) { +void nt_cd_mute(bool mute) { if (mute) { - mus_mixer_fadeout_start(MIX_CD, 0, 0, FALSE); + mus_mixer_fadeout_start(MIX_CD, 0, 0, false); } else { - mus_mixer_fadeout_start(MIX_CD, 0, 100, FALSE); + mus_mixer_fadeout_start(MIX_CD, 0, 100, false); } } @@ -56,7 +56,7 @@ void nt_snd_setvol(int ch, int vol) { ntsnd[ch -1].vol = vol; } -void nt_snd_waitend(int ch, boolean waitend) { +void nt_snd_waitend(int ch, bool waitend) { if (ch < 1) return; ntsnd[ch -1].waitend = waitend; @@ -74,13 +74,13 @@ void nt_snd_play(int ch) { void nt_snd_stop(int ch, int msec) { if (ch < 1) return; - mus_wav_fadeout_start(ch, msec, 0, TRUE); + mus_wav_fadeout_start(ch, msec, 0, true); } void nt_snd_stopall(int msec) { int i; for (i = 1; i <= 10; i++) { - mus_wav_fadeout_start(i, msec, 0, TRUE); + mus_wav_fadeout_start(i, msec, 0, true); } } diff --git a/modules/NIGHTDLL/nt_sound.h b/modules/NIGHTDLL/nt_sound.h index 4bfda52..cf8365b 100644 --- a/modules/NIGHTDLL/nt_sound.h +++ b/modules/NIGHTDLL/nt_sound.h @@ -6,11 +6,11 @@ extern void nt_voice_set(int no); extern void nt_cd_play(int no); extern void nt_cd_stop(int msec); -extern void nt_cd_mute(boolean mute); +extern void nt_cd_mute(bool mute); extern void nt_snd_setwave(int ch, int no); extern void nt_snd_setloop(int ch, int num); extern void nt_snd_setvol(int ch, int vol); -extern void nt_snd_waitend(int ch, boolean waitend); +extern void nt_snd_waitend(int ch, bool waitend); extern void nt_snd_play(int ch); extern void nt_snd_stop(int ch, int msec); extern void nt_snd_stopall(int msec); diff --git a/modules/NIGHTDLL/sactstring.c b/modules/NIGHTDLL/sactstring.c index a36b2d9..48932bd 100644 --- a/modules/NIGHTDLL/sactstring.c +++ b/modules/NIGHTDLL/sactstring.c @@ -151,7 +151,7 @@ static void replacestr_cb(void* data, void* userdata) { start = replacesrc; out = replacedst; - while (TRUE) { + while (true) { next = strstr(start, ex->src); if (next == NULL) break; strncat(out, start, (size_t)(next - start)); diff --git a/modules/NIGHTDLL/sprite.c b/modules/NIGHTDLL/sprite.c index 2b6328e..8570ea6 100644 --- a/modules/NIGHTDLL/sprite.c +++ b/modules/NIGHTDLL/sprite.c @@ -22,7 +22,7 @@ sprite_t *nt_sp_new(int no, int cg1, int cg2, int cg3, int type) { sp->cg3 = cg3 ? nt_scg_addref(cg3) : NULL; sp->curcg = sp->cg1; - sp->show = TRUE; + sp->show = true; sp->blendrate = 255; sp->loc.x = 0; sp->loc.y = 0; @@ -54,7 +54,7 @@ sprite_t *nt_sp_msg_new(int no, int x, int y, int width, int height) { sp->no = no; sp->type = SPRITE_MSG; - sp->show = TRUE; + sp->show = true; sp->blendrate = 255; sp->loc.x = x; sp->loc.y = y; @@ -83,8 +83,8 @@ void nt_sp_free(sprite_t *sp) { free(sp); } -void nt_sp_set_show(sprite_t *sp, boolean show) { - boolean oldshow; +void nt_sp_set_show(sprite_t *sp, bool show) { + bool oldshow; if (sp == NULL) return; diff --git a/modules/NIGHTDLL/sprite.h b/modules/NIGHTDLL/sprite.h index 93e9d36..57c0f12 100644 --- a/modules/NIGHTDLL/sprite.h +++ b/modules/NIGHTDLL/sprite.h @@ -78,7 +78,7 @@ struct _sprite { cginfo_t *curcg; cginfo_t *cg1, *cg2, *cg3; - boolean show; + bool show; int blendrate; @@ -110,13 +110,13 @@ typedef struct _sprite sprite_t; extern sprite_t *nt_sp_new(int no, int cg1, int cg2, int cg3, int type); extern sprite_t *nt_sp_msg_new(int no, int x, int y, int width, int height); extern void nt_sp_free(sprite_t *sp); -extern void nt_sp_set_show(sprite_t *sp, boolean show); +extern void nt_sp_set_show(sprite_t *sp, bool show); // extern void nt_sp_set_cg(sprite_t *sp, int no); extern void nt_sp_set_loc(sprite_t *sp, int x, int y); /* in nt_sprite_update.c */ extern int nt_sp_update_clipped(); -extern int nt_sp_update_all(boolean syncscreen); +extern int nt_sp_update_all(bool syncscreen); extern int nt_sp_updateme(sprite_t *sp); extern int nt_sp_updateme_part(sprite_t *sp, int x, int y, int w, int h); extern void nt_sp_add_updatelist(sprite_t *sp); diff --git a/modules/NIGHTDLL/sprite_eupdate.c b/modules/NIGHTDLL/sprite_eupdate.c index 50d949e..61ebdcc 100644 --- a/modules/NIGHTDLL/sprite_eupdate.c +++ b/modules/NIGHTDLL/sprite_eupdate.c @@ -39,11 +39,11 @@ */ int nt_sp_eupdate(int no, int time, int cancel) { if (no == 1013) { - nt_sp_update_all(TRUE); + nt_sp_update_all(true); return OK; } - nt_sp_update_all(FALSE); + nt_sp_update_all(false); enum sdl_effect_type type = from_sact_effect(no - 100); if (type == EFFECT_INVALID) { diff --git a/modules/NIGHTDLL/sprite_update.c b/modules/NIGHTDLL/sprite_update.c index a3d3a69..91a15b7 100644 --- a/modules/NIGHTDLL/sprite_update.c +++ b/modules/NIGHTDLL/sprite_update.c @@ -92,7 +92,7 @@ static void do_update_each(void* data, void* userdata) { 画面全体の更新 @param syncscreen: surface0 に描画したものを Screen に反映させるかどうか */ -int nt_sp_update_all(boolean syncscreen) { +int nt_sp_update_all(bool syncscreen) { // 画面全体を更新領域に MyRectangle r = {0, 0, sf0->width, sf0->height }; diff --git a/modules/SACT/SACT.c b/modules/SACT/SACT.c index a8e17da..8ac8ec0 100644 --- a/modules/SACT/SACT.c +++ b/modules/SACT/SACT.c @@ -150,17 +150,17 @@ static void Init() { sact.dmap = sf_create_pixel(sf0->width, sf0->height, 16); // その他 System35 のデフォルト動作の変更 - ags_setAntialiasedStringMode(TRUE); + ags_setAntialiasedStringMode(true); sys_setHankakuMode(2); // 全角半角変換無し - ags_autorepeat(FALSE); // key auto repeat off + ags_autorepeat(false); // key auto repeat off if (sact.version >= 120) { - sact.logging = TRUE; + sact.logging = true; #ifdef __EMSCRIPTEN__ EM_ASM( xsystem35.texthook.disableWheelEvent(0xffffffff) ); #endif } else { - sact.logging = FALSE; + sact.logging = false; } TRACE("SACT.Init %d:", p1); @@ -267,7 +267,7 @@ static void SpriteDeleteCount() { * 現在設定されているスプライト状態を画面に反映(~SP_UPDATE) */ static void Draw() { - sp_update_all(TRUE); + sp_update_all(true); TRACE("SACT.Draw:"); } @@ -1027,7 +1027,7 @@ static void WaitKeySimple() { TRACE("SACT.WaitKeySimple %d:", vKey); // とりあえず全更新 - sp_update_all(TRUE); + sp_update_all(true); sact.waittype = KEYWAIT_SIMPLE; sact.waitkey = -1; @@ -1339,7 +1339,7 @@ static void MessagePeek() { * ログ採取停止 */ static void Log_Stop() { - sact.logging = FALSE; + sact.logging = false; TRACE("SACT.Log_Stop:"); } @@ -1348,7 +1348,7 @@ static void Log_Stop() { * ログ採取開始 */ static void Log_Start() { - sact.logging = TRUE; + sact.logging = true; TRACE("SACT.Log_Start:"); } diff --git a/modules/SACT/sact.h b/modules/SACT/sact.h index 3872b4f..53ef8a8 100644 --- a/modules/SACT/sact.h +++ b/modules/SACT/sact.h @@ -116,8 +116,8 @@ struct _sprite { cginfo_t *curcg; // スプライトを表示するか - boolean show; - boolean show_save; // Zkey hide save用 + bool show; + bool show_save; // Zkey hide save用 // 表示する際のブレンド率 0:全く見えない, 255: 通常表示 int blendrate; @@ -139,8 +139,8 @@ struct _sprite { // spriteを再描画するときの callback int (* update)(struct _sprite *sp); - boolean focused; // forcusを得ているか - boolean pressed; // このsprite上でマウスが押されているか + bool focused; // forcusを得ているか + bool pressed; // このsprite上でマウスが押されているか SList *expsp; // 説明スプライトのリスト @@ -151,7 +151,7 @@ struct _sprite { int speed; // 移動速度 int starttime; // 移動開始時刻 int endtime; // 移動終了予定時刻 - boolean moving; // 移動中かどうか + bool moving; // 移動中かどうか } move; // SACT.Numeral用パラメータ @@ -170,7 +170,7 @@ struct _sprite { // ゲットスプライト struct { - boolean dragging; // ドラッグ中 + bool dragging; // ドラッグ中 MyPoint dragstart; // ドラッグ開始位置 } get; @@ -254,7 +254,7 @@ struct _sact { // DnDに関するもの sprite_t *draggedsp; // drag中のスプライト - boolean dropped; // スプライトがドロップされたかどうか + bool dropped; // スプライトがドロップされたかどうか // keywaitの種類 int waittype; @@ -275,12 +275,12 @@ struct _sact { // depth map surface_t *dmap; - boolean zhiding; // Zkeyによる隠し中 + bool zhiding; // Zkeyによる隠し中 int zofftime; - boolean zdooff; + bool zdooff; // バックログ - boolean logging; + bool logging; List *log; }; typedef struct _sact sact_t; diff --git a/modules/SACT/sactamask.c b/modules/SACT/sactamask.c index 0160760..2139c4a 100644 --- a/modules/SACT/sactamask.c +++ b/modules/SACT/sactamask.c @@ -124,13 +124,13 @@ int sp_eupdate_amap(int index, int time, int cancel) { mask = smask_get(index); if (mask == NULL) { - sp_update_all(TRUE); + sp_update_all(true); return OK; } // 現在の sf0 をセーブ sfsrc = sf_dup(sf0); - sp_update_all(FALSE); + sp_update_all(false); sfdst = sf_dup(sf0); sf_copyall(sf0, sfsrc); diff --git a/modules/SACT/sactsound.c b/modules/SACT/sactsound.c index 9659362..9f2896a 100644 --- a/modules/SACT/sactsound.c +++ b/modules/SACT/sactsound.c @@ -101,7 +101,7 @@ int ssnd_stop(int no, int fadetime) { int slot = slt_find(no); if (slot != -1) { - mus_wav_fadeout_start(slot, fadetime, 0, TRUE); + mus_wav_fadeout_start(slot, fadetime, 0, true); cache[slot - SLOTOFFSET] = 0; } @@ -177,7 +177,7 @@ int ssnd_stopall(int time) { for (i = 0; i < CACHEMAX; i++) { if (cache[i] > 0) { - mus_wav_fadeout_start(i + SLOTOFFSET, time, 0, TRUE); + mus_wav_fadeout_start(i + SLOTOFFSET, time, 0, true); cache[i] = 0; } } diff --git a/modules/SACT/sprite.c b/modules/SACT/sprite.c index ca4ee1f..d0ecc64 100644 --- a/modules/SACT/sprite.c +++ b/modules/SACT/sprite.c @@ -109,7 +109,7 @@ int sp_init() { sact.sp[i] = calloc(1, sizeof(sprite_t)); sact.sp[i]->no = i; sact.sp[i]->type = SPRITE_NONE; - sact.sp[i]->show = FALSE; + sact.sp[i]->show = false; } // 壁紙(スプライト番号0)はデフォルトへ @@ -161,7 +161,7 @@ int sp_new(int no, int cg1, int cg2, int cg3, int type) { //初期のcurcgはcg1 sp->curcg = sp->cg1; - sp->show = TRUE; // 初期状態は表示 + sp->show = true; // 初期状態は表示 sp->blendrate = 255; // ブレンド無し sp->loc.x = 0; // 初期表示位置は(0,0) sp->loc.y = 0; @@ -220,7 +220,7 @@ int sp_new_msg(int no, int x, int y, int width, int height) { sp->type = SPRITE_MSG; sp->no = no; - sp->show = TRUE; // 初期状態は表示 + sp->show = true; // 初期状態は表示 sp->blendrate = 255; // ブレンド無し sp->freezed_state = 0; // 状態固定無し sp->loc.x = x - sact.origin.x; // 初期表示位置 @@ -261,7 +261,7 @@ int sp_set_wall_paper(int no) { } sp->type = SPRITE_WP; - sp->show = TRUE; + sp->show = true; sp->blendrate = 255; sp->cur.x = 0; sp->cur.y = 0; @@ -321,7 +321,7 @@ int sp_free(int no) { memset(sp, 0, sizeof(sprite_t)); sp->type = SPRITE_NONE; sp->no = no; - sp->show = FALSE; + sp->show = false; memcpy(&(sp->numeral), &(back.numeral), sizeof(sp->numeral)); } return OK; @@ -330,7 +330,7 @@ int sp_free(int no) { // 表示状態の変更 int sp_set_show(int wNum, int wCount, int sShow) { int i; - boolean oldstate; + bool oldstate; sprite_t *sp; sp_assert_no(wNum); @@ -726,12 +726,12 @@ int sp_sound_ob(int wNumWave) { * 指定の座標が現在のスプライトの位置の範囲に入っているか? * @param sp: 調べる対象のスプライト * @param x,y: 座標 - * @return: TRUE:入っている, FALSE: 入っていない + * @return: true:入っている, false: 入っていない */ -boolean sp_is_insprite(sprite_t *sp, int x, int y) { +bool sp_is_insprite(sprite_t *sp, int x, int y) { uint8_t *dp; - if (x < 0 || y < 0 || x >= sf0->width || y >= sf0->height) return FALSE; + if (x < 0 || y < 0 || x >= sf0->width || y >= sf0->height) return false; dp = GETOFFSET_PIXEL(sact.dmap, x, y); return (*(uint16_t *)dp == sp->no); diff --git a/modules/SACT/sprite.h b/modules/SACT/sprite.h index 4c0faa8..b968895 100644 --- a/modules/SACT/sprite.h +++ b/modules/SACT/sprite.h @@ -48,7 +48,7 @@ extern int sp_thaw_sprite(int wNum); extern int sp_add_quakesprite(int wNum); extern int sp_clear_quakesprite_all(); extern int sp_set_animeinterval(int wNum, int wTime); -extern boolean sp_is_insprite(sprite_t *sp, int x, int y); +extern bool sp_is_insprite(sprite_t *sp, int x, int y); extern int sp_set_blendrate(int wNum, int wCount, int rate); extern int sp_query_isexist(int wNum, int *ret); extern int sp_query_info(int wNum, int *vtype, int *vcg1, int *vcg2, int *vcg3); @@ -71,7 +71,7 @@ extern int sp_sound_ob(int wNumWave); // in sprite_update.c -extern int sp_update_all(boolean syncscreen); +extern int sp_update_all(bool syncscreen); extern int sp_update_clipped(); extern int sp_updateme(sprite_t *sp); extern int sp_updateme_part(sprite_t *sp, int x, int y, int w, int h); diff --git a/modules/SACT/sprite_eupdate.c b/modules/SACT/sprite_eupdate.c index 600be76..d6411c2 100644 --- a/modules/SACT/sprite_eupdate.c +++ b/modules/SACT/sprite_eupdate.c @@ -40,11 +40,11 @@ */ int sp_eupdate(int type, int time, int cancel) { if (sact.waitskiplv > 1) { - sp_update_all(TRUE); + sp_update_all(true); return OK; } - sp_update_all(FALSE); + sp_update_all(false); enum sdl_effect_type sdl_effect = from_sact_effect(type); if (sdl_effect == EFFECT_INVALID) { diff --git a/modules/SACT/sprite_event.c b/modules/SACT/sprite_event.c index 23dcc84..efcda66 100644 --- a/modules/SACT/sprite_event.c +++ b/modules/SACT/sprite_event.c @@ -91,11 +91,11 @@ static void cb_waitkey_selection(agsevent_t *e); static void cb_focused_swsp(void* s, void* data) { sprite_t *sp = (sprite_t *)s; int *update = (int *)data; - boolean oldstate = sp->show; + bool oldstate = sp->show; SACT_DEBUG("show up spex %d", sp->no); - sp->show = TRUE; + sp->show = true; if (oldstate != sp->show) { (*update)++; sp_updateme(sp); @@ -109,11 +109,11 @@ static void cb_focused_swsp(void* s, void* data) { static void cb_defocused_swsp(void* s, void* data) { sprite_t *sp = (sprite_t *)s; int *update = (int *)data; - boolean oldstate = sp->show; + bool oldstate = sp->show; SACT_DEBUG("hide spex %d", sp->no); - sp->show = FALSE; + sp->show = false; if (oldstate != sp->show) { (*update)++; sp_updateme(sp); @@ -124,7 +124,7 @@ static void cb_defocused_swsp(void* s, void* data) { static void cb_focused_zkey(void* s, void* data) { sprite_t *sp = (sprite_t *)s; int *update = (int *)data; - boolean oldstate = sp->show; + bool oldstate = sp->show; sp->show = sp->show_save; if (oldstate != sp->show) { @@ -137,9 +137,9 @@ static void cb_focused_zkey(void* s, void* data) { static void cb_defocused_zkey(void* s, void* data) { sprite_t *sp = (sprite_t *)s; int *update = (int *)data; - boolean oldstate = sp->show; + bool oldstate = sp->show; - sp->show = FALSE; + sp->show = false; if (oldstate != sp->show) { (*update)++; sp_updateme(sp); @@ -174,7 +174,7 @@ static int cb_focused(sprite_t *sp) { sp->curcg = sp->cg2; update++; } - sp->focused = TRUE; + sp->focused = true; SACT_DEBUG("get forcused %d, type %d", sp->no, sp->type); if (sp->numsound1) { ssnd_play(sp->numsound1); @@ -197,7 +197,7 @@ static int cb_defocused(sprite_t *sp) { } sp->curcg = sp->cg1; update++; - sp->focused = FALSE; + sp->focused = false; SACT_DEBUG("lost forcused %d", sp->no); } @@ -216,11 +216,11 @@ static void cb_waitkey_simple(agsevent_t *e) { cur = sdl_getTicks(); if (!sact.zhiding) { slist_foreach(sact.sp_zhide, cb_defocused_zkey, &update); - sact.zhiding = TRUE; - sact.zdooff = TRUE; + sact.zhiding = true; + sact.zdooff = true; sact.zofftime = cur; } else { - sact.zdooff = FALSE; + sact.zdooff = false; } } break; @@ -236,7 +236,7 @@ static void cb_waitkey_simple(agsevent_t *e) { case AGSEVENT_BUTTON_RELEASE: if (sact.zhiding) { slist_foreach(sact.sp_zhide, cb_focused_zkey, &update); - sact.zhiding = FALSE; + sact.zhiding = false; } // fall through @@ -246,7 +246,7 @@ static void cb_waitkey_simple(agsevent_t *e) { cur = sdl_getTicks(); if (500 < (cur - sact.zofftime) || !sact.zdooff) { slist_foreach(sact.sp_zhide, cb_focused_zkey, &update); - sact.zhiding = FALSE; + sact.zhiding = false; } break; case KEY_PAGEUP: diff --git a/modules/SACT/sprite_get.c b/modules/SACT/sprite_get.c index c8483c3..088895f 100644 --- a/modules/SACT/sprite_get.c +++ b/modules/SACT/sprite_get.c @@ -42,9 +42,9 @@ static void cb_remove(sprite_t *sp); static void cb_defocused_swsp(void* s, void* data) { sprite_t *sp = (sprite_t *)s; int *update = (int *)data; - boolean oldstate = sp->show; + bool oldstate = sp->show; - sp->show = FALSE; + sp->show = false; if (oldstate != sp->show) { (*update)++; sp_updateme(sp); @@ -61,7 +61,7 @@ static int eventCB_GET(sprite_t *sp, agsevent_t *e) { if (e->code != AGSEVENT_BUTTON_LEFT) break; // drag開始時のマウスの位置記録 - sp->u.get.dragging = TRUE; + sp->u.get.dragging = true; sp->u.get.dragstart.x = e->mousex; sp->u.get.dragstart.y = e->mousey; @@ -73,7 +73,7 @@ static int eventCB_GET(sprite_t *sp, agsevent_t *e) { // スプライトの表示を一番前に持って来る sact.draggedsp = sp; - sact.dropped = FALSE; + sact.dropped = false; // 説明スプライトがある場合は、それを非表示にする if (sp->expsp) { @@ -92,7 +92,7 @@ static int eventCB_GET(sprite_t *sp, agsevent_t *e) { if (!sp->u.get.dragging) break; - sact.dropped = TRUE; + sact.dropped = true; break; case AGSEVENT_MOUSE_MOTION: diff --git a/modules/SACT/sprite_keywait.c b/modules/SACT/sprite_keywait.c index 73691ee..beb8cca 100644 --- a/modules/SACT/sprite_keywait.c +++ b/modules/SACT/sprite_keywait.c @@ -41,7 +41,7 @@ static void hidesprite(sprite_t *sp); -static boolean waitcond(int endtime); +static bool waitcond(int endtime); @@ -57,23 +57,23 @@ static void hidesprite(sprite_t *sp) { } sp_updateme(sp); - sp->show = FALSE; + sp->show = false; sp_update_clipped(); } /* キー待ち終了の条件チェック @param endtime: 終了時間 - @return: 終了なら TRUE、継続なら FALSE + @return: 終了なら true、継続なら false スプライトがドロップされた時の各種処理を含む */ -static boolean waitcond(int endtime) { +static bool waitcond(int endtime) { int curtime = sdl_getTicks(); - if (curtime >= endtime) return TRUE; + if (curtime >= endtime) return true; if (sact.dropped) { - sact.draggedsp->u.get.dragging = FALSE; + sact.draggedsp->u.get.dragging = false; if (sact.waitkey != -1) { // dropしたスプライトをじわじわ消す hidesprite(sact.draggedsp); @@ -81,8 +81,8 @@ static boolean waitcond(int endtime) { sact.sp_result_put = sact.waitkey; sp_free(sact.draggedsp->no); sact.draggedsp = NULL; - sact.dropped = FALSE; - return TRUE; + sact.dropped = false; + return true; } else { // PUT/SWPUTスプライト以外のところにdropした場合 sprite_t *sp = sact.draggedsp; @@ -99,7 +99,7 @@ static boolean waitcond(int endtime) { ssnd_play(sact.draggedsp->numsound3); } sact.draggedsp = NULL; - sact.dropped = FALSE; + sact.dropped = false; } } @@ -120,7 +120,7 @@ int sp_keywait(int *vOK, int *vRND, int *vD01, int *vD02, int *vD03, int timeout int curtime, endtime; // とりあえず全更新 - sp_update_all(TRUE); + sp_update_all(true); // depthmap を準備 slist_foreach(sact.updatelist, sp_draw_dmap, NULL); @@ -136,7 +136,7 @@ int sp_keywait(int *vOK, int *vRND, int *vD01, int *vD02, int *vD03, int timeout // とりあえず、現在のマウス位置を送って、switch sprite の // 状態を更新しておく MyPoint p; - sys_getMouseInfo(&p, FALSE); + sys_getMouseInfo(&p, false); agsevent_t agse = { .type = AGSEVENT_MOUSE_MOTION, .mousex = p.x, diff --git a/modules/SACT/sprite_move.c b/modules/SACT/sprite_move.c index 74f0dc1..03360e0 100644 --- a/modules/SACT/sprite_move.c +++ b/modules/SACT/sprite_move.c @@ -62,7 +62,7 @@ static void move_drain(sprite_t *sp) { // 後で、movelist から外してもらうための処理 sact.teventremovelist = slist_append(sact.teventremovelist, sp); - sp->move.moving = FALSE; + sp->move.moving = false; if (sp->move.speed > 0) sp->move.time = 0; } @@ -122,7 +122,7 @@ void spev_move_setup(void* data, void* userdata) { // move 開始時刻の記録 sp->move.starttime = sact.movestarttime; - sp->move.moving = TRUE; + sp->move.moving = true; // MOVE_SPEED で設定した場合は、移動量を考慮して移動時間を決定 if (sp->move.speed > 0) { diff --git a/modules/SACT/sprite_msg.c b/modules/SACT/sprite_msg.c index 65e8cba..fded121 100644 --- a/modules/SACT/sprite_msg.c +++ b/modules/SACT/sprite_msg.c @@ -46,7 +46,7 @@ struct markinfo { int interval; }; -static boolean is_messagesprite(int wNum); +static bool is_messagesprite(int wNum); static void replacestr_cb(void* data, void* userdata); static char *replacestr(char *msg); static void update_mark(sprite_t *sp, cginfo_t *cg); @@ -65,17 +65,17 @@ static char *replacesrc; static char *replacedst; // 指定の番号のスプライトがメッセージスプライトかどうかをチェック -static boolean is_messagesprite(int wNum) { +static bool is_messagesprite(int wNum) { // check sprite number is sane - if (wNum >= (SPRITEMAX -1) || wNum <= 0) return FALSE; + if (wNum >= (SPRITEMAX -1) || wNum <= 0) return false; // check sprite is set - if (sact.sp[wNum] == NULL) return FALSE; + if (sact.sp[wNum] == NULL) return false; // check sprite is message sprite - if (sact.sp[wNum]->type != SPRITE_MSG) return FALSE; + if (sact.sp[wNum]->type != SPRITE_MSG) return false; - return TRUE; + return true; } // 文字列の置き換え処理 @@ -88,7 +88,7 @@ static void replacestr_cb(void* data, void* userdata) { start = replacesrc; out = replacedst; - while (TRUE) { + while (true) { next = strstr(start, ex->src); if (next == NULL) break; strncat(out, start, (size_t)(next - start)); @@ -118,10 +118,10 @@ static char *replacestr(char *msg) { // アニメパターンの描画 static void update_mark(sprite_t *sp, cginfo_t *cg) { - boolean show = sp->show; + bool show = sp->show; cginfo_t *curcg = sp->curcg; - sp->show = TRUE; + sp->show = true; sp->curcg = cg; sp_updateme(sp); @@ -241,7 +241,7 @@ void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wF char *msg; sprite_t *sp; int len = 0; // 処理した文字数? - boolean needupdate = FALSE; + bool needupdate = false; MyRectangle uparea = {0,0,0,0}; // wRSize == 0 -> ルビ無し(SACT.MessageOutputからの呼出) @@ -303,7 +303,7 @@ void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wF mbuf, wColorR, wColorG, wColorB); - needupdate = TRUE; + needupdate = true; append_to_log(mbuf); @@ -314,7 +314,7 @@ void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wF cw, wSize + wRSize + wRLineSpace); sp_update_clipped(); - needupdate = FALSE; + needupdate = false; // keywait delta = sdl_getTicks() - wcnt; diff --git a/modules/SACT/sprite_put.c b/modules/SACT/sprite_put.c index a72992e..ef8852d 100644 --- a/modules/SACT/sprite_put.c +++ b/modules/SACT/sprite_put.c @@ -48,7 +48,7 @@ static int eventCB_PUT(sprite_t *sp, agsevent_t *e) { update++; } - sp->pressed = TRUE; + sp->pressed = true; break; case AGSEVENT_BUTTON_RELEASE: @@ -76,7 +76,7 @@ static int eventCB_PUT(sprite_t *sp, agsevent_t *e) { ssnd_play(sp->numsound2); } } - sp->pressed = FALSE; + sp->pressed = false; } break; } diff --git a/modules/SACT/sprite_sel.c b/modules/SACT/sprite_sel.c index d74af91..9e81542 100644 --- a/modules/SACT/sprite_sel.c +++ b/modules/SACT/sprite_sel.c @@ -44,11 +44,11 @@ static int selected_item_cur; static surface_t *selcanvas; // 前のカーソルの状態 -static boolean oldstate; // spriteの中か外か +static bool oldstate; // spriteの中か外か static int oldindex; // 何番目の要素か(0~) -static boolean sp_is_insprite2(sprite_t *sp, int x, int y, int margin); +static bool sp_is_insprite2(sprite_t *sp, int x, int y, int margin); static void cb_select_move(agsevent_t *e); static void cb_select_release(agsevent_t *e); static int update_selwindow(sprite_t *sp); @@ -63,7 +63,7 @@ static int sel_main(); * 内側にマージンを含む sprite内領域チェック * マージン内はsprite内部とは判断しない */ -static boolean sp_is_insprite2(sprite_t *sp, int x, int y, int margin) { +static bool sp_is_insprite2(sprite_t *sp, int x, int y, int margin) { MyPoint p = {x, y}; MyRectangle r = { sp->cur.x + margin, @@ -78,7 +78,7 @@ static boolean sp_is_insprite2(sprite_t *sp, int x, int y, int margin) { static void cb_select_move(agsevent_t *e) { int x = e->mousex, y = e->mousey; sprite_t *sp = sact.sp[sact.sel.spno]; - boolean newstate; + bool newstate; int newindex; // sprite内か? @@ -116,7 +116,7 @@ static void cb_select_move(agsevent_t *e) { static void cb_select_release(agsevent_t *e) { int x = e->mousex, y = e->mousey; sprite_t *sp = sact.sp[sact.sel.spno]; - boolean st; + bool st; int iy; switch (e->code) { @@ -202,7 +202,7 @@ static void setup_selwindow() { (sact.sel.font_size + sact.sel.linespace) * (sact.sel.movecursor - 1); ags_setCursorLocation(x, y, true, true); selected_item = (sact.sel.movecursor -1); - oldstate = TRUE; + oldstate = true; oldindex = selected_item -1; } @@ -315,7 +315,7 @@ void ssel_add(int nString, int wI) { */ int ssel_select(int wNum, int wChoiceSize, int wMenuOutSpc, int wChoiceLineSpace, int wChoiceAutoMoveCursor, int nAlign) { int ret = 0; - boolean saveflag; + bool saveflag; // check sprite number is sane if (wNum >= (SPRITEMAX-1) || wNum <= 0) return ret; @@ -335,7 +335,7 @@ int ssel_select(int wNum, int wChoiceSize, int wMenuOutSpc, int wChoiceLineSpace // 古い sprite の表示フラグを保存 saveflag = sact.sp[wNum]->show; - sact.sp[wNum]->show = TRUE; + sact.sp[wNum]->show = true; setup_selwindow(); ret = sel_main(); diff --git a/modules/SACT/sprite_switch.c b/modules/SACT/sprite_switch.c index 3fbf59b..5a8170c 100644 --- a/modules/SACT/sprite_switch.c +++ b/modules/SACT/sprite_switch.c @@ -49,7 +49,7 @@ static int eventCB_switch(sprite_t *sp, agsevent_t *e) { update++; } - sp->pressed = TRUE; + sp->pressed = true; break; case AGSEVENT_BUTTON_RELEASE: @@ -71,7 +71,7 @@ static int eventCB_switch(sprite_t *sp, agsevent_t *e) { ssnd_play(sp->numsound2); } } - sp->pressed = FALSE; + sp->pressed = false; break; } diff --git a/modules/SACT/sprite_update.c b/modules/SACT/sprite_update.c index 13eaceb..ad20b7b 100644 --- a/modules/SACT/sprite_update.c +++ b/modules/SACT/sprite_update.c @@ -90,7 +90,7 @@ static void do_update_each(void* data, void* userdata) { 画面全体の更新 @param syncscreen: surface0 に描画したものを Screen に反映させるかどうか */ -int sp_update_all(boolean syncscreen) { +int sp_update_all(bool syncscreen) { // スプライト移動がある場合は移動開始 if (sact.movelist) { diff --git a/modules/ShGraph/ShGraph.c b/modules/ShGraph/ShGraph.c index c7024b0..e11d741 100644 --- a/modules/ShGraph/ShGraph.c +++ b/modules/ShGraph/ShGraph.c @@ -452,7 +452,7 @@ static void PlayAnimeData() { int p6 = getCaliValue(); /* IWinMsg */ int interval, loop; int i; - boolean is_backcopied; + bool is_backcopied; agsurface_t *dib; TRACE("ShGraph.PlayAnimeData %d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6); @@ -470,7 +470,7 @@ static void PlayAnimeData() { for (loop = 0; loop < p1; loop++) { int cnt = sdl_getTicks(); - is_backcopied = FALSE; + is_backcopied = false; for (i = 0; i < SLOT; i++) { int srcno = s1[i].add_p2; @@ -489,7 +489,7 @@ static void PlayAnimeData() { int sx, sy, dx, dy; if (!is_backcopied) { - is_backcopied = TRUE; + is_backcopied = true; ags_copyArea(mapback.x, mapback.y, mapback.w, mapback.h, mapback_p5, mapback_p6); } diff --git a/modules/lib/graph.c b/modules/lib/graph.c index ad88ab6..49e795c 100644 --- a/modules/lib/graph.c +++ b/modules/lib/graph.c @@ -36,48 +36,48 @@ * @param ds: 転送先surface * @param dx: 転送先X座標 * @param dy: 転送先Y座標 - * @return TRUE -> 描画領域がある - * FALSE-> 転送領域の高さや幅が0以下になったり、転送元、転送先の座標が + * @return true -> 描画領域がある + * false-> 転送領域の高さや幅が0以下になったり、転送元、転送先の座標が * surfaceの範囲外になり、描画領域がなくなった。 * それぞれの引数は適宜変更されている */ -boolean gr_clip(surface_t *ss, int *sx, int *sy, int *sw, int *sh, surface_t *ds, int *dx, int *dy) { +bool gr_clip(surface_t *ss, int *sx, int *sy, int *sw, int *sh, surface_t *ds, int *dx, int *dy) { int w, h; if (ss == NULL) { WARNING("ss surface is null"); - return FALSE; + return false; } if (ss == NULL) { WARNING("ss surface is null"); - return FALSE; + return false; } if (*sx > ss->width) { WARNING("sx is too large (sx=%d,width=%d)", *sx, ss->width); - return FALSE; + return false; } if (*sy > ss->height) { WARNING("sy is too large (sy=%d,height=%d)", *sy, ss->height); - return FALSE; + return false; } if (*sx < 0) { WARNING("sx is too small (sx=%d)", *sx); - return FALSE; + return false; } if (*sy < 0) { WARNING("sy is too small (sy=%d)", *sy); - return FALSE; + return false; } if (*dx > ds->width) { WARNING("dx is too large (dx=%d,width=%d)", *dx, ds->width); - return FALSE; + return false; } if (*dy > ds->height) { WARNING("dy is too large (dy=%d,height=%d)", *dy, ds->height); - return FALSE; + return false; } w = *sw; @@ -95,11 +95,11 @@ boolean gr_clip(surface_t *ss, int *sx, int *sy, int *sw, int *sh, surface_t *ds if (*sw <= 0) { WARNING("sw become <=0"); - return FALSE; + return false; } if (*sh <= 0) { WARNING("sh become <=0"); - return FALSE; + return false; } if (*sw != w) { @@ -109,7 +109,7 @@ boolean gr_clip(surface_t *ss, int *sx, int *sy, int *sw, int *sh, surface_t *ds NOTICE("height change %d -> %d", h, *sh); } - return TRUE; + return true; } /** @@ -120,26 +120,26 @@ boolean gr_clip(surface_t *ss, int *sx, int *sy, int *sw, int *sh, surface_t *ds * @param sy: 描画開始Y座標 * @param sw: 描画幅 * @param sh: 描画高さ - * @return TRUE -> 描画領域がある - * FALSE-> 描画領域の高さや幅が0以下になったり、描画開始座標が + * @return true -> 描画領域がある + * false-> 描画領域の高さや幅が0以下になったり、描画開始座標が * surfaceの範囲外になり、描画領域がなくなった。 * それぞれの引数は適宜変更されている */ -boolean gr_clip_xywh(surface_t *ss, int *sx, int *sy, int *sw, int *sh) { +bool gr_clip_xywh(surface_t *ss, int *sx, int *sy, int *sw, int *sh) { int w, h; if (ss == NULL) { WARNING("ss surface is null"); - return FALSE; + return false; } if (*sx > ss->width) { WARNING("sx is too large (sx=%d,width=%d)", *sx, ss->width); - return FALSE; + return false; } if (*sy > ss->height) { WARNING("sy is too large (sy=%d,height=%d)", *sy, ss->height); - return FALSE; + return false; } w = *sw; @@ -157,11 +157,11 @@ boolean gr_clip_xywh(surface_t *ss, int *sx, int *sy, int *sw, int *sh) { if (*sw <= 0) { WARNING("sw become <=0"); - return FALSE; + return false; } if (*sh <= 0) { WARNING("sh become <=0"); - return FALSE; + return false; } if (*sw != w) { @@ -171,7 +171,7 @@ boolean gr_clip_xywh(surface_t *ss, int *sx, int *sy, int *sw, int *sh) { NOTICE("height change %d -> %d", h, *sh); } - return TRUE; + return true; } void gr_init() { diff --git a/modules/lib/ngraph.h b/modules/lib/ngraph.h index c008ea4..7ad2ced 100644 --- a/modules/lib/ngraph.h +++ b/modules/lib/ngraph.h @@ -11,8 +11,8 @@ // DLL 用 graphic 関連関数 /* in graph.c */ -extern boolean gr_clip(surface_t *ss, int *sx, int *sy, int *sw, int *sh, surface_t *ds, int *dx, int *dy); -extern boolean gr_clip_xywh(surface_t *ss, int *sx, int *sy, int *sw, int *sh); +extern bool gr_clip(surface_t *ss, int *sx, int *sy, int *sw, int *sh, surface_t *ds, int *dx, int *dy); +extern bool gr_clip_xywh(surface_t *ss, int *sx, int *sy, int *sw, int *sh); /* in graph_expandcolor_blend.c */ diff --git a/modules/lib/surface.c b/modules/lib/surface.c index 2c44461..b9a9714 100644 --- a/modules/lib/surface.c +++ b/modules/lib/surface.c @@ -8,7 +8,7 @@ #include "surface.h" #include "system.h" -static surface_t *create(int width, int height, int depth, boolean has_pixel, boolean has_alpha) { +static surface_t *create(int width, int height, int depth, bool has_pixel, bool has_alpha) { surface_t *s = calloc(1, sizeof(surface_t)); s->width = width; @@ -56,7 +56,7 @@ static surface_t *create(int width, int height, int depth, boolean has_pixel, bo * @return 生成した surface オブジェクト */ surface_t *sf_create_surface(int width, int height, int depth) { - return create(width, height, depth, TRUE, TRUE); + return create(width, height, depth, true, true); } /** @@ -66,7 +66,7 @@ surface_t *sf_create_surface(int width, int height, int depth) { * @return 生成した surface オブジェクト */ surface_t *sf_create_alpha(int width, int height) { - return create(width, height, 8, FALSE, TRUE); + return create(width, height, 8, false, true); } /** @@ -77,7 +77,7 @@ surface_t *sf_create_alpha(int width, int height) { * @return 生成した surface オブジェクト */ surface_t *sf_create_pixel(int width, int height, int depth) { - return create(width, height, depth, TRUE, FALSE); + return create(width, height, depth, true, false); } /** @@ -156,7 +156,7 @@ void sf_copyall(surface_t *dst, surface_t *src) { * @param copyalpha: alpha pixel をコピーするか * @return: 複製した surface */ -surface_t *sf_dup2(surface_t *in, boolean copypixel, boolean copyalpha) { +surface_t *sf_dup2(surface_t *in, bool copypixel, bool copyalpha) { surface_t *sf; int len; diff --git a/modules/lib/surface.h b/modules/lib/surface.h index e699faa..241101d 100644 --- a/modules/lib/surface.h +++ b/modules/lib/surface.h @@ -11,7 +11,7 @@ extern surface_t *sf_create_alpha(int width, int height); extern surface_t *sf_create_pixel(int width, int height, int depth); extern void sf_free(surface_t *s); extern surface_t *sf_dup(surface_t *in); -extern surface_t *sf_dup2(surface_t *in, boolean copypixel, boolean copyalpha); +extern surface_t *sf_dup2(surface_t *in, bool copypixel, bool copyalpha); extern void sf_copyall(surface_t *dst, surface_t *src); diff --git a/src/ags.c b/src/ags.c index ed52c9d..cce382a 100644 --- a/src/ags.c +++ b/src/ags.c @@ -44,12 +44,12 @@ #include "image.h" #include "debugger.h" -static boolean need_update = TRUE; -static boolean fade_outed = FALSE; +static bool need_update = true; +static bool fade_outed = false; static int cursor_move_time = 50; /* カーソル移動にかかる時間(ms) */ static void palette_changed(void) { - nact->ags.pal_changed = TRUE; + nact->ags.pal_changed = true; dbg_on_palette_change(); } @@ -82,14 +82,14 @@ static void initPal(void) { palette_changed(); } -boolean ags_check_param(int *x, int *y, int *w, int *h) { +bool ags_check_param(int *x, int *y, int *w, int *h) { if (*x >= nact->ags.world_size.width) { WARNING("Illegal Param x = %d (max=%d)(@%03x:%05x)", *x, nact->ags.world_size.width, sl_getPage(), sl_getIndex()); - return FALSE; + return false; } if (*y >= nact->ags.world_size.height) { WARNING("Illegal Param y = %d (max=%d)", *y, nact->ags.world_size.height); - return FALSE; + return false; } if (*x < 0) { *w += *x; *x = 0; } @@ -98,26 +98,26 @@ boolean ags_check_param(int *x, int *y, int *w, int *h) { if ((*x + *w) > nact->ags.world_size.width) { *w = nact->ags.world_size.width - *x;} if ((*y + *h) > nact->ags.world_size.height) { *h = nact->ags.world_size.height - *y;} - if (*w <= 0) return FALSE; - if (*h <= 0) return FALSE; + if (*w <= 0) return false; + if (*h <= 0) return false; - return TRUE; + return true; } -boolean ags_check_param_xy(int *x, int *y) { +bool ags_check_param_xy(int *x, int *y) { if (*x >= nact->ags.world_size.width) { WARNING("Illegal Param x = %d", *x); - return FALSE; + return false; } if (*y >= nact->ags.world_size.height) { WARNING("Illegal Param y = %d", *y); - return FALSE; + return false; } if (*x < 0) { *x = 0; } if (*y < 0) { *y = 0; } - return TRUE; + return true; } void ags_init(const char *render_driver, bool enable_zb) { @@ -141,7 +141,7 @@ void ags_init(const char *render_driver, bool enable_zb) { } void ags_remove(void) { - ags_autorepeat(TRUE); + ags_autorepeat(true); sdl_Remove(); } @@ -172,7 +172,7 @@ void ags_setWorldSize(int width, int height, int depth) { memset(nact->ags.dib->alpha, 255, width * height); } - fade_outed = FALSE; /* thanx tajiri@wizard */ + fade_outed = false; /* thanx tajiri@wizard */ palette_changed(); } @@ -207,7 +207,7 @@ void ags_getWindowInfo(DispInfo *info) { sdl_getWindowInfo(info); } -void ags_setExposeSwitch(boolean expose) { +void ags_setExposeSwitch(bool expose) { need_update = expose; } @@ -539,7 +539,7 @@ void ags_alpha_setPixel(int x, int y, int w, int h, uint8_t *b) { alpha_set_pixels(nact->ags.dib, x, y, w, h, b + offset, savew); } -void ags_runEffect(int duration_ms, boolean cancelable, ags_EffectStepFunc step, void *arg) { +void ags_runEffect(int duration_ms, bool cancelable, ags_EffectStepFunc step, void *arg) { unsigned wflags = cancelable ? KEYWAIT_CANCELABLE : KEYWAIT_NONCANCELABLE; int start = sdl_getTicks(); for (int t = 0; t < duration_ms; t = sdl_getTicks() - start) { @@ -553,7 +553,7 @@ void ags_runEffect(int duration_ms, boolean cancelable, ags_EffectStepFunc step, step(arg, 1.0); } -static void fade(int duration, boolean cancelable, enum sdl_effect_type type) { +static void fade(int duration, bool cancelable, enum sdl_effect_type type) { nact->waitcancel_key = 0; SDL_Rect rect = {0, 0, nact->ags.view_area.w, nact->ags.view_area.h}; @@ -565,8 +565,8 @@ static void fade(int duration, boolean cancelable, enum sdl_effect_type type) { sdl_effect_finish(eff); } -void ags_fadeIn(int rate, boolean flag) { - fade_outed = FALSE; +void ags_fadeIn(int rate, bool flag) { + fade_outed = false; if (nact->ags.world_depth == 8) sdl_setPalette(nact->ags.pal, 0, 256); @@ -579,12 +579,12 @@ void ags_fadeIn(int rate, boolean flag) { sdl_updateAll(&nact->ags.view_area); } -void ags_fadeOut(int rate, boolean flag) { +void ags_fadeOut(int rate, bool flag) { if (need_update && !fade_outed) { int duration = rate * 16 * 1000 / 60; fade(duration, flag, nact->ags.world_depth == 8 ? EFFECT_FADEOUT : EFFECT_DITHERING_FADEOUT); } - fade_outed = TRUE; + fade_outed = true; if (nact->ags.world_depth == 8) { Color pal[256]; @@ -593,8 +593,8 @@ void ags_fadeOut(int rate, boolean flag) { } } -void ags_whiteIn(int rate, boolean flag) { - fade_outed = FALSE; +void ags_whiteIn(int rate, bool flag) { + fade_outed = false; if (nact->ags.world_depth == 8) sdl_setPalette(nact->ags.pal, 0, 256); @@ -607,12 +607,12 @@ void ags_whiteIn(int rate, boolean flag) { sdl_updateAll(&nact->ags.view_area); } -void ags_whiteOut(int rate, boolean flag) { +void ags_whiteOut(int rate, bool flag) { if (need_update && !fade_outed) { int duration = rate * 16 * 1000 / 60; fade(duration, flag, nact->ags.world_depth == 8 ? EFFECT_WHITEIN : EFFECT_DITHERING_WHITEOUT); } - fade_outed = TRUE; + fade_outed = true; if (nact->ags.world_depth == 8) { Color pal[256]; @@ -679,13 +679,13 @@ void ags_setCursorLocation(int x, int y, bool is_dibgeo, bool for_selection) { } EMSCRIPTEN_KEEPALIVE -void ags_setAntialiasedStringMode(boolean on) { +void ags_setAntialiasedStringMode(bool on) { if (!nact->ags.noantialias) { font_set_antialias(on); } } -boolean ags_getAntialiasedStringMode() { +bool ags_getAntialiasedStringMode() { return font_get_antialias(); } @@ -712,6 +712,6 @@ agsurface_t *ags_getDIB() { return nact->ags.dib; } -void ags_autorepeat(boolean enable) { +void ags_autorepeat(bool enable) { sdl_setAutoRepeat(enable); } diff --git a/src/ags.h b/src/ags.h index a3a9bcd..77012d4 100644 --- a/src/ags.h +++ b/src/ags.h @@ -102,7 +102,7 @@ enum agsevent_button { struct _ags { Color pal[256]; /* system palette */ - boolean pal_changed; /* system palette has changed */ + bool pal_changed; /* system palette has changed */ MyDimension world_size; /* size of off-screen */ @@ -117,8 +117,8 @@ struct _ags { bool mouse_warp_enabled; bool enable_zb; - boolean noantialias; /* antialias を使用しない */ - boolean noimagecursor; /* リソースファイルのカーソルを読みこまない */ + bool noantialias; /* antialias を使用しない */ + bool noimagecursor; /* リソースファイルのカーソルを読みこまない */ }; typedef struct _ags ags_t; @@ -136,12 +136,12 @@ extern void ags_setWindowTitle(const char *title_utf8); extern void ags_getDIBInfo(DispInfo *info); extern void ags_getWindowInfo(DispInfo *info); extern void ags_getViewAreaInfo(DispInfo *info); -extern boolean ags_check_param(int *x, int *y, int *w, int *h); -extern boolean ags_check_param_xy(int *x, int *y); +extern bool ags_check_param(int *x, int *y, int *w, int *h); +extern bool ags_check_param_xy(int *x, int *y); extern agsurface_t *ags_getDIB(); /* 画面更新 */ -extern void ags_setExposeSwitch(boolean expose); +extern void ags_setExposeSwitch(bool expose); extern void ags_updateFull(void); extern void ags_updateArea(int x, int y, int width, int height); @@ -191,10 +191,10 @@ extern void ags_alpha_getPixel(int x, int y, int *pic); extern void ags_alpha_setPixel(int x, int y, int w, int h, uint8_t *b); /* fader */ -extern void ags_fadeIn(int rate, boolean flg); -extern void ags_fadeOut(int rate, boolean flg); -extern void ags_whiteIn(int rate, boolean flg); -extern void ags_whiteOut(int rate, boolean flg); +extern void ags_fadeIn(int rate, bool flg); +extern void ags_fadeOut(int rate, bool flg); +extern void ags_whiteIn(int rate, bool flg); +extern void ags_whiteOut(int rate, bool flg); /* フォント関連 */ enum FontType { @@ -213,12 +213,12 @@ extern void ags_setCursorMoveTime(int msec); extern int ags_getCursorMoveTime(); /* misc */ -extern void ags_setAntialiasedStringMode(boolean mode); -extern boolean ags_getAntialiasedStringMode(); -extern void ags_autorepeat(boolean enable); +extern void ags_setAntialiasedStringMode(bool mode); +extern bool ags_getAntialiasedStringMode(); +extern void ags_autorepeat(bool enable); typedef void (*ags_EffectStepFunc)(void *, float); -void ags_runEffect(int duration_ms, boolean cancelable, ags_EffectStepFunc step, void *arg); +void ags_runEffect(int duration_ms, bool cancelable, ags_EffectStepFunc step, void *arg); #define RMASK16 0xf800 #define GMASK16 0x07e0 diff --git a/src/ald_manager.c b/src/ald_manager.c index 5a66888..7649b8e 100644 --- a/src/ald_manager.c +++ b/src/ald_manager.c @@ -108,7 +108,7 @@ void ald_freedata(dridata *data) { } } -void ald_init(int type, const char **file, int cnt, boolean use_mmap) { +void ald_init(int type, const char **file, int cnt, bool use_mmap) { if (type >= DRIFILETYPEMAX || cnt <= 0) return; dri[type] = dri_init(file, cnt, use_mmap); diff --git a/src/ald_manager.h b/src/ald_manager.h index 31e8993..3852228 100644 --- a/src/ald_manager.h +++ b/src/ald_manager.h @@ -38,7 +38,7 @@ typedef enum { DRIFILE_BGM =6 /* stream music data */ } DRIFILETYPE; -void ald_init(int type, const char **file, int cnt, boolean use_mmap); +void ald_init(int type, const char **file, int cnt, bool use_mmap); bool ald_is_linked(DRIFILETYPE type, int no); bool ald_exists(DRIFILETYPE type, int no); dridata *ald_getdata(DRIFILETYPE type, int no); diff --git a/src/bmp.c b/src/bmp.c index e07ece8..817b63b 100644 --- a/src/bmp.c +++ b/src/bmp.c @@ -141,20 +141,20 @@ static void extract_24bit(bmp_header *bmp, uint16_t *pic, uint8_t *b) { /* * Check data is 8bit bmp format cg or not * data: raw data (pointer to data top) - * return: TRUE if data is bmp + * return: true if data is bmp */ -boolean bmp256_checkfmt(uint8_t *data) { +bool bmp256_checkfmt(uint8_t *data) { int w, h, bpp; - if (data[0] != 'B' || data[1] != 'M') return FALSE; + if (data[0] != 'B' || data[1] != 'M') return false; w = LittleEndian_getDW(data, 18); h = LittleEndian_getDW(data, 22); bpp = LittleEndian_getW(data, 28); - if (bpp != 8) return FALSE; - if (w < 0 || h < 0) return FALSE; + if (bpp != 8) return false; + if (w < 0 || h < 0) return false; - return TRUE; + return true; } /* @@ -188,21 +188,21 @@ cgdata *bmp256_extract(uint8_t *data) { /* * Check data is 24bit bmp format cg or not * data: raw data (pointer to data top) - * return: TRUE if data is pms + * return: true if data is pms */ -boolean bmp16m_checkfmt(uint8_t *data) { +bool bmp16m_checkfmt(uint8_t *data) { int w, h, bpp; - if (data[0] != 'B' || data[1] != 'M') return FALSE; + if (data[0] != 'B' || data[1] != 'M') return false; w = LittleEndian_getDW(data, 18); h = LittleEndian_getDW(data, 22); bpp = LittleEndian_getW(data, 28); - if (bpp != 24) return FALSE; - if (w < 0 || h < 0) return FALSE; + if (bpp != 24) return false; + if (w < 0 || h < 0) return false; - return TRUE; + return true; } /* diff --git a/src/bmp.h b/src/bmp.h index 4e179c0..89d1dea 100644 --- a/src/bmp.h +++ b/src/bmp.h @@ -46,9 +46,9 @@ typedef struct { BMP_Type bmpTp; /* bmp type */ } bmp_header; -extern boolean bmp256_checkfmt(uint8_t *data); +extern bool bmp256_checkfmt(uint8_t *data); extern cgdata *bmp256_extract(uint8_t *data); -extern boolean bmp16m_checkfmt(uint8_t *data); +extern bool bmp16m_checkfmt(uint8_t *data); extern cgdata *bmp16m_extract(uint8_t *data); #endif /* !__BMP__ */ diff --git a/src/cdrom.mp3.c b/src/cdrom.mp3.c index be5ddfd..75dca29 100644 --- a/src/cdrom.mp3.c +++ b/src/cdrom.mp3.c @@ -55,7 +55,7 @@ cdromdevice_t cdrom = { #define PLAYLIST_MAX 256 -static boolean enabled = FALSE; +static bool enabled = false; static char *playlist[PLAYLIST_MAX]; static Mix_Music *mix_music; static int trackno; // 現在演奏中のトラック @@ -101,7 +101,7 @@ static int cdrom_init(char *playlist_path) { NOTICE("cdrom: Loaded playlist from %s", playlist_path); trackno = 0; - enabled = TRUE; + enabled = true; return OK; } diff --git a/src/cmd2F.c b/src/cmd2F.c index 2d2271f..c1bb4c9 100644 --- a/src/cmd2F.c +++ b/src/cmd2F.c @@ -1503,7 +1503,7 @@ void commands2F8B() { void commands2F8C() { TRACE("sysReset:"); - nact_quit(TRUE); + nact_quit(true); } void cmd2F_reset(void) { diff --git a/src/cmd_check.c b/src/cmd_check.c index b9cd8c5..d8b7cc2 100644 --- a/src/cmd_check.c +++ b/src/cmd_check.c @@ -211,10 +211,10 @@ void exec_command(void) { /* 選択肢の登録 */ if (nact->sel.in_setting) { sel_fixElement(); - nact->sel.in_setting = FALSE; + nact->sel.in_setting = false; } else { sel_addRetValue(sl_getaddr()); - nact->sel.in_setting = TRUE; + nact->sel.in_setting = true; } break; case '%': @@ -534,7 +534,7 @@ void exec_command(void) { case 'A': /* hit Any Key */ sys_hit_any_key(); - msg_nextPage(TRUE); + msg_nextPage(true); TRACE("A"); break; case 'B': diff --git a/src/cmdb.c b/src/cmdb.c index 379bc04..ca6d358 100644 --- a/src/cmdb.c +++ b/src/cmdb.c @@ -36,9 +36,9 @@ void commandB0() { switch(num) { case 0: - msg_nextPage(TRUE); break; + msg_nextPage(true); break; case 1: - msg_nextPage(FALSE); break; + msg_nextPage(false); break; default: break; } diff --git a/src/cmdi.c b/src/cmdi.c index 194abfb..353dab0 100644 --- a/src/cmdi.c +++ b/src/cmdi.c @@ -61,7 +61,7 @@ void commandIK() { sys_keywait(REPEAT_RATE_SLOW, KEYWAIT_NONCANCELABLE); } repeating++; - sys_key_releasewait(key, TRUE); + sys_key_releasewait(key, true); sysVar[0] = ik_key = key; break; case 1: @@ -75,11 +75,11 @@ void commandIK() { sys_keywait(REPEAT_RATE_FAST, KEYWAIT_NONCANCELABLE); } repeating++; - sys_key_releasewait(key, TRUE); + sys_key_releasewait(key, true); sysVar[0] = ik_key = key; break; case 2: - sysVar[0] = sys_getMouseInfo(NULL, TRUE); + sysVar[0] = sys_getMouseInfo(NULL, true); break; case 3: sysVar[0] = sys_getKeyInfo(); @@ -104,7 +104,7 @@ void commandIM() { int *y_var = getCaliVariable(); MyPoint p; - sysVar[0] = sys_getMouseInfo(&p, FALSE); + sysVar[0] = sys_getMouseInfo(&p, false); *x_var = p.x; *y_var = p.y; TRACE("IM %d,%d:", *x_var, *y_var); @@ -143,9 +143,9 @@ void commandIY() { int p1 = getCaliValue(); if (p1 == 0) { - msgskip_activate(FALSE); + msgskip_activate(false); } else if (p1 == 1) { - msgskip_activate(TRUE); + msgskip_activate(true); } else if (p1 == 2) { msgskip_setFlags(MSGSKIP_STOP_ON_MENU, MSGSKIP_STOP_ON_MENU); } else if (p1 == 3) { diff --git a/src/cmdp.c b/src/cmdp.c index 3276477..06dc19b 100644 --- a/src/cmdp.c +++ b/src/cmdp.c @@ -38,12 +38,12 @@ void commandPN() { void commandPF() { int p1 = sl_getc(); int num = getCaliValue(); - boolean cancel_enabled; + bool cancel_enabled; if (p1 == 2 || p1 == 3) { cancel_enabled = getCaliValue() != 0; } else { - cancel_enabled = FALSE; + cancel_enabled = false; } switch(p1) { case 0: @@ -66,12 +66,12 @@ void commandPF() { void commandPW() { int p1 = sl_getc(); int num = getCaliValue(); - boolean cancel_enabled; + bool cancel_enabled; if (p1 == 2 || p1 == 3) { cancel_enabled = getCaliValue() != 0; } else { - cancel_enabled = FALSE; + cancel_enabled = false; } switch(p1) { case 0: diff --git a/src/cmds.c b/src/cmds.c index 2c44436..36e2e7b 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -29,7 +29,7 @@ #include "hacks.h" /* ぱにょ〜ん 異常シナリオ対策 */ -static boolean dummy_pcm_in_play = FALSE; +static bool dummy_pcm_in_play = false; /* 次の cdrom の loop 回数 */ static int next_cdrom_loopcnt = 0; @@ -230,7 +230,7 @@ void commandSP() { TRACE("SP %d,%d:",no,loop); if (!mus_pcm_get_state()) { - dummy_pcm_in_play = TRUE; + dummy_pcm_in_play = true; } /* ???? */ @@ -248,7 +248,7 @@ void commandST() { TRACE("ST %d:",time); if (!mus_pcm_get_state()) { - dummy_pcm_in_play = FALSE; + dummy_pcm_in_play = false; } mus_pcm_stop(time); } @@ -261,7 +261,7 @@ void commandSU() { if (!mus_pcm_get_state()) { *var1 = dummy_pcm_in_play ? 1 : 0; *var2 = 0; - if (dummy_pcm_in_play) dummy_pcm_in_play = FALSE; + if (dummy_pcm_in_play) dummy_pcm_in_play = false; } else { *var2 = 0; mus_pcm_get_playposition(var2); @@ -298,7 +298,7 @@ void commandSQ() { TRACE("SQ %d,%d,%d:", noL, noR, loop); if (!mus_pcm_get_state()) { - dummy_pcm_in_play = TRUE; + dummy_pcm_in_play = true; } if( noL<1 || noR<1 ) { @@ -325,7 +325,7 @@ void commandSW() { if (mus_pcm_get_state()) { int rate = Srate == 11 ? 11025 : Srate == 22 ? 22050 : Srate == 44 ? 44100 : 8000; - boolean able; + bool able; int ret; ret = mus_pcm_check_ability(bit, rate, channel, &able); @@ -366,7 +366,7 @@ void commandSX() { case 2: { /* フェード終了確認 */ int *var = getCaliVariable(); - boolean st; + bool st; st = mus_mixer_fadeout_get_state(device); *var = (st ? 0 : 1); TRACE("SX %d,%d:", device, sw); diff --git a/src/cmdv.c b/src/cmdv.c index f4caf36..ffe235e 100644 --- a/src/cmdv.c +++ b/src/cmdv.c @@ -43,8 +43,8 @@ typedef struct { int nxUnit; int nyUnit; int bSpCol; - boolean fEnable; - boolean useTTP; + bool fEnable; + bool useTTP; int TTPunit; } UnitMapSrcImg; @@ -71,9 +71,9 @@ typedef struct { int preY; int curX; /* 現在位置 */ int curY; - boolean draw; /* UNITを描く? */ - boolean nomove; /* 移動あり・なし */ - boolean rewrite; /* 画面更新の必要あり */ + bool draw; /* UNITを描く? */ + bool nomove; /* 移動あり・なし */ + bool rewrite; /* 画面更新の必要あり */ } VaParam; typedef struct { @@ -110,7 +110,7 @@ static UnitMapSrcImg *srcimg; #define VA_RUNNING 1 #define VACMD_MAX 20 /* Panyoで18まで */ static VaParam VAcmd[VACMD_MAX]; -static boolean inAnimation = FALSE; /* 画面更新中 */ +static bool inAnimation = false; /* 画面更新中 */ /* UnitMap 各種マクロ */ #define MAPSIZE_PER_ATTRIB (cxMap * cyMap) @@ -126,7 +126,7 @@ static boolean inAnimation = FALSE; /* 画面更新中 */ #define UNITMAP_WALKPAINT_PAGETOP(page) UNITMAP_WALKPAINT((page),0,0) #define UNITMAP_WALKRESULT_PAGETOP(page) UNITMAP_WALKRESULT((page),0,0) -static boolean vh_checkImmovableArea(int page, int x, int y, int w, int h); +static bool vh_checkImmovableArea(int page, int x, int y, int w, int h); static void vh_append_pos(int x, int y); static void vh_copy_to_src(); static void vh_check_udlr(int n, int nPage, int x, int y); @@ -196,8 +196,8 @@ void commandVP() { /* from T2 */ srcimg[nPage].nxUnit = nxUnit; srcimg[nPage].nyUnit = nyUnit; srcimg[nPage].bSpCol = bSpCol; - srcimg[nPage].useTTP = FALSE; - srcimg[nPage].fEnable = TRUE; + srcimg[nPage].useTTP = false; + srcimg[nPage].fEnable = true; } void commandVS() { /* from Rance4 */ @@ -376,7 +376,7 @@ void commandVH() { /* from Rance4 */ vh_cnt_src = n = 1; vh_cnt_dst = 0; - while(TRUE) { + while(true) { for (i = 0; i < vh_cnt_src; i++) { vh_check_udlr(n, nPage, (vh_src + i)->x, (vh_src + i)->y); } @@ -569,9 +569,9 @@ void commandVZ() { /* from T2 */ switch(p1) { case 0: - srcimg[p2].useTTP = FALSE; break; + srcimg[p2].useTTP = false; break; case 1: - srcimg[p2].useTTP = TRUE; + srcimg[p2].useTTP = true; srcimg[p2].TTPunit = p3; break; case 2: @@ -743,9 +743,9 @@ void commandVA() { /* from Panyo */ case 0: if (p2 == 0) { /* 停止 */ - inAnimation = TRUE; + inAnimation = true; VAcmd[p1].state = VA_STOPPED; - VAcmd[p1].draw = TRUE; + VAcmd[p1].draw = true; if (p3 == 0) { /* ユニット消し */ va_restoreUnit(p1); @@ -755,32 +755,32 @@ void commandVA() { /* from Panyo */ va_drawUnit(p1); va_updateUnit(p1); } - VAcmd[p1].draw = FALSE; + VAcmd[p1].draw = false; } else { /* 開始 (p3=コマ数,0:無限(開始位置==終了位置のとき))*/ - inAnimation = TRUE; + inAnimation = true; VAcmd[p1].elaspCut = 0; VAcmd[p1].startTime = sdl_getTicks(); VAcmd[p1].totalCut = p3; if (p3 == 0) { - VAcmd[p1].nomove = TRUE; + VAcmd[p1].nomove = true; } else { if (VAcmd[p1].startX == VAcmd[p1].endX && VAcmd[p1].startY == VAcmd[p1].endY) { - VAcmd[p1].nomove = TRUE; + VAcmd[p1].nomove = true; } else { - VAcmd[p1].nomove = FALSE; + VAcmd[p1].nomove = false; } } /* animation start */ - nact->is_va_animation = TRUE; + nact->is_va_animation = true; VAcmd[p1].state = VA_RUNNING; - VAcmd[p1].draw = TRUE; + VAcmd[p1].draw = true; va_drawUnit(p1); va_updateUnit(p1); if (p2 == 2) { - VAcmd[p1].rewrite = TRUE; + VAcmd[p1].rewrite = true; /* キー抜け無し ,p3=0は指定不可 */ while(VAcmd[p1].state == VA_RUNNING) { va_animationAlone(p1); @@ -791,7 +791,7 @@ void commandVA() { /* from Panyo */ } else if (p2 == 3) { /* キー抜けあり ,p3=0は指定不可*/ int key = 0; - VAcmd[p1].rewrite = TRUE; + VAcmd[p1].rewrite = true; while(VAcmd[p1].state == VA_RUNNING) { va_animationAlone(p1); sdl_sleep(10); @@ -854,20 +854,20 @@ void commandVA() { /* from Panyo */ } } -static boolean vh_checkImmovableArea(int page, int x, int y, int w, int h) { +static bool vh_checkImmovableArea(int page, int x, int y, int w, int h) { int _x, _y; - if (x + w > cxMap) return TRUE; + if (x + w > cxMap) return true; - if (y + h > cyMap) return TRUE; + if (y + h > cyMap) return true; for (_y = y; _y < (y+h); _y++) { for (_x = x; _x < (x+w); _x++) { - if (*UNITMAP_WALKRESULT(page, _x, _y) == 255) return TRUE; + if (*UNITMAP_WALKRESULT(page, _x, _y) == 255) return true; } } - return FALSE; + return false; } static void vh_append_pos(int x, int y) { @@ -959,7 +959,7 @@ void va_animation(void) { va_update(); - inAnimation = TRUE; + inAnimation = true; for (i = 0; i < VACMD_MAX; i++) { if (VAcmd[i].state == VA_STOPPED) continue; @@ -972,10 +972,10 @@ void va_animation(void) { h = max(VAcmd[i].curY + VAcmd[i].unitHeight, VAcmd[i].preY + VAcmd[i].unitHeight) - y; ags_updateArea(x, y, w, h); // printf("x = %d, y = %d, w = %d, h = %d\n", x, y, w, h); - VAcmd[i].rewrite = FALSE; + VAcmd[i].rewrite = false; } - inAnimation = FALSE; + inAnimation = false; } static void va_animationAlone(int i) { @@ -985,7 +985,7 @@ static void va_animationAlone(int i) { if (!VAcmd[i].rewrite) return; - inAnimation = TRUE; + inAnimation = true; va_restoreUnit(i); va_drawUnit(i); @@ -996,24 +996,24 @@ static void va_animationAlone(int i) { h = max(VAcmd[i].curY + VAcmd[i].unitHeight, VAcmd[i].preY + VAcmd[i].unitHeight) - y; ags_updateArea(x, y, w, h); - VAcmd[i].rewrite = FALSE; - inAnimation = FALSE; + VAcmd[i].rewrite = false; + inAnimation = false; } static void va_update() { - boolean proceeding = FALSE; + bool proceeding = false; int i; int curTime = sdl_getTicks(); for (i = 0; i < VACMD_MAX; i++) { if (VAcmd[i].state == VA_RUNNING) { - proceeding = TRUE; + proceeding = true; int cut = (curTime - VAcmd[i].startTime) / VAcmd[i].intervaltime; if (cut > VAcmd[i].elaspCut) { /* まだ更新していない場合はskip */ if (VAcmd[i].rewrite) continue; - VAcmd[i].rewrite = TRUE; + VAcmd[i].rewrite = true; VAcmd[i].elaspCut++; /* 古い場所 */ VAcmd[i].preX = VAcmd[i].curX; @@ -1033,7 +1033,7 @@ static void va_update() { } /* 更新するものが無い場合は、タイマーを止めて、アニメーションストップ */ if (!proceeding) { - nact->is_va_animation = FALSE; + nact->is_va_animation = false; } } @@ -1060,5 +1060,5 @@ void va_reset(void) { srcimg = NULL; memset(VAcmd, 0, sizeof(VAcmd)); - inAnimation = FALSE; + inAnimation = false; } diff --git a/src/cmdw.c b/src/cmdw.c index ffa058e..13b49ef 100644 --- a/src/cmdw.c +++ b/src/cmdw.c @@ -60,7 +60,7 @@ void commandWZ() { ags_setExposeSwitch(sw != 0); if (sw == 1) { /* う〜ん こんな処理いれなあかんのかぁ〜 (T_T) */ - if (nact->ags.world_depth == 8) nact->ags.pal_changed = TRUE; + if (nact->ags.world_depth == 8) nact->ags.pal_changed = true; ags_updateFull(); } break; @@ -80,7 +80,7 @@ void commandWX() { cx = getCaliValue(); cy = getCaliValue(); - ags_setExposeSwitch(TRUE); + ags_setExposeSwitch(true); ags_updateArea(x0, y0, cx, cy); TRACE("WX %d,%d,%d,%d:", x0, y0, cx, cy); diff --git a/src/cmdy.c b/src/cmdy.c index f9cead9..7817a20 100644 --- a/src/cmdy.c +++ b/src/cmdy.c @@ -92,10 +92,10 @@ void commandY() { case 1: if (p2 == 0) { /* メッセージ領域の初期化と、文字の表示位置を左上端にセットする */ - msg_nextPage(TRUE); + msg_nextPage(true); } else if (p2 == 1) { /* メッセージ領域の文字の表示位置を左上端にセットする */ - msg_nextPage(FALSE); + msg_nextPage(false); } break; case 2: @@ -127,7 +127,7 @@ void commandY() { break; default: if (p1 == 1003) { - sys_key_releasewait(SYS35KEY_RET, FALSE); + sys_key_releasewait(SYS35KEY_RET, false); } else if (game_id == GAME_RANCE4_V2 && p2 == 1) { // Return immediately if any key is pressed. sysVar[0] = sys_getInputInfo(); diff --git a/src/cmdz.c b/src/cmdz.c index 98876cf..08685c6 100644 --- a/src/cmdz.c +++ b/src/cmdz.c @@ -127,7 +127,7 @@ void commandZW() { if (sw < 256) { nact->messagewait_enable = ((sw & 0xff) > 1); - nact->messagewait_cancelled = FALSE; + nact->messagewait_cancelled = false; } else { nact->messagewait_time = sw & 0xff; nact->messagewait_cancel = !!(sw & 0x200); @@ -160,13 +160,13 @@ void commandZF() { switch(sw) { case 0: - nact->sel.WinResizeHeight = TRUE; break; + nact->sel.WinResizeHeight = true; break; case 1: - nact->sel.WinResizeHeight = FALSE; break; + nact->sel.WinResizeHeight = false; break; case 2: - nact->sel.WinResizeWidth = FALSE; break; + nact->sel.WinResizeWidth = false; break; case 3: - nact->sel.WinResizeWidth = TRUE; break; + nact->sel.WinResizeWidth = true; break; } TRACE("ZF %d:", sw); @@ -336,7 +336,7 @@ void commandZZ0() { if (sw == 0) { #ifdef __EMSCRIPTEN__ - nact_quit(TRUE); + nact_quit(true); #else sys_exit(sysVar[0]); #endif diff --git a/src/cursor.c b/src/cursor.c index ff7bb4e..20dde0e 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -42,35 +42,35 @@ typedef struct RIFFchunk { char *data; } RIFFchunk_t; -static boolean search_chunk(uint8_t *src, char *key1, char *key2, RIFFchunk_t *c) { +static bool search_chunk(uint8_t *src, char *key1, char *key2, RIFFchunk_t *c) { if (0 == strncmp(src, key1, 4)) { c->size = LittleEndian_getW(src, 4); if (key2) { if (0 == strncmp(src+8, key2, 4)) { c->data = src + 12; - return TRUE; + return true; } - return FALSE; + return false; } c->data = src + 8; - return TRUE; + return true; } - return FALSE; + return false; } -static boolean is_riff(uint8_t *data) { +static bool is_riff(uint8_t *data) { if (0 == strncmp(data, "RIFF", 4)) { - return TRUE; + return true; } - return FALSE; + return false; } -static boolean check_iconheader(uint8_t *data) { +static bool check_iconheader(uint8_t *data) { /* read Reserved bit, abort if not 0 */ cursorHeader.idReserved = LittleEndian_getW(data, 0); if (cursorHeader.idReserved != 0) { - return FALSE; + return false; } data += 2; @@ -78,7 +78,7 @@ static boolean check_iconheader(uint8_t *data) { /* read Resource Type, 2 is for cursors, abort if different */ cursorHeader.idType = LittleEndian_getW(data, 0); if (cursorHeader.idType != 2) { - return FALSE; + return false; } data += 2; @@ -91,13 +91,13 @@ static boolean check_iconheader(uint8_t *data) { /* Number of images (>0) */ if (cursorHeader.idCount == 0) { WARNING("Cursor: no images in file!"); - return FALSE; + return false; } if (cursorHeader.idCount > 1) { WARNING("Cursor: warning: too much images in file!"); } - return TRUE; + return true; } static int read_direntries(uint8_t* data) { @@ -259,26 +259,26 @@ static int read_rgbquad(uint8_t* data) { return (int)(data - p); } -static boolean cursor_load_mono(uint8_t *d, int no) { +static bool cursor_load_mono(uint8_t *d, int no) { int pos = 6, p1; /* check header information */ if (!check_iconheader(d)) { WARNING("check_iconhdader fail"); - return FALSE; + return false; } /* read dentries */ if ((pos += read_direntries(d + pos)) <= 6) { WARNING("read dentries fail"); - return FALSE; + return false; } /* read bitmap info */ p1 = read_bitmapinfo(d + pos); if (p1 == 0) { WARNING("unable to read bitmap info"); - return FALSE; + return false; } pos += p1; @@ -287,7 +287,7 @@ static boolean cursor_load_mono(uint8_t *d, int no) { p1 = read_rgbquad(d + pos); if (p1 == 0) { WARNING("unable to read palette table"); - return FALSE; + return false; } pos += p1; @@ -295,19 +295,19 @@ static boolean cursor_load_mono(uint8_t *d, int no) { /* read pixedl data */ if (!sdl_cursorNew(d + pos, no, &cursorImage, &cursordirentry)) { WARNING("unable to read pixel data"); - return FALSE; + return false; } - return TRUE; + return true; } -static boolean cursor_load_anim(uint8_t *data, int no) { +static bool cursor_load_anim(uint8_t *data, int no) { uint8_t *b = data; int riffsize; RIFFchunk_t c; if (!search_chunk(b, "RIFF", "ACON", &c)) { WARNING("Not animation icon format"); - return FALSE; + return false; } riffsize = c.size; @@ -358,7 +358,7 @@ static boolean cursor_load_anim(uint8_t *data, int no) { b += c.size + 8; } } - return TRUE; + return true; } void cursor_load(int no, int linkno) { diff --git a/src/debug_symbol.c b/src/debug_symbol.c index ccea520..7d3ab5e 100644 --- a/src/debug_symbol.c +++ b/src/debug_symbol.c @@ -45,7 +45,7 @@ typedef struct { char *name; int page; int addr; - boolean is_local; + bool is_local; } FuncInfo; struct debug_symbols { @@ -76,7 +76,7 @@ int fgetdw(FILE *fp) { return LittleEndian_getDW(buf, 0); } -static boolean ensure_srcs(struct debug_symbols *dsym, int nr_srcs) { +static bool ensure_srcs(struct debug_symbols *dsym, int nr_srcs) { if (!dsym->srcs) { dsym->nr_srcs = nr_srcs; dsym->srcs = calloc(nr_srcs, sizeof(SrcInfo)); @@ -87,7 +87,7 @@ static boolean ensure_srcs(struct debug_symbols *dsym, int nr_srcs) { return true; } -static boolean load_srcs(struct debug_symbols *dsym, char *buf) { +static bool load_srcs(struct debug_symbols *dsym, char *buf) { int nr_srcs = LittleEndian_getDW(buf, 0); if (!ensure_srcs(dsym, nr_srcs)) return false; @@ -125,7 +125,7 @@ static void store_src_lines(SrcInfo *info, char *src) { info->lines = lines; } -static boolean load_scnt(struct debug_symbols *dsym, char *buf) { +static bool load_scnt(struct debug_symbols *dsym, char *buf) { int nr_srcs = LittleEndian_getDW(buf, 0); if (!ensure_srcs(dsym, nr_srcs)) return false; @@ -139,7 +139,7 @@ static boolean load_scnt(struct debug_symbols *dsym, char *buf) { return true; } -static boolean load_line(struct debug_symbols *dsym, unsigned char *buf) { +static bool load_line(struct debug_symbols *dsym, unsigned char *buf) { int nr_srcs = LittleEndian_getDW(buf, 0); if (!ensure_srcs(dsym, nr_srcs)) return false; @@ -159,7 +159,7 @@ static boolean load_line(struct debug_symbols *dsym, unsigned char *buf) { return true; } -static boolean load_vari(struct debug_symbols *dsym, char *buf) { +static bool load_vari(struct debug_symbols *dsym, char *buf) { dsym->nr_vars = LittleEndian_getDW(buf, 0); dsym->variables = calloc(dsym->nr_vars, sizeof(char *)); char *p = buf + 4; @@ -170,7 +170,7 @@ static boolean load_vari(struct debug_symbols *dsym, char *buf) { return true; } -static boolean load_func(struct debug_symbols *dsym, char *buf) { +static bool load_func(struct debug_symbols *dsym, char *buf) { dsym->nr_funcs = LittleEndian_getDW(buf, 0); dsym->functions = calloc(dsym->nr_funcs, sizeof(FuncInfo)); char *p = buf + 4; @@ -221,7 +221,7 @@ struct debug_symbols *dsym_load(const char *path) { return NULL; } - boolean ok = true; + bool ok = true; if (!strcmp(tag, "SRCS")) { ok = load_srcs(dsym, section_content); } else if (!strcmp(tag, "SCNT")) { @@ -369,7 +369,7 @@ const char *dsym_addr2func(struct debug_symbols *dsym, int page, int addr) { return f->name; } -boolean dsym_func2addr(struct debug_symbols *dsym, const char *name, int *inout_page, int *out_addr) { +bool dsym_func2addr(struct debug_symbols *dsym, const char *name, int *inout_page, int *out_addr) { if (!dsym) return false; diff --git a/src/debug_symbol.h b/src/debug_symbol.h index 2d0d00c..64bfd76 100644 --- a/src/debug_symbol.h +++ b/src/debug_symbol.h @@ -34,6 +34,6 @@ int dsym_num_variables(struct debug_symbols *dsym); const char *dsym_variable_name(struct debug_symbols *dsym, int i); int dsym_lookup_variable(struct debug_symbols *dsym, const char *name); const char *dsym_addr2func(struct debug_symbols *dsym, int page, int addr); -boolean dsym_func2addr(struct debug_symbols *dsym, const char *name, int *inout_page, int *out_addr); +bool dsym_func2addr(struct debug_symbols *dsym, const char *name, int *inout_page, int *out_addr); #endif // __DEBUG_SYMBOL_H__ diff --git a/src/debugger.c b/src/debugger.c index bb7026c..54a2688 100644 --- a/src/debugger.c +++ b/src/debugger.c @@ -46,7 +46,7 @@ static struct { int line; } step_exec_state; -void dbg_init(const char *symbols_path, boolean use_dap) { +void dbg_init(const char *symbols_path, bool use_dap) { dbg_impl = use_dap ? &dbg_dap_impl : &dbg_cui_impl; dbg_impl->init(symbols_path); } @@ -91,7 +91,7 @@ static char next_char(void) { return *eval_input; } -static boolean consume(char c) { +static bool consume(char c) { if (next_char() != c) return false; eval_input++; @@ -110,7 +110,7 @@ static int clamp(int val) { : val; } -static boolean is_identifier(uint8_t c) { +static bool is_identifier(uint8_t c) { return isalnum(c) || !isascii(c) || c == '_' || c == '.'; } @@ -258,7 +258,7 @@ static int eval_condition(const char *expr) { } } -boolean dbg_evaluate(const char *expr, char *result, size_t result_size) { +bool dbg_evaluate(const char *expr, char *result, size_t result_size) { eval_input = expr; eval_result = result; eval_result_size = result_size; @@ -280,7 +280,7 @@ static PhysicalBreakpoint *find_physical_breakpoint(int page, int addr) { return NULL; } -Breakpoint *dbg_set_breakpoint(int page, int addr, boolean is_internal) { +Breakpoint *dbg_set_breakpoint(int page, int addr, bool is_internal) { dridata *dfile = ald_getdata(DRIFILE_SCO, page); if (!dfile) return NULL; @@ -315,7 +315,7 @@ Breakpoint *dbg_set_breakpoint(int page, int addr, boolean is_internal) { return bp; } -boolean dbg_set_breakpoint_condition(Breakpoint *bp, const char *condition, char *err, size_t errsize) { +bool dbg_set_breakpoint_condition(Breakpoint *bp, const char *condition, char *err, size_t errsize) { if (!dbg_evaluate(condition, err, errsize)) return false; if (bp->condition) @@ -339,7 +339,7 @@ static Breakpoint *breakpoint_free(Breakpoint *bp) { return next; } -boolean dbg_delete_breakpoint(int no) { +bool dbg_delete_breakpoint(int no) { for (Breakpoint **p = &breakpoints; *p; p = &(*p)->next) { if ((*p)->no == no) { *p = breakpoint_free(*p); @@ -379,7 +379,7 @@ uint8_t dbg_handle_breakpoint(int page, int addr) { return restore_op; } -static void set_stack_frame(StackFrame *frame, int page, int addr, boolean is_return_addr) { +static void set_stack_frame(StackFrame *frame, int page, int addr, bool is_return_addr) { frame->page = page; frame->addr = addr; frame->src = dsym_page2src(symbols, page); @@ -420,7 +420,7 @@ void dbg_stepin(void) { dbg_state = DBG_STOPPED_STEP; } -static boolean should_continue_step(void) { +static bool should_continue_step(void) { if (step_exec_state.line < 0) return false; // line info was not available return step_exec_state.page == nact->current_page @@ -497,7 +497,7 @@ void dbg_next(void) { do_next(); } -static boolean should_continue_next(void) { +static bool should_continue_next(void) { if (!should_continue_step()) return false; do_next(); @@ -535,7 +535,7 @@ void dbg_on_palette_change(void) { dbg_impl->on_palette_change(); } -boolean dbg_console_vprintf(int lv, const char *format, va_list ap) { +bool dbg_console_vprintf(int lv, const char *format, va_list ap) { if (!dbg_impl || !dbg_impl->console_output) return false; char buf[1024]; diff --git a/src/debugger.h b/src/debugger.h index c4dc22a..0575487 100644 --- a/src/debugger.h +++ b/src/debugger.h @@ -41,13 +41,13 @@ extern DebuggerState dbg_state; #ifdef ENABLE_DEBUGGER #define dbg_trapped() (dbg_state != DBG_RUNNING) -void dbg_init(const char *symbols_path, boolean use_dap); +void dbg_init(const char *symbols_path, bool use_dap); void dbg_quit(void); void dbg_main(int bp_no); void dbg_onsleep(void); void dbg_on_palette_change(void); uint8_t dbg_handle_breakpoint(int page, int addr); -boolean dbg_console_vprintf(int lv, const char *format, va_list ap); +bool dbg_console_vprintf(int lv, const char *format, va_list ap); void dbg_post_command(void *data); #else // ENABLE_DEBUGGER diff --git a/src/debugger_cui.c b/src/debugger_cui.c index b5d0ce0..2ef02a5 100644 --- a/src/debugger_cui.c +++ b/src/debugger_cui.c @@ -56,7 +56,7 @@ static const char *format_address(int page, int addr) { return buf; } -static boolean parse_address(const char *str, int *page, int *addr) { +static bool parse_address(const char *str, int *page, int *addr) { // :
if (sscanf(str, "%i:%i", page, addr) == 2) return true; @@ -99,7 +99,7 @@ static boolean parse_address(const char *str, int *page, int *addr) { return false; } -static boolean print_source_line(int page, int addr) { +static bool print_source_line(int page, int addr) { int line_no = dsym_addr2line(symbols, page, addr); if (line_no <= 0) return false; diff --git a/src/debugger_dap.c b/src/debugger_dap.c index f6e813e..3ea581e 100644 --- a/src/debugger_dap.c +++ b/src/debugger_dap.c @@ -495,8 +495,8 @@ static void cmd_palette(cJSON *args, cJSON *resp) { } } -static boolean handle_request(cJSON *request) { - boolean continue_repl = true; +static bool handle_request(cJSON *request) { + bool continue_repl = true; cJSON *resp = cJSON_CreateObject(); cJSON_AddStringToObject(resp, "type", "response"); @@ -565,10 +565,10 @@ static boolean handle_request(cJSON *request) { return continue_repl; } -static boolean handle_message(char *msg) { +static bool handle_message(char *msg) { cJSON *json = cJSON_Parse(msg); cJSON *type = cJSON_GetObjectItemCaseSensitive(json, "type"); - boolean continue_repl = true; + bool continue_repl = true; if (cJSON_IsString(type) && !strcmp(type->valuestring, "request")) continue_repl = handle_request(json); cJSON_Delete(json); @@ -635,7 +635,7 @@ static void dbg_dap_repl(int bp_no) { emit_stopped_event(); dbg_state = DBG_RUNNING; - boolean continue_repl = true; + bool continue_repl = true; while (continue_repl && !nact->is_quit) { SDL_Event e; SDL_WaitEvent(&e); diff --git a/src/debugger_private.h b/src/debugger_private.h index 1656ea9..433e496 100644 --- a/src/debugger_private.h +++ b/src/debugger_private.h @@ -66,15 +66,15 @@ extern DebuggerImpl dbg_cui_impl; extern DebuggerImpl dbg_dap_impl; extern DebuggerImpl *dbg_impl; -Breakpoint *dbg_set_breakpoint(int page, int addr, boolean is_internal); -boolean dbg_delete_breakpoint(int no); +Breakpoint *dbg_set_breakpoint(int page, int addr, bool is_internal); +bool dbg_delete_breakpoint(int no); void dbg_delete_breakpoints_in_page(int page); -boolean dbg_set_breakpoint_condition(Breakpoint *bp, const char *condition, char *err, size_t errsize); +bool dbg_set_breakpoint_condition(Breakpoint *bp, const char *condition, char *err, size_t errsize); void dbg_stepin(void); void dbg_stepout(void); void dbg_next(void); int dbg_lookup_var(const char *name); -boolean dbg_evaluate(const char *expr, char *result, size_t result_size); +bool dbg_evaluate(const char *expr, char *result, size_t result_size); StackTrace *dbg_stack_trace(void); #endif // __DEBUGGER_PRIVATE_H__ diff --git a/src/dri.c b/src/dri.c index 9dcb4ac..1cb668a 100644 --- a/src/dri.c +++ b/src/dri.c @@ -76,10 +76,10 @@ static bool read_index(int volume, drifiles *d, FILE *fp) { return true; } -drifiles *dri_init(const char **file, int cnt, boolean use_mmap) { +drifiles *dri_init(const char **file, int cnt, bool use_mmap) { drifiles *d = calloc(1, sizeof(drifiles)); #if !defined(HAVE_MEMORY_MAPPED_FILE) || defined(__EMSCRIPTEN__) - use_mmap = FALSE; + use_mmap = false; #endif for (int i = 0; i < cnt; i++) { @@ -104,11 +104,11 @@ drifiles *dri_init(const char **file, int cnt, boolean use_mmap) { if (use_mmap) { mmap_t *m = map_file(file[i]); if (!m) { - use_mmap = d->mmapped = FALSE; + use_mmap = d->mmapped = false; i = 0; /* retry */ } else { d->mmap[i] = m; - d->mmapped = TRUE; + d->mmapped = true; } } } diff --git a/src/dri.h b/src/dri.h index cbe1312..d3a46ce 100644 --- a/src/dri.h +++ b/src/dri.h @@ -30,7 +30,7 @@ #define DRIFILEMAX 255 /* maximum file number for one data type */ struct _drifiles { - boolean mmapped; + bool mmapped; mmap_t *mmap[DRIFILEMAX]; char *fnames[DRIFILEMAX]; int nr_files; // upper limit on how many files could be referenced by this archive @@ -50,7 +50,7 @@ struct _dridata { }; typedef struct _dridata dridata; -drifiles *dri_init(const char **file, int cnt, boolean use_mmap); +drifiles *dri_init(const char **file, int cnt, bool use_mmap); bool dri_is_linked(drifiles *d, int no); bool dri_exists(drifiles *d, int no); dridata *dri_getdata(drifiles *d, int no); diff --git a/src/ecopy.c b/src/ecopy.c index 0be1283..6490f37 100644 --- a/src/ecopy.c +++ b/src/ecopy.c @@ -34,7 +34,7 @@ #include "nact.h" #include "effect.h" -static boolean ecp_cancel; +static bool ecp_cancel; #define EC_WAIT \ if ((key |= sys_getInputInfo()) && ecp_cancel) break; \ diff --git a/src/flood.h b/src/flood.h index 97f3a29..a885411 100644 --- a/src/flood.h +++ b/src/flood.h @@ -43,7 +43,7 @@ static SDL_Rect CONCAT(sdl_floodFill_, TYPE)(int x, int y, Uint32 col) { x++; minx = min(x, minx); - boolean span_above = FALSE, span_below = FALSE; + bool span_above = false, span_below = false; for (; x < sdl_dib->w && line[x] == old_color; x++) { line[x] = col; if (y > 0) { @@ -53,9 +53,9 @@ static SDL_Rect CONCAT(sdl_floodFill_, TYPE)(int x, int y, Uint32 col) { stack = realloc(stack, sizeof(SDL_Point) * stack_size); } stack[top] = (SDL_Point){x, y - 1}; - span_above = TRUE; + span_above = true; } else if (span_above && prev_line[x] != old_color) { - span_above = FALSE; + span_above = false; } } if (y < sdl_dib->h - 1) { @@ -65,9 +65,9 @@ static SDL_Rect CONCAT(sdl_floodFill_, TYPE)(int x, int y, Uint32 col) { stack = realloc(stack, sizeof(SDL_Point) * stack_size); } stack[top] = (SDL_Point){x, y + 1}; - span_below = TRUE; + span_below = true; } else if (span_below && next_line[x] != old_color) { - span_below = FALSE; + span_below = false; } } } diff --git a/src/font.c b/src/font.c index 8a82c12..c2bd65c 100644 --- a/src/font.c +++ b/src/font.c @@ -51,7 +51,7 @@ static int fontcnt = 0; static FontTable *fontset; static struct { - boolean antialiase_on; + bool antialiase_on; const char *name[FONTTYPEMAX]; int face[FONTTYPEMAX]; } this; @@ -215,7 +215,7 @@ SDL_Rect font_draw_glyph(int x, int y, const char *str_utf8, uint8_t cl) { } void font_init(void) { - this.antialiase_on = FALSE; + this.antialiase_on = false; if (TTF_Init() == -1) SYSERROR("Failed to intialize SDL_ttf: %s", TTF_GetError()); @@ -226,11 +226,11 @@ void font_set_name_and_index(int type, const char *name, int index) { this.face[type] = index; } -void font_set_antialias(boolean enable) { +void font_set_antialias(bool enable) { this.antialiase_on = enable; } -boolean font_get_antialias(void) { +bool font_get_antialias(void) { return this.antialiase_on; } diff --git a/src/font.h b/src/font.h index 80e8c5d..87877cb 100644 --- a/src/font.h +++ b/src/font.h @@ -36,8 +36,8 @@ extern void font_init(void); extern void font_set_name_and_index(int type, const char *name, int index); -extern void font_set_antialias(boolean enable); -extern boolean font_get_antialias(void); +extern void font_set_antialias(bool enable); +extern bool font_get_antialias(void); extern void font_select(int type, int size, int weight); 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); diff --git a/src/gameresource.c b/src/gameresource.c index 0f0c98a..ea7262f 100644 --- a/src/gameresource.c +++ b/src/gameresource.c @@ -63,7 +63,7 @@ static void storeSaveName(GameResource *gr, int no, char *src) { if (path) free(path); } -boolean initGameResourceFromDir(GameResource *gr, DIR *dir, const char *savedir, struct dirent *(*p_readdir)(DIR *)) { +bool initGameResourceFromDir(GameResource *gr, DIR *dir, const char *savedir, struct dirent *(*p_readdir)(DIR *)) { memset(gr, 0, sizeof(GameResource)); char *basename = NULL; @@ -160,7 +160,7 @@ static void trimRight(char *str) { *p = '\0'; } -static boolean initGameResourceFromFile(GameResource *gr, FILE *fp, const char *gr_fname) { +static bool initGameResourceFromFile(GameResource *gr, FILE *fp, const char *gr_fname) { int linecnt = 0, dno; char line[256]; char key[256], path[256]; @@ -227,26 +227,26 @@ static boolean initGameResourceFromFile(GameResource *gr, FILE *fp, const char * } } gr->gr_fname = strdup(gr_fname); - return TRUE; + return true; errexit: SYSERROR("Illigal resource at line(%d) file<%s>", linecnt, gr_fname); - return FALSE; + return false; } -boolean initGameResource(GameResource *gr, const char *gr_fname, const char *savedir) { +bool initGameResource(GameResource *gr, const char *gr_fname, const char *savedir) { FILE *fp = fopen(gr_fname, "r"); if (fp) { - boolean result = initGameResourceFromFile(gr, fp, gr_fname); + bool result = initGameResourceFromFile(gr, fp, gr_fname); fclose(fp); return result; } DIR *dir = opendir("."); if (dir) { - boolean result = initGameResourceFromDir(gr, dir, savedir, readdir); + bool result = initGameResourceFromDir(gr, dir, savedir, readdir); closedir(dir); return result; } SYSERROR("Game Resource File open failed"); - return FALSE; + return false; } diff --git a/src/gameresource.h b/src/gameresource.h index 648a105..1301155 100644 --- a/src/gameresource.h +++ b/src/gameresource.h @@ -43,7 +43,7 @@ typedef struct { const char *msgskip; } GameResource; -boolean initGameResource(GameResource *gr, const char *gr_fname, const char *savedir); -boolean initGameResourceFromDir(GameResource *gr, DIR *dir, const char *savedir, struct dirent *(*p_readdir)(DIR *)); +bool initGameResource(GameResource *gr, const char *gr_fname, const char *savedir); +bool initGameResourceFromDir(GameResource *gr, DIR *dir, const char *savedir, struct dirent *(*p_readdir)(DIR *)); #endif /* !__GAMERESOURCE_H__ */ diff --git a/src/hacks.c b/src/hacks.c index 0aee66d..733c260 100644 --- a/src/hacks.c +++ b/src/hacks.c @@ -34,7 +34,7 @@ #define GT_PERSIOM "PERSIOM" /* defined by cmdy.c */ -extern boolean Y3waitFlags; +extern bool Y3waitFlags; enum gameId game_id; bool daiakuji_cx_hack; diff --git a/src/input.c b/src/input.c index e47983c..b499dbe 100644 --- a/src/input.c +++ b/src/input.c @@ -51,7 +51,7 @@ void set_hak_keymode(int key, int mode) { } } -int sys_getMouseInfo(MyPoint *p, boolean is_dibgeo) { +int sys_getMouseInfo(MyPoint *p, bool is_dibgeo) { MyPoint _p; int key = sdl_getMouseInfo(&_p); @@ -93,7 +93,7 @@ int sys_keywait(int msec, unsigned flags) { if (msgskip_getFlags() & MSGSKIP_STOP_ON_CLICK) { int key = sys_getInputInfo(); if (key) - msgskip_activate(FALSE); + msgskip_activate(false); return key; } return 0; @@ -121,7 +121,7 @@ void sys_hit_any_key() { int key=0; if (msgskip_isSkipping()) { if (msgskip_getFlags() & MSGSKIP_STOP_ON_CLICK && sys_getInputInfo()) - msgskip_activate(FALSE); + msgskip_activate(false); sdl_sleep(30); return; } @@ -130,7 +130,7 @@ void sys_hit_any_key() { /* message wait flag restore */ if (nact->messagewait_cancelled) { - nact->messagewait_cancelled = FALSE; + nact->messagewait_cancelled = false; /* consume the input that cancelled message wait */ while (!nact->is_quit && !(key & hak_ignore_mask)) { key = sys_keywait(INT_MAX, KEYWAIT_CANCELABLE); @@ -149,7 +149,7 @@ void sys_hit_any_key() { } } -void sys_key_releasewait(int key, boolean zi_mask_enabled) { +void sys_key_releasewait(int key, bool zi_mask_enabled) { int mask; if (zi_mask_enabled) { diff --git a/src/input.h b/src/input.h index e72e527..b0c4341 100644 --- a/src/input.h +++ b/src/input.h @@ -156,16 +156,16 @@ enum keycode { KEY_SCROLLLOCK = 0x91, // Scroll Lockキー }; -extern boolean RawKeyInfo[NUM_KEYCODES]; +extern bool RawKeyInfo[NUM_KEYCODES]; extern int sys_keywait(int msec, unsigned flags); -extern int sys_getMouseInfo(MyPoint *p, boolean is_dibgeo); +extern int sys_getMouseInfo(MyPoint *p, bool is_dibgeo); extern int sys_getInputInfo(void); extern int sys_getKeyInfo(void); extern int sys_getJoyInfo(void); extern void sys_getWheelInfo(int *forward, int *back); extern void sys_clearWheelInfo(void); -extern void sys_key_releasewait(int key, boolean zi_mask_enabled); +extern void sys_key_releasewait(int key, bool zi_mask_enabled); extern void sys_hit_any_key(); extern void set_hak_keymode(int key, int mode); diff --git a/src/jpeg.c b/src/jpeg.c index a26ead3..a4139ab 100644 --- a/src/jpeg.c +++ b/src/jpeg.c @@ -33,7 +33,7 @@ #include "system.h" #include "jpeg.h" -boolean jpeg_checkfmt(uint8_t *data) { +bool jpeg_checkfmt(uint8_t *data) { return data[0] == 0xff && data[1] == 0xd8; } diff --git a/src/jpeg.h b/src/jpeg.h index 70e1c64..d43718c 100644 --- a/src/jpeg.h +++ b/src/jpeg.h @@ -22,7 +22,7 @@ #include "cg.h" -extern boolean jpeg_checkfmt(uint8_t *data); +extern bool jpeg_checkfmt(uint8_t *data); extern cgdata *jpeg_extract(uint8_t *data, size_t size); #endif // __JPEG_H__ diff --git a/src/menu.c b/src/menu.c index 012e740..b428961 100644 --- a/src/menu.c +++ b/src/menu.c @@ -32,11 +32,11 @@ #include "input.h" #include "msgskip.h" -static boolean menu_initilized = FALSE; +static bool menu_initilized = false; static int menu_callback() { sys_getInputInfo(); - return TRUE; + return true; } @@ -48,22 +48,22 @@ void menu_open(void) { // gtk_menu_popup_at_pointer() cannot be used because there's no GdkEvent here. gtk_menu_popup(GTK_MENU(menu_window_popup), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time()); gtk_widget_show(menu_window_popup); - nact->popupmenu_opened = TRUE; + nact->popupmenu_opened = true; } void menu_quitmenu_open(void) { if (!menu_initilized) return; gtk_widget_show(menu_window_exit); - nact->popupmenu_opened = TRUE; + nact->popupmenu_opened = true; } -boolean menu_inputstring(INPUTSTRING_PARAM *p) { +bool menu_inputstring(INPUTSTRING_PARAM *p) { char s[256]; - if (!menu_initilized) return FALSE; + if (!menu_initilized) return false; - menu_ok_input = FALSE; + menu_ok_input = false; gtk_label_set_text(GTK_LABEL(menu_label_inputstring_title), p->title); sprintf(s, _("MAX %d charater"), p->max); @@ -83,13 +83,13 @@ boolean menu_inputstring(INPUTSTRING_PARAM *p) { } else { p->newstring = p->oldstring; } - return TRUE; + return true; } -boolean menu_inputstring2(INPUTSTRING_PARAM *p) { - if (!menu_initilized) return FALSE; +bool menu_inputstring2(INPUTSTRING_PARAM *p) { + if (!menu_initilized) return false; - menu_ok_input = FALSE; + menu_ok_input = false; gtk_entry_set_max_length(GTK_ENTRY(menu_textentry2), p->max *2); gtk_entry_set_text(GTK_ENTRY(menu_textentry2), p->oldstring); gtk_widget_set_size_request(menu_textentry2, p->h * p->max + 8, p->h + 4); @@ -105,16 +105,16 @@ boolean menu_inputstring2(INPUTSTRING_PARAM *p) { } else { p->newstring = p->oldstring; } - return TRUE; + return true; } -boolean menu_inputnumber(INPUTNUM_PARAM *p) { +bool menu_inputnumber(INPUTNUM_PARAM *p) { GtkAdjustment *adj; char s[256]; - if (!menu_initilized) return FALSE; + if (!menu_initilized) return false; - menu_ok_input = FALSE; + menu_ok_input = false; gtk_window_set_title (GTK_WINDOW(menu_window_in), p->title); sprintf(s, "%d ", p->max); @@ -140,11 +140,11 @@ boolean menu_inputnumber(INPUTNUM_PARAM *p) { } else { p->value = -1; } - return TRUE; + return true; } void menu_init() { - menu_initilized = TRUE; + menu_initilized = true; menu_window_popup = create_menu1(); menu_window_in = create_window1(); menu_window_is = create_window2(); @@ -162,5 +162,5 @@ void menu_gtkmainiteration() { } } -void menu_setSkipState(boolean enabled, boolean activated) { +void menu_setSkipState(bool enabled, bool activated) { } diff --git a/src/menu.h b/src/menu.h index e8f1eec..008ff72 100644 --- a/src/menu.h +++ b/src/menu.h @@ -32,7 +32,7 @@ typedef struct inputstring_param { const char *newstring; int max; /* for MJ cmd */ - boolean need_window; + bool need_window; int x, y, h; } INPUTSTRING_PARAM; @@ -48,13 +48,13 @@ typedef struct inputnum_param { extern void menu_open(void); extern void menu_quitmenu_open(void); extern void menu_resetmenu_open(void); -extern boolean menu_inputstring(INPUTSTRING_PARAM *); -extern boolean menu_inputstring2(INPUTSTRING_PARAM *); -extern boolean menu_inputnumber(INPUTNUM_PARAM *); +extern bool menu_inputstring(INPUTSTRING_PARAM *); +extern bool menu_inputstring2(INPUTSTRING_PARAM *); +extern bool menu_inputnumber(INPUTNUM_PARAM *); extern void menu_widgetinit(void); extern void menu_init(); extern void menu_gtkmainiteration(); -extern void menu_setSkipState(boolean enabled, boolean activated); +extern void menu_setSkipState(bool enabled, bool activated); #ifdef _WIN32 struct SDL_SysWMmsg; diff --git a/src/menu_android.c b/src/menu_android.c index 7526b91..4541ac9 100644 --- a/src/menu_android.c +++ b/src/menu_android.c @@ -37,12 +37,12 @@ void menu_quitmenu_open(void) { return; } -boolean menu_inputstring(INPUTSTRING_PARAM *p) { +bool menu_inputstring(INPUTSTRING_PARAM *p) { static char buf[256]; JNIEnv *env = SDL_AndroidGetJNIEnv(); if ((*env)->PushLocalFrame(env, 16) < 0) { WARNING("Failed to allocate JVM local references"); - return FALSE; + return false; } jstring msg = (*env)->NewStringUTF(env, p->title); @@ -50,7 +50,7 @@ boolean menu_inputstring(INPUTSTRING_PARAM *p) { if (!msg || !oldstring) { WARNING("Failed to allocate a string"); (*env)->PopLocalFrame(env, NULL); - return FALSE; + return false; } jobject context = SDL_AndroidGetActivity(); @@ -63,31 +63,31 @@ boolean menu_inputstring(INPUTSTRING_PARAM *p) { (*env)->ReleaseStringUTFChars(env, newstring, newstr_utf8); (*env)->PopLocalFrame(env, NULL); p->newstring = buf; - return TRUE; + return true; } (*env)->PopLocalFrame(env, NULL); p->newstring = p->oldstring; - return FALSE; + return false; } -boolean menu_inputstring2(INPUTSTRING_PARAM *p) { +bool menu_inputstring2(INPUTSTRING_PARAM *p) { p->newstring = p->oldstring; - return TRUE; + return true; } -boolean menu_inputnumber(INPUTNUM_PARAM *p) { +bool menu_inputnumber(INPUTNUM_PARAM *p) { JNIEnv *env = SDL_AndroidGetJNIEnv(); if ((*env)->PushLocalFrame(env, 16) < 0) { WARNING("Failed to allocate JVM local references"); - return FALSE; + return false; } jstring msg = (*env)->NewStringUTF(env, p->title); if (!msg) { WARNING("Failed to allocate a string"); (*env)->PopLocalFrame(env, NULL); - return FALSE; + return false; } jobject context = SDL_AndroidGetActivity(); @@ -96,7 +96,7 @@ boolean menu_inputnumber(INPUTNUM_PARAM *p) { p->value = (*env)->CallIntMethod(env, context, mid, msg, p->min, p->max, p->def); (*env)->PopLocalFrame(env, NULL); - return TRUE; + return true; } void menu_init(void) { @@ -107,5 +107,5 @@ void menu_gtkmainiteration() { return; } -void menu_setSkipState(boolean enabled, boolean activated) { +void menu_setSkipState(bool enabled, bool activated) { } diff --git a/src/menu_callback.c b/src/menu_callback.c index 3d13ddf..254fabc 100644 --- a/src/menu_callback.c +++ b/src/menu_callback.c @@ -30,8 +30,8 @@ #include "msgskip.h" #include "s39init.h" -boolean menu_ok_exit; /* exit window で OK が押されたかどうか */ -boolean menu_ok_input; /* 文字列/数値入力 window で OK が... */ +bool menu_ok_exit; /* exit window で OK が押されたかどうか */ +bool menu_ok_input; /* 文字列/数値入力 window で OK が... */ GtkWidget *menu_item_msgskip_on; GtkWidget *menu_item_msgskip_off; @@ -65,7 +65,7 @@ void on_item2_activate (GtkMenuItem *menuitem, gpointer user_data) { - msgskip_activate(TRUE); + msgskip_activate(true); gtk_menu_popdown(GTK_MENU(menu_window_popup)); } @@ -74,7 +74,7 @@ void on_item3_activate (GtkMenuItem *menuitem, gpointer user_data) { - msgskip_activate(FALSE); + msgskip_activate(false); gtk_menu_popdown(GTK_MENU(menu_window_popup)); } @@ -111,7 +111,7 @@ void on_item16_activate (GtkMenuItem *menuitem, gpointer user_data) { - nact->popupmenu_opened = TRUE; + nact->popupmenu_opened = true; gtk_widget_show(menu_window_about); } @@ -120,7 +120,7 @@ void on_item17_activate (GtkMenuItem *menuitem, gpointer user_data) { - nact->popupmenu_opened = TRUE; + nact->popupmenu_opened = true; gtk_widget_show(menu_window_exit); } @@ -129,7 +129,7 @@ void on_button1_clicked (GtkButton *button, gpointer user_data) { - menu_ok_input = TRUE; + menu_ok_input = true; gtk_widget_hide(menu_window_in); gtk_main_quit(); } @@ -140,7 +140,7 @@ void on_button2_clicked (GtkButton *button, gpointer user_data) { - menu_ok_input = FALSE; + menu_ok_input = false; gtk_widget_hide(menu_window_in); gtk_main_quit(); } @@ -151,7 +151,7 @@ void on_button4_clicked (GtkButton *button, gpointer user_data) { - menu_ok_input = FALSE; + menu_ok_input = false; gtk_widget_hide(menu_window_is); gtk_main_quit(); } @@ -163,7 +163,7 @@ on_button3_clicked (GtkButton *button, gpointer user_data) { menu_textentry_string = gtk_entry_get_text(GTK_ENTRY(menu_textentry)); - menu_ok_input = TRUE; + menu_ok_input = true; gtk_widget_hide(menu_window_is); gtk_main_quit(); } @@ -173,9 +173,9 @@ void on_button5_clicked (GtkButton *button, gpointer user_data) { - menu_ok_exit = TRUE; - nact_quit(FALSE); - nact->popupmenu_opened = FALSE; + menu_ok_exit = true; + nact_quit(false); + nact->popupmenu_opened = false; } @@ -184,8 +184,8 @@ void on_button6_clicked (GtkButton *button, gpointer user_data) { - nact->popupmenu_opened = FALSE; - menu_ok_exit = FALSE; + nact->popupmenu_opened = false; + menu_ok_exit = false; gtk_widget_hide(menu_window_exit); } @@ -195,7 +195,7 @@ on_button11_clicked (GtkButton *button, gpointer user_data) { gtk_widget_hide(menu_window_about); - nact->popupmenu_opened = FALSE; + nact->popupmenu_opened = false; } /* menu canceld */ @@ -204,7 +204,7 @@ on_menu1_deactivate (GtkMenuShell *menushell, gpointer user_data) { gtk_menu_popdown(GTK_MENU(menu_window_popup)); - nact->popupmenu_opened = FALSE; + nact->popupmenu_opened = false; } /* get enter in text entry */ @@ -213,7 +213,7 @@ on_entry1_activate (GtkEditable *editable, gpointer user_data) { menu_textentry_string = gtk_entry_get_text(GTK_ENTRY(editable)); - menu_ok_input = TRUE; + menu_ok_input = true; gtk_widget_hide(menu_window_is); gtk_main_quit(); } @@ -226,7 +226,7 @@ on_spinbutton1_activate (GtkEditable *editable, GtkAdjustment *adj; adj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(menu_spinbutton)); if (gtk_adjustment_get_value(adj) >= gtk_adjustment_get_lower(adj) && gtk_adjustment_get_value(adj) <= gtk_adjustment_get_upper(adj)) { - menu_ok_input = TRUE; + menu_ok_input = true; gtk_widget_hide(menu_window_in); gtk_main_quit(); } @@ -238,7 +238,7 @@ on_entry2_activate (GtkEditable *editable, gpointer user_data) { menu_textentry_string = gtk_entry_get_text(GTK_ENTRY(editable)); - menu_ok_input = TRUE; + menu_ok_input = true; gtk_widget_hide(menu_window_is2); gtk_main_quit(); } diff --git a/src/menu_callback.h b/src/menu_callback.h index 117c846..7f8e77c 100644 --- a/src/menu_callback.h +++ b/src/menu_callback.h @@ -25,8 +25,8 @@ #include -extern boolean menu_ok_exit; -extern boolean menu_ok_input; +extern bool menu_ok_exit; +extern bool menu_ok_input; extern GtkWidget *menu_item_msgskip_on; extern GtkWidget *menu_item_msgskip_off; diff --git a/src/menu_emscripten.c b/src/menu_emscripten.c index 3fddcce..df3190b 100644 --- a/src/menu_emscripten.c +++ b/src/menu_emscripten.c @@ -34,7 +34,7 @@ void menu_quitmenu_open(void) { return; } -boolean menu_inputstring(INPUTSTRING_PARAM *p) { +bool menu_inputstring(INPUTSTRING_PARAM *p) { static char buf[256]; int ok = EM_ASM_({ var r = xsystem35.shell.inputString(UTF8ToString($0), UTF8ToString($1), $2); @@ -51,16 +51,16 @@ boolean menu_inputstring(INPUTSTRING_PARAM *p) { return ok; } -boolean menu_inputstring2(INPUTSTRING_PARAM *p) { +bool menu_inputstring2(INPUTSTRING_PARAM *p) { p->newstring = p->oldstring; - return TRUE; + return true; } -boolean menu_inputnumber(INPUTNUM_PARAM *p) { +bool menu_inputnumber(INPUTNUM_PARAM *p) { p->value = EM_ASM_({ return xsystem35.shell.inputNumber(UTF8ToString($0), $1, $2, $3); }, p->title, p->min, p->max, p->def); - return TRUE; + return true; } void menu_init(void) { @@ -71,6 +71,6 @@ void menu_gtkmainiteration() { return; } -EM_JS(void, menu_setSkipState, (boolean enabled, boolean activated), { +EM_JS(void, menu_setSkipState, (bool enabled, bool activated), { xsystem35.shell.setSkipButtonState(enabled, activated); }); diff --git a/src/menu_gui.c b/src/menu_gui.c index f41eb89..150d592 100644 --- a/src/menu_gui.c +++ b/src/menu_gui.c @@ -58,7 +58,7 @@ create_window1 (void) window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_object_set_data(G_OBJECT(window1), "window1", window1); gtk_window_set_title (GTK_WINDOW (window1), _("InputNumber")); - gtk_window_set_resizable(GTK_WINDOW (window1), FALSE); + gtk_window_set_resizable(GTK_WINDOW (window1), false); gtk_window_set_position(GTK_WINDOW (window1), GTK_WIN_POS_MOUSE); hbox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); @@ -73,7 +73,7 @@ create_window1 (void) g_object_set_data_full(G_OBJECT(window1), "vbox1", vbox1, (GDestroyNotify)g_object_unref); gtk_widget_show (vbox1); - gtk_box_pack_start (GTK_BOX (hbox1), vbox1, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (hbox1), vbox1, true, true, 0); gtk_widget_set_size_request(vbox1, 128, -2); gtk_container_set_border_width (GTK_CONTAINER (vbox1), 10); @@ -83,14 +83,14 @@ create_window1 (void) g_object_set_data_full(G_OBJECT(window1), "spinbutton1", spinbutton1, (GDestroyNotify)g_object_unref); gtk_widget_show (spinbutton1); - gtk_box_pack_start (GTK_BOX (vbox1), spinbutton1, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox1), spinbutton1, false, false, 0); grid1 = gtk_grid_new(); g_object_ref(grid1); g_object_set_data_full(G_OBJECT(window1), "grid1", grid1, (GDestroyNotify)g_object_unref); gtk_widget_show (grid1); - gtk_box_pack_start (GTK_BOX (vbox1), grid1, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox1), grid1, false, false, 0); gtk_grid_set_row_spacing(GTK_GRID(grid1), 5); gtk_grid_set_column_spacing(GTK_GRID(grid1), 3); @@ -143,33 +143,33 @@ create_window1 (void) gtk_label_set_justify (GTK_LABEL (label13), GTK_JUSTIFY_LEFT); vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); - gtk_box_set_homogeneous(GTK_BOX(vbox2), TRUE); + gtk_box_set_homogeneous(GTK_BOX(vbox2), true); g_object_ref(vbox2); g_object_set_data_full(G_OBJECT(window1), "vbox2", vbox2, (GDestroyNotify)g_object_unref); gtk_widget_show (vbox2); - gtk_box_pack_start (GTK_BOX (hbox1), vbox2, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (hbox1), vbox2, false, true, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox2), 10); button1 = gtk_button_new_with_label (_("OK")); g_object_ref(button1); g_object_set_data_full(G_OBJECT(window1), "button1", button1, (GDestroyNotify)g_object_unref); gtk_widget_show (button1); - gtk_box_pack_start (GTK_BOX (vbox2), button1, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox2), button1, false, false, 0); button2 = gtk_button_new_with_label (_("Cancel")); g_object_ref(button2); g_object_set_data_full(G_OBJECT(window1), "button2", button2, (GDestroyNotify)g_object_unref); gtk_widget_show (button2); - gtk_box_pack_start (GTK_BOX (vbox2), button2, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox2), button2, false, false, 0); label4 = gtk_label_new (""); g_object_ref(label4); g_object_set_data_full(G_OBJECT(window1), "label4", label4, (GDestroyNotify)g_object_unref); gtk_widget_show (label4); - gtk_box_pack_start (GTK_BOX (vbox2), label4, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox2), label4, false, false, 0); g_signal_connect(spinbutton1, "activate", G_CALLBACK(on_spinbutton1_activate), @@ -201,11 +201,11 @@ create_window2 (void) g_object_set_data(G_OBJECT(window2), "window2", window2); gtk_container_set_border_width (GTK_CONTAINER (window2), 10); gtk_window_set_title (GTK_WINDOW (window2), _("InputString")); - gtk_window_set_resizable(GTK_WINDOW (window2), FALSE); + gtk_window_set_resizable(GTK_WINDOW (window2), false); gtk_window_set_position(GTK_WINDOW (window2), GTK_WIN_POS_MOUSE); vbox3 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); - gtk_box_set_homogeneous(GTK_BOX(vbox3), TRUE); + gtk_box_set_homogeneous(GTK_BOX(vbox3), true); g_object_ref(vbox3); g_object_set_data_full(G_OBJECT(window2), "vbox3", vbox3, (GDestroyNotify)g_object_unref); @@ -217,7 +217,7 @@ create_window2 (void) g_object_set_data_full(G_OBJECT(window2), "label5", label5, (GDestroyNotify)g_object_unref); gtk_widget_show (label5); - gtk_box_pack_start (GTK_BOX (vbox3), label5, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox3), label5, false, false, 0); gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_LEFT); gtk_label_set_xalign(GTK_LABEL(label5), 0.00); @@ -226,14 +226,14 @@ create_window2 (void) g_object_set_data_full(G_OBJECT(window2), "entry1", entry1, (GDestroyNotify)g_object_unref); gtk_widget_show (entry1); - gtk_box_pack_start (GTK_BOX (vbox3), entry1, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox3), entry1, false, false, 0); menu_label_inputstring_maxchar = label6 = gtk_label_new (_("MAX charater")); g_object_ref(label6); g_object_set_data_full(G_OBJECT(window2), "label6", label6, (GDestroyNotify)g_object_unref); gtk_widget_show (label6); - gtk_box_pack_start (GTK_BOX (vbox3), label6, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox3), label6, false, false, 0); gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT); gtk_label_set_xalign(GTK_LABEL(label6), 0.00); @@ -242,7 +242,7 @@ create_window2 (void) g_object_set_data_full(G_OBJECT(window2), "label7", label7, (GDestroyNotify)g_object_unref); gtk_widget_show (label7); - gtk_box_pack_start (GTK_BOX (vbox3), label7, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox3), label7, false, false, 0); gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_LEFT); gtk_label_set_xalign(GTK_LABEL(label7), 0.00); @@ -251,21 +251,21 @@ create_window2 (void) g_object_set_data_full(G_OBJECT(window2), "hbox2", hbox2, (GDestroyNotify)g_object_unref); gtk_widget_show (hbox2); - gtk_box_pack_start (GTK_BOX (vbox3), hbox2, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox3), hbox2, true, true, 0); button4 = gtk_button_new_with_label (_("Cancel")); g_object_ref(button4); g_object_set_data_full(G_OBJECT(window2), "button4", button4, (GDestroyNotify)g_object_unref); gtk_widget_show (button4); - gtk_box_pack_end (GTK_BOX (hbox2), button4, FALSE, FALSE, 0); + gtk_box_pack_end (GTK_BOX (hbox2), button4, false, false, 0); button3 = gtk_button_new_with_label (_("OK")); g_object_ref(button3); g_object_set_data_full(G_OBJECT(window2), "button3", button3, (GDestroyNotify)g_object_unref); gtk_widget_show (button3); - gtk_box_pack_end (GTK_BOX (hbox2), button3, FALSE, FALSE, 0); + gtk_box_pack_end (GTK_BOX (hbox2), button3, false, false, 0); g_signal_connect(button4, "clicked", G_CALLBACK(on_button4_clicked), @@ -294,11 +294,11 @@ create_window3 (void) g_object_set_data(G_OBJECT(window3), "window3", window3); gtk_container_set_border_width (GTK_CONTAINER (window3), 10); gtk_window_set_title (GTK_WINDOW (window3), _("Exit")); - gtk_window_set_resizable(GTK_WINDOW (window3), FALSE); + gtk_window_set_resizable(GTK_WINDOW (window3), false); gtk_window_set_position(GTK_WINDOW (window3), GTK_WIN_POS_MOUSE); vbox4 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10); - gtk_box_set_homogeneous(GTK_BOX(vbox4), TRUE); + gtk_box_set_homogeneous(GTK_BOX(vbox4), true); g_object_ref(vbox4); g_object_set_data_full(G_OBJECT(window3), "vbox4", vbox4, (GDestroyNotify)g_object_unref); @@ -310,29 +310,29 @@ create_window3 (void) g_object_set_data_full(G_OBJECT(window3), "label8", label8, (GDestroyNotify)g_object_unref); gtk_widget_show (label8); - gtk_box_pack_start (GTK_BOX (vbox4), label8, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox4), label8, false, false, 0); hbox3 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10); - gtk_box_set_homogeneous(GTK_BOX(hbox3), TRUE); + gtk_box_set_homogeneous(GTK_BOX(hbox3), true); g_object_ref(hbox3); g_object_set_data_full(G_OBJECT(window3), "hbox3", hbox3, (GDestroyNotify)g_object_unref); gtk_widget_show (hbox3); - gtk_box_pack_start (GTK_BOX (vbox4), hbox3, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox4), hbox3, true, true, 0); button5 = gtk_button_new_with_label (_("Yes")); g_object_ref(button5); g_object_set_data_full(G_OBJECT(window3), "button5", button5, (GDestroyNotify)g_object_unref); gtk_widget_show (button5); - gtk_box_pack_start (GTK_BOX (hbox3), button5, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (hbox3), button5, false, true, 0); button6 = gtk_button_new_with_label (_("No")); g_object_ref(button6); g_object_set_data_full(G_OBJECT(window3), "button6", button6, (GDestroyNotify)g_object_unref); gtk_widget_show (button6); - gtk_box_pack_start (GTK_BOX (hbox3), button6, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (hbox3), button6, false, true, 0); g_signal_connect(window3, "destroy", G_CALLBACK(on_window3_destroy), @@ -485,7 +485,7 @@ create_menu1 (void) (GDestroyNotify)g_object_unref); gtk_widget_show (__________1); gtk_container_add (GTK_CONTAINER (menu1), __________1); - gtk_widget_set_sensitive (__________1, FALSE); + gtk_widget_set_sensitive (__________1, false); item4 = gtk_menu_item_new_with_label (_("MouseAutoMove")); g_object_ref(item4); @@ -521,7 +521,7 @@ create_menu1 (void) (GDestroyNotify)g_object_unref); gtk_widget_show (__________2); gtk_container_add (GTK_CONTAINER (menu1), __________2); - gtk_widget_set_sensitive (__________2, FALSE); + gtk_widget_set_sensitive (__________2, false); item7 = gtk_menu_item_new_with_label (_("VolumeValance")); g_object_ref(item7); @@ -543,7 +543,7 @@ create_menu1 (void) (GDestroyNotify)g_object_unref); gtk_widget_show (__________4); gtk_container_add (GTK_CONTAINER (menu1), __________4); - gtk_widget_set_sensitive (__________4, FALSE); + gtk_widget_set_sensitive (__________4, false); item17 = gtk_menu_item_new_with_label (_("Exit")); g_object_ref(item17); diff --git a/src/menu_gui_volval.c b/src/menu_gui_volval.c index 2773be3..6c7992b 100644 --- a/src/menu_gui_volval.c +++ b/src/menu_gui_volval.c @@ -76,13 +76,13 @@ static GtkWidget* vval_win_open(struct _volval *vval, int max) { g_object_set_data_full(G_OBJECT(window1), "hscale1", hscale1, (GDestroyNotify) g_object_unref); gtk_widget_show (hscale1); - gtk_widget_set_hexpand(hscale1, TRUE); + gtk_widget_set_hexpand(hscale1, true); gtk_widget_set_margin_start(hscale1, 5); gtk_widget_set_margin_end(hscale1, 5); gtk_widget_set_margin_top(hscale1, 2); gtk_widget_set_margin_bottom(hscale1, 2); gtk_grid_attach(GTK_GRID(grid2), hscale1, 1, j+1, 1, 1); - gtk_scale_set_draw_value (GTK_SCALE (hscale1), FALSE); + gtk_scale_set_draw_value (GTK_SCALE (hscale1), false); gtk_scale_set_digits (GTK_SCALE (hscale1), 0); checkbutton1 = gtk_check_button_new_with_label (_("mute")); @@ -104,8 +104,8 @@ static GtkWidget* vval_win_open(struct _volval *vval, int max) { g_object_set_data_full(G_OBJECT(window1), "hbox1", hbox1, (GDestroyNotify) g_object_unref); gtk_widget_show (hbox1); - gtk_widget_set_hexpand(hbox1, TRUE); - gtk_widget_set_vexpand(hbox1, TRUE); + gtk_widget_set_hexpand(hbox1, true); + gtk_widget_set_vexpand(hbox1, true); gtk_grid_attach(GTK_GRID(grid2), hbox1, 1, 0, 1, 1); label6 = gtk_label_new (_("small")); @@ -113,7 +113,7 @@ static GtkWidget* vval_win_open(struct _volval *vval, int max) { g_object_set_data_full(G_OBJECT(window1), "label6", label6, (GDestroyNotify) g_object_unref); gtk_widget_show (label6); - gtk_box_pack_start (GTK_BOX (hbox1), label6, TRUE, FALSE, 3); + gtk_box_pack_start (GTK_BOX (hbox1), label6, true, false, 3); gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT); label7 = gtk_label_new (_("large")); @@ -121,7 +121,7 @@ static GtkWidget* vval_win_open(struct _volval *vval, int max) { g_object_set_data_full(G_OBJECT(window1), "label7", label7, (GDestroyNotify) g_object_unref); gtk_widget_show (label7); - gtk_box_pack_start (GTK_BOX (hbox1), label7, TRUE, FALSE, 3); + gtk_box_pack_start (GTK_BOX (hbox1), label7, true, false, 3); gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_RIGHT); g_signal_connect(window1, "delete_event", @@ -135,12 +135,12 @@ static void on_checkbutton1_toggled (GtkToggleButton *togglebutton, gpointer user_data) { - boolean *muted = (boolean *)user_data; + bool *muted = (bool *)user_data; if (gtk_toggle_button_get_active(togglebutton)) { - *muted = TRUE; + *muted = true; } else { - *muted = FALSE; + *muted = false; } s39ini_setvol(); } @@ -160,5 +160,5 @@ on_window1_destroy (GtkWindow *window, gpointer user_data) { s39ini_winclose(); - return TRUE; + return true; } diff --git a/src/menu_sdl.c b/src/menu_sdl.c index fd0d05d..d2b25a3 100644 --- a/src/menu_sdl.c +++ b/src/menu_sdl.c @@ -56,7 +56,7 @@ void menu_quitmenu_open(void) { return; } if (buttonid == 1) { - nact_quit(FALSE); + nact_quit(false); } } @@ -79,29 +79,29 @@ void menu_resetmenu_open(void) { return; } if (buttonid == 1) { - nact_quit(TRUE); + nact_quit(true); } } -boolean menu_inputstring(INPUTSTRING_PARAM *p) { +bool menu_inputstring(INPUTSTRING_PARAM *p) { #ifdef _WIN32 return input_string(p); #else p->newstring = p->oldstring; - return TRUE; + return true; #endif } -boolean menu_inputstring2(INPUTSTRING_PARAM *p) { +bool menu_inputstring2(INPUTSTRING_PARAM *p) { return sdl_inputString(p); } -boolean menu_inputnumber(INPUTNUM_PARAM *p) { +bool menu_inputnumber(INPUTNUM_PARAM *p) { #ifdef _WIN32 return input_number(p); #else p->value = p->def; - return TRUE; + return true; #endif } @@ -116,6 +116,6 @@ void menu_gtkmainiteration() { } #ifndef _WIN32 -void menu_setSkipState(boolean enabled, boolean activated) { +void menu_setSkipState(bool enabled, bool activated) { } #endif diff --git a/src/message.c b/src/message.c index 08f02d8..400bcdf 100644 --- a/src/message.c +++ b/src/message.c @@ -53,7 +53,7 @@ static int msgDecorateColor; static int msgDecorateType; /* 現在の文字表示位置 */ static MyPoint msgcur; -static boolean nextLineIsAfterKaigyou = FALSE; +static bool nextLineIsAfterKaigyou = false; /* Private Methods */ static void drawLineFrame(Bcom_WindowInfo *info); @@ -74,13 +74,13 @@ void msg_init() { msg.HitAnyKeyMsgColor = 255; msg.WinBackgroundTransparent = 255; - msg.AutoPageChange = TRUE; /* 自動改ページ */ + msg.AutoPageChange = true; /* 自動改ページ */ msg.LineIncrement = 2; /* 改行幅 */ msg.WinBackgroundTransparentColor = -1; /* Window背景の透過色 -1:指定無し*/ /* MG コマンドによるメッセージの文字列変数への取り込み */ - msg.mg_getString = FALSE; - msg.mg_dspMsg = TRUE; + msg.mg_getString = false; + msg.mg_dspMsg = true; msg.mg_startStrVarNo = 1; msg.mg_curStrVarNo = 1; msg.mg_policyR = 0; @@ -100,14 +100,14 @@ void msg_init() { } msg.winno = 1; msg.win = &msg.wininfo[1]; - msg.wininfo[1].save = TRUE; + msg.wininfo[1].save = true; // Private variables msgDecorateColor = 0; msgDecorateType = 0; msgcur.x = 0; msgcur.y = 0; - nextLineIsAfterKaigyou = FALSE; + nextLineIsAfterKaigyou = false; } void msg_setFontSize(int size) { @@ -127,7 +127,7 @@ void msg_putMessage(const char *m) { if (nextLineIsAfterKaigyou) { sys_hit_any_key(); - msg_nextPage(TRUE); + msg_nextPage(true); } texthook_message(m); @@ -201,7 +201,7 @@ void msg_putMessage(const char *m) { ags_updateArea(drawn.x + x, drawn.y, 16, drawn.h); if (nact->messagewait_cancel) { if (sys_getInputInfo()) { - nact->messagewait_cancelled = TRUE; + nact->messagewait_cancelled = true; ags_updateArea(drawn.x, drawn.y, drawn.w, drawn.h); break; } @@ -227,11 +227,11 @@ void msg_nextLine() { msgcur.y += (msg.MsgFontSize + msg.LineIncrement); if ((msgcur.y + msg.MsgFontSize) > (msg.win->y + msg.win->height)) { - nextLineIsAfterKaigyou = TRUE; + nextLineIsAfterKaigyou = true; } } -void msg_nextPage(boolean innerclear) { +void msg_nextPage(bool innerclear) { texthook_nextpage(); // puts("next Page"); @@ -267,7 +267,7 @@ void msg_nextPage(boolean innerclear) { if (msg.mg_getString) msgget_at_a(); } - nextLineIsAfterKaigyou = FALSE; + nextLineIsAfterKaigyou = false; } void msg_openWindow(int W, int C1, int C2, int N, int M) { @@ -328,7 +328,7 @@ void msg_setMessageLocation(int x, int y) { texthook_newline(); msgcur.x = x; msgcur.y = y; - nextLineIsAfterKaigyou = FALSE; + nextLineIsAfterKaigyou = false; } void msg_getMessageLocation(MyPoint *loc) { diff --git a/src/message.h b/src/message.h index 489f909..acc5e5b 100644 --- a/src/message.h +++ b/src/message.h @@ -34,7 +34,7 @@ extern void msg_setStringDecorationColor(int col); extern void msg_setStringDecorationType(int type); extern void msg_putMessage(const char *msg); extern void msg_nextLine(); -extern void msg_nextPage(boolean clear); +extern void msg_nextPage(bool clear); extern void msg_hitAnyKey(); extern void msg_openWindow(int W, int C1, int C2, int N, int M); extern void msg_setMessageLocation(int x, int y); @@ -53,13 +53,13 @@ struct __message { int HitAnyKeyMsgColor; int WinBackgroundTransparentColor; - boolean AutoPageChange; + bool AutoPageChange; int LineIncrement; int WinBackgroundTransparent; /* MG command関連 */ - boolean mg_getString; - boolean mg_dspMsg; + bool mg_getString; + bool mg_dspMsg; int mg_startStrVarNo; int mg_curStrVarNo; int mg_policyR; diff --git a/src/midi.android.c b/src/midi.android.c index 5fa6620..54d6d0f 100644 --- a/src/midi.android.c +++ b/src/midi.android.c @@ -36,7 +36,7 @@ static int midi_setflag(int mode, int index, int val); static int midi_setvol(int vol); static int midi_getvol(); static int midi_fadestart(int time, int volume, int stop); -static boolean midi_fading(); +static bool midi_fading(); #define midi midi_android mididevice_t midi = { @@ -128,7 +128,7 @@ static int midi_unpause(void) { } static int midi_get_playing_info(midiplaystate *st) { - st->in_play = FALSE; + st->in_play = false; st->loc_ms = 0; JNIEnv *env = SDL_AndroidGetJNIEnv(); @@ -143,7 +143,7 @@ static int midi_get_playing_info(midiplaystate *st) { (*env)->PopLocalFrame(env, NULL); if (pos >= 0) { - st->in_play = TRUE; + st->in_play = true; st->loc_ms = pos; } return OK; @@ -169,6 +169,6 @@ static int midi_fadestart(int time, int volume, int stop) { return NG; // FIXME } -static boolean midi_fading() { - return FALSE; // FIXME +static bool midi_fading() { + return false; // FIXME } diff --git a/src/midi.emscripten.c b/src/midi.emscripten.c index 727d1b8..e35711e 100644 --- a/src/midi.emscripten.c +++ b/src/midi.emscripten.c @@ -61,11 +61,11 @@ EM_JS(int, midi_unpause, (void), { static int midi_get_playing_info(midiplaystate *st) { int pos = EM_ASM_INT_V( return xsystem35.midiPlayer.getPosition(); ); if (pos >= 0) { - st->in_play = TRUE; + st->in_play = true; st->loc_ms = pos; return OK; } - st->in_play = FALSE; + st->in_play = false; st->loc_ms = 0; return OK; } @@ -91,7 +91,7 @@ EM_JS(int, midi_fadestart, (int time, int volume, int stop), { return xsystem35.midiPlayer.fadeStart(time, volume, stop); }); -EM_JS(boolean, midi_fading, (), { +EM_JS(bool, midi_fading, (), { return xsystem35.midiPlayer.isFading(); }); diff --git a/src/midi.h b/src/midi.h index 928d4e4..ef63770 100644 --- a/src/midi.h +++ b/src/midi.h @@ -27,7 +27,7 @@ #include "portab.h" typedef struct { - boolean in_play; /* now playing ? */ + bool in_play; /* now playing ? */ int loc_ms; /* playing posion in ms */ int play_no; /* current playing no */ } midiplaystate; @@ -48,7 +48,7 @@ struct mididevice { int (* setvol)(int); int (* getvol)(int); int (* fadestart)(int time, int volume, int stop); - boolean (* fading)(); + bool (* fading)(); }; extern int midi_init(mididevice_t *); diff --git a/src/midi.portmidi.c b/src/midi.portmidi.c index 944ab66..c5e6e6b 100644 --- a/src/midi.portmidi.c +++ b/src/midi.portmidi.c @@ -358,12 +358,12 @@ static int midi_unpause(void) { static int midi_getpos(midiplaystate *st) { if (SDL_AtomicGet(&atomic_seq) == 0) { - st->in_play = FALSE; + st->in_play = false; st->loc_ms = 0; return OK; } - st->in_play = TRUE; + st->in_play = true; st->loc_ms = SDL_GetTicks() - start_time; return OK; diff --git a/src/midi.sdlmixer.c b/src/midi.sdlmixer.c index e2bbb3f..162e7d7 100644 --- a/src/midi.sdlmixer.c +++ b/src/midi.sdlmixer.c @@ -44,7 +44,7 @@ static int midi_setflag(int mode, int index, int val); static int midi_setvol(int vol); static int midi_getvol(); static int midi_fadestart(int time, int volume, int stop); -static boolean midi_fading(); +static bool midi_fading(); #define midi midi_sdlmixer mididevice_t midi = { @@ -127,12 +127,12 @@ static int midi_unpause(void) { static int midi_get_playing_info(midiplaystate *st) { if (!mix_music || !Mix_PlayingMusic()) { - st->in_play = FALSE; + st->in_play = false; st->loc_ms = 0; return OK; } - st->in_play = TRUE; + st->in_play = true; st->loc_ms = SDL_GetTicks() - start_time; return OK; } @@ -171,6 +171,6 @@ static int midi_fadestart(int time, int volume, int stop) { return NG; } -static boolean midi_fading() { +static bool midi_fading() { return SDL_GetTicks() < fade_tick; } diff --git a/src/msgskip.c b/src/msgskip.c index 69dd92c..a7c16ac 100644 --- a/src/msgskip.c +++ b/src/msgskip.c @@ -45,14 +45,14 @@ static struct { mmap_t *map; MsgSkipData *data; unsigned flags; - boolean for_ain_message; - boolean dirty; - boolean enabled; // The menu item is enabled - boolean activated; // Turned on by the user - boolean paused; // Used by MsgSkip module + bool for_ain_message; + bool dirty; + bool enabled; // The menu item is enabled + bool activated; // Turned on by the user + bool paused; // Used by MsgSkip module } msgskip = { .flags = MSGSKIP_STOP_ON_UNSEEN | MSGSKIP_STOP_ON_MENU | MSGSKIP_STOP_ON_CLICK, - .enabled = TRUE, + .enabled = true, }; // Knuth's multiplicative hash. @@ -60,13 +60,13 @@ static uint32_t hash(uint32_t x, int s) { return (x * 2654435761ULL) >> s; } -static void msgskip_action(boolean unseen) { +static void msgskip_action(bool unseen) { if (unseen && !(msgskip.flags & MSGSKIP_SKIP_UNSEEN)) { if (msgskip.flags & MSGSKIP_STOP_ON_UNSEEN) - msgskip_activate(FALSE); - msgskip_enableMenu(FALSE); + msgskip_activate(false); + msgskip_enableMenu(false); } else { - msgskip_enableMenu(TRUE); + msgskip_enableMenu(true); } } @@ -106,15 +106,15 @@ void msgskip_init(const char *msgskip_file) { #endif } -boolean msgskip_isSkipping(void) { +bool msgskip_isSkipping(void) { return msgskip.enabled & msgskip.activated; } -boolean msgskip_isActivated(void) { +bool msgskip_isActivated(void) { return msgskip.activated; } -void msgskip_enableMenu(boolean enable) { +void msgskip_enableMenu(bool enable) { if (enable == msgskip.enabled) return; msgskip.enabled = enable; @@ -122,7 +122,7 @@ void msgskip_enableMenu(boolean enable) { } EMSCRIPTEN_KEEPALIVE -void msgskip_activate(boolean activate) { +void msgskip_activate(bool activate) { if (msgskip.activated == activate) return; msgskip.activated = activate; @@ -151,14 +151,14 @@ void msgskip_onAinMessage(int msgid) { || (unsigned)msgid >= msgskip.data->size) return; uint8_t bit = 1 << (msgid & 7); - boolean unseen = !(msgskip.data->seen[msgid >> 3] & bit); + bool unseen = !(msgskip.data->seen[msgid >> 3] & bit); msgskip.data->seen[msgid >> 3] |= bit; if (unseen) msgskip.dirty = true; msgskip_action(unseen); } -void msgskip_pause(boolean pause) { +void msgskip_pause(bool pause) { msgskip.paused = pause; } diff --git a/src/msgskip.h b/src/msgskip.h index 62eba37..00d1c29 100644 --- a/src/msgskip.h +++ b/src/msgskip.h @@ -28,14 +28,14 @@ #define MSGSKIP_STOP_ON_CLICK 8 extern void msgskip_init(const char *msgskip_file); -extern boolean msgskip_isSkipping(void); -extern boolean msgskip_isActivated(void); -extern void msgskip_enableMenu(boolean enable); -extern void msgskip_activate(boolean activate); +extern bool msgskip_isSkipping(void); +extern bool msgskip_isActivated(void); +extern void msgskip_enableMenu(bool enable); +extern void msgskip_activate(bool activate); extern void msgskip_onMessage(void); extern void msgskip_onAinMessage(int msgid); extern unsigned msgskip_getFlags(); extern void msgskip_setFlags(unsigned flags, unsigned mask); -extern void msgskip_pause(boolean pause); +extern void msgskip_pause(bool pause); #endif // __MSGSKIP_H__ diff --git a/src/music.c b/src/music.c index 02f31b3..579104c 100644 --- a/src/music.c +++ b/src/music.c @@ -116,9 +116,9 @@ int mus_midi_get_flag(int mode, int index) { /* * MIDI の有効/無効 フラグの取得 * return: FALASE -> 無効 - * TRUE -> 有効 + * true -> 有効 */ -boolean mus_midi_get_state() { +bool mus_midi_get_state() { return prv.midi_valid; } @@ -189,21 +189,21 @@ int mus_pcm_get_playposition(int *pos) { * ch : Mono or Stereo * able: 可能かどうかの状態を受け取る場所 */ -int mus_pcm_check_ability(int bit, int rate, int ch, boolean *able) { +int mus_pcm_check_ability(int bit, int rate, int ch, bool *able) { if (!prv.pcm_valid) { - *able = FALSE; + *able = false; return NG; } - *able = TRUE; + *able = true; return OK; } /* * PCM の有効/無効 フラグの取得 * return: FALASE -> 無効 - * TRUE -> 有効 + * true -> 有効 */ -boolean mus_pcm_get_state() { +bool mus_pcm_get_state() { return prv.pcm_valid; } @@ -227,14 +227,14 @@ int mus_mixer_fadeout_start(int device, int time, int volume, int stop) { * 指定のデバイスが現在フェード中かどうかを調べる * device: 指定デバイス * - * return: TRUE -> フェード中 - * FALSE -> フェード中でない + * return: true -> フェード中 + * false -> フェード中でない */ -boolean mus_mixer_fadeout_get_state(int device) { +bool mus_mixer_fadeout_get_state(int device) { if (device == MIX_MIDI) return musmidi_fading(); WARNING("(device=%d) not implemented", device); - return FALSE; + return false; } /* @@ -358,12 +358,12 @@ int mus_wav_fadeout_stop(int ch) { * 指定のチャンネルが現在フェード中かどうかを調べる * ch: channel * - * return: TRUE -> フェード中 - * FALSE -> フェード中でない + * return: true -> フェード中 + * false -> フェード中でない */ -boolean mus_wav_fadeout_get_state(int ch) { +bool mus_wav_fadeout_get_state(int ch) { WARNING("not implemented"); - return FALSE; + return false; } /* diff --git a/src/music.h b/src/music.h index cdd25dd..48009ea 100644 --- a/src/music.h +++ b/src/music.h @@ -49,7 +49,7 @@ extern int mus_midi_unpause(void); extern int mus_midi_get_playposition(midiplaystate *state); extern int mus_midi_set_flag(int mode, int index, int val); extern int mus_midi_get_flag(int mode, int index); -extern boolean mus_midi_get_state(void); +extern bool mus_midi_get_state(void); /* pcm (Scommand) related function */ extern int mus_pcm_start(int no, int loop); @@ -57,12 +57,12 @@ extern int mus_pcm_mix(int noL, int noR, int loop); extern int mus_pcm_stop(int msec); extern int mus_pcm_load(int no); extern int mus_pcm_get_playposition(int *pos); -extern int mus_pcm_check_ability(int bit, int rate, int ch, boolean *able); -extern boolean mus_pcm_get_state(void); +extern int mus_pcm_check_ability(int bit, int rate, int ch, bool *able); +extern bool mus_pcm_get_state(void); /* fader/mixer related function */ extern int mus_mixer_fadeout_start(int device, int time, int volume, int stop); -extern boolean mus_mixer_fadeout_get_state(int device); +extern bool mus_mixer_fadeout_get_state(int device); extern int mus_mixer_fadeout_stop(int device); extern int mus_mixer_get_level(int device); extern bool mus_mixer_set_level(int device, int level); @@ -76,7 +76,7 @@ extern int mus_wav_stop(int ch); extern int mus_wav_get_playposition(int ch); extern int mus_wav_fadeout_start(int ch, int time, int volume, int stop); extern int mus_wav_fadeout_stop(int ch); -extern boolean mus_wav_fadeout_get_state(int ch); +extern bool mus_wav_fadeout_get_state(int ch); extern int mus_wav_waitend(int ch); extern int mus_wav_waittime(int ch, int time); extern int mus_wav_wavtime(int ch); diff --git a/src/music_midi.c b/src/music_midi.c index 65fdc0c..3440dae 100644 --- a/src/music_midi.c +++ b/src/music_midi.c @@ -33,10 +33,10 @@ int musmidi_init(void) { int st = midi_init(&prv.mididev); if (st == -1) { - prv.midi_valid = FALSE; + prv.midi_valid = false; return NG; } else { - prv.midi_valid = TRUE; + prv.midi_valid = true; return OK; } } @@ -103,7 +103,7 @@ int musmidi_unpause(void) { } midiplaystate musmidi_getpos(void) { - midiplaystate st = {FALSE, 0, 0}; + midiplaystate st = {false, 0, 0}; if (!prv.midi_valid || !prv.midi_current_track) return st; prv.mididev.getpos(&st); @@ -135,10 +135,10 @@ int musmidi_fadestart(int time, int volume, int stop) { return prv.mididev.fadestart(time, volume, stop); } -boolean musmidi_fading(void) { - if (!prv.midi_valid) return FALSE; +bool musmidi_fading(void) { + if (!prv.midi_valid) return false; if (!prv.mididev.fading) - return FALSE; + return false; return prv.mididev.fading(); } diff --git a/src/music_midi.h b/src/music_midi.h index fd4da87..75a8522 100644 --- a/src/music_midi.h +++ b/src/music_midi.h @@ -15,6 +15,6 @@ midiplaystate musmidi_getpos(void); int musmidi_setflag(int mode, int index, int val); int musmidi_getflag(int mode, int index); int musmidi_fadestart(int time, int volume, int stop); -boolean musmidi_fading(void); +bool musmidi_fading(void); #endif /* __MUSIC_MIDI_H__ */ diff --git a/src/music_pcm.h b/src/music_pcm.h index 92b55b9..6662e90 100644 --- a/src/music_pcm.h +++ b/src/music_pcm.h @@ -40,7 +40,7 @@ extern int muspcm_unpause(int slot); extern int muspcm_getpos(int slot); extern int muspcm_setvol(int slot, int lv); extern int muspcm_getwavelen(int slot); -extern boolean muspcm_isplaying(int slot); +extern bool muspcm_isplaying(int slot); extern int muspcm_waitend(int slot); #endif /* __MUSIC_PCM_H__ */ diff --git a/src/music_private.h b/src/music_private.h index 28b1b35..68495bf 100644 --- a/src/music_private.h +++ b/src/music_private.h @@ -32,8 +32,8 @@ #include "ald_manager.h" struct _musprvdat { - boolean midi_valid; - boolean pcm_valid; + bool midi_valid; + bool pcm_valid; cdromdevice_t *cddev; mididevice_t mididev; diff --git a/src/nact.c b/src/nact.c index f51e752..ffbe3f1 100644 --- a/src/nact.c +++ b/src/nact.c @@ -141,11 +141,11 @@ static void nact_callback() { } void nact_init() { - nact->is_quit = FALSE; - nact->restart = FALSE; + nact->is_quit = false; + nact->restart = false; nact->callback = nact_callback; - nact->is_va_animation = FALSE; - nact->is_cursor_animation = FALSE; + nact->is_va_animation = false; + nact->is_cursor_animation = false; nact->encoding = SHIFT_JIS; free(nact->game_title_utf8); @@ -155,13 +155,13 @@ void nact_init() { nact->datatbl_addr = NULL; nact->fnc_return_value = 0; - nact->messagewait_enable = FALSE; - nact->messagewait_cancelled = FALSE; + nact->messagewait_enable = false; + nact->messagewait_cancelled = false; nact->messagewait_time = 0; - nact->messagewait_cancel = FALSE; + nact->messagewait_cancel = false; msg_init(); - nact->is_msg_out = TRUE; + nact->is_msg_out = true; nact->msgout = NULL; sel_init(); @@ -182,8 +182,8 @@ void nact_reset(void) { cmd2F_reset(); } -void nact_quit(boolean restart) { - nact->is_quit = TRUE; +void nact_quit(bool restart) { + nact->is_quit = true; nact->restart = restart; request_yield(); } diff --git a/src/nact.h b/src/nact.h index cb5ab64..bbee3c8 100644 --- a/src/nact.h +++ b/src/nact.h @@ -46,7 +46,7 @@ extern void sys_setCharacterEncoding(CharacterEncoding encoding); extern void nact_main(); extern void nact_init(); extern void nact_reset(void); -extern void nact_quit(boolean restart); +extern void nact_quit(bool restart); // cali.c struct VarRef; @@ -68,12 +68,12 @@ void cmd2F_reset(void); typedef struct { /* general */ - boolean is_quit; /* quit command */ - boolean restart; + bool is_quit; /* quit command */ + bool restart; void (*callback)(void); /* main の callback */ - boolean is_va_animation; /* VA command working */ - boolean is_cursor_animation; /* animation cursor working */ - boolean popupmenu_opened; /* popup menu が 開いているか */ + bool is_va_animation; /* VA command working */ + bool is_cursor_animation; /* animation cursor working */ + bool popupmenu_opened; /* popup menu が 開いているか */ CharacterEncoding encoding; char *game_title_utf8; @@ -88,10 +88,10 @@ typedef struct { int waitcancel_key; // TODO: remove this /* message wait */ - boolean messagewait_enable; - boolean messagewait_cancelled; + bool messagewait_enable; + bool messagewait_cancelled; int messagewait_time; - boolean messagewait_cancel; + bool messagewait_cancel; /* ags */ @@ -99,7 +99,7 @@ typedef struct { /* メッセージ関連 */ msg_t msg; - boolean is_msg_out; /* 通常メッセージを表示するか */ + bool is_msg_out; /* 通常メッセージを表示するか */ void (*msgout)(const char *msg); // 通常以外(DLL等)のメッセージ表示関数 /* 選択肢関連 */ diff --git a/src/pcm.emscripten.c b/src/pcm.emscripten.c index 4da1787..58acf8d 100644 --- a/src/pcm.emscripten.c +++ b/src/pcm.emscripten.c @@ -91,7 +91,7 @@ EM_JS(int, muspcm_getwavelen, (int slot), { return len > 65535 ? 65535 : len; }); -EM_JS(boolean, muspcm_isplaying, (int slot), { +EM_JS(bool, muspcm_isplaying, (int slot), { return xsystem35.audio.pcm_isplaying(slot); }); diff --git a/src/pcm.sdlmixer.c b/src/pcm.sdlmixer.c index c76b982..4113133 100644 --- a/src/pcm.sdlmixer.c +++ b/src/pcm.sdlmixer.c @@ -319,9 +319,9 @@ int muspcm_getwavelen(int slot) { } // 指定のスロットが現在演奏中かどうかを取得 -boolean muspcm_isplaying(int slot) { +bool muspcm_isplaying(int slot) { if ((unsigned)slot >= PCM_SLOTS) - return FALSE; + return false; return Mix_Playing(slot); } diff --git a/src/pms.c b/src/pms.c index 5bbe181..5172a4a 100644 --- a/src/pms.c +++ b/src/pms.c @@ -198,22 +198,22 @@ static void extract_16bit(pms_header *pms, uint16_t *pic, uint8_t *b) { /* * Check data is 8bit pms format cg or not * data: raw data (pointer to data top) - * return: TRUE if data is pms + * return: true if data is pms */ -boolean pms256_checkfmt(uint8_t *data) { +bool pms256_checkfmt(uint8_t *data) { int x, y, w, h; - if (data[0] != 0x50 || data[1] != 0x4d) return FALSE; - if (data[6] != 8) return FALSE; + if (data[0] != 0x50 || data[1] != 0x4d) return false; + if (data[6] != 8) return false; x = LittleEndian_getDW(data, 16); y = LittleEndian_getDW(data, 20); w = LittleEndian_getDW(data, 24); h = LittleEndian_getDW(data, 28); - if (x < 0 || y < 0 || w < 0 || h < 0) return FALSE; + if (x < 0 || y < 0 || w < 0 || h < 0) return false; - return TRUE; + return true; } /* @@ -248,22 +248,22 @@ cgdata *pms256_extract(uint8_t *data) { /* * Check data is 16bit pms format cg or not * data: raw data (pointer to data top) - * return: TRUE if data is pms + * return: true if data is pms */ -boolean pms64k_checkfmt(uint8_t *data) { +bool pms64k_checkfmt(uint8_t *data) { int x, y, w, h; - if (data[0] != 0x50 || data[1] != 0x4d) return FALSE; - if (data[6] != 16) return FALSE; + if (data[0] != 0x50 || data[1] != 0x4d) return false; + if (data[6] != 16) return false; x = LittleEndian_getDW(data, 16); y = LittleEndian_getDW(data, 20); w = LittleEndian_getDW(data, 24); h = LittleEndian_getDW(data, 28); - if (x < 0 || y < 0 || w < 0 || h < 0) return FALSE; + if (x < 0 || y < 0 || w < 0 || h < 0) return false; - return TRUE; + return true; } /* diff --git a/src/pms.h b/src/pms.h index ce069cb..ef22216 100644 --- a/src/pms.h +++ b/src/pms.h @@ -59,9 +59,9 @@ typedef struct { * */ -extern boolean pms256_checkfmt(uint8_t *data); +extern bool pms256_checkfmt(uint8_t *data); extern cgdata *pms256_extract(uint8_t *data); -extern boolean pms64k_checkfmt(uint8_t *data); +extern bool pms64k_checkfmt(uint8_t *data); extern cgdata *pms64k_extract(uint8_t *data); #endif /* !__PMS__ */ diff --git a/src/portab.h b/src/portab.h index b32a35a..89a5957 100644 --- a/src/portab.h +++ b/src/portab.h @@ -31,21 +31,9 @@ #define OK 0 #define NG (-1) -#ifndef FALSE -#define FALSE false -#undef TRUE -#define TRUE true -#endif - #define min(x,y) ((x) < (y) ? (x) : (y)) #define max(x,y) ((x) > (y) ? (x) : (y)) -typedef bool ___boolean; - -#ifndef boolean -#define boolean ___boolean -#endif - /* * Standard gettext macros. */ diff --git a/src/profile.c b/src/profile.c index 9f68366..090b36e 100644 --- a/src/profile.c +++ b/src/profile.c @@ -53,14 +53,14 @@ static struct profile_kv *check_profile(const char *name) return NULL; } -static boolean insert_profile(const char *name, const char *value) +static bool insert_profile(const char *name, const char *value) { struct profile_kv *kv; if ((kv = check_profile(name))) { free(kv->value); kv->value = strdup(value); - return TRUE; + return true; } profile = realloc(profile, sizeof(struct profile_kv) * (profile_values + 1)); @@ -70,7 +70,7 @@ static boolean insert_profile(const char *name, const char *value) profile[profile_values].name = strdup(name); profile[profile_values].value = strdup(value); profile_values++; - return TRUE; + return true; } static int load_rc_file(const char *profile_path) @@ -96,11 +96,11 @@ static int load_rc_file(const char *profile_path) /* 読み込んだ行をパースする */ p = q = rc_line; - is_flag = FALSE; + is_flag = false; while (*q) { if (*q == ':') - is_flag = TRUE; + is_flag = true; if (iscntrl(*q) || (!is_flag && isspace(*q))) q++; diff --git a/src/qnt.c b/src/qnt.c index 372f534..d3812fa 100644 --- a/src/qnt.c +++ b/src/qnt.c @@ -212,11 +212,11 @@ static void extract_alpha(qnt_header *qnt, uint8_t *pic, uint8_t *b) { data: raw data (pointer to data top) - return: TRUE if data is qnt + return: true if data is qnt */ -boolean qnt_checkfmt(uint8_t *data) { - if (data[0] != 'Q' || data[1] != 'N' || data[2] != 'T') return FALSE; - return TRUE; +bool qnt_checkfmt(uint8_t *data) { + if (data[0] != 'Q' || data[1] != 'N' || data[2] != 'T') return false; + return true; } /* diff --git a/src/qnt.h b/src/qnt.h index 8f9a613..587102c 100644 --- a/src/qnt.h +++ b/src/qnt.h @@ -41,7 +41,7 @@ typedef struct { int alpha_size; /* compressed alpha pixel size */ } qnt_header; -extern boolean qnt_checkfmt(uint8_t *data); +extern bool qnt_checkfmt(uint8_t *data); extern cgdata *qnt_extract(uint8_t *data); #endif /* __QNT_H__ */ diff --git a/src/s39init.c b/src/s39init.c index 2493b4c..9f95e89 100644 --- a/src/s39init.c +++ b/src/s39init.c @@ -40,7 +40,7 @@ static int vval_max; // 最大チャンネル番号 struct _volval { char *label; int vol; - boolean mute; + bool mute; }; static struct _volval vval[MAXVOLCH]; static GtkWidget *vval_win; @@ -100,7 +100,7 @@ int s39ini_init(void) { int s39ini_winopen() { if (vval_win) { gtk_widget_show(vval_win); - nact->popupmenu_opened = TRUE; + nact->popupmenu_opened = true; } return OK; } @@ -109,7 +109,7 @@ int s39ini_winopen() { int s39ini_winclose() { if (vval_win) { gtk_widget_hide(vval_win); - nact->popupmenu_opened = FALSE; + nact->popupmenu_opened = false; } return OK; } diff --git a/src/savedata.c b/src/savedata.c index 9f2af13..1e07d20 100644 --- a/src/savedata.c +++ b/src/savedata.c @@ -214,7 +214,7 @@ static int loadVarPage(char *buf) { int cnt = head->size / sizeof(uint16_t); if (varPage[page].size < cnt || varPage[page].value == NULL) { - if (!v_allocatePage(page, cnt, TRUE)) { + if (!v_allocatePage(page, cnt, true)) { WARNING("Array allocation failed: page=%d size=%d", page, cnt); return SAVE_LOADERR; } @@ -605,7 +605,7 @@ int save_loadAll(int no) { nact->sel.wininfo[j].y = save_base->selWinInfo[i].y; nact->sel.wininfo[j].width = save_base->selWinInfo[i].width; nact->sel.wininfo[j].height = save_base->selWinInfo[i].height; - // nact->sel.wininfo[i].save = TRUE; + // nact->sel.wininfo[i].save = true; } for (int i = 0; i < MSGWINMAX; i++) { int j = format == SAVEFMT_XSYS35 @@ -616,7 +616,7 @@ int save_loadAll(int no) { nact->msg.wininfo[j].width = save_base->msgWinInfo[i].width; nact->msg.wininfo[j].height = save_base->msgWinInfo[i].height; // nact->msg.wininfo[i].savedImage = NULL; - // nact->msg.wininfo[i].save = FALSE; + // nact->msg.wininfo[i].save = false; } /* スタックのロード */ loadStack(format, saveTop + save_base->stackinfo); diff --git a/src/scenario.c b/src/scenario.c index 911a875..22372d5 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -94,7 +94,7 @@ static int stack_pop_dword(void) { } /* initilize stack and load first scenario data */ -boolean sl_init(void) { +bool sl_init(void) { stack_buf = malloc(stack_size); if (stack_buf == NULL) NOMEMERR(); @@ -102,11 +102,11 @@ boolean sl_init(void) { stack_top = stack_buf; sl_jmpFar(0); - return TRUE; + return true; } /* UD 0 command, reinitilized scenario loader */ -boolean sl_reinit(void) { +bool sl_reinit(void) { free(stack_buf); return sl_init(); } @@ -174,27 +174,27 @@ void sl_jmpNear(int address) { #page page = 0~ */ -boolean sl_jmpFar(int page) { +bool sl_jmpFar(int page) { if (dfile) { ald_freedata(dfile); } dfile = ald_getdata(DRIFILE_SCO, page); if (dfile == NULL) { - return FALSE; + return false; } sl_sco = dfile->data; sl_page = page; sl_index = LittleEndian_getDW(sl_sco, 4); - return TRUE; + return true; } /* ~page,address page = 1~ */ -boolean sl_jmpFar2(int page, int address) { +bool sl_jmpFar2(int page, int address) { if (dfile) { ald_freedata(dfile); } @@ -202,12 +202,12 @@ boolean sl_jmpFar2(int page, int address) { dfile = ald_getdata(DRIFILE_SCO, page); if (dfile == NULL) { TRACE_MESSAGE("ald_getdata fail\n"); - return FALSE; + return false; } sl_sco = dfile->data; sl_page = page; sl_index = address; - return TRUE; + return true; } void sl_callNear(int address) { diff --git a/src/scenario.h b/src/scenario.h index d4a8943..d61236a 100644 --- a/src/scenario.h +++ b/src/scenario.h @@ -59,8 +59,8 @@ extern const uint8_t *sl_sco; // scenario page buffer extern int sl_page; // current scenario page (0-based) extern int sl_index; // cureent scenario address -boolean sl_init(void); -boolean sl_reinit(void); +bool sl_init(void); +bool sl_reinit(void); int sl_getw(void); #define sl_getdw sl_getaddr int sl_getdAt(int address); @@ -72,8 +72,8 @@ const char *sl_getString(char term); const char *sl_getConstString(void); void sl_jmpNear(int address); -boolean sl_jmpFar(int page); -boolean sl_jmpFar2(int page, int address); +bool sl_jmpFar(int page); +bool sl_jmpFar2(int page, int address); void sl_callNear(int address); void sl_retNear(void); void sl_callFar(int page); diff --git a/src/sdl_core.h b/src/sdl_core.h index 7f253db..5c605dc 100644 --- a/src/sdl_core.h +++ b/src/sdl_core.h @@ -43,11 +43,11 @@ extern void sdl_setWorldSize(int width, int height, int depth); extern void sdl_setWindowSize(int w, int h); extern void sdl_setWindowTitle(char *name); extern void sdl_getWindowInfo(DispInfo *info); -extern void sdl_setFullscreen(boolean on); -extern boolean sdl_isFullscreen(void); +extern void sdl_setFullscreen(bool on); +extern bool sdl_isFullscreen(void); extern void sdl_raiseWindow(void); extern agsurface_t *sdl_getDIB(void); -extern void sdl_setIntegerScaling(boolean enable); +extern void sdl_setIntegerScaling(bool enable); /* 画面更新 */ extern void sdl_updateArea(MyRectangle *src, MyPoint *dst); @@ -97,13 +97,13 @@ extern void sdl_setJoyDeviceIndex(int index); extern void sdl_setCursorLocation(int x, int y); extern void sdl_setCursorInternalLocation(int x, int y); extern void sdl_setCursorType(int type); -extern boolean sdl_cursorNew(uint8_t* data, int no, CursorImage *cursorImage, TCursorDirEntry *cursordirentry); +extern bool sdl_cursorNew(uint8_t* data, int no, CursorImage *cursorImage, TCursorDirEntry *cursordirentry); extern int sdl_getKeyInfo(); extern int sdl_getMouseInfo(MyPoint *p); extern void sdl_getWheelInfo(int *forward, int *back); extern void sdl_clearWheelInfo(void); extern int sdl_getJoyInfo(void); -extern void sdl_setAutoRepeat(boolean enable); +extern void sdl_setAutoRepeat(bool enable); extern MyPoint sdl_translateMouseCoords(int x, int y); /* misc */ @@ -116,7 +116,7 @@ extern uint32_t sdl_getTicks(void); extern void sdl_sleep(int msec); extern void sdl_wait_vsync(); extern void sdl_showMessageBox(enum messagebox_type type, const char* title_utf8, const char* message_utf8); -extern boolean sdl_inputString(struct inputstring_param *); +extern bool sdl_inputString(struct inputstring_param *); extern void sdl_post_debugger_command(void *data); extern void sdl_handle_event(SDL_Event *e); diff --git a/src/sdl_cursor.c b/src/sdl_cursor.c index db5eb26..ecc4387 100644 --- a/src/sdl_cursor.c +++ b/src/sdl_cursor.c @@ -86,7 +86,7 @@ void sdl_cursor_init(void) { cursor[CURSOR_WAIT] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_WAIT); } -boolean sdl_cursorNew(uint8_t* data, int no, CursorImage *cursorImage, TCursorDirEntry *cursordirentry) { +bool sdl_cursorNew(uint8_t* data, int no, CursorImage *cursorImage, TCursorDirEntry *cursordirentry) { int xormasklen, andmasklen, xornum; int i, j; int h = 0; @@ -135,7 +135,7 @@ boolean sdl_cursorNew(uint8_t* data, int no, CursorImage *cursorImage, TCursorDi #undef height #undef width - return TRUE; + return true; } MyPoint sdl_translateMouseCoords(int x, int y) { diff --git a/src/sdl_draw.c b/src/sdl_draw.c index c8a97dc..423a118 100644 --- a/src/sdl_draw.c +++ b/src/sdl_draw.c @@ -45,7 +45,7 @@ static void sdl_pal_check(void) { if (nact->ags.pal_changed) { - nact->ags.pal_changed = FALSE; + nact->ags.pal_changed = false; sdl_setPalette(nact->ags.pal, 0, 256); } } @@ -109,7 +109,7 @@ void sdl_updateArea(MyRectangle *src, MyPoint *dst) { SDL_BlitSurface(sdl_dib, src, sdl_display, &rect_d); - sdl_dirty = TRUE; + sdl_dirty = true; } /* 全画面更新 */ @@ -118,7 +118,7 @@ void sdl_updateAll(MyRectangle *view_rect) { SDL_BlitSurface(sdl_dib, view_rect, sdl_display, &rect); - sdl_dirty = TRUE; + sdl_dirty = true; } /* Color の複数個指定 */ diff --git a/src/sdl_event.c b/src/sdl_event.c index 81bff81..439bd6c 100644 --- a/src/sdl_event.c +++ b/src/sdl_event.c @@ -44,7 +44,7 @@ #include "hacks.h" static void sdl_getEvent(void); -static void keyEventProsess(SDL_KeyboardEvent *e, boolean pressed); +static void keyEventProsess(SDL_KeyboardEvent *e, bool pressed); static uint32_t custom_event_type = (uint32_t)-1; @@ -56,7 +56,7 @@ enum CustomEventCode { /* pointer の状態 */ static int mousex, mousey, mouseb; static int mouse_wheel_up, mouse_wheel_down; -boolean RawKeyInfo[256]; +bool RawKeyInfo[256]; /* SDL Joystick */ static int joyinfo=0; @@ -262,7 +262,7 @@ void sdl_handle_event(SDL_Event *e) { case SDL_WINDOWEVENT: switch (e->window.event) { case SDL_WINDOWEVENT_EXPOSED: - sdl_dirty = TRUE; + sdl_dirty = true; break; } break; @@ -272,13 +272,13 @@ void sdl_handle_event(SDL_Event *e) { break; #endif case SDL_APP_DIDENTERFOREGROUND: - sdl_dirty = TRUE; + sdl_dirty = true; break; case SDL_KEYDOWN: - keyEventProsess(&e->key, TRUE); + keyEventProsess(&e->key, true); break; case SDL_KEYUP: - keyEventProsess(&e->key, FALSE); + keyEventProsess(&e->key, false); switch (e->key.keysym.sym) { case SDLK_F1: msgskip_activate(!msgskip_isActivated()); @@ -308,13 +308,13 @@ void sdl_handle_event(SDL_Event *e) { case SDL_MOUSEBUTTONDOWN: mouseb |= (1 << e->button.button); - RawKeyInfo[mouse_to_rawkey(e->button.button)] = TRUE; + RawKeyInfo[mouse_to_rawkey(e->button.button)] = true; send_agsevent(AGSEVENT_BUTTON_PRESS, mouse_to_agsevent(e->button.button)); break; case SDL_MOUSEBUTTONUP: mouseb &= (0xffffffff ^ (1 << e->button.button)); - RawKeyInfo[mouse_to_rawkey(e->button.button)] = FALSE; + RawKeyInfo[mouse_to_rawkey(e->button.button)] = false; send_agsevent(AGSEVENT_BUTTON_RELEASE, mouse_to_agsevent(e->button.button)); if (e->button.button == 2) { menu_open(); @@ -325,8 +325,8 @@ void sdl_handle_event(SDL_Event *e) { if (SDL_GetNumTouchFingers(e->tfinger.touchId) >= 2) { mouseb &= ~(1 << SDL_BUTTON_LEFT); mouseb |= 1 << SDL_BUTTON_RIGHT; - RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_LEFT)] = FALSE; - RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_RIGHT)] = TRUE; + RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_LEFT)] = false; + RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_RIGHT)] = true; send_agsevent(AGSEVENT_BUTTON_PRESS, AGSEVENT_BUTTON_RIGHT); } else { // SDL_RendererEventWatch clamps touch locations outside of the @@ -341,7 +341,7 @@ void sdl_handle_event(SDL_Event *e) { send_agsevent(AGSEVENT_MOUSE_MOTION, 0); } mouseb |= 1 << button; - RawKeyInfo[mouse_to_rawkey(button)] = TRUE; + RawKeyInfo[mouse_to_rawkey(button)] = true; send_agsevent(AGSEVENT_BUTTON_PRESS, mouse_to_agsevent(button)); } break; @@ -350,8 +350,8 @@ void sdl_handle_event(SDL_Event *e) { if (SDL_GetNumTouchFingers(e->tfinger.touchId) == 0) { int ags_button = (mouseb & 1 << SDL_BUTTON_LEFT) ? AGSEVENT_BUTTON_LEFT : AGSEVENT_BUTTON_RIGHT; mouseb &= ~(1 << SDL_BUTTON_LEFT | 1 << SDL_BUTTON_RIGHT); - RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_LEFT)] = FALSE; - RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_RIGHT)] = FALSE; + RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_LEFT)] = false; + RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_RIGHT)] = false; mousex = e->tfinger.x * view_w; mousey = e->tfinger.y * view_h; send_agsevent(AGSEVENT_BUTTON_RELEASE, ags_button); @@ -426,11 +426,11 @@ void sdl_handle_event(SDL_Event *e) { case SIMULATE_RIGHT_BUTTON: if ((intptr_t)e->user.data1) { mouseb |= 1 << SDL_BUTTON_RIGHT; - RawKeyInfo[KEY_MOUSE_RIGHT] = TRUE; + RawKeyInfo[KEY_MOUSE_RIGHT] = true; send_agsevent(AGSEVENT_BUTTON_PRESS, AGSEVENT_BUTTON_RIGHT); } else { mouseb &= ~(1 << SDL_BUTTON_RIGHT); - RawKeyInfo[KEY_MOUSE_RIGHT] = FALSE; + RawKeyInfo[KEY_MOUSE_RIGHT] = false; send_agsevent(AGSEVENT_BUTTON_RELEASE, AGSEVENT_BUTTON_RIGHT); } break; @@ -458,7 +458,7 @@ static void sdl_getEvent(void) { } /* キー情報の取得 */ -static void keyEventProsess(SDL_KeyboardEvent *e, boolean pressed) { +static void keyEventProsess(SDL_KeyboardEvent *e, bool pressed) { int code = sdl_keytable[e->keysym.scancode]; RawKeyInfo[code] = pressed; send_agsevent(pressed ? AGSEVENT_KEY_PRESS : AGSEVENT_KEY_RELEASE, code); diff --git a/src/sdl_input.c b/src/sdl_input.c index bcd4569..4b0abf3 100644 --- a/src/sdl_input.c +++ b/src/sdl_input.c @@ -35,7 +35,7 @@ struct EditorState { char *text; char composingText[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; int cursor; - boolean done; + bool done; }; static struct EditorState *input; @@ -75,7 +75,7 @@ static void redraw() { ags_updateArea(input->rect.x, input->rect.y, input->rect.w, input->rect.h); } -static boolean handle_event(const SDL_Event *e) { +static bool handle_event(const SDL_Event *e) { switch (e->type) { case SDL_KEYDOWN: if (*input->composingText) @@ -83,12 +83,12 @@ static boolean handle_event(const SDL_Event *e) { switch (e->key.keysym.sym) { case SDLK_RETURN: input->params->newstring = input->text; - input->done = TRUE; - return TRUE; + input->done = true; + return true; case SDLK_ESCAPE: input->params->newstring = NULL; - input->done = TRUE; - return TRUE; + input->done = true; + return true; case SDLK_BACKSPACE: { char *p = input->text + strlen(input->text) - 1; @@ -98,7 +98,7 @@ static boolean handle_event(const SDL_Event *e) { *p = '\0'; redraw(); } - return TRUE; + return true; } break; @@ -118,18 +118,18 @@ static boolean handle_event(const SDL_Event *e) { input->cursor = 0; redraw(); } - return TRUE; + return true; case SDL_TEXTEDITING: strncpy(input->composingText, e->edit.text, SDL_TEXTEDITINGEVENT_TEXT_SIZE); input->cursor = e->edit.start; redraw(); - return TRUE; + return true; } - return FALSE; + return false; } -boolean sdl_inputString(INPUTSTRING_PARAM *p) { +bool sdl_inputString(INPUTSTRING_PARAM *p) { static char *buf; free(buf); buf = malloc(p->max * MAX_UTF8_BYTES_PAR_CHAR + 1); @@ -167,5 +167,5 @@ boolean sdl_inputString(INPUTSTRING_PARAM *p) { input = NULL; - return TRUE; + return true; } diff --git a/src/sdl_private.h b/src/sdl_private.h index 1584af0..5b1784c 100644 --- a/src/sdl_private.h +++ b/src/sdl_private.h @@ -41,12 +41,12 @@ extern int view_w; extern int view_h; extern bool sdl_dirty; extern bool sdl_fs_on; -extern boolean (*sdl_custom_event_handler)(const SDL_Event *); +extern bool (*sdl_custom_event_handler)(const SDL_Event *); void sdl_event_init(void); void sdl_cursor_init(void); int sdl_nearest_color(int r, int g, int b); -boolean sdl_joy_open(int index); +bool sdl_joy_open(int index); SDL_Surface *sdl_dib_to_surface_with_alpha(int x, int y, int w, int h); SDL_Surface *sdl_dib_to_surface_colorkey(int x, int y, int w, int h, int col); diff --git a/src/sdl_video.c b/src/sdl_video.c index 4bbab8d..1a71366 100644 --- a/src/sdl_video.c +++ b/src/sdl_video.c @@ -47,7 +47,7 @@ int view_w; int view_h; bool sdl_dirty; bool sdl_fs_on; -boolean (*sdl_custom_event_handler)(const SDL_Event *); +bool (*sdl_custom_event_handler)(const SDL_Event *); static void window_init(const char *render_driver); static void makeDIB(int width, int height, int depth); @@ -56,31 +56,31 @@ static int joy_device_index = -1; static SDL_Joystick *js; -boolean sdl_joy_open(int index) { +bool sdl_joy_open(int index) { if (js) - return FALSE; + return false; js = SDL_JoystickOpen(index); if (!js) - return FALSE; + return false; const char *name = SDL_JoystickName(js); int axes = SDL_JoystickNumAxes(js); int buttons = SDL_JoystickNumButtons(js); SDL_JoystickEventState(SDL_ENABLE); NOTICE("SDL joystick '%s' %d axes %d buttons", name, axes, buttons); - return TRUE; + return true; } -static boolean joy_open(void) { +static bool joy_open(void) { if (joy_device_index >= 0) return sdl_joy_open(joy_device_index); for (int i = 0; i < SDL_NumJoysticks(); i++) { if (sdl_joy_open(i)) - return TRUE; + return true; } - return FALSE; + return false; } /* SDL の初期化 */ @@ -223,7 +223,7 @@ agsurface_t *sdl_getDIB(void) { } /* AutoRepeat の設定 */ -void sdl_setAutoRepeat(boolean enable) { +void sdl_setAutoRepeat(bool enable) { if (enable) { // SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); } else { @@ -231,7 +231,7 @@ void sdl_setAutoRepeat(boolean enable) { } } -void sdl_setFullscreen(boolean on) { +void sdl_setFullscreen(bool on) { #ifndef __EMSCRIPTEN__ if (on == sdl_fs_on) return; @@ -240,7 +240,7 @@ void sdl_setFullscreen(boolean on) { #endif } -boolean sdl_isFullscreen(void) { +bool sdl_isFullscreen(void) { return sdl_fs_on; } @@ -285,7 +285,7 @@ void sdl_setJoyDeviceIndex(int index) { joy_device_index = index; } -void sdl_setIntegerScaling(boolean enable) { +void sdl_setIntegerScaling(bool enable) { SDL_RenderSetIntegerScale(sdl_renderer, enable); } diff --git a/src/selection.c b/src/selection.c index 998f6f5..9e461a4 100644 --- a/src/selection.c +++ b/src/selection.c @@ -104,11 +104,11 @@ void sel_init() { sel.EncloseType = 0; /* 選択したあとメッセージ領域を初期化するか */ - sel.ClearMsgWindow = TRUE; + sel.ClearMsgWindow = true; /* 選択Windowの大きさの変更 */ - sel.WinResizeWidth = FALSE; - sel.WinResizeHeight = TRUE; + sel.WinResizeWidth = false; + sel.WinResizeHeight = true; for (int i = 0; i < SELWINMAX; i++) { if (sel.wininfo[i].savedimg) @@ -124,10 +124,10 @@ void sel_init() { } sel.winno = 1; sel.win = &sel.wininfo[1]; - sel.wininfo[1].save = TRUE; + sel.wininfo[1].save = true; /* 選択肢を登録中 */ - sel.in_setting = FALSE; + sel.in_setting = false; // Private variables memset(elm, 0, sizeof(elm)); @@ -173,7 +173,7 @@ void sel_goto(int no, int flag) { sl_jmpNear(elmv[no -1]); if (flag) { - sel.in_setting = FALSE; + sel.in_setting = false; regnum = 0; maxElementLength = 0; } @@ -187,7 +187,7 @@ void sel_returengoto(int no, int flag) { sl_returnGoto(elmv[no -1]); if (flag) { - sel.in_setting = FALSE; + sel.in_setting = false; regnum = 0; maxElementLength = 0; } @@ -312,7 +312,7 @@ static void init_selwindow() { int x = r.x + r.w * MOUSE_INIT_X_RATIO/100; if (default_element == 0) { MyPoint p; - sys_getMouseInfo(&p, TRUE); + sys_getMouseInfo(&p, true); if (p.y < r.y) { int y = r.y + (sel.MsgFontSize +2) * MOUSE_INIT_Y_RATIO/100; ags_setCursorLocation(x, y, true, true); @@ -346,7 +346,7 @@ static int whereElement(void) { MyRectangle *r = workR; static int mpx, mpy; - sys_getMouseInfo(&p, TRUE); + sys_getMouseInfo(&p, true); if (keymode) { if (abs(mpx - p.x) > 2 || abs(mpy - p.y) > 2) { keymode = 0; @@ -367,7 +367,7 @@ static int whereElement(void) { return -1; } -static void lineEncloseElement(MyRectangle *r, int col, boolean thick) { +static void lineEncloseElement(MyRectangle *r, int col, bool thick) { ags_drawRectangle(r->x, r->y, r->w + 2, r->h + 2, col); if (thick) ags_drawRectangle(r->x + 1, r->y + 1, r->w, r->h, col); @@ -385,9 +385,9 @@ static void encloseElement(int sw, int no) { } else { switch(sel.EncloseType) { case 0: - lineEncloseElement(r, sel.WinBackgroundColor, TRUE); break; + lineEncloseElement(r, sel.WinBackgroundColor, true); break; case 1: - lineEncloseElement(r, sel.WinBackgroundColor, FALSE); break; + lineEncloseElement(r, sel.WinBackgroundColor, false); break; case 2: ags_fillRectangle(r->x, r->y, r->w +2, r->h +2, sel.WinBackgroundColor); ags_drawString(r->x +2, r->y +1, elm[no], sel.MsgFontColor); @@ -404,9 +404,9 @@ static void encloseElement(int sw, int no) { } switch(sel.EncloseType) { case 0: - lineEncloseElement(r, sel.WinFrameColor, TRUE); break; + lineEncloseElement(r, sel.WinFrameColor, true); break; case 1: - lineEncloseElement(r, 255, FALSE); break; + lineEncloseElement(r, 255, false); break; case 2: ags_fillRectangle(r->x, r->y, r->w +2, r->h +2, sel.MsgFontColor); ags_drawString(r->x +2, r->y +1, elm[no], sel.WinBackgroundColor); @@ -436,7 +436,7 @@ void sel_select() { int key, prevkey = 0, i; if (msgskip_getFlags() & MSGSKIP_STOP_ON_MENU) - msgskip_activate(FALSE); + msgskip_activate(false); saveimg2 = NULL; keymode = 0; @@ -456,7 +456,7 @@ void sel_select() { workR[i].h = 2 + sel.MsgFontSize; } - sys_key_releasewait(SYS35KEY_RET, FALSE); + sys_key_releasewait(SYS35KEY_RET, false); while (!nact->is_quit) { key = sys_keywait(25, KEYWAIT_CANCELABLE); @@ -496,7 +496,7 @@ void sel_select() { if (preElement >= 0) { encloseElement(0, preElement); } - sys_key_releasewait(key, FALSE); + sys_key_releasewait(key, false); encloseElement(1, curElement); preElement = curElement; } @@ -536,7 +536,7 @@ void sel_select() { remove_selwindow(); if (sel.ClearMsgWindow) { - msg_nextPage(TRUE); + msg_nextPage(true); } if (curElement != -1) { diff --git a/src/selection.h b/src/selection.h index d91786a..40ddf49 100644 --- a/src/selection.h +++ b/src/selection.h @@ -66,11 +66,11 @@ struct _selection { int EncloseType; /* 選択したあとメッセージ領域を初期化するか */ - boolean ClearMsgWindow; + bool ClearMsgWindow; /* 選択Windowの大きさの変更 */ - boolean WinResizeWidth; - boolean WinResizeHeight; + bool WinResizeWidth; + bool WinResizeHeight; /* 選択肢 Window */ int winno; @@ -78,7 +78,7 @@ struct _selection { Bcom_WindowInfo wininfo[SELWINMAX]; /* 選択肢を登録中 */ - boolean in_setting; + bool in_setting; }; typedef struct _selection sel_t; diff --git a/src/utfsjis.c b/src/utfsjis.c index e1ec000..c86e4b1 100644 --- a/src/utfsjis.c +++ b/src/utfsjis.c @@ -136,27 +136,27 @@ uint8_t *utf2sjis(const uint8_t *src) { } /* src 内に半角カナもしくはASCII文字があるかどうか */ -boolean sjis_has_hankaku(const uint8_t *src) { +bool sjis_has_hankaku(const uint8_t *src) { while(*src) { if (CHECKSJIS1BYTE(*src)) { src++; } else { - return TRUE; + return true; } src++; } - return FALSE; + return false; } /* src 内に 全角文字があるかどうか */ -boolean sjis_has_zenkaku(const uint8_t *src) { +bool sjis_has_zenkaku(const uint8_t *src) { while(*src) { if (CHECKSJIS1BYTE(*src)) { - return TRUE; + return true; } src++; } - return FALSE; + return false; } int utf8_next_codepoint(const char **msg) { diff --git a/src/utfsjis.h b/src/utfsjis.h index 503bf13..b6f4ad2 100644 --- a/src/utfsjis.h +++ b/src/utfsjis.h @@ -46,8 +46,8 @@ extern char* codeconv(CharacterEncoding tocode, extern uint8_t* sjis2utf(const uint8_t *src); extern uint8_t* utf2sjis(const uint8_t *src); -extern boolean sjis_has_hankaku(const uint8_t *src); -extern boolean sjis_has_zenkaku(const uint8_t *src); +extern bool sjis_has_hankaku(const uint8_t *src); +extern bool sjis_has_zenkaku(const uint8_t *src); extern int utf8_next_codepoint(const char **msg); extern char *advance_char(const char *s, CharacterEncoding e); diff --git a/src/variable.h b/src/variable.h index 4e4126b..d5b69cc 100644 --- a/src/variable.h +++ b/src/variable.h @@ -29,7 +29,7 @@ struct VarPage { int size; - boolean saveflag; + bool saveflag; int *value; }; diff --git a/src/vsp.c b/src/vsp.c index 3a31ecd..5df8c3c 100644 --- a/src/vsp.c +++ b/src/vsp.c @@ -172,19 +172,19 @@ static void extract(vsp_header *vsp, uint8_t *pic, uint8_t *b) { /* * Check data is vsp format cg or not * data: raw data (pointer to data top) - * return: TRUE if data is vsp + * return: true if data is vsp */ -boolean vsp_checkfmt(uint8_t *data) { +bool vsp_checkfmt(uint8_t *data) { int x0 = LittleEndian_getW(data, 0); int y0 = LittleEndian_getW(data, 2); int w = LittleEndian_getW(data, 4) - x0; int h = LittleEndian_getW(data, 6) - y0; - if (x0 < 0 || x0 > 80 || y0 < 0 || y0 > 400) return FALSE; + if (x0 < 0 || x0 > 80 || y0 < 0 || y0 > 400) return false; /* 401: for dalk's broken cg */ - if (w < 0 || w > 80 || h < 0 || h > 401) return FALSE; + if (w < 0 || w > 80 || h < 0 || h > 401) return false; - return TRUE; + return true; } /* diff --git a/src/vsp.h b/src/vsp.h index b64c541..30501d2 100644 --- a/src/vsp.h +++ b/src/vsp.h @@ -45,7 +45,7 @@ typedef struct { * 16 palltes into pal[16] ~ pal[31]. */ -extern boolean vsp_checkfmt(uint8_t *data); +extern bool vsp_checkfmt(uint8_t *data); extern cgdata *vsp_extract(uint8_t *data); #endif /* !__VSP__ */ diff --git a/src/webp.c b/src/webp.c index f1294d7..056f842 100644 --- a/src/webp.c +++ b/src/webp.c @@ -25,12 +25,12 @@ #include "ald_manager.h" #include "LittleEndian.h" -boolean webp_checkfmt(uint8_t *data) { +bool webp_checkfmt(uint8_t *data) { if (data[0] != 'R' || data[1] != 'I' || data[2] != 'F' || data[3] != 'F') - return FALSE; + return false; if (data[8] != 'W' || data[9] != 'E' || data[10] != 'B' || data[11] != 'P') - return FALSE; - return TRUE; + return false; + return true; } static int get_base_cg(uint8_t *data, size_t size) { diff --git a/src/webp.h b/src/webp.h index 66b62dc..bb074f5 100644 --- a/src/webp.h +++ b/src/webp.h @@ -22,7 +22,7 @@ #include "cg.h" -boolean webp_checkfmt(uint8_t *data); +bool webp_checkfmt(uint8_t *data); cgdata *webp_extract(uint8_t *data, size_t size); #endif // __WEBP_H__ diff --git a/src/win/dialog.c b/src/win/dialog.c index 07166b1..a4a87c7 100644 --- a/src/win/dialog.c +++ b/src/win/dialog.c @@ -76,18 +76,18 @@ static INT_PTR CALLBACK text_dialog_proc(HWND hDlg, UINT msg, WPARAM wParam, LPA return TRUE; } -boolean input_string(INPUTSTRING_PARAM *p) { +bool input_string(INPUTSTRING_PARAM *p) { p->newstring = p->oldstring; DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG1), get_hwnd(sdl_window), text_dialog_proc, (LPARAM)p); - return TRUE; + return true; } -boolean input_number(INPUTNUM_PARAM *p) { +bool input_number(INPUTNUM_PARAM *p) { // TODO: Implement p->value = p->def; - return TRUE; + return true; } diff --git a/src/win/dialog.h b/src/win/dialog.h index d52d267..00d8783 100644 --- a/src/win/dialog.h +++ b/src/win/dialog.h @@ -24,7 +24,7 @@ struct inputstring_param; struct inputnum_param; -boolean input_string(struct inputstring_param *p); -boolean input_number(struct inputnum_param *p); +bool input_string(struct inputstring_param *p); +bool input_number(struct inputnum_param *p); #endif // __DIALOG_H__ diff --git a/src/win/menubar.c b/src/win/menubar.c index 3fd8454..02c7c73 100644 --- a/src/win/menubar.c +++ b/src/win/menubar.c @@ -104,11 +104,11 @@ void win_menu_onSysWMEvent(SDL_SysWMmsg* msg) { menu_quitmenu_open(); break; case ID_SCREEN_WINDOW: - sdl_setFullscreen(FALSE); + sdl_setFullscreen(false); SetMenu(get_hwnd(sdl_window), hmenu); break; case ID_SCREEN_FULL: - sdl_setFullscreen(TRUE); + sdl_setFullscreen(true); SetMenu(get_hwnd(sdl_window), NULL); break; case ID_SCREEN_INTEGER_SCALING: @@ -137,7 +137,7 @@ void win_menu_onMouseMotion(int x, int y) { SetMenu(get_hwnd(sdl_window), y > 0 ? NULL : hmenu); } -void menu_setSkipState(boolean enabled, boolean activated) { +void menu_setSkipState(bool enabled, bool activated) { HWND hwnd = get_hwnd(sdl_window); EnableMenuItem(hmenu, ID_MSGSKIP, enabled ? MF_ENABLED : MF_GRAYED); diff --git a/src/windowframe.h b/src/windowframe.h index a3cdf47..cd2b6e1 100644 --- a/src/windowframe.h +++ b/src/windowframe.h @@ -41,7 +41,7 @@ typedef struct { int y; int width; int height; - boolean save; + bool save; void *savedimg; } Bcom_WindowInfo; diff --git a/src/xsystem35.c b/src/xsystem35.c index 9148e1a..24b881b 100644 --- a/src/xsystem35.c +++ b/src/xsystem35.c @@ -75,7 +75,7 @@ #include "texthook.h" static char *gameResourceFile = "xsystem35.gr"; -static void sys35_usage(boolean verbose); +static void sys35_usage(bool verbose); static void sys35_init(); static void sys35_remove(); static void sys35_ParseOption(int *argc, char **argv); @@ -98,13 +98,13 @@ static const char *fontname_tt[FONTTYPEMAX] = {DEFAULT_GOTHIC_TTF, DEFAULT_MINCH static char fontface[FONTTYPEMAX]; static const char *savedir; -static boolean font_noantialias; +static bool font_noantialias; static bool enable_zb = false; static bool integer_scaling = false; /* fullscreen on from command line */ -static boolean fs_on; +static bool fs_on; -static void sys35_usage(boolean verbose) { +static void sys35_usage(bool verbose) { if (verbose) { puts("System35 for X Window System [proj. Rainy Moon]"); puts(" (C) Masaki Chikama(Wren) 1997-2002"); @@ -262,28 +262,28 @@ static void sys35_ParseOption(int *argc, char **argv) { FILE *fp; for (i = 1; i < *argc; i++) { if (!strcmp(argv[i], "-h")) { - sys35_usage(TRUE); + sys35_usage(true); } if (!strcmp(argv[i], "--help")) { - sys35_usage(TRUE); + sys35_usage(true); } } for (i = 1; i < *argc; i++) { if (0 == strcmp(argv[i], "-savedir")) { if (i == *argc - 1) { fprintf(stderr, "xsystem35: The -savedir option requires directory name\n\n"); - sys35_usage(FALSE); + sys35_usage(false); } savedir = argv[++i]; } if (0 == strcmp(argv[i], "-gamefile")) { if (i == *argc - 1) { fprintf(stderr, "xsystem35: The -gamefile option requires file value\n\n"); - sys35_usage(FALSE); + sys35_usage(false); } if (NULL == (fp = fopen(argv[i + 1],"r"))) { fprintf(stderr, "xsystem35: gamefile '%s' not found\n\n", argv[i + 1]); - sys35_usage(FALSE); + sys35_usage(false); } fclose(fp); gameResourceFile = argv[i + 1]; @@ -301,7 +301,7 @@ static void sys35_ParseOption(int *argc, char **argv) { if (argv[i + 1] != NULL) { if (!set_texthook_mode(argv[i + 1])) { fprintf(stderr, "xsystem35: Invalid texthook mode '%s'\n\n", argv[i + 1]); - sys35_usage(FALSE); + sys35_usage(false); } } } else if (0 == strcmp(argv[i], "-texthook_suppress")) { @@ -319,11 +319,11 @@ static void sys35_ParseOption(int *argc, char **argv) { sdl_setJoyDeviceIndex(atoi(argv[i + 1])); } } else if (0 == strcmp(argv[i], "-fullscreen")) { - fs_on = TRUE; + fs_on = true; } else if (0 == strcmp(argv[i], "-noantialias")) { - font_noantialias = TRUE; + font_noantialias = true; } else if (0 == strcmp(argv[i], "-enable_zb")) { - enable_zb = TRUE; + enable_zb = true; } else if (0 == strcmp(argv[i], "-ttfont_gothic")) { if (argv[i + 1] != NULL) { fontname_tt[FONT_GOTHIC] = argv[i + 1]; @@ -333,7 +333,7 @@ static void sys35_ParseOption(int *argc, char **argv) { fontname_tt[FONT_MINCHO] = argv[i + 1]; } } else if (0 == strcmp(argv[i], "-noimagecursor")) { - nact->ags.noimagecursor = TRUE; + nact->ags.noimagecursor = true; } else if (0 == strcmp(argv[i], "-debuglv")) { if (argv[i + 1] != NULL) { debuglv = argv[i + 1][0] - '0'; @@ -494,7 +494,7 @@ static void registerGameFiles(void) { if (nact->files.cnt[DRIFILE_SCO] == 0) SYSERROR("No Scenario data available"); for (int type = 0; type < DRIFILETYPEMAX; type++) { - boolean use_mmap = true; + bool use_mmap = true; if (debugger_mode != DEBUGGER_DISABLED && type == DRIFILE_SCO) { // Do not mmap scenario files so that BREAKPOINT instructions can be inserted. use_mmap = false; @@ -525,7 +525,7 @@ int main(int argc, char **argv) { sdl_showMessageBox(MESSAGEBOX_ERROR, "xsystem35", "Cannot find scenario file (*SA.ALD)"); exit(1); #else - sys35_usage(TRUE); + sys35_usage(true); #endif } registerGameFiles(); @@ -579,7 +579,7 @@ int main(int argc, char **argv) { EMSCRIPTEN_KEEPALIVE void sys_restart(void) { - nact_quit(TRUE); + nact_quit(true); } #endif