Skip to content

Commit 090defa

Browse files
committed
clangformat
1 parent 9f99501 commit 090defa

File tree

9 files changed

+57
-75
lines changed

9 files changed

+57
-75
lines changed

include/SSVOpenHexagon/Utils/Concat.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ struct IsCharArray<const char (&)[N]> : std::true_type
3737
template <typename... Ts>
3838
inline constexpr bool AllConvertibleToStringView =
3939
((std::is_convertible_v<Ts, std::string_view> || IsCharArray<Ts>::value ||
40-
std::is_same_v<Ts, char>)&&...);
40+
std::is_same_v<Ts, char>) &&
41+
...);
4142

4243
template <std::size_t N>
4344
[[nodiscard, gnu::always_inline]] constexpr inline std::size_t getSize(

include/SSVOpenHexagon/Utils/Split.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ template <typename TSplitType = std::string_view>
3636
std::vector<TSplitType> result;
3737

3838
withSplit<TSplitType>([&](TSplitType&& piece)
39-
{ result.emplace_back(std::move(piece)); },
40-
str, delims);
39+
{ result.emplace_back(std::move(piece)); }, str, delims);
4140

4241
return result;
4342
}

src/SSVOpenHexagon/Components/CWall.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ CWall::CWall(const unsigned int sides, const float wallAngleLeft,
2222
const float angleN = angle - div;
2323
const float angleP = angle + div;
2424

25-
const auto vecFromRad = [](const float rad, const float dist) {
26-
return sf::Vector2f{dist * std::cos(rad), dist * std::sin(rad)};
27-
};
25+
const auto vecFromRad = [](const float rad, const float dist)
26+
{ return sf::Vector2f{dist * std::cos(rad), dist * std::sin(rad)}; };
2827

2928
_vertexPositions[0] = centerPos + vecFromRad(angleN, distance);
3029

src/SSVOpenHexagon/Core/HGScripting.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,7 @@ static void waitUntilSImpl(const double mDuration,
312312

313313
void HexagonGame::initLua_MainTimeline()
314314
{
315-
addLuaFn(lua, "t_eval",
316-
[this](const std::string& mCode)
315+
addLuaFn(lua, "t_eval", [this](const std::string& mCode)
317316
{ timeline.append_do([=, this] { Utils::runLuaCode(lua, mCode); }); })
318317
.arg("code")
319318
.doc(
@@ -327,8 +326,7 @@ void HexagonGame::initLua_MainTimeline()
327326
[this] { timeline.append_do([this] { death(true); }); })
328327
.doc("*Add to the main timeline*: kill the player.");
329328

330-
addLuaFn(lua, "t_wait",
331-
[this](double mDuration)
329+
addLuaFn(lua, "t_wait", [this](double mDuration)
332330
{ timeline.append_wait_for_sixths(mDuration); })
333331
.arg("duration")
334332
.doc(
@@ -386,8 +384,7 @@ void HexagonGame::initLua_EventTimeline()
386384
"*Add to the event timeline*: pause the game timer for `$0` "
387385
"seconds.");
388386

389-
addLuaFn(lua, "e_wait",
390-
[this](double mDuration)
387+
addLuaFn(lua, "e_wait", [this](double mDuration)
391388
{ eventTimeline.append_wait_for_sixths(mDuration); })
392389
.arg("duration")
393390
.doc(
@@ -1105,9 +1102,8 @@ void HexagonGame::initLua()
11051102
{
11061103
LuaScripting::init(
11071104
lua, rng, false /* inMenu */, cwManager, levelStatus, status, styleData,
1108-
assets,
1109-
[this](const std::string& filename) -> void { runLuaFile(filename); },
1110-
execScriptPackPathContext,
1105+
assets, [this](const std::string& filename) -> void
1106+
{ runLuaFile(filename); }, execScriptPackPathContext,
11111107
[this]() -> const std::string& { return levelData->packPath; },
11121108
[this]() -> const PackData& { return getPackData(); },
11131109
(window == nullptr) /* headless */);

src/SSVOpenHexagon/Core/HexagonClient.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ template <typename T>
264264
.steamId = steamId, //
265265
.name = name, //
266266
.passwordHash = passwordHash //
267-
} //
267+
} //
268268
);
269269
}
270270

@@ -278,7 +278,7 @@ template <typename T>
278278
.steamId = steamId, //
279279
.name = name, //
280280
.passwordHash = passwordHash //
281-
} //
281+
} //
282282
);
283283
}
284284

@@ -297,7 +297,7 @@ template <typename T>
297297
CTSPDeleteAccount{
298298
.steamId = steamId, //
299299
.passwordHash = passwordHash //
300-
} //
300+
} //
301301
);
302302
}
303303

@@ -310,7 +310,7 @@ template <typename T>
310310
CTSPRequestTopScores{
311311
.loginToken = loginToken, //
312312
.levelValidator = levelValidator //
313-
} //
313+
} //
314314
);
315315
}
316316

@@ -323,7 +323,7 @@ template <typename T>
323323
CTSPRequestOwnScore{
324324
.loginToken = loginToken, //
325325
.levelValidator = levelValidator //
326-
} //
326+
} //
327327
);
328328
}
329329

