Review tileRenderFloorsInRect

This commit is contained in:
Alexander Batalov 2022-12-20 16:22:56 +03:00
parent 18afce71b0
commit 281c1aa82a
1 changed files with 11 additions and 10 deletions

View File

@ -1442,20 +1442,21 @@ void tileRenderFloorsInRect(Rect* rect, int elevation)
lightGetLightLevel(); lightGetLightLevel();
temp = gSquareGridWidth * minY; int baseSquareTile = gSquareGridWidth * minY;
for (int v15 = minY; v15 <= maxY; v15++) {
for (int i = minX; i <= maxX; i++) { for (int y = minY; y <= maxY; y++) {
int v3 = temp + i; for (int x = minX; x <= maxX; x++) {
int frmId = gTileSquares[elevation]->field_0[v3]; int squareTile = baseSquareTile + x;
int frmId = gTileSquares[elevation]->field_0[squareTile];
if ((((frmId & 0xF000) >> 12) & 0x01) == 0) { if ((((frmId & 0xF000) >> 12) & 0x01) == 0) {
int v12; int tileScreenX;
int v13; int tileScreenY;
squareTileToScreenXY(v3, &v12, &v13, elevation); squareTileToScreenXY(squareTile, &tileScreenX, &tileScreenY, elevation);
int fid = buildFid(OBJ_TYPE_TILE, frmId & 0xFFF, 0, 0, 0); int fid = buildFid(OBJ_TYPE_TILE, frmId & 0xFFF, 0, 0, 0);
tileRenderFloor(fid, v12, v13, rect); tileRenderFloor(fid, tileScreenX, tileScreenY, rect);
} }
} }
temp += gSquareGridWidth; baseSquareTile += gSquareGridWidth;
} }
} }