• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionad951098494c9de50a330832bbd93a3e508989a8 (tree)
Time2019-02-27 02:02:19
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38993 cur_wid/hgt を floor_type に取り込み width/heightに改名。 / Move cur_wid/hgt to floor_type structure and rename width and height.

Change Summary

Incremental Difference

--- a/src/cmd4.c
+++ b/src/cmd4.c
@@ -5270,9 +5270,9 @@ static void do_cmd_knowledge_artifacts(void)
52705270 }
52715271
52725272 /* Check the dungeon */
5273- for (y = 0; y < cur_hgt; y++)
5273+ for (y = 0; y < current_floor_ptr->height; y++)
52745274 {
5275- for (x = 0; x < cur_wid; x++)
5275+ for (x = 0; x < current_floor_ptr->width; x++)
52765276 {
52775277 grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
52785278
--- a/src/defines.h
+++ b/src/defines.h
@@ -3407,20 +3407,20 @@
34073407 * Determines if a map location is fully inside the outer walls
34083408 */
34093409 #define in_bounds(Y,X) \
3410- (((Y) > 0) && ((X) > 0) && ((Y) < cur_hgt-1) && ((X) < cur_wid-1))
3410+ (((Y) > 0) && ((X) > 0) && ((Y) < current_floor_ptr->height-1) && ((X) < current_floor_ptr->width-1))
34113411
34123412 /*
34133413 * Determines if a map location is on or inside the outer walls
34143414 */
34153415 #define in_bounds2(Y,X) \
3416- (((Y) >= 0) && ((X) >= 0) && ((Y) < cur_hgt) && ((X) < cur_wid))
3416+ (((Y) >= 0) && ((X) >= 0) && ((Y) < current_floor_ptr->height) && ((X) < current_floor_ptr->width))
34173417
34183418 /*
34193419 * Determines if a map location is on or inside the outer walls
34203420 * (unsigned version)
34213421 */
34223422 #define in_bounds2u(Y,X) \
3423- (((Y) < cur_hgt) && ((X) < cur_wid))
3423+ (((Y) < current_floor_ptr->height) && ((X) < current_floor_ptr->width))
34243424
34253425 /*
34263426 * Determines if a map location is currently "on screen" -RAK-
--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -3406,8 +3406,8 @@ static void process_world(void)
34063406 int number_mon = 0;
34073407
34083408 /* Count all hostile monsters */
3409- for (i2 = 0; i2 < cur_wid; ++i2)
3410- for (j2 = 0; j2 < cur_hgt; j2++)
3409+ for (i2 = 0; i2 < current_floor_ptr->width; ++i2)
3410+ for (j2 = 0; j2 < current_floor_ptr->height; j2++)
34113411 {
34123412 grid_type *g_ptr = &current_floor_ptr->grid_array[j2][i2];
34133413
@@ -5962,8 +5962,8 @@ void play_game(bool new_game)
59625962 record_o_name[0] = '\0';
59635963
59645964 /* Reset map panel */
5965- panel_row_min = cur_hgt;
5966- panel_col_min = cur_wid;
5965+ panel_row_min = current_floor_ptr->height;
5966+ panel_col_min = current_floor_ptr->width;
59675967
59685968 /* Sexy gal gets bonus to maximum weapon skill of whip */
59695969 if (p_ptr->pseikaku == SEIKAKU_SEXY)
--- a/src/externs.h
+++ b/src/externs.h
@@ -159,8 +159,6 @@ extern s16b command_new;
159159 extern bool msg_flag;
160160 extern s16b running;
161161 extern GAME_TURN resting;
162-extern POSITION cur_hgt;
163-extern POSITION cur_wid;
164162 extern MONSTER_NUMBER num_repro;
165163 extern DEPTH object_level;
166164 extern DEPTH monster_level;
--- a/src/floor-events.c
+++ b/src/floor-events.c
@@ -9,9 +9,9 @@ void day_break()
99 if (!p_ptr->wild_mode)
1010 {
1111 /* Hack -- Scan the town */
12- for (y = 0; y < cur_hgt; y++)
12+ for (y = 0; y < current_floor_ptr->height; y++)
1313 {
14- for (x = 0; x < cur_wid; x++)
14+ for (x = 0; x < current_floor_ptr->width; x++)
1515 {
1616 grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
1717
@@ -46,9 +46,9 @@ void night_falls(void)
4646 if (!p_ptr->wild_mode)
4747 {
4848 /* Hack -- Scan the town */
49- for (y = 0; y < cur_hgt; y++)
49+ for (y = 0; y < current_floor_ptr->height; y++)
5050 {
51- for (x = 0; x < cur_wid; x++)
51+ for (x = 0; x < current_floor_ptr->width; x++)
5252 {
5353 grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
5454
@@ -97,9 +97,9 @@ MONSTER_NUMBER count_all_hostile_monsters(void)
9797 POSITION x, y;
9898 MONSTER_NUMBER number_mon = 0;
9999
100- for (x = 0; x < cur_wid; ++x)
100+ for (x = 0; x < current_floor_ptr->width; ++x)
101101 {
102- for (y = 0; y < cur_hgt; ++y)
102+ for (y = 0; y < current_floor_ptr->height; ++y)
103103 {
104104 MONSTER_IDX m_idx = current_floor_ptr->grid_array[y][x].m_idx;
105105
--- a/src/floor-generate.c
+++ b/src/floor-generate.c
@@ -221,9 +221,9 @@ static bool alloc_stairs(IDX feat, int num, int walls)
221221 int candidates = 0;
222222 int pick;
223223
224- for (y = 1; y < cur_hgt - 1; y++)
224+ for (y = 1; y < current_floor_ptr->height - 1; y++)
225225 {
226- for (x = 1; x < cur_wid - 1; x++)
226+ for (x = 1; x < current_floor_ptr->width - 1; x++)
227227 {
228228 if (alloc_stairs_aux(y, x, walls))
229229 {
@@ -247,9 +247,9 @@ static bool alloc_stairs(IDX feat, int num, int walls)
247247 /* Choose a random one */
248248 pick = randint1(candidates);
249249
250- for (y = 1; y < cur_hgt - 1; y++)
250+ for (y = 1; y < current_floor_ptr->height - 1; y++)
251251 {
252- for (x = 1; x < cur_wid - 1; x++)
252+ for (x = 1; x < current_floor_ptr->width - 1; x++)
253253 {
254254 if (alloc_stairs_aux(y, x, walls))
255255 {
@@ -295,7 +295,7 @@ static void alloc_object(int set, EFFECT_ID typ, int num)
295295 grid_type *g_ptr;
296296
297297 /* A small level has few objects. */
298- num = num * cur_hgt * cur_wid / (MAX_HGT*MAX_WID) +1;
298+ num = num * current_floor_ptr->height * current_floor_ptr->width / (MAX_HGT*MAX_WID) +1;
299299
300300 /* Place some objects */
301301 for (k = 0; k < num; k++)
@@ -307,8 +307,8 @@ static void alloc_object(int set, EFFECT_ID typ, int num)
307307
308308 dummy++;
309309
310- y = randint0(cur_hgt);
311- x = randint0(cur_wid);
310+ y = randint0(current_floor_ptr->height);
311+ x = randint0(current_floor_ptr->width);
312312
313313 g_ptr = &current_floor_ptr->grid_array[y][x];
314314
@@ -425,8 +425,8 @@ bool place_quest_monsters(void)
425425 grid_type *g_ptr;
426426 feature_type *f_ptr;
427427
428- y = randint0(cur_hgt);
429- x = randint0(cur_wid);
428+ y = randint0(current_floor_ptr->height);
429+ x = randint0(current_floor_ptr->width);
430430
431431 g_ptr = &current_floor_ptr->grid_array[y][x];
432432 f_ptr = &f_info[g_ptr->feat];
@@ -581,8 +581,8 @@ static bool cave_gen(void)
581581 dun_tun_jct = rand_range(DUN_TUN_JCT_MIN, DUN_TUN_JCT_MAX);
582582
583583 /* Actual maximum number of rooms on this level */
584- dun->row_rooms = cur_hgt / BLOCK_HGT;
585- dun->col_rooms = cur_wid / BLOCK_WID;
584+ dun->row_rooms = current_floor_ptr->height / BLOCK_HGT;
585+ dun->col_rooms = current_floor_ptr->width / BLOCK_WID;
586586
587587 /* Initialize the room table */
588588 for (y = 0; y < dun->row_rooms; y++)
@@ -606,34 +606,34 @@ static bool cave_gen(void)
606606 if (dun->empty_level)
607607 {
608608 /* Start with floors */
609- for (y = 0; y < cur_hgt; y++)
609+ for (y = 0; y < current_floor_ptr->height; y++)
610610 {
611- for (x = 0; x < cur_wid; x++)
611+ for (x = 0; x < current_floor_ptr->width; x++)
612612 {
613613 place_floor_bold(y, x);
614614 }
615615 }
616616
617617 /* Special boundary walls -- Top and bottom */
618- for (x = 0; x < cur_wid; x++)
618+ for (x = 0; x < current_floor_ptr->width; x++)
619619 {
620620 place_extra_bold(0, x);
621- place_extra_bold(cur_hgt - 1, x);
621+ place_extra_bold(current_floor_ptr->height - 1, x);
622622 }
623623
624624 /* Special boundary walls -- Left and right */
625- for (y = 1; y < (cur_hgt - 1); y++)
625+ for (y = 1; y < (current_floor_ptr->height - 1); y++)
626626 {
627627 place_extra_bold(y, 0);
628- place_extra_bold(y, cur_wid - 1);
628+ place_extra_bold(y, current_floor_ptr->width - 1);
629629 }
630630 }
631631 else
632632 {
633633 /* Start with walls */
634- for (y = 0; y < cur_hgt; y++)
634+ for (y = 0; y < current_floor_ptr->height; y++)
635635 {
636- for (x = 0; x < cur_wid; x++)
636+ for (x = 0; x < current_floor_ptr->width; x++)
637637 {
638638 place_extra_bold(y, x);
639639 }
@@ -646,7 +646,7 @@ static bool cave_gen(void)
646646 /* Build maze */
647647 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_MAZE)
648648 {
649- build_maze_vault(cur_wid/2-1, cur_hgt/2-1, cur_wid-4, cur_hgt-4, FALSE);
649+ build_maze_vault(current_floor_ptr->width/2-1, current_floor_ptr->height/2-1, current_floor_ptr->width-4, current_floor_ptr->height-4, FALSE);
650650
651651 /* Place 3 or 4 down stairs near some walls */
652652 if (!alloc_stairs(feat_down_stair, rand_range(2, 3), 3)) return FALSE;
@@ -671,7 +671,7 @@ static bool cave_gen(void)
671671 {
672672 while (one_in_(DUN_MOS_DEN))
673673 {
674- place_trees(randint1(cur_wid - 2), randint1(cur_hgt - 2));
674+ place_trees(randint1(current_floor_ptr->width - 2), randint1(current_floor_ptr->height - 2));
675675 }
676676 }
677677
@@ -867,17 +867,17 @@ static bool cave_gen(void)
867867 }
868868
869869 /* Special boundary walls -- Top and bottom */
870- for (x = 0; x < cur_wid; x++)
870+ for (x = 0; x < current_floor_ptr->width; x++)
871871 {
872872 place_bound_perm_wall(&current_floor_ptr->grid_array[0][x]);
873- place_bound_perm_wall(&current_floor_ptr->grid_array[cur_hgt - 1][x]);
873+ place_bound_perm_wall(&current_floor_ptr->grid_array[current_floor_ptr->height - 1][x]);
874874 }
875875
876876 /* Special boundary walls -- Left and right */
877- for (y = 1; y < (cur_hgt - 1); y++)
877+ for (y = 1; y < (current_floor_ptr->height - 1); y++)
878878 {
879879 place_bound_perm_wall(&current_floor_ptr->grid_array[y][0]);
880- place_bound_perm_wall(&current_floor_ptr->grid_array[y][cur_wid - 1]);
880+ place_bound_perm_wall(&current_floor_ptr->grid_array[y][current_floor_ptr->width - 1]);
881881 }
882882
883883 /* Determine the character location */
@@ -894,12 +894,12 @@ static bool cave_gen(void)
894894 i = d_info[p_ptr->dungeon_idx].min_m_alloc_level;
895895
896896 /* To make small levels a bit more playable */
897- if (cur_hgt < MAX_HGT || cur_wid < MAX_WID)
897+ if (current_floor_ptr->height < MAX_HGT || current_floor_ptr->width < MAX_WID)
898898 {
899899 int small_tester = i;
900900
901- i = (i * cur_hgt) / MAX_HGT;
902- i = (i * cur_wid) / MAX_WID;
901+ i = (i * current_floor_ptr->height) / MAX_HGT;
902+ i = (i * current_floor_ptr->width) / MAX_WID;
903903 i += 1;
904904
905905 if (i > small_tester) i = small_tester;
@@ -945,9 +945,9 @@ static bool cave_gen(void)
945945 if (dun->empty_level && (!one_in_(DARK_EMPTY) || (randint1(100) > current_floor_ptr->dun_level)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
946946 {
947947 /* Lite the current_floor_ptr->grid_array */
948- for (y = 0; y < cur_hgt; y++)
948+ for (y = 0; y < current_floor_ptr->height; y++)
949949 {
950- for (x = 0; x < cur_wid; x++)
950+ for (x = 0; x < current_floor_ptr->width; x++)
951951 {
952952 current_floor_ptr->grid_array[y][x].info |= (CAVE_GLOW);
953953 }
@@ -1025,8 +1025,8 @@ static void generate_challenge_arena(void)
10251025 POSITION qx = 0;
10261026
10271027 /* Smallest area */
1028- cur_hgt = SCREEN_HGT;
1029- cur_wid = SCREEN_WID;
1028+ current_floor_ptr->height = SCREEN_HGT;
1029+ current_floor_ptr->width = SCREEN_WID;
10301030
10311031 /* Start with solid walls */
10321032 for (y = 0; y < MAX_HGT; y++)
@@ -1186,9 +1186,9 @@ static void generate_fixed_floor(void)
11861186 POSITION x, y;
11871187
11881188 /* Start with perm walls */
1189- for (y = 0; y < cur_hgt; y++)
1189+ for (y = 0; y < current_floor_ptr->height; y++)
11901190 {
1191- for (x = 0; x < cur_wid; x++)
1191+ for (x = 0; x < current_floor_ptr->width; x++)
11921192 {
11931193 place_solid_perm_bold(y, x);
11941194 }
@@ -1242,26 +1242,26 @@ static bool level_gen(concptr *why)
12421242 while ((level_height == MAX_HGT/SCREEN_HGT) && (level_width == MAX_WID/SCREEN_WID));
12431243 }
12441244
1245- cur_hgt = level_height * SCREEN_HGT;
1246- cur_wid = level_width * SCREEN_WID;
1245+ current_floor_ptr->height = level_height * SCREEN_HGT;
1246+ current_floor_ptr->width = level_width * SCREEN_WID;
12471247
12481248 /* Assume illegal panel */
1249- panel_row_min = cur_hgt;
1250- panel_col_min = cur_wid;
1249+ panel_row_min = current_floor_ptr->height;
1250+ panel_col_min = current_floor_ptr->width;
12511251
12521252 msg_format_wizard(CHEAT_DUNGEON,
12531253 _("小さなフロア: X:%d, Y:%d", "A 'small' dungeon level: X:%d, Y:%d."),
1254- cur_wid, cur_hgt);
1254+ current_floor_ptr->width, current_floor_ptr->height);
12551255 }
12561256 else
12571257 {
12581258 /* Big dungeon */
1259- cur_hgt = MAX_HGT;
1260- cur_wid = MAX_WID;
1259+ current_floor_ptr->height = MAX_HGT;
1260+ current_floor_ptr->width = MAX_WID;
12611261
12621262 /* Assume illegal panel */
1263- panel_row_min = cur_hgt;
1264- panel_col_min = cur_wid;
1263+ panel_row_min = current_floor_ptr->height;
1264+ panel_col_min = current_floor_ptr->width;
12651265 }
12661266
12671267 /* Make a dungeon */
@@ -1281,9 +1281,9 @@ void wipe_generate_random_floor_flags(void)
12811281 {
12821282 POSITION x, y;
12831283
1284- for (y = 0; y < cur_hgt; y++)
1284+ for (y = 0; y < current_floor_ptr->height; y++)
12851285 {
1286- for (x = 0; x < cur_wid; x++)
1286+ for (x = 0; x < current_floor_ptr->width; x++)
12871287 {
12881288 /* Wipe unused flags */
12891289 current_floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
@@ -1292,9 +1292,9 @@ void wipe_generate_random_floor_flags(void)
12921292
12931293 if (current_floor_ptr->dun_level)
12941294 {
1295- for (y = 1; y < cur_hgt - 1; y++)
1295+ for (y = 1; y < current_floor_ptr->height - 1; y++)
12961296 {
1297- for (x = 1; x < cur_wid - 1; x++)
1297+ for (x = 1; x < current_floor_ptr->width - 1; x++)
12981298 {
12991299 /* There might be trap */
13001300 current_floor_ptr->grid_array[y][x].info |= CAVE_UNSAFE;
--- a/src/floor-save.c
+++ b/src/floor-save.c
@@ -323,8 +323,8 @@ static void build_dead_end(void)
323323 set_floor_and_wall(0);
324324
325325 /* Smallest area */
326- cur_hgt = SCREEN_HGT;
327- cur_wid = SCREEN_WID;
326+ current_floor_ptr->height = SCREEN_HGT;
327+ current_floor_ptr->width = SCREEN_WID;
328328
329329 /* Filled with permanent walls */
330330 for (y = 0; y < MAX_HGT; y++)
@@ -337,8 +337,8 @@ static void build_dead_end(void)
337337 }
338338
339339 /* Place at center of the floor */
340- p_ptr->y = cur_hgt / 2;
341- p_ptr->x = cur_wid / 2;
340+ p_ptr->y = current_floor_ptr->height / 2;
341+ p_ptr->x = current_floor_ptr->width / 2;
342342
343343 /* Give one square */
344344 place_floor_bold(p_ptr->y, p_ptr->x);
@@ -756,9 +756,9 @@ static void locate_connected_stairs(saved_floor_type *sf_ptr)
756756 int i;
757757
758758 /* Search usable stairs */
759- for (y = 0; y < cur_hgt; y++)
759+ for (y = 0; y < current_floor_ptr->height; y++)
760760 {
761- for (x = 0; x < cur_wid; x++)
761+ for (x = 0; x < current_floor_ptr->width; x++)
762762 {
763763 grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
764764 feature_type *f_ptr = &f_info[g_ptr->feat];
@@ -1473,9 +1473,9 @@ void stair_creation(void)
14731473 {
14741474 POSITION x, y;
14751475
1476- for (y = 0; y < cur_hgt; y++)
1476+ for (y = 0; y < current_floor_ptr->height; y++)
14771477 {
1478- for (x = 0; x < cur_wid; x++)
1478+ for (x = 0; x < current_floor_ptr->width; x++)
14791479 {
14801480 grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
14811481
--- a/src/floor-streams.c
+++ b/src/floor-streams.c
@@ -164,8 +164,8 @@ void add_river(IDX feat1, IDX feat2)
164164
165165
166166 /* Hack -- Choose starting point */
167- y2 = randint1(cur_hgt / 2 - 2) + cur_hgt / 2;
168- x2 = randint1(cur_wid / 2 - 2) + cur_wid / 2;
167+ y2 = randint1(current_floor_ptr->height / 2 - 2) + current_floor_ptr->height / 2;
168+ x2 = randint1(current_floor_ptr->width / 2 - 2) + current_floor_ptr->width / 2;
169169
170170 /* Hack -- Choose ending point somewhere on boundary */
171171 switch(randint1(4))
@@ -173,7 +173,7 @@ void add_river(IDX feat1, IDX feat2)
173173 case 1:
174174 {
175175 /* top boundary */
176- x1 = randint1(cur_wid-2)+1;
176+ x1 = randint1(current_floor_ptr->width-2)+1;
177177 y1 = 1;
178178 break;
179179 }
@@ -181,21 +181,21 @@ void add_river(IDX feat1, IDX feat2)
181181 {
182182 /* left boundary */
183183 x1 = 1;
184- y1 = randint1(cur_hgt-2)+1;
184+ y1 = randint1(current_floor_ptr->height-2)+1;
185185 break;
186186 }
187187 case 3:
188188 {
189189 /* right boundary */
190- x1 = cur_wid-1;
191- y1 = randint1(cur_hgt-2)+1;
190+ x1 = current_floor_ptr->width-1;
191+ y1 = randint1(current_floor_ptr->height-2)+1;
192192 break;
193193 }
194194 case 4:
195195 {
196196 /* bottom boundary */
197- x1 = randint1(cur_wid-2)+1;
198- y1 = cur_hgt-1;
197+ x1 = randint1(current_floor_ptr->width-2)+1;
198+ y1 = current_floor_ptr->height-1;
199199 break;
200200 }
201201 }
@@ -241,8 +241,8 @@ void build_streamer(IDX feat, int chance)
241241 bool streamer_may_have_gold = have_flag(streamer_ptr->flags, FF_MAY_HAVE_GOLD);
242242
243243 /* Hack -- Choose starting point */
244- y = rand_spread(cur_hgt / 2, cur_hgt / 6);
245- x = rand_spread(cur_wid / 2, cur_wid / 6);
244+ y = rand_spread(current_floor_ptr->height / 2, current_floor_ptr->height / 6);
245+ x = rand_spread(current_floor_ptr->width / 2, current_floor_ptr->width / 6);
246246
247247 /* Choose a random compass direction */
248248 dir = randint0(8);
@@ -448,8 +448,8 @@ void destroy_level(void)
448448 for (n = 0; n < randint1(5); n++)
449449 {
450450 /* Pick an epi-center */
451- x1 = rand_range(5, cur_wid - 1 - 5);
452- y1 = rand_range(5, cur_hgt - 1 - 5);
451+ x1 = rand_range(5, current_floor_ptr->width - 1 - 5);
452+ y1 = rand_range(5, current_floor_ptr->height - 1 - 5);
453453
454454 (void)destroy_area(y1, x1, 15, TRUE);
455455 }
--- a/src/grid.c
+++ b/src/grid.c
@@ -51,8 +51,8 @@ bool new_player_spot(void)
5151 while (max_attempts--)
5252 {
5353 /* Pick a legal spot */
54- y = (POSITION)rand_range(1, cur_hgt - 2);
55- x = (POSITION)rand_range(1, cur_wid - 2);
54+ y = (POSITION)rand_range(1, current_floor_ptr->height - 2);
55+ x = (POSITION)rand_range(1, current_floor_ptr->width - 2);
5656
5757 g_ptr = &current_floor_ptr->grid_array[y][x];
5858
@@ -2411,9 +2411,9 @@ void prt_map(void)
24112411
24122412 /* Get bounds */
24132413 xmin = (0 < panel_col_min) ? panel_col_min : 0;
2414- xmax = (cur_wid - 1 > panel_col_max) ? panel_col_max : cur_wid - 1;
2414+ xmax = (current_floor_ptr->width - 1 > panel_col_max) ? panel_col_max : current_floor_ptr->width - 1;
24152415 ymin = (0 < panel_row_min) ? panel_row_min : 0;
2416- ymax = (cur_hgt - 1 > panel_row_max) ? panel_row_max : cur_hgt - 1;
2416+ ymax = (current_floor_ptr->height - 1 > panel_row_max) ? panel_row_max : current_floor_ptr->height - 1;
24172417
24182418 /* Bottom section of screen */
24192419 for (y = 1; y <= ymin - panel_row_prt; y++)
@@ -2664,8 +2664,8 @@ void display_map(int *cy, int *cx)
26642664 wid -= 14;
26652665 if (use_bigtile) wid /= 2;
26662666
2667- yrat = (cur_hgt + hgt - 1) / hgt;
2668- xrat = (cur_wid + wid - 1) / wid;
2667+ yrat = (current_floor_ptr->height + hgt - 1) / hgt;
2668+ xrat = (current_floor_ptr->width + wid - 1) / wid;
26692669
26702670 /* Disable lighting effects */
26712671 view_special_lite = FALSE;
@@ -2703,19 +2703,19 @@ void display_map(int *cy, int *cx)
27032703 }
27042704
27052705 /* Allocate the maps */
2706- C_MAKE(bigma, (cur_hgt + 2), TERM_COLOR *);
2707- C_MAKE(bigmc, (cur_hgt + 2), char_ptr);
2708- C_MAKE(bigmp, (cur_hgt + 2), byte_ptr);
2706+ C_MAKE(bigma, (current_floor_ptr->height + 2), TERM_COLOR *);
2707+ C_MAKE(bigmc, (current_floor_ptr->height + 2), char_ptr);
2708+ C_MAKE(bigmp, (current_floor_ptr->height + 2), byte_ptr);
27092709
27102710 /* Allocate and wipe each line map */
2711- for (y = 0; y < (cur_hgt + 2); y++)
2711+ for (y = 0; y < (current_floor_ptr->height + 2); y++)
27122712 {
27132713 /* Allocate one row each array */
2714- C_MAKE(bigma[y], (cur_wid + 2), TERM_COLOR);
2715- C_MAKE(bigmc[y], (cur_wid + 2), char);
2716- C_MAKE(bigmp[y], (cur_wid + 2), byte);
2714+ C_MAKE(bigma[y], (current_floor_ptr->width + 2), TERM_COLOR);
2715+ C_MAKE(bigmc[y], (current_floor_ptr->width + 2), char);
2716+ C_MAKE(bigmp[y], (current_floor_ptr->width + 2), byte);
27172717
2718- for (x = 0; x < cur_wid + 2; ++x)
2718+ for (x = 0; x < current_floor_ptr->width + 2; ++x)
27192719 {
27202720 /* Nothing here */
27212721 bigma[y][x] = TERM_WHITE;
@@ -2727,9 +2727,9 @@ void display_map(int *cy, int *cx)
27272727 }
27282728
27292729 /* Fill in the map */
2730- for (i = 0; i < cur_wid; ++i)
2730+ for (i = 0; i < current_floor_ptr->width; ++i)
27312731 {
2732- for (j = 0; j < cur_hgt; ++j)
2732+ for (j = 0; j < current_floor_ptr->height; ++j)
27332733 {
27342734 x = i / xrat + 1;
27352735 y = j / yrat + 1;
@@ -2760,9 +2760,9 @@ void display_map(int *cy, int *cx)
27602760 }
27612761 }
27622762
2763- for (j = 0; j < cur_hgt; ++j)
2763+ for (j = 0; j < current_floor_ptr->height; ++j)
27642764 {
2765- for (i = 0; i < cur_wid; ++i)
2765+ for (i = 0; i < current_floor_ptr->width; ++i)
27662766 {
27672767 x = i / xrat + 1;
27682768 y = j / yrat + 1;
@@ -2898,18 +2898,18 @@ void display_map(int *cy, int *cx)
28982898 C_KILL(object_autopick_yx, (hgt + 2), object_type **);
28992899
29002900 /* Free each line map */
2901- for (y = 0; y < (cur_hgt + 2); y++)
2901+ for (y = 0; y < (current_floor_ptr->height + 2); y++)
29022902 {
29032903 /* Free one row each array */
2904- C_KILL(bigma[y], (cur_wid + 2), TERM_COLOR);
2905- C_KILL(bigmc[y], (cur_wid + 2), SYMBOL_CODE);
2906- C_KILL(bigmp[y], (cur_wid + 2), byte);
2904+ C_KILL(bigma[y], (current_floor_ptr->width + 2), TERM_COLOR);
2905+ C_KILL(bigmc[y], (current_floor_ptr->width + 2), SYMBOL_CODE);
2906+ C_KILL(bigmp[y], (current_floor_ptr->width + 2), byte);
29072907 }
29082908
29092909 /* Free each line map */
2910- C_KILL(bigma, (cur_hgt + 2), TERM_COLOR *);
2911- C_KILL(bigmc, (cur_hgt + 2), char_ptr);
2912- C_KILL(bigmp, (cur_hgt + 2), byte_ptr);
2910+ C_KILL(bigma, (current_floor_ptr->height + 2), TERM_COLOR *);
2911+ C_KILL(bigmc, (current_floor_ptr->height + 2), char_ptr);
2912+ C_KILL(bigmp, (current_floor_ptr->height + 2), byte_ptr);
29132913 }
29142914
29152915
@@ -3441,7 +3441,7 @@ void update_lite(void)
34413441
34423442 /* Maximal south */
34433443 max_y = p_ptr->y + p;
3444- if (max_y > cur_hgt - 1) max_y = cur_hgt - 1;
3444+ if (max_y > current_floor_ptr->height - 1) max_y = current_floor_ptr->height - 1;
34453445
34463446 /* Maximal west */
34473447 min_x = p_ptr->x - p;
@@ -3449,7 +3449,7 @@ void update_lite(void)
34493449
34503450 /* Maximal east */
34513451 max_x = p_ptr->x + p;
3452- if (max_x > cur_wid - 1) max_x = cur_wid - 1;
3452+ if (max_x > current_floor_ptr->width - 1) max_x = current_floor_ptr->width - 1;
34533453
34543454 /* Scan the maximal box */
34553455 for (y = min_y; y <= max_y; y++)
@@ -4297,8 +4297,8 @@ void update_view(void)
42974297
42984298 int full, over;
42994299
4300- POSITION y_max = cur_hgt - 1;
4301- POSITION x_max = cur_wid - 1;
4300+ POSITION y_max = current_floor_ptr->height - 1;
4301+ POSITION x_max = current_floor_ptr->width - 1;
43024302
43034303 grid_type *g_ptr;
43044304
@@ -4781,9 +4781,9 @@ void forget_flow(void)
47814781 POSITION x, y;
47824782
47834783 /* Check the entire dungeon */
4784- for (y = 0; y < cur_hgt; y++)
4784+ for (y = 0; y < current_floor_ptr->height; y++)
47854785 {
4786- for (x = 0; x < cur_wid; x++)
4786+ for (x = 0; x < current_floor_ptr->width; x++)
47874787 {
47884788 /* Forget the old data */
47894789 current_floor_ptr->grid_array[y][x].dist = 0;
@@ -4835,9 +4835,9 @@ void update_flow(void)
48354835 }
48364836
48374837 /* Erase all of the current flow information */
4838- for (y = 0; y < cur_hgt; y++)
4838+ for (y = 0; y < current_floor_ptr->height; y++)
48394839 {
4840- for (x = 0; x < cur_wid; x++)
4840+ for (x = 0; x < current_floor_ptr->width; x++)
48414841 {
48424842 current_floor_ptr->grid_array[y][x].cost = 0;
48434843 current_floor_ptr->grid_array[y][x].dist = 0;
@@ -4947,9 +4947,9 @@ void update_smell(void)
49474947 if (++scent_when == 254)
49484948 {
49494949 /* Scan the entire dungeon */
4950- for (y = 0; y < cur_hgt; y++)
4950+ for (y = 0; y < current_floor_ptr->height; y++)
49514951 {
4952- for (x = 0; x < cur_wid; x++)
4952+ for (x = 0; x < current_floor_ptr->width; x++)
49534953 {
49544954 int w = current_floor_ptr->grid_array[y][x].when;
49554955 current_floor_ptr->grid_array[y][x].when = (w > 128) ? (w - 128) : 0;
@@ -5007,9 +5007,9 @@ void map_area(POSITION range)
50075007 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
50085008
50095009 /* Scan that area */
5010- for (y = 1; y < cur_hgt - 1; y++)
5010+ for (y = 1; y < current_floor_ptr->height - 1; y++)
50115011 {
5012- for (x = 1; x < cur_wid - 1; x++)
5012+ for (x = 1; x < current_floor_ptr->width - 1; x++)
50135013 {
50145014 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
50155015
@@ -5599,9 +5599,9 @@ void glow_deep_lava_and_bldg(void)
55995599 /* Not in the darkness dungeon */
56005600 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) return;
56015601
5602- for (y = 0; y < cur_hgt; y++)
5602+ for (y = 0; y < current_floor_ptr->height; y++)
56035603 {
5604- for (x = 0; x < cur_wid; x++)
5604+ for (x = 0; x < current_floor_ptr->width; x++)
56055605 {
56065606 g_ptr = &current_floor_ptr->grid_array[y][x];
56075607
--- a/src/init1.c
+++ b/src/init1.c
@@ -4273,15 +4273,15 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in
42734273 /* Hack - Set the dungeon size */
42744274 panels_y = (*y / SCREEN_HGT);
42754275 if (*y % SCREEN_HGT) panels_y++;
4276- cur_hgt = panels_y * SCREEN_HGT;
4276+ current_floor_ptr->height = panels_y * SCREEN_HGT;
42774277
42784278 panels_x = (*x / SCREEN_WID);
42794279 if (*x % SCREEN_WID) panels_x++;
4280- cur_wid = panels_x * SCREEN_WID;
4280+ current_floor_ptr->width = panels_x * SCREEN_WID;
42814281
42824282 /* Assume illegal panel */
4283- panel_row_min = cur_hgt;
4284- panel_col_min = cur_wid;
4283+ panel_row_min = current_floor_ptr->height;
4284+ panel_col_min = current_floor_ptr->width;
42854285
42864286 /* Place player in a quest level */
42874287 if (p_ptr->inside_quest)
--- a/src/load.c
+++ b/src/load.c
@@ -2579,9 +2579,9 @@ static errr rd_dungeon_old(void)
25792579 p_ptr->x = (POSITION)tmp16s;
25802580 if (z_older_than(10, 3, 13) && !current_floor_ptr->dun_level && !p_ptr->inside_arena) {p_ptr->y = 33;p_ptr->x = 131;}
25812581 rd_s16b(&tmp16s);
2582- cur_hgt = (POSITION)tmp16s;
2582+ current_floor_ptr->height = (POSITION)tmp16s;
25832583 rd_s16b(&tmp16s);
2584- cur_wid = (POSITION)tmp16s;
2584+ current_floor_ptr->width = (POSITION)tmp16s;
25852585 rd_s16b(&tmp16s); /* max_panel_rows */
25862586 rd_s16b(&tmp16s); /* max_panel_cols */
25872587
@@ -2590,8 +2590,8 @@ static errr rd_dungeon_old(void)
25902590 #endif
25912591
25922592 /* Maximal size */
2593- ymax = cur_hgt;
2594- xmax = cur_wid;
2593+ ymax = current_floor_ptr->height;
2594+ xmax = current_floor_ptr->width;
25952595
25962596
25972597 /*** Run length decoding ***/
@@ -3040,9 +3040,9 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
30403040 p_ptr->x = (POSITION)tmp16u;
30413041
30423042 rd_s16b(&tmp16s);
3043- cur_hgt = (POSITION)tmp16s;
3043+ current_floor_ptr->height = (POSITION)tmp16s;
30443044 rd_s16b(&tmp16s);
3045- cur_wid = (POSITION)tmp16s;
3045+ current_floor_ptr->width = (POSITION)tmp16s;
30463046
30473047 rd_byte(&p_ptr->feeling);
30483048
@@ -3080,8 +3080,8 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
30803080 }
30813081
30823082 /* Maximal size */
3083- ymax = cur_hgt;
3084- xmax = cur_wid;
3083+ ymax = current_floor_ptr->height;
3084+ xmax = current_floor_ptr->width;
30853085
30863086
30873087 /*** Run length decoding ***/
--- a/src/main-win.c
+++ b/src/main-win.c
@@ -3176,8 +3176,8 @@ static void windows_map(void)
31763176 {
31773177 min_x = 0;
31783178 min_y = 0;
3179- max_x = cur_wid;
3180- max_y = cur_hgt;
3179+ max_x = current_floor_ptr->width;
3180+ max_y = current_floor_ptr->height;
31813181 }
31823182
31833183 /* Draw the map */
--- a/src/mind.c
+++ b/src/mind.c
@@ -1287,8 +1287,8 @@ static int number_of_mirrors(void)
12871287 {
12881288 POSITION x, y;
12891289 int val = 0;
1290- for (x = 0; x < cur_wid; x++) {
1291- for (y = 0; y < cur_hgt; y++) {
1290+ for (x = 0; x < current_floor_ptr->width; x++) {
1291+ for (y = 0; y < current_floor_ptr->height; y++) {
12921292 if (is_mirror_grid(&current_floor_ptr->grid_array[y][x])) val++;
12931293 }
12941294 }
@@ -1370,8 +1370,8 @@ static bool cast_mirror_spell(int spell)
13701370 break;
13711371 /* mirror sleeping */
13721372 case 9:
1373- for (x = 0; x < cur_wid; x++) {
1374- for (y = 0; y < cur_hgt; y++) {
1373+ for (x = 0; x < current_floor_ptr->width; x++) {
1374+ for (y = 0; y < current_floor_ptr->height; y++) {
13751375 if (is_mirror_grid(&current_floor_ptr->grid_array[y][x])) {
13761376 project(0, 2, y, x, (HIT_POINT)plev, GF_OLD_SLEEP, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
13771377 }
--- a/src/monster2.c
+++ b/src/monster2.c
@@ -3002,8 +3002,8 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
30023002 number_mon = 0;
30033003
30043004 /* Count all quest monsters */
3005- for (i2 = 0; i2 < cur_wid; ++i2)
3006- for (j2 = 0; j2 < cur_hgt; j2++)
3005+ for (i2 = 0; i2 < current_floor_ptr->width; ++i2)
3006+ for (j2 = 0; j2 < current_floor_ptr->height; j2++)
30073007 if (current_floor_ptr->grid_array[j2][i2].m_idx > 0)
30083008 if (m_list[current_floor_ptr->grid_array[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
30093009 number_mon++;
@@ -3743,8 +3743,8 @@ bool alloc_guardian(bool def_val)
37433743 while (try_count)
37443744 {
37453745 /* Get a random spot */
3746- oy = randint1(cur_hgt - 4) + 2;
3747- ox = randint1(cur_wid - 4) + 2;
3746+ oy = randint1(current_floor_ptr->height - 4) + 2;
3747+ ox = randint1(current_floor_ptr->width - 4) + 2;
37483748
37493749 /* Is it a good spot ? */
37503750 if (cave_empty_bold2(oy, ox) && monster_can_cross_terrain(current_floor_ptr->grid_array[oy][ox].feat, &r_info[guardian], 0))
@@ -3786,8 +3786,8 @@ bool alloc_monster(POSITION dis, BIT_FLAGS mode)
37863786 while (attempts_left--)
37873787 {
37883788 /* Pick a location */
3789- y = randint0(cur_hgt);
3790- x = randint0(cur_wid);
3789+ y = randint0(current_floor_ptr->height);
3790+ x = randint0(current_floor_ptr->width);
37913791
37923792 /* Require empty floor grid (was "naked") */
37933793 if (current_floor_ptr->dun_level)
--- a/src/object2.c
+++ b/src/object2.c
@@ -5089,9 +5089,9 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION
50895089 {
50905090 int candidates = 0, pick;
50915091
5092- for (ty = 1; ty < cur_hgt - 1; ty++)
5092+ for (ty = 1; ty < current_floor_ptr->height - 1; ty++)
50935093 {
5094- for (tx = 1; tx < cur_wid - 1; tx++)
5094+ for (tx = 1; tx < current_floor_ptr->width - 1; tx++)
50955095 {
50965096 /* A valid space found */
50975097 if (cave_drop_bold(ty, tx)) candidates++;
@@ -5128,9 +5128,9 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION
51285128 /* Choose a random one */
51295129 pick = randint1(candidates);
51305130
5131- for (ty = 1; ty < cur_hgt - 1; ty++)
5131+ for (ty = 1; ty < current_floor_ptr->height - 1; ty++)
51325132 {
5133- for (tx = 1; tx < cur_wid - 1; tx++)
5133+ for (tx = 1; tx < current_floor_ptr->width - 1; tx++)
51345134 {
51355135 if (cave_drop_bold(ty, tx))
51365136 {
--- a/src/player-move.c
+++ b/src/player-move.c
@@ -1138,8 +1138,8 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
11381138 {
11391139 p_ptr->wilderness_y--;
11401140 p_ptr->wilderness_x--;
1141- p_ptr->oldpy = cur_hgt - 2;
1142- p_ptr->oldpx = cur_wid - 2;
1141+ p_ptr->oldpy = current_floor_ptr->height - 2;
1142+ p_ptr->oldpx = current_floor_ptr->width - 2;
11431143 ambush_flag = FALSE;
11441144 }
11451145
@@ -1147,7 +1147,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
11471147 {
11481148 p_ptr->wilderness_y--;
11491149 p_ptr->wilderness_x++;
1150- p_ptr->oldpy = cur_hgt - 2;
1150+ p_ptr->oldpy = current_floor_ptr->height - 2;
11511151 p_ptr->oldpx = 1;
11521152 ambush_flag = FALSE;
11531153 }
@@ -1157,7 +1157,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
11571157 p_ptr->wilderness_y++;
11581158 p_ptr->wilderness_x--;
11591159 p_ptr->oldpy = 1;
1160- p_ptr->oldpx = cur_wid - 2;
1160+ p_ptr->oldpx = current_floor_ptr->width - 2;
11611161 ambush_flag = FALSE;
11621162 }
11631163
@@ -1173,7 +1173,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
11731173 else if (y == 0)
11741174 {
11751175 p_ptr->wilderness_y--;
1176- p_ptr->oldpy = cur_hgt - 2;
1176+ p_ptr->oldpy = current_floor_ptr->height - 2;
11771177 p_ptr->oldpx = x;
11781178 ambush_flag = FALSE;
11791179 }
@@ -1189,7 +1189,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
11891189 else if (x == 0)
11901190 {
11911191 p_ptr->wilderness_x--;
1192- p_ptr->oldpx = cur_wid - 2;
1192+ p_ptr->oldpx = current_floor_ptr->width - 2;
11931193 p_ptr->oldpy = y;
11941194 ambush_flag = FALSE;
11951195 }
@@ -2278,9 +2278,9 @@ void forget_travel_flow(void)
22782278 {
22792279 POSITION x, y;
22802280 /* Check the entire dungeon / Forget the old data */
2281- for (y = 0; y < cur_hgt; y++)
2281+ for (y = 0; y < current_floor_ptr->height; y++)
22822282 {
2283- for (x = 0; x < cur_wid; x++)
2283+ for (x = 0; x < current_floor_ptr->width; x++)
22842284 {
22852285
22862286 travel.cost[y][x] = MAX_SHORT;
--- a/src/rooms-city.c
+++ b/src/rooms-city.c
@@ -201,9 +201,9 @@ bool build_type16(void)
201201 bool prevent_bm = FALSE;
202202
203203 /* Hack -- If already exist black market, prevent building */
204- for (y = 0; (y < cur_hgt) && !prevent_bm; y++)
204+ for (y = 0; (y < current_floor_ptr->height) && !prevent_bm; y++)
205205 {
206- for (x = 0; x < cur_wid; x++)
206+ for (x = 0; x < current_floor_ptr->width; x++)
207207 {
208208 if (current_floor_ptr->grid_array[y][x].feat == FF_STORE)
209209 {
--- a/src/rooms-vault.c
+++ b/src/rooms-vault.c
@@ -656,7 +656,7 @@ bool build_type7(void)
656656 y = v_ptr->hgt;
657657
658658 /* Some huge vault cannot be ratated to fit in the dungeon */
659- if (x + 2 > cur_hgt - 2)
659+ if (x + 2 > current_floor_ptr->height - 2)
660660 {
661661 /* Forbid 90 or 270 degree ratation */
662662 transno &= ~1;
@@ -736,7 +736,7 @@ bool build_type8(void)
736736 y = v_ptr->hgt;
737737
738738 /* Some huge vault cannot be ratated to fit in the dungeon */
739- if (x + 2 > cur_hgt - 2)
739+ if (x + 2 > current_floor_ptr->height - 2)
740740 {
741741 /* Forbid 90 or 270 degree ratation */
742742 transno &= ~1;
@@ -1258,7 +1258,7 @@ bool build_type17(void)
12581258 y = v_ptr->hgt;
12591259
12601260 /* Some huge vault cannot be ratated to fit in the dungeon */
1261- if (x + 2 > cur_hgt - 2)
1261+ if (x + 2 > current_floor_ptr->height - 2)
12621262 {
12631263 /* Forbid 90 or 270 degree ratation */
12641264 transno &= ~1;
--- a/src/rooms.c
+++ b/src/rooms.c
@@ -1145,8 +1145,8 @@ void build_cavern(void)
11451145 if ((current_floor_ptr->dun_level <= randint1(50)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
11461146
11471147 /* Make a current_floor_ptr->grid_array the size of the dungeon */
1148- xsize = cur_wid - 1;
1149- ysize = cur_hgt - 1;
1148+ xsize = current_floor_ptr->width - 1;
1149+ ysize = current_floor_ptr->height - 1;
11501150 x0 = xsize / 2;
11511151 y0 = ysize / 2;
11521152
@@ -1335,8 +1335,8 @@ void build_lake(int type)
13351335 }
13361336
13371337 /* Make the size of the dungeon */
1338- xsize = cur_wid - 1;
1339- ysize = cur_hgt - 1;
1338+ xsize = current_floor_ptr->width - 1;
1339+ ysize = current_floor_ptr->height - 1;
13401340 x0 = xsize / 2;
13411341 y0 = ysize / 2;
13421342
@@ -2126,7 +2126,7 @@ bool generate_rooms(void)
21262126 int total_prob;
21272127 int prob_list[ROOM_T_MAX];
21282128 int rooms_built = 0;
2129- int area_size = 100 * (cur_hgt*cur_wid) / (MAX_HGT*MAX_WID);
2129+ int area_size = 100 * (current_floor_ptr->height*current_floor_ptr->width) / (MAX_HGT*MAX_WID);
21302130 int level_index = MIN(10, div_round(current_floor_ptr->dun_level, 10));
21312131
21322132 /* Number of each type of room on this level */
--- a/src/save.c
+++ b/src/save.c
@@ -943,8 +943,8 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
943943 wr_u16b((s16b)num_repro);
944944 wr_u16b((u16b)p_ptr->y);
945945 wr_u16b((u16b)p_ptr->x);
946- wr_u16b((u16b)cur_hgt);
947- wr_u16b((u16b)cur_wid);
946+ wr_u16b((u16b)current_floor_ptr->height);
947+ wr_u16b((u16b)current_floor_ptr->width);
948948 wr_byte(p_ptr->feeling);
949949
950950
@@ -969,9 +969,9 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
969969 C_MAKE(templates, max_num_temp, cave_template_type);
970970
971971 /* Extract template array */
972- for (y = 0; y < cur_hgt; y++)
972+ for (y = 0; y < current_floor_ptr->height; y++)
973973 {
974- for (x = 0; x < cur_wid; x++)
974+ for (x = 0; x < current_floor_ptr->width; x++)
975975 {
976976 grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
977977
@@ -1049,9 +1049,9 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
10491049 prev_u16b = 0;
10501050
10511051 /* Dump the current_floor_ptr->grid_array */
1052- for (y = 0; y < cur_hgt; y++)
1052+ for (y = 0; y < current_floor_ptr->height; y++)
10531053 {
1054- for (x = 0; x < cur_wid; x++)
1054+ for (x = 0; x < current_floor_ptr->width; x++)
10551055 {
10561056 grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
10571057
--- a/src/spells-floor.c
+++ b/src/spells-floor.c
@@ -40,10 +40,10 @@ void wiz_lite(bool ninja)
4040 }
4141
4242 /* Scan all normal grids */
43- for (y = 1; y < cur_hgt - 1; y++)
43+ for (y = 1; y < current_floor_ptr->height - 1; y++)
4444 {
4545 /* Scan all normal grids */
46- for (x = 1; x < cur_wid - 1; x++)
46+ for (x = 1; x < current_floor_ptr->width - 1; x++)
4747 {
4848 grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
4949
@@ -115,9 +115,9 @@ void wiz_dark(void)
115115 POSITION y, x;
116116
117117 /* Forget every grid */
118- for (y = 1; y < cur_hgt - 1; y++)
118+ for (y = 1; y < current_floor_ptr->height - 1; y++)
119119 {
120- for (x = 1; x < cur_wid - 1; x++)
120+ for (x = 1; x < current_floor_ptr->width - 1; x++)
121121 {
122122 grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
123123
@@ -128,17 +128,17 @@ void wiz_dark(void)
128128 }
129129
130130 /* Forget every grid on horizontal edge */
131- for (x = 0; x < cur_wid; x++)
131+ for (x = 0; x < current_floor_ptr->width; x++)
132132 {
133133 current_floor_ptr->grid_array[0][x].info &= ~(CAVE_MARK);
134- current_floor_ptr->grid_array[cur_hgt - 1][x].info &= ~(CAVE_MARK);
134+ current_floor_ptr->grid_array[current_floor_ptr->height - 1][x].info &= ~(CAVE_MARK);
135135 }
136136
137137 /* Forget every grid on vertical edge */
138- for (y = 1; y < (cur_hgt - 1); y++)
138+ for (y = 1; y < (current_floor_ptr->height - 1); y++)
139139 {
140140 current_floor_ptr->grid_array[y][0].info &= ~(CAVE_MARK);
141- current_floor_ptr->grid_array[y][cur_wid - 1].info &= ~(CAVE_MARK);
141+ current_floor_ptr->grid_array[y][current_floor_ptr->width - 1].info &= ~(CAVE_MARK);
142142 }
143143
144144 /* Forget all objects */
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -60,9 +60,9 @@ static void next_mirror(POSITION* next_y, POSITION* next_x, POSITION cury, POSIT
6060 POSITION x, y;
6161 int num;
6262
63- for (x = 0; x < cur_wid; x++)
63+ for (x = 0; x < current_floor_ptr->width; x++)
6464 {
65- for (y = 0; y < cur_hgt; y++)
65+ for (y = 0; y < current_floor_ptr->height; y++)
6666 {
6767 if (is_mirror_grid(&current_floor_ptr->grid_array[y][x])) {
6868 mirror_y[mirror_num] = y;
@@ -6486,9 +6486,9 @@ bool binding_field(HIT_POINT dam)
64866486 monster_target_y = p_ptr->y;
64876487 monster_target_x = p_ptr->x;
64886488
6489- for (x = 0; x < cur_wid; x++)
6489+ for (x = 0; x < current_floor_ptr->width; x++)
64906490 {
6491- for (y = 0; y < cur_hgt; y++)
6491+ for (y = 0; y < current_floor_ptr->height; y++)
64926492 {
64936493 if (is_mirror_grid(&current_floor_ptr->grid_array[y][x]) &&
64946494 distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
@@ -6620,9 +6620,9 @@ void seal_of_mirror(HIT_POINT dam)
66206620 {
66216621 POSITION x, y;
66226622
6623- for (x = 0; x < cur_wid; x++)
6623+ for (x = 0; x < current_floor_ptr->width; x++)
66246624 {
6625- for (y = 0; y < cur_hgt; y++)
6625+ for (y = 0; y < current_floor_ptr->height; y++)
66266626 {
66276627 if (is_mirror_grid(&current_floor_ptr->grid_array[y][x]))
66286628 {
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -45,9 +45,9 @@ static bool detect_feat_flag(POSITION range, int flag, bool known)
4545 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
4646
4747 /* Scan the current panel */
48- for (y = 1; y < cur_hgt - 1; y++)
48+ for (y = 1; y < current_floor_ptr->height - 1; y++)
4949 {
50- for (x = 1; x <= cur_wid - 1; x++)
50+ for (x = 1; x <= current_floor_ptr->width - 1; x++)
5151 {
5252 int dist = distance(p_ptr->y, p_ptr->x, y, x);
5353 if (dist > range) continue;
@@ -3864,9 +3864,9 @@ void remove_all_mirrors(bool explode)
38643864 {
38653865 POSITION x, y;
38663866
3867- for (x = 0; x < cur_wid; x++)
3867+ for (x = 0; x < current_floor_ptr->width; x++)
38683868 {
3869- for (y = 0; y < cur_hgt; y++)
3869+ for (y = 0; y < current_floor_ptr->height; y++)
38703870 {
38713871 if (is_mirror_grid(&current_floor_ptr->grid_array[y][x]))
38723872 {
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -263,9 +263,9 @@ bool teleport_player_aux(POSITION dis, BIT_FLAGS mode)
263263 int min, pick, i;
264264
265265 int left = MAX(1, p_ptr->x - dis);
266- int right = MIN(cur_wid - 2, p_ptr->x + dis);
266+ int right = MIN(current_floor_ptr->width - 2, p_ptr->x + dis);
267267 int top = MAX(1, p_ptr->y - dis);
268- int bottom = MIN(cur_hgt - 2, p_ptr->y + dis);
268+ int bottom = MIN(current_floor_ptr->height - 2, p_ptr->y + dis);
269269
270270 if (p_ptr->wild_mode) return FALSE;
271271
@@ -1390,9 +1390,9 @@ static bool vanish_dungeon(void)
13901390 }
13911391
13921392 /* Scan all normal grids */
1393- for (y = 1; y < cur_hgt - 1; y++)
1393+ for (y = 1; y < current_floor_ptr->height - 1; y++)
13941394 {
1395- for (x = 1; x < cur_wid - 1; x++)
1395+ for (x = 1; x < current_floor_ptr->width - 1; x++)
13961396 {
13971397 g_ptr = &current_floor_ptr->grid_array[y][x];
13981398
@@ -1424,7 +1424,7 @@ static bool vanish_dungeon(void)
14241424 }
14251425
14261426 /* Special boundary walls -- Top and bottom */
1427- for (x = 0; x < cur_wid; x++)
1427+ for (x = 0; x < current_floor_ptr->width; x++)
14281428 {
14291429 g_ptr = &current_floor_ptr->grid_array[0][x];
14301430 f_ptr = &f_info[g_ptr->mimic];
@@ -1441,7 +1441,7 @@ static bool vanish_dungeon(void)
14411441 if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
14421442 }
14431443
1444- g_ptr = &current_floor_ptr->grid_array[cur_hgt - 1][x];
1444+ g_ptr = &current_floor_ptr->grid_array[current_floor_ptr->height - 1][x];
14451445 f_ptr = &f_info[g_ptr->mimic];
14461446
14471447 /* Lose room and vault */
@@ -1458,7 +1458,7 @@ static bool vanish_dungeon(void)
14581458 }
14591459
14601460 /* Special boundary walls -- Left and right */
1461- for (y = 1; y < (cur_hgt - 1); y++)
1461+ for (y = 1; y < (current_floor_ptr->height - 1); y++)
14621462 {
14631463 g_ptr = &current_floor_ptr->grid_array[y][0];
14641464 f_ptr = &f_info[g_ptr->mimic];
@@ -1475,7 +1475,7 @@ static bool vanish_dungeon(void)
14751475 if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
14761476 }
14771477
1478- g_ptr = &current_floor_ptr->grid_array[y][cur_wid - 1];
1478+ g_ptr = &current_floor_ptr->grid_array[y][current_floor_ptr->width - 1];
14791479 f_ptr = &f_info[g_ptr->mimic];
14801480
14811481 /* Lose room and vault */
--- a/src/types.h
+++ b/src/types.h
@@ -1878,4 +1878,6 @@ typedef struct {
18781878 grid_type *grid_array[MAX_HGT];
18791879 DEPTH dun_level; /*!< 現在の実ダンジョン階層base_levelの参照元となる / Current dungeon level */
18801880 DEPTH base_level;
1881+ POSITION width; /* Current dungeon width */
1882+ POSITION height; /* Current dungeon height */
18811883 } floor_type;
\ No newline at end of file
--- a/src/variable.c
+++ b/src/variable.c
@@ -111,8 +111,6 @@ bool msg_flag; /* Used in msg_print() for "buffering" */
111111 s16b running; /* Current counter for running, if any */
112112 GAME_TURN resting; /* Current counter for resting, if any */
113113
114-POSITION cur_hgt; /* Current dungeon height */
115-POSITION cur_wid; /* Current dungeon width */
116114 MONSTER_NUMBER num_repro; /*!< Current reproducer count */
117115 DEPTH object_level; /*!< アイテムの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current object creation level */
118116 DEPTH monster_level; /*!< モンスターの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current monster creation level */
--- a/src/view-mainwindow.c
+++ b/src/view-mainwindow.c
@@ -2435,8 +2435,8 @@ void resize_map(void)
24352435 panel_col_max = 0;
24362436
24372437 /* Reset the panels */
2438- panel_row_min = cur_hgt;
2439- panel_col_min = cur_wid;
2438+ panel_row_min = current_floor_ptr->height;
2439+ panel_col_min = current_floor_ptr->width;
24402440
24412441 verify_panel();
24422442
@@ -2497,11 +2497,11 @@ bool change_panel(POSITION dy, POSITION dx)
24972497 x = panel_col_min + dx * wid / 2;
24982498
24992499 /* Verify the row */
2500- if (y > cur_hgt - hgt) y = cur_hgt - hgt;
2500+ if (y > current_floor_ptr->height - hgt) y = current_floor_ptr->height - hgt;
25012501 if (y < 0) y = 0;
25022502
25032503 /* Verify the col */
2504- if (x > cur_wid - wid) x = cur_wid - wid;
2504+ if (x > current_floor_ptr->width - wid) x = current_floor_ptr->width - wid;
25052505 if (x < 0) x = 0;
25062506
25072507 /* Handle "changes" */
--- a/src/wild.c
+++ b/src/wild.c
@@ -424,8 +424,8 @@ static void generate_area(POSITION y, POSITION x, bool border, bool corner)
424424 /* Hack -- Induce consistant flavors */
425425 Rand_state_set(wilderness[y][x].seed);
426426
427- dy = rand_range(6, cur_hgt - 6);
428- dx = rand_range(6, cur_wid - 6);
427+ dy = rand_range(6, current_floor_ptr->height - 6);
428+ dx = rand_range(6, current_floor_ptr->width - 6);
429429
430430 current_floor_ptr->grid_array[dy][dx].feat = feat_entrance;
431431 current_floor_ptr->grid_array[dy][dx].special = wilderness[y][x].entrance;
@@ -455,12 +455,12 @@ void wilderness_gen(void)
455455 feature_type *f_ptr;
456456
457457 /* Big town */
458- cur_hgt = MAX_HGT;
459- cur_wid = MAX_WID;
458+ current_floor_ptr->height = MAX_HGT;
459+ current_floor_ptr->width = MAX_WID;
460460
461461 /* Assume illegal panel */
462- panel_row_min = cur_hgt;
463- panel_col_min = cur_wid;
462+ panel_row_min = current_floor_ptr->height;
463+ panel_col_min = current_floor_ptr->width;
464464
465465 /* Init the wilderness */
466466
@@ -564,9 +564,9 @@ void wilderness_gen(void)
564564 current_floor_ptr->grid_array[MAX_HGT - 1][MAX_WID - 1].mimic = border.south_east;
565565
566566 /* Light up or darken the area */
567- for (y = 0; y < cur_hgt; y++)
567+ for (y = 0; y < current_floor_ptr->height; y++)
568568 {
569- for (x = 0; x < cur_wid; x++)
569+ for (x = 0; x < current_floor_ptr->width; x++)
570570 {
571571 g_ptr = &current_floor_ptr->grid_array[y][x];
572572
@@ -610,9 +610,9 @@ void wilderness_gen(void)
610610
611611 if (p_ptr->teleport_town)
612612 {
613- for (y = 0; y < cur_hgt; y++)
613+ for (y = 0; y < current_floor_ptr->height; y++)
614614 {
615- for (x = 0; x < cur_wid; x++)
615+ for (x = 0; x < current_floor_ptr->width; x++)
616616 {
617617 g_ptr = &current_floor_ptr->grid_array[y][x];
618618
@@ -635,9 +635,9 @@ void wilderness_gen(void)
635635
636636 else if (p_ptr->leaving_dungeon)
637637 {
638- for (y = 0; y < cur_hgt; y++)
638+ for (y = 0; y < current_floor_ptr->height; y++)
639639 {
640- for (x = 0; x < cur_wid; x++)
640+ for (x = 0; x < current_floor_ptr->width; x++)
641641 {
642642 g_ptr = &current_floor_ptr->grid_array[y][x];
643643
@@ -725,15 +725,15 @@ void wilderness_gen_small(void)
725725 current_floor_ptr->grid_array[j][i].info |= (CAVE_GLOW | CAVE_MARK);
726726 }
727727
728- cur_hgt = (s16b) max_wild_y;
729- cur_wid = (s16b) max_wild_x;
728+ current_floor_ptr->height = (s16b) max_wild_y;
729+ current_floor_ptr->width = (s16b) max_wild_x;
730730
731- if (cur_hgt > MAX_HGT) cur_hgt = MAX_HGT;
732- if (cur_wid > MAX_WID) cur_wid = MAX_WID;
731+ if (current_floor_ptr->height > MAX_HGT) current_floor_ptr->height = MAX_HGT;
732+ if (current_floor_ptr->width > MAX_WID) current_floor_ptr->width = MAX_WID;
733733
734734 /* Assume illegal panel */
735- panel_row_min = cur_hgt;
736- panel_col_min = cur_wid;
735+ panel_row_min = current_floor_ptr->height;
736+ panel_col_min = current_floor_ptr->width;
737737
738738 /* Place the player */
739739 p_ptr->x = p_ptr->wilderness_x;
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -1913,9 +1913,9 @@ void do_cmd_debug(void)
19131913
19141914 /* Make every dungeon square "known" to test streamers -KMW- */
19151915 case 'u':
1916- for (y = 0; y < cur_hgt; y++)
1916+ for (y = 0; y < current_floor_ptr->height; y++)
19171917 {
1918- for (x = 0; x < cur_wid; x++)
1918+ for (x = 0; x < current_floor_ptr->width; x++)
19191919 {
19201920 current_floor_ptr->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
19211921 }
--- a/src/xtra2.c
+++ b/src/xtra2.c
@@ -299,8 +299,8 @@ void verify_panel(void)
299299
300300 get_screen_size(&wid, &hgt);
301301
302- max_prow_min = cur_hgt - hgt;
303- max_pcol_min = cur_wid - wid;
302+ max_prow_min = current_floor_ptr->height - hgt;
303+ max_pcol_min = current_floor_ptr->width - wid;
304304
305305 /* Bounds checking */
306306 if (max_prow_min < 0) max_prow_min = 0;
@@ -793,9 +793,9 @@ static void target_set_prepare(BIT_FLAGS mode)
793793 {
794794 /* Inner range */
795795 min_hgt = MAX((p_ptr->y - MAX_RANGE), 0);
796- max_hgt = MIN((p_ptr->y + MAX_RANGE), cur_hgt - 1);
796+ max_hgt = MIN((p_ptr->y + MAX_RANGE), current_floor_ptr->height - 1);
797797 min_wid = MAX((p_ptr->x - MAX_RANGE), 0);
798- max_wid = MIN((p_ptr->x + MAX_RANGE), cur_wid - 1);
798+ max_wid = MIN((p_ptr->x + MAX_RANGE), current_floor_ptr->width - 1);
799799 }
800800 else /* not targetting */
801801 {
@@ -1746,11 +1746,11 @@ bool target_set(BIT_FLAGS mode)
17461746 }
17471747
17481748 /* Slide into legality */
1749- if (x >= cur_wid-1) x = cur_wid - 2;
1749+ if (x >= current_floor_ptr->width-1) x = current_floor_ptr->width - 2;
17501750 else if (x <= 0) x = 1;
17511751
17521752 /* Slide into legality */
1753- if (y >= cur_hgt-1) y = cur_hgt- 2;
1753+ if (y >= current_floor_ptr->height-1) y = current_floor_ptr->height- 2;
17541754 else if (y <= 0) y = 1;
17551755 }
17561756 }
@@ -1920,11 +1920,11 @@ bool target_set(BIT_FLAGS mode)
19201920 }
19211921
19221922 /* Slide into legality */
1923- if (x >= cur_wid-1) x = cur_wid - 2;
1923+ if (x >= current_floor_ptr->width-1) x = current_floor_ptr->width - 2;
19241924 else if (x <= 0) x = 1;
19251925
19261926 /* Slide into legality */
1927- if (y >= cur_hgt-1) y = cur_hgt- 2;
1927+ if (y >= current_floor_ptr->height-1) y = current_floor_ptr->height- 2;
19281928 else if (y <= 0) y = 1;
19291929 }
19301930 }
@@ -2410,9 +2410,9 @@ static void tgt_pt_prepare(void)
24102410 if (!expand_list) return;
24112411
24122412 /* Scan the current panel */
2413- for (y = 1; y < cur_hgt; y++)
2413+ for (y = 1; y < current_floor_ptr->height; y++)
24142414 {
2415- for (x = 1; x < cur_wid; x++)
2415+ for (x = 1; x < current_floor_ptr->width; x++)
24162416 {
24172417 /* Require "interesting" contents */
24182418 if (!tgt_pt_accept(y, x)) continue;
@@ -2579,11 +2579,11 @@ bool tgt_pt(POSITION *x_ptr, POSITION *y_ptr)
25792579 }
25802580
25812581 /* Slide into legality */
2582- if (x >= cur_wid-1) x = cur_wid - 2;
2582+ if (x >= current_floor_ptr->width-1) x = current_floor_ptr->width - 2;
25832583 else if (x <= 0) x = 1;
25842584
25852585 /* Slide into legality */
2586- if (y >= cur_hgt-1) y = cur_hgt- 2;
2586+ if (y >= current_floor_ptr->height-1) y = current_floor_ptr->height- 2;
25872587 else if (y <= 0) y = 1;
25882588
25892589 }
Show on old repository browser