OSDN Git Service

[Refactor] #38995 world_type 構造体に starttime を start_time に改名して取り込む。 / Move starttime...
authordeskull <deskull@users.sourceforge.jp>
Sun, 3 Mar 2019 10:50:27 +0000 (19:50 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 3 Mar 2019 10:50:27 +0000 (19:50 +0900)
src/autopick.c
src/birth.c
src/dungeon.c
src/externs.h
src/files.c
src/load.c
src/quest.c
src/save.c
src/types.h
src/variable.c
src/view-mainwindow.c

index 6b21e8b..85042d6 100644 (file)
@@ -6006,7 +6006,7 @@ void do_cmd_edit_autopick(void)
                old_autosave_turn = current_world_ptr->game_turn;
        }
 
-       /* HACK -- Reset start_time to stop counting playtime while edit */
+       /* HACK -- Reset start_time to stop counting current_world_ptr->play_time while edit */
        update_playtime();
 
        /* Free old entries */
@@ -6132,7 +6132,7 @@ void do_cmd_edit_autopick(void)
        /* Reload autopick pref */
        process_autopick_file(buf);
 
-       /* HACK -- reset start_time so that playtime is not increase while edit */
+       /* HACK -- reset start_time so that current_world_ptr->play_time is not increase while edit */
        start_time = (u32b)time(NULL);
 
        /* Save cursor location */
index 2c41d81..85e63d5 100644 (file)
@@ -4544,7 +4544,7 @@ void player_birth(void)
        int i, j;
        char buf[80];
 
-       playtime = 0;
+       current_world_ptr->play_time = 0;
 
        /* 
         * Wipe monsters in old dungeon
index b890d2b..6c24001 100644 (file)
@@ -1061,7 +1061,7 @@ void leave_quest_check(void)
                        q_ptr->status = QUEST_STATUS_FAILED;
                        q_ptr->complev = p_ptr->lev;
                        update_playtime();
-                       q_ptr->comptime = playtime;
+                       q_ptr->comptime = current_world_ptr->play_time;
 
                        /* Additional settings */
                        switch (q_ptr->type)
@@ -1111,7 +1111,7 @@ void leave_tower_check(void)
                        quest[QUEST_TOWER1].status = QUEST_STATUS_FAILED;
                        quest[QUEST_TOWER1].complev = p_ptr->lev;
                        update_playtime();
-                       quest[QUEST_TOWER1].comptime = playtime;
+                       quest[QUEST_TOWER1].comptime = current_world_ptr->play_time;
                }
        }
 }
@@ -3087,7 +3087,7 @@ static void process_world_aux_movement(void)
                                                        q_ptr->status = QUEST_STATUS_FAILED;
                                                        q_ptr->complev = (byte)p_ptr->lev;
                                                        update_playtime();
-                                                       q_ptr->comptime = playtime;
+                                                       q_ptr->comptime = current_world_ptr->play_time;
                                                        r_info[q_ptr->r_idx].flags1 &= ~(RF1_QUESTOR);
                                                }
                                        }
index 3847051..c640734 100644 (file)
@@ -341,7 +341,6 @@ extern MONSTER_IDX pet_t_m_idx;
 extern MONSTER_IDX riding_t_m_idx;
 extern MONRACE_IDX today_mon;
 extern bool write_level;
-extern u32b playtime;
 extern u32b start_time;
 extern bool sukekaku;
 extern bool new_mane;
index 617ac9e..9c32f60 100644 (file)
@@ -1906,7 +1906,7 @@ static void display_player_middle(void)
                display_player_one_line(ENTRY_SP, format("%4d/%4d", p_ptr->csp , p_ptr->msp), TERM_RED);
 
        /* Dump play time */
-       display_player_one_line(ENTRY_PLAY_TIME, format("%.2lu:%.2lu:%.2lu", playtime/(60*60), (playtime/60)%60, playtime%60), TERM_L_GREEN);
+       display_player_one_line(ENTRY_PLAY_TIME, format("%.2lu:%.2lu:%.2lu", current_world_ptr->play_time/(60*60), (current_world_ptr->play_time/60)%60, current_world_ptr->play_time%60), TERM_L_GREEN);
 }
 
 
