• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisionb33e3310ad5e0960c1f947f00f79794006089aab (tree)
Time2019-07-06 11:20:44
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 edit_history() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/birth.c
+++ b/src/birth.c
@@ -3644,7 +3644,7 @@ static bool do_cmd_histpref(void)
36443644 * @brief 生い立ちメッセージを編集する。/Character background edit-mode
36453645 * @return なし
36463646 */
3647-static void edit_history(void)
3647+static void edit_history(player_type *creature_ptr)
36483648 {
36493649 char old_history[4][60];
36503650 TERM_LEN y = 0, x = 0;
@@ -3653,15 +3653,15 @@ static void edit_history(void)
36533653 /* Edit character background */
36543654 for (i = 0; i < 4; i++)
36553655 {
3656- sprintf(old_history[i], "%s", p_ptr->history[i]);
3656+ sprintf(old_history[i], "%s", creature_ptr->history[i]);
36573657 }
36583658 /* Turn 0 to space */
36593659 for (i = 0; i < 4; i++)
36603660 {
3661- for (j = 0; p_ptr->history[i][j]; j++) /* loop */;
3661+ for (j = 0; creature_ptr->history[i][j]; j++) /* loop */;
36623662
3663- for (; j < 59; j++) p_ptr->history[i][j] = ' ';
3664- p_ptr->history[i][59] = '\0';
3663+ for (; j < 59; j++) creature_ptr->history[i][j] = ' ';
3664+ creature_ptr->history[i][59] = '\0';
36653665 }
36663666 display_player(1);
36673667 #ifdef JP
@@ -3679,14 +3679,14 @@ static void edit_history(void)
36793679
36803680 for (i = 0; i < 4; i++)
36813681 {
3682- put_str(p_ptr->history[i], i + 12, 10);
3682+ put_str(creature_ptr->history[i], i + 12, 10);
36833683 }
36843684 #ifdef JP
3685- if (iskanji2(p_ptr->history[y], x))
3686- c_put_str(TERM_L_BLUE, format("%c%c", p_ptr->history[y][x],p_ptr->history[y][x+1]), y + 12, x + 10);
3685+ if (iskanji2(creature_ptr->history[y], x))
3686+ c_put_str(TERM_L_BLUE, format("%c%c", creature_ptr->history[y][x],creature_ptr->history[y][x+1]), y + 12, x + 10);
36873687 else
36883688 #endif
3689- c_put_str(TERM_L_BLUE, format("%c", p_ptr->history[y][x]), y + 12, x + 10);
3689+ c_put_str(TERM_L_BLUE, format("%c", creature_ptr->history[y][x]), y + 12, x + 10);
36903690
36913691 /* Place cursor just after cost of current stat */
36923692 Term_gotoxy(x + 10, y + 12);
@@ -3703,7 +3703,7 @@ static void edit_history(void)
37033703 y--;
37043704 if (y < 0) y = 3;
37053705 #ifdef JP
3706- if ((x > 0) && (iskanji2(p_ptr->history[y], x-1))) x--;
3706+ if ((x > 0) && (iskanji2(creature_ptr->history[y], x-1))) x--;
37073707 #endif
37083708 }
37093709 else if (skey == SKEY_DOWN || c == KTRL('n'))
@@ -3711,13 +3711,13 @@ static void edit_history(void)
37113711 y++;
37123712 if (y > 3) y = 0;
37133713 #ifdef JP
3714- if ((x > 0) && (iskanji2(p_ptr->history[y], x-1))) x--;
3714+ if ((x > 0) && (iskanji2(creature_ptr->history[y], x-1))) x--;
37153715 #endif
37163716 }
37173717 else if (skey == SKEY_RIGHT || c == KTRL('f'))
37183718 {
37193719 #ifdef JP
3720- if (iskanji2(p_ptr->history[y], x)) x++;
3720+ if (iskanji2(creature_ptr->history[y], x)) x++;
37213721 #endif
37223722 x++;
37233723 if (x > 58)
@@ -3740,7 +3740,7 @@ static void edit_history(void)
37403740 }
37413741
37423742 #ifdef JP
3743- if ((x > 0) && (iskanji2(p_ptr->history[y], x-1))) x--;
3743+ if ((x > 0) && (iskanji2(creature_ptr->history[y], x-1))) x--;
37443744 #endif
37453745 }
37463746 else if (c == '\r' || c == '\n')
@@ -3765,8 +3765,8 @@ static void edit_history(void)
37653765
37663766 for (i = 0; i < 4; i++)
37673767 {
3768- sprintf(p_ptr->history[i], "%s", old_history[i]);
3769- put_str(p_ptr->history[i], i + 12, 10);
3768+ sprintf(creature_ptr->history[i], "%s", old_history[i]);
3769+ put_str(creature_ptr->history[i], i + 12, 10);
37703770 }
37713771 break;
37723772 }
@@ -3775,7 +3775,7 @@ static void edit_history(void)
37753775 if (do_cmd_histpref())
37763776 {
37773777 #ifdef JP
3778- if ((x > 0) && (iskanji2(p_ptr->history[y], x - 1))) x--;
3778+ if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1))) x--;
37793779 #endif
37803780 }
37813781 }
@@ -3792,12 +3792,12 @@ static void edit_history(void)
37923792 else x = 0;
37933793 }
37943794
3795- p_ptr->history[y][x] = ' ';
3795+ creature_ptr->history[y][x] = ' ';
37963796 #ifdef JP
3797- if ((x > 0) && (iskanji2(p_ptr->history[y], x - 1)))
3797+ if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1)))
37983798 {
37993799 x--;
3800- p_ptr->history[y][x] = ' ';
3800+ creature_ptr->history[y][x] = ' ';
38013801 }
38023802 #endif
38033803 }
@@ -3808,9 +3808,9 @@ static void edit_history(void)
38083808 #endif
38093809 {
38103810 #ifdef JP
3811- if (iskanji2(p_ptr->history[y], x))
3811+ if (iskanji2(creature_ptr->history[y], x))
38123812 {
3813- p_ptr->history[y][x+1] = ' ';
3813+ creature_ptr->history[y][x+1] = ' ';
38143814 }
38153815
38163816 if (iskanji(c))
@@ -3822,17 +3822,17 @@ static void edit_history(void)
38223822 if (y > 3) y = 0;
38233823 }
38243824
3825- if (iskanji2(p_ptr->history[y], x+1))
3825+ if (iskanji2(creature_ptr->history[y], x+1))
38263826 {
3827- p_ptr->history[y][x+2] = ' ';
3827+ creature_ptr->history[y][x+2] = ' ';
38283828 }
38293829
3830- p_ptr->history[y][x++] = c;
3830+ creature_ptr->history[y][x++] = c;
38313831
38323832 c = inkey();
38333833 }
38343834 #endif
3835- p_ptr->history[y][x++] = c;
3835+ creature_ptr->history[y][x++] = c;
38363836 if (x > 58)
38373837 {
38383838 x = 0;
@@ -4149,7 +4149,7 @@ static bool player_birth_aux(player_type *creature_ptr)
41494149
41504150 if (autochara)
41514151 {
4152- if (!get_chara_limits(p_ptr)) return FALSE;
4152+ if (!get_chara_limits(creature_ptr)) return FALSE;
41534153 }
41544154
41554155 #endif /* ALLOW_AUTOROLLER */
@@ -4460,7 +4460,7 @@ static bool player_birth_aux(player_type *creature_ptr)
44604460 process_player_name(current_world_ptr->creating_savefile);
44614461
44624462 /*** Edit character background ***/
4463- edit_history();
4463+ edit_history(p_ptr);
44644464
44654465 /*** Finish up ***/
44664466
@@ -4587,12 +4587,12 @@ void player_birth(player_type *creature_ptr)
45874587 wipe_m_list();
45884588
45894589 /* Wipe the player */
4590- player_wipe_without_name(p_ptr);
4590+ player_wipe_without_name(creature_ptr);
45914591
45924592 /* Create a new character */
45934593
45944594 /* Quick start? */
4595- if (!ask_quick_start(p_ptr))
4595+ if (!ask_quick_start(creature_ptr))
45964596 {
45974597 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_DEFAULT);
45984598
@@ -4600,10 +4600,10 @@ void player_birth(player_type *creature_ptr)
46004600 while (1)
46014601 {
46024602 /* Roll up a new character */
4603- if (player_birth_aux(p_ptr)) break;
4603+ if (player_birth_aux(creature_ptr)) break;
46044604
46054605 /* Wipe the player */
4606- player_wipe_without_name(p_ptr);
4606+ player_wipe_without_name(creature_ptr);
46074607 }
46084608 }
46094609
Show on old repository browser