Skip to content

Commit

Permalink
Format project, apply custom clang-format only to Unity bindings project
Browse files Browse the repository at this point in the history
  • Loading branch information
Basssiiie committed Oct 12, 2024
1 parent 2d64ed1 commit 3729ca7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterExternBlock: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
Expand Down Expand Up @@ -63,7 +62,6 @@ IncludeCategories:
- Regex: '^<'
Priority: 2
IndentCaseLabels: true
IndentExternBlock: true
IndentPPDirectives: AfterHash
IndentWidth: 4
IndentWrappedFunctionNames: true
Expand Down
6 changes: 6 additions & 0 deletions src/openrct2-bindings/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
BasedOnStyle: InheritParentConfig
BraceWrapping:
AfterExternBlock: true
IndentExternBlock: true
...
2 changes: 1 addition & 1 deletion src/openrct2-bindings/Map/Path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ extern "C"
EXPORT void GetPathElementAt(int x, int y, int index, PathInfo* element)
{
const TileElement* source = GetTileElementAt(x, y, index, TileElementType::Path);
SetPathInfo(x, y, index, source, element);
SetPathInfo(x, y, index, source, element);
}

// Writes all the path element details to the specified buffer.
Expand Down
6 changes: 2 additions & 4 deletions src/openrct2-bindings/Map/Surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
#include "../Utilities/Logging.h"
#include "../Utilities/TileElementHelper.h"

#include <openrct2/object/ObjectManager.h>
#include <openrct2/object/TerrainEdgeObject.h>
#include <openrct2/object/TerrainSurfaceObject.h>
#include <openrct2/paint/tile_element/Paint.Surface.h>
#include <openrct2/paint/tile_element/Paint.Surface.cpp>
#include <openrct2/world/Map.h>

extern "C"
Expand All @@ -32,9 +30,9 @@ extern "C"
uint8_t grassLength = surface->GetGrassLength();
auto imageId = ImageId(surfaceObject->GetImageId({ x, y }, grassLength, element->GetDirection(), 0, false, false));
if (surfaceObject->Colour != 255)
{
{
imageId = imageId.WithPrimary(surfaceObject->Colour);
}
}
return imageId.ToUInt32();
}

Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-bindings/Map/Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extern "C"
static void SetTrackInfo(int x, int y, int index, const TileElement* source, TrackInfo* target)
{
const TrackElement* track = source->AsTrack();

if (track == nullptr)
{
dll_log("Could not find track element at %i, %i, index %i", x, y, index);
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-bindings/Map/Wall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ extern "C"
const TileElement* source = GetTileElementAt(x, y, index, TileElementType::Wall);
SetWallInfo(x, y, index, source, element);
}

// Writes all the wall element details to the specified buffer.
EXPORT int GetAllWallElementsAt(int x, int y, WallInfo* elements, int length)
{
Expand Down

0 comments on commit 3729ca7

Please sign in to comment.