mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Merge pull request #22386 from mrmbernardi/format
Apply check-code-formatting changes
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -63,7 +63,7 @@ jobs:
|
||||
check-code-formatting:
|
||||
name: Check code formatting
|
||||
runs-on: ubuntu-latest
|
||||
container: openrct2/openrct2-build:4-format
|
||||
container: openrct2/openrct2-build:17-format
|
||||
defaults:
|
||||
run:
|
||||
shell: sh
|
||||
|
||||
@@ -16,4 +16,4 @@ fi
|
||||
basedir="$($readlink_bin -f `dirname $0`/..)"
|
||||
cd $basedir
|
||||
|
||||
scripts/run-clang-format.py -r src test data/shaders --exclude src/thirdparty
|
||||
scripts/run-clang-format.py --clang-format-executable /usr/lib/llvm18/bin/clang-format -r src test data/shaders --exclude src/thirdparty
|
||||
|
||||
@@ -89,26 +89,20 @@ enum
|
||||
|
||||
constexpr char NAC = '\0';
|
||||
|
||||
#define ExampleTableEnd \
|
||||
{ \
|
||||
nullptr, nullptr \
|
||||
}
|
||||
#define OptionTableEnd \
|
||||
{ \
|
||||
UINT8_MAX, nullptr, NAC, nullptr, nullptr \
|
||||
}
|
||||
#define CommandTableEnd \
|
||||
{ \
|
||||
nullptr, nullptr, nullptr, nullptr, nullptr \
|
||||
constexpr CommandLineExample kExampleTableEnd = CommandLineExample{ nullptr, nullptr };
|
||||
constexpr CommandLineOptionDefinition kOptionTableEnd = CommandLineOptionDefinition{ UINT8_MAX, nullptr, NAC, nullptr,
|
||||
nullptr };
|
||||
constexpr CommandLineCommand kCommandTableEnd = CommandLineCommand{ nullptr, nullptr, nullptr, nullptr, nullptr };
|
||||
|
||||
consteval CommandLineCommand DefineCommand(
|
||||
const char* name, const char* params, const CommandLineOptionDefinition* options, const CommandLineFunc func)
|
||||
{
|
||||
return CommandLineCommand{ name, params, options, nullptr, func };
|
||||
}
|
||||
|
||||
#define DefineCommand(name, params, options, func) \
|
||||
{ \
|
||||
name, params, options, nullptr, func \
|
||||
}
|
||||
#define DefineSubCommand(name, subcommandtable) \
|
||||
{ \
|
||||
name, "", nullptr, subcommandtable, nullptr \
|
||||
consteval CommandLineCommand DefineSubCommand(const char* name, const CommandLineCommand* subcommandtable)
|
||||
{
|
||||
return CommandLineCommand{ name, "", nullptr, subcommandtable, nullptr };
|
||||
}
|
||||
|
||||
namespace OpenRCT2::CommandLine
|
||||
|
||||
@@ -21,7 +21,7 @@ using namespace OpenRCT2;
|
||||
// clang-format off
|
||||
static constexpr CommandLineOptionDefinition NoOptions[]
|
||||
{
|
||||
OptionTableEnd
|
||||
kOptionTableEnd
|
||||
};
|
||||
|
||||
static exitcode_t HandleObjectsInfo(CommandLineArgEnumerator *argEnumerator);
|
||||
@@ -30,7 +30,7 @@ const CommandLineCommand CommandLine::ParkInfoCommands[]{
|
||||
// Main commands
|
||||
DefineCommand("objects", "<savefile>", NoOptions, HandleObjectsInfo),
|
||||
|
||||
CommandTableEnd
|
||||
kCommandTableEnd
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ static constexpr CommandLineOptionDefinition StandardOptions[]
|
||||
#ifdef USE_BREAKPAD
|
||||
{ CMDLINE_TYPE_SWITCH, &_silentBreakpad, NAC, "silent-breakpad", "make breakpad crash reporting silent" },
|
||||
#endif // USE_BREAKPAD
|
||||
OptionTableEnd
|
||||
kOptionTableEnd
|
||||
};
|
||||
|
||||
static exitcode_t HandleNoCommand(CommandLineArgEnumerator * enumerator);
|
||||
@@ -146,7 +146,7 @@ const CommandLineCommand CommandLine::RootCommands[]
|
||||
DefineSubCommand("sprite", CommandLine::SpriteCommands ),
|
||||
DefineSubCommand("simulate", CommandLine::SimulateCommands ),
|
||||
DefineSubCommand("parkinfo", CommandLine::ParkInfoCommands ),
|
||||
CommandTableEnd
|
||||
kCommandTableEnd
|
||||
};
|
||||
|
||||
const CommandLineExample CommandLine::RootExamples[]
|
||||
@@ -160,7 +160,7 @@ const CommandLineExample CommandLine::RootExamples[]
|
||||
#ifndef DISABLE_NETWORK
|
||||
{ "host ./my_park.sv6 --port 11753 --headless", "run a headless server for a saved park" },
|
||||
#endif
|
||||
ExampleTableEnd
|
||||
kExampleTableEnd
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ static constexpr CommandLineOptionDefinition ScreenshotOptionsDef[]
|
||||
{ CMDLINE_TYPE_SWITCH, &_options.remove_litter, NAC, "remove-litter", "remove litter for the screenshot" },
|
||||
{ CMDLINE_TYPE_SWITCH, &_options.tidy_up_park, NAC, "tidy-up-park", "clear grass, water plants, fix vandalism and remove litter" },
|
||||
{ CMDLINE_TYPE_SWITCH, &_options.transparent, NAC, "transparent", "make the background transparent" },
|
||||
OptionTableEnd
|
||||
kOptionTableEnd
|
||||
};
|
||||
|
||||
static exitcode_t HandleScreenshot(CommandLineArgEnumerator *argEnumerator);
|
||||
@@ -37,7 +37,7 @@ const CommandLineCommand CommandLine::ScreenshotCommands[]
|
||||
// Main commands
|
||||
DefineCommand("", "<file> <output_image> <width> <height> [<x> <y> <zoom> <rotation>]", ScreenshotOptionsDef, HandleScreenshot),
|
||||
DefineCommand("", "<file> <output_image> giant <zoom> <rotation>", ScreenshotOptionsDef, HandleScreenshot),
|
||||
CommandTableEnd
|
||||
kCommandTableEnd
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@ using namespace OpenRCT2;
|
||||
static exitcode_t HandleSimulate(CommandLineArgEnumerator* argEnumerator);
|
||||
|
||||
const CommandLineCommand CommandLine::SimulateCommands[]{ // Main commands
|
||||
DefineCommand("", "<ticks>", nullptr, HandleSimulate), CommandTableEnd
|
||||
DefineCommand("", "<ticks>", nullptr, HandleSimulate),
|
||||
kCommandTableEnd
|
||||
};
|
||||
|
||||
static exitcode_t HandleSimulate(CommandLineArgEnumerator* argEnumerator)
|
||||
|
||||
@@ -28,7 +28,7 @@ static const char* _mode;
|
||||
static constexpr CommandLineOptionDefinition SpriteOptions[]
|
||||
{
|
||||
{ CMDLINE_TYPE_STRING, &_mode, 'm', "mode", "the type of sprite conversion <" SZ_DEFAULT "|" SZ_CLOSEST "|" SZ_DITHERING ">" },
|
||||
OptionTableEnd
|
||||
kOptionTableEnd
|
||||
};
|
||||
|
||||
static exitcode_t HandleSprite(CommandLineArgEnumerator *argEnumerator);
|
||||
@@ -45,7 +45,7 @@ const CommandLineCommand CommandLine::SpriteCommands[]
|
||||
DefineCommand("exportall", "<spritefile> <output directory>", SpriteOptions, HandleSprite),
|
||||
DefineCommand("exportalldat", "<DAT identifier> <output directory>", SpriteOptions, HandleSprite),
|
||||
|
||||
CommandTableEnd
|
||||
kCommandTableEnd
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
// Adapted from freetype.h in order to avoid C-style casts.
|
||||
// clang-format off
|
||||
|
||||
#define FT_LOAD_TARGET_ALT(x) (static_cast<FT_Int32>((x)&15) << 16)
|
||||
#define FT_IMAGE_TAG(value, _x1, _x2, _x3, _x4) \
|
||||
|
||||
@@ -32,8 +32,8 @@ struct ITrackDesignRepository
|
||||
|
||||
[[nodiscard]] virtual size_t GetCount() const = 0;
|
||||
[[nodiscard]] virtual size_t GetCountForObjectEntry(ride_type_t rideType, const std::string& entry) const = 0;
|
||||
[[nodiscard]] virtual std::vector<TrackDesignFileRef> GetItemsForObjectEntry(
|
||||
ride_type_t rideType, const std::string& entry) const = 0;
|
||||
[[nodiscard]] virtual std::vector<TrackDesignFileRef>
|
||||
GetItemsForObjectEntry(ride_type_t rideType, const std::string& entry) const = 0;
|
||||
|
||||
virtual void Scan(int32_t language) = 0;
|
||||
virtual bool Delete(const std::string& path) = 0;
|
||||
|
||||
@@ -273,7 +273,8 @@ namespace OpenRCT2::Scripting
|
||||
// Only ensuring it was not in the same generated method fixed it.
|
||||
__declspec(noinline)
|
||||
# endif
|
||||
std::shared_ptr<ScDisposable> CreateSubscription(HOOK_TYPE hookType, const DukValue& callback)
|
||||
std::shared_ptr<ScDisposable>
|
||||
CreateSubscription(HOOK_TYPE hookType, const DukValue& callback)
|
||||
{
|
||||
auto owner = _execInfo.GetCurrentPlugin();
|
||||
auto cookie = _hookEngine.Subscribe(hookType, owner, callback);
|
||||
|
||||
Reference in New Issue
Block a user