index 8a62a18..815c4f1 100644 (file)
@@ -2349,11 +2349,11 @@ static void rd_extra(void)
 
        if (z_older_than(10,1,2))
        {
-               playtime = 0;
+               current_world_ptr->play_time = 0;
        }
        else
        {
-               rd_u32b(&playtime);
+               rd_u32b(&current_world_ptr->play_time);
        }
 
        if (z_older_than(10,3,9))
index 40eba14..26069c0 100644 (file)
@@ -77,7 +77,7 @@ void complete_quest(QUEST_IDX quest_num)
        q_ptr->status = QUEST_STATUS_COMPLETED;
        q_ptr->complev = p_ptr->lev;
        update_playtime();
-       q_ptr->comptime = playtime;
+       q_ptr->comptime = current_world_ptr->play_time;
 
        if (!(q_ptr->flags & QUEST_FLAG_SILENT))
        {
@@ -354,7 +354,7 @@ void quest_discovery(QUEST_IDX q_idx)
                        quest[q_idx].status = QUEST_STATUS_FINISHED;
                        q_ptr->complev = 0;
                        update_playtime();
-                       q_ptr->comptime = playtime;
+                       q_ptr->comptime = current_world_ptr->play_time;
                }
                else
                {
index 34be718..f24e473 100644 (file)
@@ -842,7 +842,7 @@ static void wr_extra(void)
        /* Save temporary preserved pets (obsolated) */
        wr_s16b(0);
 
-       wr_u32b(playtime);
+       wr_u32b(current_world_ptr->play_time);
 
        wr_s32b(p_ptr->visit);
 
@@ -1610,7 +1610,7 @@ static bool save_player_aux(char *name)
        /* Failure */
        if (!ok) return (FALSE);
 
-       counts_write(0, playtime);
+       counts_write(0, current_world_ptr->play_time);
 
        /* Successful save */
        character_saved = TRUE;
@@ -1960,9 +1960,9 @@ bool load_player(void)
                        u32b tmp = counts_read(2);
                        if (tmp > p_ptr->count)
                                p_ptr->count = tmp;
-                       if (counts_read(0) > playtime || counts_read(1) == playtime)
+                       if (counts_read(0) > current_world_ptr->play_time || counts_read(1) == current_world_ptr->play_time)
                                counts_write(2, ++p_ptr->count);
-                       counts_write(1, playtime);
+                       counts_write(1, current_world_ptr->play_time);
                }
 
                /* Success */
index 4d85d1c..c813f94 100644 (file)
@@ -1916,11 +1916,8 @@ typedef struct {
 } floor_type;
 
 typedef struct {
-       /*
-        * Maximum size of the wilderness
-        */
-       POSITION max_wild_x;
-       POSITION max_wild_y;
+       POSITION max_wild_x; /*!< Maximum size of the wilderness */
+       POSITION max_wild_y; /*!< Maximum size of the wilderness */
        GAME_TURN game_turn;                    /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
        GAME_TURN game_turn_limit;              /*!< game_turnの最大値 / Limit of game_turn */
        GAME_TURN dungeon_turn;                 /*!< NASTY生成の計算に関わる内部ターン値 / Game current_world_ptr->game_turn in dungeon */
@@ -1929,4 +1926,5 @@ typedef struct {
 
        MONRACE_IDX bounty_r_idx[MAX_KUBI];
 
+       u32b play_time; /*!< 実プレイ時間 */
 } world_type;
index 4a2f382..3468a2e 100644 (file)
@@ -792,7 +792,6 @@ MONSTER_IDX today_mon;
 
 bool write_level;
 
-u32b playtime;
 u32b start_time;
 
 bool sukekaku;
index 9328563..b5b1cb7 100644 (file)
@@ -2413,7 +2413,7 @@ void update_playtime(void)
        if (start_time != 0)
        {
                u32b tmp = (u32b)time(NULL);
-               playtime += (tmp - start_time);
+               current_world_ptr->play_time += (tmp - start_time);
                start_time = tmp;
        }
 }