Skip to content

Commit

Permalink
Enumerate the map tiles in row order
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Feb 16, 2024
1 parent a877546 commit f2658eb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/keybind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ void kf_HalveHeights()
{
MAPTILE *psTile;

for (int i = 0; i < mapWidth; ++i)
for (int j = 0; j < mapHeight; ++j)
{
for (int j = 0; j < mapHeight; ++j)
for (int i = 0; i < mapWidth; ++i)
{
psTile = mapTile(i, j);
psTile->height /= 2;
Expand Down
4 changes: 2 additions & 2 deletions src/lighting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ void initLighting(UDWORD x1, UDWORD y1, UDWORD x2, UDWORD y2)
return;
}

for (unsigned i = x1; i < x2; i++)
for (unsigned j = y1; j < y2; j++)
{
for (unsigned j = y1; j < y2; j++)
for (unsigned i = x1; i < x2; i++)
{
MAPTILE *psTile = mapTile(i, j);

Expand Down
6 changes: 2 additions & 4 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,11 +708,9 @@ static bool hasDecals(int i, int j)
// Sets the ground type to be a decal or not
static bool mapSetGroundTypes()
{
int i, j;

for (i = 0; i < mapWidth; i++)
for (int j = 0; j < mapHeight; j++)
{
for (j = 0; j < mapHeight; j++)
for (int i = 0; i < mapWidth; i++)
{
MAPTILE *psTile = mapTile(i, j);

Expand Down
4 changes: 2 additions & 2 deletions src/qtscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1760,9 +1760,9 @@ std::vector<scripting_engine::LabelInfo> scripting_engine::debug_GetLabelInfo()

void clearMarks()
{
for (int x = 0; x < mapWidth; x++) // clear old marks
for (int y = 0; y < mapHeight; y++)
{
for (int y = 0; y < mapHeight; y++)
for (int x = 0; x < mapWidth; x++) // clear old marks
{
MAPTILE *psTile = mapTile(x, y);
psTile->tileInfoBits &= ~BITS_MARKED;
Expand Down
4 changes: 2 additions & 2 deletions src/visibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,9 @@ void revealAll(UBYTE player)
}

//reveal all tiles
for (i = 0; i < mapWidth; i++)
for (j = 0; j < mapHeight; j++)
{
for (j = 0; j < mapHeight; j++)
for (i = 0; i < mapWidth; i++)
{
psTile = mapTile(i, j);
psTile->tileExploredBits |= alliancebits[player];
Expand Down

0 comments on commit f2658eb

Please sign in to comment.