Apply clang-format
This commit is contained in:
parent
e3a2142941
commit
82cea78def
11 changed files with 32 additions and 32 deletions
|
|
@ -300,11 +300,11 @@ void SelheroClassSelectorEsc()
|
|||
void SelheroNameSelect(int /*value*/)
|
||||
{
|
||||
// only check names in multiplayer, we don't care about them in single
|
||||
if (selhero_isMultiPlayer && !UiValidPlayerName(selhero_heroInfo.name)) {
|
||||
if (selhero_isMultiPlayer && !UiValidPlayerName(selhero_heroInfo.name)) {
|
||||
ArtBackground.Unload();
|
||||
UiSelOkDialog(title, _("Invalid name. A name cannot contain spaces, reserved characters, or reserved words.\n"), false);
|
||||
LoadBackgroundArt("ui_art\\selhero.pcx");
|
||||
} else{
|
||||
} else {
|
||||
if (gfnHeroCreate(&selhero_heroInfo)) {
|
||||
SelheroLoadSelect(1);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -396,8 +396,8 @@ void RightMouseDown()
|
|||
return;
|
||||
}
|
||||
if ((!sbookflag || !RightPanel.Contains(MousePosition))
|
||||
&& !TryIconCurs()
|
||||
&& (pcursinvitem == -1 || !UseInvItem(MyPlayerId, pcursinvitem))) {
|
||||
&& !TryIconCurs()
|
||||
&& (pcursinvitem == -1 || !UseInvItem(MyPlayerId, pcursinvitem))) {
|
||||
if (pcurs == CURSOR_HAND) {
|
||||
if (pcursinvitem == -1 || !UseInvItem(MyPlayerId, pcursinvitem))
|
||||
CheckPlrSpell();
|
||||
|
|
|
|||
|
|
@ -613,5 +613,4 @@ void FloodTransparencyValues(uint8_t floorID)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace devilution
|
||||
|
|
|
|||
|
|
@ -1172,7 +1172,7 @@ void Teleport(int i)
|
|||
monster._mdir = GetMonsterDirection(monster);
|
||||
|
||||
if (monster.mlid != NO_LIGHT) {
|
||||
ChangeLightXY(monster.mlid, { x, y });
|
||||
ChangeLightXY(monster.mlid, { x, y });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ void LoadOptions()
|
|||
env->DeleteLocalRef(clazz);
|
||||
#elif defined(__vita__)
|
||||
int32_t language = SCE_SYSTEM_PARAM_LANG_ENGLISH_US; // default to english
|
||||
const char* vita_locales[] = {
|
||||
const char *vita_locales[] = {
|
||||
"ja_JP",
|
||||
"en_US",
|
||||
"fr_FR",
|
||||
|
|
@ -327,9 +327,9 @@ void LoadOptions()
|
|||
};
|
||||
SceAppUtilInitParam initParam;
|
||||
SceAppUtilBootParam bootParam;
|
||||
memset( &initParam, 0, sizeof(SceAppUtilInitParam) );
|
||||
memset( &bootParam, 0, sizeof(SceAppUtilBootParam) );
|
||||
sceAppUtilInit( &initParam, &bootParam );
|
||||
memset(&initParam, 0, sizeof(SceAppUtilInitParam));
|
||||
memset(&bootParam, 0, sizeof(SceAppUtilBootParam));
|
||||
sceAppUtilInit(&initParam, &bootParam);
|
||||
sceAppUtilSystemParamGetInt(SCE_SYSTEM_PARAM_ID_LANG, &language);
|
||||
if (language < 0 || language > SCE_SYSTEM_PARAM_LANG_TURKISH)
|
||||
language = SCE_SYSTEM_PARAM_LANG_ENGLISH_US; // default to english
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace
|
||||
|
||||
std::string GetLocale()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3546,7 +3546,7 @@ void CheckPlrSpell()
|
|||
|
||||
if (
|
||||
((chrflag || QuestLogIsOpen) && LeftPanel.Contains(MousePosition)) // inside left panel
|
||||
|| ((invflag || sbookflag) && RightPanel.Contains(MousePosition)) // inside right panel
|
||||
|| ((invflag || sbookflag) && RightPanel.Contains(MousePosition)) // inside right panel
|
||||
) {
|
||||
if (rspell != SPL_HEAL
|
||||
&& rspell != SPL_IDENTIFY
|
||||
|
|
@ -3713,7 +3713,7 @@ void CheckStats(PlayerStruct &player)
|
|||
int maxStatPoint = player.GetMaximumAttributeValue(attribute);
|
||||
switch (attribute) {
|
||||
case CharacterAttribute::Strength:
|
||||
player._pBaseStr = clamp(player._pBaseStr, 0 , maxStatPoint);
|
||||
player._pBaseStr = clamp(player._pBaseStr, 0, maxStatPoint);
|
||||
break;
|
||||
case CharacterAttribute::Magic:
|
||||
player._pBaseMag = clamp(player._pBaseMag, 0, maxStatPoint);
|
||||
|
|
|
|||
|
|
@ -1212,7 +1212,7 @@ void DrawView(const Surface &out, int startX, int startY)
|
|||
DrawQuestLog(out);
|
||||
}
|
||||
if (!chrflag && Players[MyPlayerId]._pStatPts != 0 && !spselflag
|
||||
&& (!QuestLogIsOpen || !LeftPanel.Contains(MainPanel.position + Displacement { 0, -74 }))) {
|
||||
&& (!QuestLogIsOpen || !LeftPanel.Contains(MainPanel.position + Displacement { 0, -74 }))) {
|
||||
DrawLevelUpIcon(out);
|
||||
}
|
||||
if (ShowUniqueItemInfoBox) {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ enum class LogPriority {
|
|||
namespace detail {
|
||||
|
||||
template <typename... Args>
|
||||
std::string format(const char *fmt, Args &&... args)
|
||||
std::string format(const char *fmt, Args &&...args)
|
||||
{
|
||||
FMT_TRY
|
||||
{
|
||||
|
|
@ -56,99 +56,99 @@ std::string format(const char *fmt, Args &&... args)
|
|||
} // namespace detail
|
||||
|
||||
template <typename... Args>
|
||||
void Log(const char *fmt, Args &&... args)
|
||||
void Log(const char *fmt, Args &&...args)
|
||||
{
|
||||
auto str = detail::format(fmt, std::forward<Args>(args)...);
|
||||
SDL_Log("%s", str.c_str());
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogVerbose(LogCategory category, const char *fmt, Args &&... args)
|
||||
void LogVerbose(LogCategory category, const char *fmt, Args &&...args)
|
||||
{
|
||||
auto str = detail::format(fmt, std::forward<Args>(args)...);
|
||||
SDL_LogVerbose(static_cast<int>(category), "%s", str.c_str());
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogVerbose(const char *fmt, Args &&... args)
|
||||
void LogVerbose(const char *fmt, Args &&...args)
|
||||
{
|
||||
LogVerbose(defaultCategory, fmt, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogDebug(LogCategory category, const char *fmt, Args &&... args)
|
||||
void LogDebug(LogCategory category, const char *fmt, Args &&...args)
|
||||
{
|
||||
auto str = detail::format(fmt, std::forward<Args>(args)...);
|
||||
SDL_LogDebug(static_cast<int>(category), "%s", str.c_str());
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogDebug(const char *fmt, Args &&... args)
|
||||
void LogDebug(const char *fmt, Args &&...args)
|
||||
{
|
||||
LogDebug(defaultCategory, fmt, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogInfo(LogCategory category, const char *fmt, Args &&... args)
|
||||
void LogInfo(LogCategory category, const char *fmt, Args &&...args)
|
||||
{
|
||||
auto str = detail::format(fmt, std::forward<Args>(args)...);
|
||||
SDL_LogInfo(static_cast<int>(category), "%s", str.c_str());
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogInfo(const char *fmt, Args &&... args)
|
||||
void LogInfo(const char *fmt, Args &&...args)
|
||||
{
|
||||
LogInfo(defaultCategory, fmt, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogWarn(LogCategory category, const char *fmt, Args &&... args)
|
||||
void LogWarn(LogCategory category, const char *fmt, Args &&...args)
|
||||
{
|
||||
auto str = detail::format(fmt, std::forward<Args>(args)...);
|
||||
SDL_LogWarn(static_cast<int>(category), "%s", str.c_str());
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogWarn(const char *fmt, Args &&... args)
|
||||
void LogWarn(const char *fmt, Args &&...args)
|
||||
{
|
||||
LogWarn(defaultCategory, fmt, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogError(LogCategory category, const char *fmt, Args &&... args)
|
||||
void LogError(LogCategory category, const char *fmt, Args &&...args)
|
||||
{
|
||||
auto str = detail::format(fmt, std::forward<Args>(args)...);
|
||||
SDL_LogError(static_cast<int>(category), "%s", str.c_str());
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogError(const char *fmt, Args &&... args)
|
||||
void LogError(const char *fmt, Args &&...args)
|
||||
{
|
||||
LogError(defaultCategory, fmt, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogCritical(LogCategory category, const char *fmt, Args &&... args)
|
||||
void LogCritical(LogCategory category, const char *fmt, Args &&...args)
|
||||
{
|
||||
auto str = detail::format(fmt, std::forward<Args>(args)...);
|
||||
SDL_LogCritical(static_cast<int>(category), "%s", str.c_str());
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogCritical(const char *fmt, Args &&... args)
|
||||
void LogCritical(const char *fmt, Args &&...args)
|
||||
{
|
||||
LogCritical(defaultCategory, fmt, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogMessageV(LogCategory category, LogPriority priority, const char *fmt, Args &&... args)
|
||||
void LogMessageV(LogCategory category, LogPriority priority, const char *fmt, Args &&...args)
|
||||
{
|
||||
auto str = detail::format(fmt, std::forward<Args>(args)...);
|
||||
SDL_LogMessageV(static_cast<int>(category), static_cast<SDL_LogPriority>(priority), "%s", str.c_str());
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void LogMessageV(const char *fmt, Args &&... args)
|
||||
void LogMessageV(const char *fmt, Args &&...args)
|
||||
{
|
||||
LogMessageV(defaultCategory, fmt, std::forward<Args>(args)...);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ void CheckPath(Point startPosition, Point destinationPosition, std::vector<int8_
|
|||
|
||||
for (auto i = 0; i < pathLength; i++) {
|
||||
EXPECT_EQ(pathSteps[i], expectedSteps[i]) << "Path step " << i << " differs from expectation for a path from "
|
||||
<< startPosition << " to " << destinationPosition; // this shouldn't be a requirement but...
|
||||
<< startPosition << " to " << destinationPosition; // this shouldn't be a requirement but...
|
||||
|
||||
// Path directions are all jacked up compared to the Direction enum. Most consumers have their own mapping definition
|
||||
//startPosition += Direction { path[i] - 1 };
|
||||
|
|
|
|||
|
|
@ -132,7 +132,8 @@ TEST(RandomTest, ShiftModDistributionSignCarry)
|
|||
// The Diablo LCG implementation attempts to improve the quality of generated numbers that would only use the low
|
||||
// bits of the LCG output but due to applying this after taking the absolute value this introduces bias. This may
|
||||
// be an inconsistency with the implementation in devilutionx, see the comment for RandomTest_ShiftModDistributionHighBits
|
||||
TEST(RandomTest, ShiftModDistributionLowBits) {
|
||||
TEST(RandomTest, ShiftModDistributionLowBits)
|
||||
{
|
||||
// All the following seeds generate values less than 2^16, so after shifting they give a 0 value
|
||||
constexpr auto maxBound = 65534;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue