mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use `bool` type for boolean logic
This commit is contained in:
parent
3dd98c7aa2
commit
c7417e11a4
|
@ -253,9 +253,9 @@ void map_set_tile_elements(sint32 x, sint32 y, rct_tile_element *elements)
|
|||
gTileElementTilePointers[x + y * MAXIMUM_MAP_SIZE_TECHNICAL] = elements;
|
||||
}
|
||||
|
||||
sint32 tile_element_is_last_for_tile(const rct_tile_element *element)
|
||||
bool tile_element_is_last_for_tile(const rct_tile_element *element)
|
||||
{
|
||||
return element->flags & TILE_ELEMENT_FLAG_LAST_TILE;
|
||||
return (element->flags & TILE_ELEMENT_FLAG_LAST_TILE) != 0;
|
||||
}
|
||||
|
||||
bool tile_element_is_ghost(const rct_tile_element *element)
|
||||
|
@ -715,7 +715,7 @@ void sub_68B089()
|
|||
* Checks if the tile at coordinate at height counts as connected.
|
||||
* @return 1 if connected, 0 otherwise
|
||||
*/
|
||||
sint32 map_coord_is_connected(sint32 x, sint32 y, sint32 z, uint8 faceDirection)
|
||||
bool map_coord_is_connected(sint32 x, sint32 y, sint32 z, uint8 faceDirection)
|
||||
{
|
||||
rct_tile_element *tileElement = map_get_first_element_at(x, y);
|
||||
|
||||
|
@ -730,17 +730,17 @@ sint32 map_coord_is_connected(sint32 x, sint32 y, sint32 z, uint8 faceDirection)
|
|||
if (pathType & 1) {
|
||||
if (pathDirection == faceDirection) {
|
||||
if (z == tileElement->base_height + 2)
|
||||
return 1;
|
||||
return true;
|
||||
} else if ((pathDirection ^ 2) == faceDirection && z == tileElement->base_height) {
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (z == tileElement->base_height)
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
} while (!tile_element_is_last_for_tile(tileElement++));
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -417,7 +417,7 @@ void map_update_tile_pointers();
|
|||
rct_tile_element *map_get_first_element_at(sint32 x, sint32 y);
|
||||
rct_tile_element *map_get_nth_element_at(sint32 x, sint32 y, sint32 n);
|
||||
void map_set_tile_elements(sint32 x, sint32 y, rct_tile_element *elements);
|
||||
sint32 tile_element_is_last_for_tile(const rct_tile_element *element);
|
||||
bool tile_element_is_last_for_tile(const rct_tile_element *element);
|
||||
bool tile_element_is_ghost(const rct_tile_element *element);
|
||||
uint8 tile_element_get_scenery_quadrant(const rct_tile_element *element);
|
||||
sint32 tile_element_get_type(const rct_tile_element *element);
|
||||
|
@ -438,7 +438,7 @@ rct_tile_element * map_get_ride_entrance_element_at(sint32 x, sint32 y, sint32 z
|
|||
rct_tile_element * map_get_ride_exit_element_at(sint32 x, sint32 y, sint32 z, bool ghost);
|
||||
sint32 tile_element_height(sint32 x, sint32 y);
|
||||
void sub_68B089();
|
||||
sint32 map_coord_is_connected(sint32 x, sint32 y, sint32 z, uint8 faceDirection);
|
||||
bool map_coord_is_connected(sint32 x, sint32 y, sint32 z, uint8 faceDirection);
|
||||
void map_remove_provisional_elements();
|
||||
void map_restore_provisional_elements();
|
||||
void map_update_path_wide_flags();
|
||||
|
|
|
@ -119,8 +119,8 @@ rct_sprite *get_sprite(size_t sprite_idx) {
|
|||
return &sprite_list[sprite_idx];
|
||||
}
|
||||
|
||||
int tile_element_is_last_for_tile(const rct_tile_element *element) {
|
||||
return element->flags & TILE_ELEMENT_FLAG_LAST_TILE;
|
||||
bool tile_element_is_last_for_tile(const rct_tile_element *element) {
|
||||
return (element->flags & TILE_ELEMENT_FLAG_LAST_TILE) != 0;
|
||||
}
|
||||
|
||||
int tile_element_get_type(const rct_tile_element *element) {
|
||||
|
@ -293,4 +293,4 @@ void track_element_set_cable_lift(rct_tile_element * trackElement)
|
|||
void track_element_clear_cable_lift(rct_tile_element * trackElement)
|
||||
{
|
||||
trackElement->properties.track.colour &= ~TRACK_ELEMENT_COLOUR_FLAG_CABLE_LIFT;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue