Codechange: rename byte to uint8_t (#12308)
This commit is contained in:
@@ -1694,7 +1694,7 @@ static void ViewportDrawDirtyBlocks()
|
||||
|
||||
dst = dpi->dst_ptr;
|
||||
|
||||
byte bo = UnScaleByZoom(dpi->left + dpi->top, dpi->zoom) & 1;
|
||||
uint8_t bo = UnScaleByZoom(dpi->left + dpi->top, dpi->zoom) & 1;
|
||||
do {
|
||||
for (int i = (bo ^= 1); i < right; i += 2) blitter->SetPixel(dst, i, 0, (uint8_t)colour);
|
||||
dst = blitter->MoveTo(dst, 0, 1);
|
||||
@@ -2892,7 +2892,7 @@ static int CalcHeightdiff(HighLightStyle style, uint distance, TileIndex start_t
|
||||
|
||||
/* In the case of an area we can determine whether we were dragging south or
|
||||
* east by checking the X-coordinates of the tiles */
|
||||
byte style_t = (byte)(TileX(end_tile) > TileX(start_tile));
|
||||
uint8_t style_t = (uint8_t)(TileX(end_tile) > TileX(start_tile));
|
||||
start_tile = TileAdd(start_tile, ToTileIndexDiff(heightdiff_area_by_dir[style_t]));
|
||||
end_tile = TileAdd(end_tile, ToTileIndexDiff(heightdiff_area_by_dir[2 + style_t]));
|
||||
[[fallthrough]];
|
||||
@@ -2926,7 +2926,7 @@ static int CalcHeightdiff(HighLightStyle style, uint distance, TileIndex start_t
|
||||
if (swap && distance == 0) style = flip_style_direction[style];
|
||||
|
||||
/* Use lookup table for start-tile based on HighLightStyle direction */
|
||||
byte style_t = style * 2;
|
||||
uint8_t style_t = style * 2;
|
||||
assert(style_t < lengthof(heightdiff_line_by_dir) - 13);
|
||||
h0 = TileHeight(TileAdd(start_tile, ToTileIndexDiff(heightdiff_line_by_dir[style_t])));
|
||||
uint ht = TileHeight(TileAdd(start_tile, ToTileIndexDiff(heightdiff_line_by_dir[style_t + 1])));
|
||||
@@ -3168,7 +3168,7 @@ static void CalcRaildirsDrawstyle(int x, int y, int method)
|
||||
TileIndex t0 = TileVirtXY(_thd.selstart.x, _thd.selstart.y);
|
||||
TileIndex t1 = TileVirtXY(x, y);
|
||||
uint distance = DistanceManhattan(t0, t1) + 1;
|
||||
byte index = 0;
|
||||
uint8_t index = 0;
|
||||
|
||||
if (distance != 1) {
|
||||
int heightdiff = CalcHeightdiff(b, distance, t0, t1);
|
||||
@@ -3264,7 +3264,7 @@ calc_heightdiff_single_direction:;
|
||||
TileIndex t0 = TileVirtXY(sx, sy);
|
||||
TileIndex t1 = TileVirtXY(x, y);
|
||||
uint distance = DistanceManhattan(t0, t1) + 1;
|
||||
byte index = 0;
|
||||
uint8_t index = 0;
|
||||
|
||||
if (distance != 1) {
|
||||
/* With current code passing a HT_LINE style to calculate the height
|
||||
@@ -3298,7 +3298,7 @@ calc_heightdiff_single_direction:;
|
||||
TileIndex t1 = TileVirtXY(x, y);
|
||||
uint dx = Delta(TileX(t0), TileX(t1)) + 1;
|
||||
uint dy = Delta(TileY(t0), TileY(t1)) + 1;
|
||||
byte index = 0;
|
||||
uint8_t index = 0;
|
||||
|
||||
/* If dragging an area (eg dynamite tool) and it is actually a single
|
||||
* row/column, change the type to 'line' to get proper calculation for height */
|
||||
|
Reference in New Issue
Block a user