diff --git a/Source/drlg_l1.cpp b/Source/drlg_l1.cpp index cfe90716f..3ac6e6edc 100644 --- a/Source/drlg_l1.cpp +++ b/Source/drlg_l1.cpp @@ -2401,8 +2401,7 @@ void Pass3() void LoadL1Dungeon(const char *path, int vx, int vy) { - dminx = 16; - dminy = 16; + dminPosition = { 16, 16 }; dmaxx = 96; dmaxy = 96; @@ -2458,8 +2457,7 @@ void LoadPreL1Dungeon(const char *path) } } - dminx = 16; - dminy = 16; + dminPosition = { 16, 16 }; dmaxx = 96; dmaxy = 96; @@ -2496,8 +2494,7 @@ void CreateL5Dungeon(uint32_t rseed, lvl_entry entry) { SetRndSeed(rseed); - dminx = 16; - dminy = 16; + dminPosition = { 16, 16 }; dmaxx = 96; dmaxy = 96; @@ -2522,8 +2519,8 @@ void CreateL5Dungeon(uint32_t rseed, lvl_entry entry) DRLG_SetPC(); - for (int j = dminy; j < dmaxy; j++) { - for (int i = dminx; i < dmaxx; i++) { + for (int j = dminPosition.y; j < dmaxy; j++) { + for (int i = dminPosition.x; i < dmaxx; i++) { if (dPiece[i][j] == 290) { UberRow = i; UberCol = j; diff --git a/Source/drlg_l2.cpp b/Source/drlg_l2.cpp index 0706ae837..22c455ff1 100644 --- a/Source/drlg_l2.cpp +++ b/Source/drlg_l2.cpp @@ -3172,8 +3172,7 @@ void CreateL2Dungeon(uint32_t rseed, lvl_entry entry) SetRndSeed(rseed); - dminx = 16; - dminy = 16; + dminPosition = { 16, 16 }; dmaxx = 96; dmaxy = 96; diff --git a/Source/drlg_l3.cpp b/Source/drlg_l3.cpp index 5790a1d50..2fc71bc13 100644 --- a/Source/drlg_l3.cpp +++ b/Source/drlg_l3.cpp @@ -2481,8 +2481,7 @@ void CreateL3Dungeon(uint32_t rseed, lvl_entry entry) { SetRndSeed(rseed); - dminx = 16; - dminy = 16; + dminPosition = { 16, 16 }; dmaxx = 96; dmaxy = 96; @@ -2518,8 +2517,7 @@ void CreateL3Dungeon(uint32_t rseed, lvl_entry entry) void LoadL3Dungeon(const char *path, int vx, int vy) { - dminx = 16; - dminy = 16; + dminPosition = { 16, 16 }; dmaxx = 96; dmaxy = 96; diff --git a/Source/drlg_l4.cpp b/Source/drlg_l4.cpp index 62fa4ba25..9a577d815 100644 --- a/Source/drlg_l4.cpp +++ b/Source/drlg_l4.cpp @@ -1468,8 +1468,7 @@ void CreateL4Dungeon(uint32_t rseed, lvl_entry entry) { SetRndSeed(rseed); - dminx = 16; - dminy = 16; + dminPosition = { 16, 16 }; dmaxx = 96; dmaxy = 96; @@ -1485,8 +1484,7 @@ void CreateL4Dungeon(uint32_t rseed, lvl_entry entry) void LoadL4Dungeon(const char *path, int vx, int vy) { - dminx = 16; - dminy = 16; + dminPosition = { 16, 16 }; dmaxx = 96; dmaxy = 96; @@ -1508,8 +1506,7 @@ void LoadL4Dungeon(const char *path, int vx, int vy) void LoadPreL4Dungeon(const char *path) { - dminx = 16; - dminy = 16; + dminPosition = { 16, 16 }; dmaxx = 96; dmaxy = 96; diff --git a/Source/gendung.cpp b/Source/gendung.cpp index 56736052e..63a03c8ef 100644 --- a/Source/gendung.cpp +++ b/Source/gendung.cpp @@ -32,8 +32,7 @@ std::array nSolidTable; std::array nTransTable; std::array nMissileTable; std::array nTrapTable; -int dminx; -int dminy; +Point dminPosition; int dmaxx; int dmaxy; dungeon_type leveltype; diff --git a/Source/gendung.h b/Source/gendung.h index dde3beac8..63be65235 100644 --- a/Source/gendung.h +++ b/Source/gendung.h @@ -165,10 +165,8 @@ extern std::array nTransTable; */ extern std::array nMissileTable; extern std::array nTrapTable; -/** Specifies the minimum X-coordinate of the map. */ -extern int dminx; -/** Specifies the minimum Y-coordinate of the map. */ -extern int dminy; +/** Specifies the minimum X,Y-coordinates of the map. */ +extern Point dminPosition; /** Specifies the maximum X-coordinate of the map. */ extern int dmaxx; /** Specifies the maximum Y-coordinate of the map. */ diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index 4d55de8ce..efd3c3247 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -1624,12 +1624,12 @@ void ScrollView() scroll = false; if (MousePosition.x < 20) { - if (dmaxy - 1 <= ViewPosition.y || dminx >= ViewPosition.x) { + if (dmaxy - 1 <= ViewPosition.y || dminPosition.x >= ViewPosition.x) { if (dmaxy - 1 > ViewPosition.y) { ViewPosition.y++; scroll = true; } - if (dminx < ViewPosition.x) { + if (dminPosition.x < ViewPosition.x) { ViewPosition.x--; scroll = true; } @@ -1640,12 +1640,12 @@ void ScrollView() } } if (MousePosition.x > gnScreenWidth - 20) { - if (dmaxx - 1 <= ViewPosition.x || dminy >= ViewPosition.y) { + if (dmaxx - 1 <= ViewPosition.x || dminPosition.y >= ViewPosition.y) { if (dmaxx - 1 > ViewPosition.x) { ViewPosition.x++; scroll = true; } - if (dminy < ViewPosition.y) { + if (dminPosition.y < ViewPosition.y) { ViewPosition.y--; scroll = true; } @@ -1656,12 +1656,12 @@ void ScrollView() } } if (MousePosition.y < 20) { - if (dminy >= ViewPosition.y || dminx >= ViewPosition.x) { - if (dminy < ViewPosition.y) { + if (dminPosition.y >= ViewPosition.y || dminPosition.x >= ViewPosition.x) { + if (dminPosition.y < ViewPosition.y) { ViewPosition.y--; scroll = true; } - if (dminx < ViewPosition.x) { + if (dminPosition.x < ViewPosition.x) { ViewPosition.x--; scroll = true; } diff --git a/Source/town.cpp b/Source/town.cpp index 527df2b9b..ed566240a 100644 --- a/Source/town.cpp +++ b/Source/town.cpp @@ -268,8 +268,7 @@ void TownOpenGrave() void CreateTown(lvl_entry entry) { - dminx = 10; - dminy = 10; + dminPosition = { 10, 10 }; dmaxx = 84; dmaxy = 84; DRLG_InitTrans();