@@ -337,7 +337,7 @@ template <typename T>
337337
CTSPRequestTopScoresAndOwnScore{
338338
.loginToken = loginToken, //
339339
.levelValidator = levelValidator //
340-
} //
340+
} //
341341
);
342342
}
343343

@@ -350,7 +350,7 @@ template <typename T>
350350
CTSPStartedGame{
351351
.loginToken = loginToken, //
352352
.levelValidator = levelValidator //
353-
} //
353+
} //
354354
);
355355
}
356356

@@ -365,7 +365,7 @@ template <typename T>
365365
CTSPCompressedReplay{
366366
.loginToken = loginToken, //
367367
.compressedReplayFile = compressedReplayFile //
368-
} //
368+
} //
369369
);
370370
}
371371

@@ -377,7 +377,7 @@ template <typename T>
377377
return sendEncrypted( //
378378
CTSPRequestServerStatus{
379379
.loginToken = loginToken, //
380-
} //
380+
} //
381381
);
382382
}
383383

@@ -388,7 +388,7 @@ template <typename T>
388388
return sendEncrypted( //
389389
CTSPReady{
390390
.loginToken = loginToken, //
391-
} //
391+
} //
392392
);
393393
}
394394

src/SSVOpenHexagon/Core/HexagonServer.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ template <typename T>
182182
STCPLoginSuccess{
183183
.loginToken = static_cast<std::uint64_t>(loginToken), //
184184
.loginName = loginName //
185-
} //
185+
} //
186186
);
187187
}
188188

@@ -221,7 +221,7 @@ template <typename T>
221221
STCPTopScores{
222222
.levelValidator = levelValidator, //
223223
.scores = scores //
224-
} //
224+
} //
225225
);
226226
}
227227

@@ -232,7 +232,7 @@ template <typename T>
232232
STCPOwnScore{
233233
.levelValidator = levelValidator, //
234234
.score = score //
235-
} //
235+
} //
236236
);
237237
}
238238

@@ -246,7 +246,7 @@ template <typename T>
246246
.levelValidator = levelValidator, //
247247
.scores = scores, //
248248
.ownScore = ownScore //
249-
} //
249+
} //
250250
);
251251
}
252252

@@ -259,7 +259,7 @@ template <typename T>
259259
.protocolVersion = protocolVersion, //
260260
.gameVersion = gameVersion, //
261261
.supportedLevelValidators = supportedLevelValidators //
262-
} //
262+
} //
263263
);
264264
}
265265

@@ -960,7 +960,7 @@ void HexagonServer::printCTSPDataVerbose(
960960
.steamId = steamId,
961961
.name = name,
962962
.passwordHash = Utils::stringToCharVec(passwordHash) //
963-
} //
963+
} //
964964
);
965965

966966
SSVOH_SLOG << "Successfully registered\n";

src/SSVOpenHexagon/Core/LuaScripting.cpp

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,8 @@ static void initCustomWalls(Lua::LuaContext& lua, CCustomWallManager& cwManager)
284284

285285
addLuaFn(lua, "cw_setVertexPos", //
286286
[&cwManager](
287-
CCustomWallHandle cwHandle, int vertexIndex, float x, float y) {
288-
cwManager.setVertexPos(cwHandle, vertexIndex, sf::Vector2f{x, y});
289-
})
287+
CCustomWallHandle cwHandle, int vertexIndex, float x, float y)
288+
{ cwManager.setVertexPos(cwHandle, vertexIndex, sf::Vector2f{x, y}); })
290289
.arg("cwHandle")
291290
.arg("vertexIndex")
292291
.arg("x")
@@ -297,9 +296,8 @@ static void initCustomWalls(Lua::LuaContext& lua, CCustomWallManager& cwManager)
297296

298297
addLuaFn(lua, "cw_moveVertexPos", //
299298
[&cwManager](
300-
CCustomWallHandle cwHandle, int vertexIndex, float x, float y) {
301-
cwManager.moveVertexPos(cwHandle, vertexIndex, sf::Vector2f{x, y});
302-
})
299+
CCustomWallHandle cwHandle, int vertexIndex, float x, float y)
300+
{ cwManager.moveVertexPos(cwHandle, vertexIndex, sf::Vector2f{x, y}); })
303301
.arg("cwHandle")
304302
.arg("vertexIndex")
305303
.arg("offsetX")
@@ -309,9 +307,8 @@ static void initCustomWalls(Lua::LuaContext& lua, CCustomWallManager& cwManager)
309307
"position of its vertex with index `$1`.");
310308

311309
addLuaFn(lua, "cw_moveVertexPos4Same", //
312-
[&cwManager](CCustomWallHandle cwHandle, float x, float y) {
313-
cwManager.moveVertexPos4Same(cwHandle, sf::Vector2f{x, y});
314-
})
310+
[&cwManager](CCustomWallHandle cwHandle, float x, float y)
311+
{ cwManager.moveVertexPos4Same(cwHandle, sf::Vector2f{x, y}); })
315312
.arg("cwHandle")
316313
.arg("offsetX")
317314
.arg("offsetY")
@@ -1150,16 +1147,14 @@ static void initStyleControl(Lua::LuaContext& lua, StyleData& styleData)
11501147
"Set the color of the center polygon to match the style color with "
11511148
"index `$0`.");
11521149

