From 353c8bcf8d90f90ccc04d104587ba89526fa1c1a Mon Sep 17 00:00:00 2001 From: oli414 Date: Tue, 1 May 2018 17:48:34 +0200 Subject: [PATCH] Adhere to coding style --- src/openrct2/world/Surface.cpp | 8 ++++---- src/openrct2/world/Surface.h | 8 ++++---- src/openrct2/world/TileElement.cpp | 16 ++++++++-------- src/openrct2/world/TileElement.h | 14 +++++++------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/openrct2/world/Surface.cpp b/src/openrct2/world/Surface.cpp index 9e85216cb2..0363a76c31 100644 --- a/src/openrct2/world/Surface.cpp +++ b/src/openrct2/world/Surface.cpp @@ -16,7 +16,7 @@ #include "Surface.h" -sint32 surface_get_terrain(const rct_tile_element *element) +sint32 surface_get_terrain(const rct_tile_element * element) { sint32 terrain = (element->properties.surface.terrain >> 5) & 7; if (element->type & 1) @@ -24,7 +24,7 @@ sint32 surface_get_terrain(const rct_tile_element *element) return terrain; } -sint32 surface_get_terrain_edge(const rct_tile_element *element) +sint32 surface_get_terrain_edge(const rct_tile_element * element) { sint32 terrain_edge = (element->properties.surface.slope >> 5) & 7; if (element->type & 128) @@ -32,7 +32,7 @@ sint32 surface_get_terrain_edge(const rct_tile_element *element) return terrain_edge; } -void surface_set_terrain(rct_tile_element *element, sint32 terrain) +void surface_set_terrain(rct_tile_element * element, sint32 terrain) { // Bit 3 for terrain is stored in element.type bit 0 if (terrain & 8) @@ -45,7 +45,7 @@ void surface_set_terrain(rct_tile_element *element, sint32 terrain) element->properties.surface.terrain |= (terrain & 7) << 5; } -void surface_set_terrain_edge(rct_tile_element *element, sint32 terrain) +void surface_set_terrain_edge(rct_tile_element * element, sint32 terrain) { // Bit 3 for terrain is stored in element.type bit 7 if (terrain & 8) diff --git a/src/openrct2/world/Surface.h b/src/openrct2/world/Surface.h index 188719259b..79aa4b1d38 100644 --- a/src/openrct2/world/Surface.h +++ b/src/openrct2/world/Surface.h @@ -112,10 +112,10 @@ enum { #define TILE_ELEMENT_SURFACE_WATER_HEIGHT_MASK 0x1F // in rct_tile_element.properties.surface.terrain #define TILE_ELEMENT_SURFACE_TERRAIN_MASK 0xE0 // in rct_tile_element.properties.surface.terrain -sint32 surface_get_terrain(const rct_tile_element *element); -sint32 surface_get_terrain_edge(const rct_tile_element *element); -void surface_set_terrain(rct_tile_element *element, sint32 terrain); -void surface_set_terrain_edge(rct_tile_element *element, sint32 terrain); +sint32 surface_get_terrain(const rct_tile_element * element); +sint32 surface_get_terrain_edge(const rct_tile_element * element); +void surface_set_terrain(rct_tile_element * element, sint32 terrain); +void surface_set_terrain_edge(rct_tile_element * element, sint32 terrain); // ~Oli414: Needs to renamed. This function is specific to the surface object. sint32 surface_get_water_height(const rct_tile_element * tileElement); diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/TileElement.cpp index 7fd49e2692..5df4e001f5 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/TileElement.cpp @@ -23,32 +23,32 @@ #include "TileElement.h" #include "Scenery.h" -uint8 tile_element_get_scenery_quadrant(const rct_tile_element *element) +uint8 tile_element_get_scenery_quadrant(const rct_tile_element * element) { return (element->type & TILE_ELEMENT_QUADRANT_MASK) >> 6; } -sint32 tile_element_get_type(const rct_tile_element *element) +sint32 tile_element_get_type(const rct_tile_element * element) { return element->type & TILE_ELEMENT_TYPE_MASK; } -sint32 tile_element_get_direction(const rct_tile_element *element) +sint32 tile_element_get_direction(const rct_tile_element * element) { return element->type & TILE_ELEMENT_DIRECTION_MASK; } -sint32 tile_element_get_direction_with_offset(const rct_tile_element *element, uint8 offset) +sint32 tile_element_get_direction_with_offset(const rct_tile_element * element, uint8 offset) { return ((element->type & TILE_ELEMENT_DIRECTION_MASK) + offset) & TILE_ELEMENT_DIRECTION_MASK; } -bool tile_element_is_ghost(const rct_tile_element *element) +bool tile_element_is_ghost(const rct_tile_element * element) { return element->flags & TILE_ELEMENT_FLAG_GHOST; } -bool tile_element_is_underground(rct_tile_element *tileElement) +bool tile_element_is_underground(rct_tile_element * tileElement) { do { tileElement++; @@ -58,7 +58,7 @@ bool tile_element_is_underground(rct_tile_element *tileElement) return true; } -sint32 tile_element_get_banner_index(rct_tile_element *tileElement) +sint32 tile_element_get_banner_index(rct_tile_element * tileElement) { rct_scenery_entry* sceneryEntry; @@ -101,7 +101,7 @@ void tile_element_set_banner_index(rct_tile_element * tileElement, sint32 banner } } -void tile_element_remove_banner_entry(rct_tile_element *tileElement) +void tile_element_remove_banner_entry(rct_tile_element * tileElement) { sint32 bannerIndex = tile_element_get_banner_index(tileElement); if (bannerIndex == BANNER_INDEX_NULL) diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 2d510b5ac5..2b09a01715 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -208,13 +208,13 @@ enum #define MAP_ELEM_TRACK_SEQUENCE_SEQUENCE_MASK 0x0F #define MAP_ELEM_TRACK_SEQUENCE_TAKING_PHOTO_MASK 0xF0 -uint8 tile_element_get_scenery_quadrant(const rct_tile_element *element); -sint32 tile_element_get_type(const rct_tile_element *element); -sint32 tile_element_get_direction(const rct_tile_element *element); -sint32 tile_element_get_direction_with_offset(const rct_tile_element *element, uint8 offset); -sint32 tile_element_get_banner_index(rct_tile_element *tileElement); -bool tile_element_is_ghost(const rct_tile_element *element); -bool tile_element_is_underground(rct_tile_element *tileElement); +uint8 tile_element_get_scenery_quadrant(const rct_tile_element * element); +sint32 tile_element_get_type(const rct_tile_element * element); +sint32 tile_element_get_direction(const rct_tile_element * element); +sint32 tile_element_get_direction_with_offset(const rct_tile_element * element, uint8 offset); +sint32 tile_element_get_banner_index(rct_tile_element * tileElement); +bool tile_element_is_ghost(const rct_tile_element * element); +bool tile_element_is_underground(rct_tile_element * tileElement); // ~Oli414: The banner functions should be part of banner. void tile_element_set_banner_index(rct_tile_element * tileElement, sint32 bannerIndex);