• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisione21515fc1a8bdb90bfb73a1d7a1e629d8a279900 (tree)
Time2019-03-02 00:44:28
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38993 mon_lite_n/x/y を floor_type に取り込む。 / Move mon_lite_n/x/y to floor_type structure.

Change Summary

Incremental Difference

--- a/src/externs.h
+++ b/src/externs.h
@@ -216,9 +216,6 @@ extern int player_egid;
216216 extern char player_base[32];
217217 extern char savefile[1024];
218218 extern char savefile_base[40];
219-extern POSITION_IDX mon_lite_n;
220-extern POSITION mon_lite_y[MON_LITE_MAX];
221-extern POSITION mon_lite_x[MON_LITE_MAX];
222219 extern POSITION_IDX view_n;
223220 extern POSITION view_y[VIEW_MAX];
224221 extern POSITION view_x[VIEW_MAX];
--- a/src/grid.c
+++ b/src/grid.c
@@ -3713,10 +3713,10 @@ void update_mon_lite(void)
37133713 (MAX_SIGHT / 2 + 1) : (MAX_SIGHT + 3);
37143714
37153715 /* Clear all monster lit squares */
3716- for (i = 0; i < mon_lite_n; i++)
3716+ for (i = 0; i < current_floor_ptr->mon_lite_n; i++)
37173717 {
37183718 /* Point to grid */
3719- g_ptr = &current_floor_ptr->grid_array[mon_lite_y[i]][mon_lite_x[i]];
3719+ g_ptr = &current_floor_ptr->grid_array[current_floor_ptr->mon_lite_y[i]][current_floor_ptr->mon_lite_x[i]];
37203720
37213721 /* Set temp or xtra flag */
37223722 g_ptr->info |= (g_ptr->info & CAVE_MNLT) ? CAVE_TEMP : CAVE_XTRA;
@@ -3904,10 +3904,10 @@ void update_mon_lite(void)
39043904 /*
39053905 * Look at old set flags to see if there are any changes.
39063906 */
3907- for (i = 0; i < mon_lite_n; i++)
3907+ for (i = 0; i < current_floor_ptr->mon_lite_n; i++)
39083908 {
3909- fx = mon_lite_x[i];
3910- fy = mon_lite_y[i];
3909+ fx = current_floor_ptr->mon_lite_x[i];
3910+ fy = current_floor_ptr->mon_lite_y[i];
39113911
39123912 /* We trust this grid is in bounds */
39133913
@@ -3942,7 +3942,7 @@ void update_mon_lite(void)
39423942 }
39433943
39443944 /* Clear the lite array */
3945- mon_lite_n = 0;
3945+ current_floor_ptr->mon_lite_n = 0;
39463946
39473947 /* Copy the temp array into the lit array lighting the new squares. */
39483948 for (i = 0; i < end_temp; i++)
@@ -3977,9 +3977,9 @@ void update_mon_lite(void)
39773977 }
39783978
39793979 /* Save in the monster lit or darkened array */
3980- mon_lite_x[mon_lite_n] = fx;
3981- mon_lite_y[mon_lite_n] = fy;
3982- mon_lite_n++;
3980+ current_floor_ptr->mon_lite_x[current_floor_ptr->mon_lite_n] = fx;
3981+ current_floor_ptr->mon_lite_y[current_floor_ptr->mon_lite_n] = fy;
3982+ current_floor_ptr->mon_lite_n++;
39833983 }
39843984
39853985 /* Clear the temp flag for the old lit or darken grids */
@@ -4021,17 +4021,17 @@ void clear_mon_lite(void)
40214021 grid_type *g_ptr;
40224022
40234023 /* Clear all monster lit squares */
4024- for (i = 0; i < mon_lite_n; i++)
4024+ for (i = 0; i < current_floor_ptr->mon_lite_n; i++)
40254025 {
40264026 /* Point to grid */
4027- g_ptr = &current_floor_ptr->grid_array[mon_lite_y[i]][mon_lite_x[i]];
4027+ g_ptr = &current_floor_ptr->grid_array[current_floor_ptr->mon_lite_y[i]][current_floor_ptr->mon_lite_x[i]];
40284028
40294029 /* Clear monster illumination flag */
40304030 g_ptr->info &= ~(CAVE_MNLT | CAVE_MNDK);
40314031 }
40324032
40334033 /* Empty the array */
4034- mon_lite_n = 0;
4034+ current_floor_ptr->mon_lite_n = 0;
40354035 }
40364036
40374037
--- a/src/types.h
+++ b/src/types.h
@@ -1898,6 +1898,9 @@ typedef struct {
18981898 POSITION lite_y[LITE_MAX];
18991899 POSITION lite_x[LITE_MAX];
19001900
1901+ POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
1902+ POSITION mon_lite_y[MON_LITE_MAX];
1903+ POSITION mon_lite_x[MON_LITE_MAX];
19011904 } floor_type;
19021905
19031906 typedef struct {
--- a/src/variable.c
+++ b/src/variable.c
@@ -209,10 +209,6 @@ char player_base[32];
209209 char savefile[1024];
210210 char savefile_base[40];
211211
212-POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
213-POSITION mon_lite_y[MON_LITE_MAX];
214-POSITION mon_lite_x[MON_LITE_MAX];
215-
216212 POSITION_IDX view_n; //!< Array of grids viewable to the player (see "current_floor_ptr->grid_array.c")
217213 POSITION view_y[VIEW_MAX];
218214 POSITION view_x[VIEW_MAX];
Show on old repository browser