1153-
const auto colorToTuple = [](const sf::Color& c) {
1154-
return std::tuple<int, int, int, int>{c.r, c.g, c.b, c.a};
1155-
};
1150+
const auto colorToTuple = [](const sf::Color& c)
1151+
{ return std::tuple<int, int, int, int>{c.r, c.g, c.b, c.a}; };
11561152

11571153
const auto sdColorGetter =
11581154
[&lua, &styleData, &colorToTuple](
11591155
const char* name, const char* docName, auto pmf)
11601156
{
1161-
addLuaFn(lua, name,
1162-
[&styleData, colorToTuple, pmf]
1157+
addLuaFn(lua, name, [&styleData, colorToTuple, pmf]
11631158
{ return colorToTuple((styleData.*pmf)()); })
11641159
.doc(Utils::concat("Return the current ", docName,
11651160
" color computed by the level style."));
@@ -1393,9 +1388,8 @@ static void initShaders(Lua::LuaContext& lua, HGAssets& assets,
13931388
const float a, const float b)
13941389
{
13951390
withValidShaderId("shdr_setUniformFVec2", shaderId,
1396-
[&](sf::Shader& shader) {
1397-
shader.setUniformUnsafe(name, sf::Glsl::Vec2{a, b});
1398-
});
1391+
[&](sf::Shader& shader)
1392+
{ shader.setUniformUnsafe(name, sf::Glsl::Vec2{a, b}); });
13991393
})
14001394
.arg("shaderId")
14011395
.arg("name")
@@ -1410,9 +1404,8 @@ static void initShaders(Lua::LuaContext& lua, HGAssets& assets,
14101404
const float a, const float b, const float c)
14111405
{
14121406
withValidShaderId("shdr_setUniformFVec3", shaderId,
1413-
[&](sf::Shader& shader) {
1414-
shader.setUniformUnsafe(name, sf::Glsl::Vec3{a, b, c});
1415-
});
1407+
[&](sf::Shader& shader)
1408+
{ shader.setUniformUnsafe(name, sf::Glsl::Vec3{a, b, c}); });
14161409
})
14171410
.arg("shaderId")
14181411
.arg("name")
@@ -1428,9 +1421,8 @@ static void initShaders(Lua::LuaContext& lua, HGAssets& assets,
14281421
const float a, const float b, const float c, const float d)
14291422
{
14301423
withValidShaderId("shdr_setUniformFVec4", shaderId,
1431-
[&](sf::Shader& shader) {
1432-
shader.setUniformUnsafe(name, sf::Glsl::Vec4{a, b, c, d});
1433-
});
1424+
[&](sf::Shader& shader)
1425+
{ shader.setUniformUnsafe(name, sf::Glsl::Vec4{a, b, c, d}); });
14341426
})
14351427
.arg("shaderId")
14361428
.arg("name")
@@ -1464,9 +1456,8 @@ static void initShaders(Lua::LuaContext& lua, HGAssets& assets,
14641456
const int a, const int b)
14651457
{
14661458
withValidShaderId("shdr_setUniformIVec2", shaderId,
1467-
[&](sf::Shader& shader) {
1468-
shader.setUniformUnsafe(name, sf::Glsl::Ivec2{a, b});
1469-
});
1459+
[&](sf::Shader& shader)
1460+
{ shader.setUniformUnsafe(name, sf::Glsl::Ivec2{a, b}); });
14701461
})
14711462
.arg("shaderId")
14721463
.arg("name")
@@ -1481,9 +1472,8 @@ static void initShaders(Lua::LuaContext& lua, HGAssets& assets,
14811472
const int a, const int b, const int c)
14821473
{
14831474
withValidShaderId("shdr_setUniformIVec3", shaderId,
1484-
[&](sf::Shader& shader) {
1485-
shader.setUniformUnsafe(name, sf::Glsl::Ivec3{a, b, c});
1486-
});
1475+
[&](sf::Shader& shader)
1476+
{ shader.setUniformUnsafe(name, sf::Glsl::Ivec3{a, b, c}); });
14871477
})
14881478
.arg("shaderId")
14891479
.arg("name")

src/SSVOpenHexagon/Online/Database.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ constexpr int tokenValiditySeconds = 3600;
217217

218218
auto query = Impl::getStorage().get_all<LoginToken>();
219219

220-
query.erase(std::remove_if(query.begin(), query.end(),
221-
[&](const LoginToken& lt)
222-
{ return isLoginTokenTimestampValid(lt); }),
220+
query.erase(
221+
std::remove_if(query.begin(), query.end(), [&](const LoginToken& lt)
222+
{ return isLoginTokenTimestampValid(lt); }),
223223
std::end(query));
224224

225225
return query;

0 commit comments

Comments
 (0)