Skip to content

Commit

Permalink
Major cleanup/refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
vittorioromeo committed Jun 30, 2024
1 parent 27675ba commit 2b7d9f7
Show file tree
Hide file tree
Showing 59 changed files with 469 additions and 662 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ set(SFML_ENABLE_PCH true)
CPMAddPackage(
NAME SFML
GITHUB_REPOSITORY vittorioromeo/SFML
GIT_TAG 7b50ac7b7a38b9fd005393887b07d53ed6f04036
GIT_TAG eed43ab7b8339c0c64ec55c509d825b9a8442346
)

set_target_properties(sfml-system PROPERTIES UNITY_BUILD ON)
set_target_properties(sfml-window PROPERTIES UNITY_BUILD ON)
set_target_properties(sfml-graphics PROPERTIES UNITY_BUILD ON)
set_target_properties(sfml-audio PROPERTIES UNITY_BUILD ON)
set_target_properties(sfml-network PROPERTIES UNITY_BUILD ON)
# set_target_properties(sfml-system PROPERTIES UNITY_BUILD ON)
# set_target_properties(sfml-window PROPERTIES UNITY_BUILD ON)
# set_target_properties(sfml-graphics PROPERTIES UNITY_BUILD ON)
# set_target_properties(sfml-audio PROPERTIES UNITY_BUILD ON)
# set_target_properties(sfml-network PROPERTIES UNITY_BUILD ON)

#
#
Expand Down
242 changes: 1 addition & 241 deletions _RELEASE/luadocs.md

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions build/make_debug_client_win10_msys_0_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ cmake .. -G"Ninja" \
-fuse-ld=lld \
-Og -g3 -fno-omit-frame-pointer \
-Wall -Wextra -Wpedantic -Wno-braced-scalar-init \
-Wno-pragmas -Wno-missing-field-initializers \
-Wno-pragmas -Wno-missing-field-initializers -Wno-array-bounds -Wno-restrict \
-Wno-stringop-overflow \
-D_GLIBCXX_ASSERTIONS=1 -D_FORTIFY_SOURCE=3 \
-fstack-protector -Wno-pragmas \
-frounding-math -fsignaling-nans -ffloat-store -ffp-contract=off \
-DSFML_ENABLE_LIFETIME_TRACKING=1"
-DSFML_ENABLE_LIFETIME_TRACKING=1" \
-DCMAKE_C_FLAGS="-Wno-attributes"
11 changes: 7 additions & 4 deletions build/make_debug_client_win10_msys_clang_0_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ cmake .. -G"Ninja" \
-DCMAKE_CXX_COMPILER="clang++" \
-DCMAKE_CXX_FLAGS="\
-fuse-ld=lld \
-ftime-trace \
-Og -g3 -fno-omit-frame-pointer \
-Wall -Wextra -Wpedantic -Wno-braced-scalar-init \
-Wno-pragmas -Wno-missing-field-initializers -Wno-array-bounds -Wno-restrict \
-Wno-stringop-overflow \
-Wno-pragmas -Wno-missing-field-initializers -Wno-array-bounds \
-D_GLIBCXX_ASSERTIONS=1 -D_FORTIFY_SOURCE=3 \
-fstack-protector -Wno-pragmas \
-frounding-math -fsignaling-nans -ffloat-store -ffp-contract=off \
-frounding-math -ffp-contract=off \
-Wno-unknown-warning-option \
-Wno-deprecated-non-prototype -Wno-unknown-attributes -Wno-maybe-uninitialized \
-Wno-unused-command-line-argument \
-DSFML_ENABLE_LIFETIME_TRACKING=1" \
-DCMAKE_C_FLAGS="-Wno-attributes"
-DCMAKE_C_FLAGS="-Wno-deprecated-non-prototype -Wno-unknown-attributes"
3 changes: 2 additions & 1 deletion buildrel/make_release_client_win10_msys_0_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ cmake .. -G"Ninja" \
-Wno-stringop-overflow \
-O3 -DNDEBUG -g3 \
-frounding-math -fsignaling-nans -ffloat-store -ffp-contract=off \
-ffold-simple-inlines -fimplicit-constexpr"
-ffold-simple-inlines -fimplicit-constexpr" \
-DCMAKE_C_FLAGS="-Wno-attributes"
4 changes: 0 additions & 4 deletions include/SSVOpenHexagon/Components/CCustomWall.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@

#pragma once

#include "SSVOpenHexagon/Components/CCustomWallHandle.hpp"

#include "SSVOpenHexagon/Utils/PointInPolygon.hpp"
#include "SSVOpenHexagon/Utils/FastVertexVector.hpp"

#include <SSVUtils/Core/Common/Frametime.hpp>

#include <SFML/System/Vector2.hpp>
#include <SFML/Graphics/Color.hpp>

Expand Down
2 changes: 1 addition & 1 deletion include/SSVOpenHexagon/Components/CCustomWallManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class CCustomWallManager
void draw(Utils::FastVertexVectorTris& wallQuads);

[[nodiscard]] bool handleCollision(
const int movement, const float radius, CPlayer& mPlayer, ssvu::FT mFT);
const int movement, const float radius, CPlayer& mPlayer, float mFT);

[[nodiscard]] std::size_t count() const noexcept
{
Expand Down
13 changes: 5 additions & 8 deletions include/SSVOpenHexagon/Components/CPlayer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
#include "SSVOpenHexagon/Utils/Ticker.hpp"
#include "SSVOpenHexagon/Utils/FastVertexVector.hpp"

#include <SSVUtils/Core/Common/Frametime.hpp>
#include <SSVStart/Utils/Vector2.hpp>

#include <SFML/System/Vector2.hpp>
#include <SFML/Graphics/Color.hpp>

Expand Down Expand Up @@ -76,7 +73,7 @@ class CPlayer
[[nodiscard]] bool checkWallCollisionEscape(
const Wall& wall, sf::Vector2f& pos, const float radiusSquared);

void updateTriangleWidthTransition(const bool focused, const ssvu::FT ft);
void updateTriangleWidthTransition(const bool focused, const float ft);

public:
explicit CPlayer(const sf::Vector2f& pos, const float swapCooldown,
Expand All @@ -103,10 +100,10 @@ class CPlayer

void kill(const bool fatal);

void update(const bool focused, const bool swapEnabled, const ssvu::FT ft);
void update(const bool focused, const bool swapEnabled, const float ft);

void updateInputMovement(const float movementDir,
const float playerSpeedMult, const bool focused, const ssvu::FT ft);
const float playerSpeedMult, const bool focused, const float ft);

void resetSwap(const float swapCooldown);

Expand All @@ -127,10 +124,10 @@ class CPlayer

[[nodiscard]] bool push(const int movementDir, const float radius,
const CWall& wall, const sf::Vector2f& mCenterPos,
const float radiusSquared, ssvu::FT ft);
const float radiusSquared, float ft);

[[nodiscard]] bool push(const int movementDir, const float radius,
const hg::CCustomWall& wall, const float radiusSquared, ssvu::FT ft);
const hg::CCustomWall& wall, const float radiusSquared, float ft);

[[nodiscard]] bool getJustSwapped() const noexcept;

Expand Down
10 changes: 5 additions & 5 deletions include/SSVOpenHexagon/Components/CWall.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class CWall
bool _killed;

void moveTowardsCenter(const float wallSpawnDist, const float radius,
const sf::Vector2f& centerPos, const ssvu::FT ft);
const sf::Vector2f& centerPos, const float ft);

void moveCurve(const sf::Vector2f& centerPos, const ssvu::FT ft);
void moveCurve(const sf::Vector2f& centerPos, const float ft);

public:
explicit CWall(const unsigned int sides, const float wallAngleLeft,
Expand All @@ -39,7 +39,7 @@ class CWall
const SpeedData& speed, const SpeedData& curve, const float hueMod);

void update(const float wallSpawnDist, const float radius,
const sf::Vector2f& centerPos, const ssvu::FT ft);
const sf::Vector2f& centerPos, const float ft);

[[gnu::always_inline]] void moveVertexAlongCurveImpl(sf::Vector2f& vertex,
const sf::Vector2f& centerPos, const float xSin,
Expand All @@ -52,14 +52,14 @@ class CWall
}

[[gnu::always_inline]] float getCurveRadians(
const ssvu::FT ft) const noexcept
const float ft) const noexcept
{
constexpr float divBy60 = 1.f / 60.f;
return _curve._speed * divBy60 * ft;
}

[[gnu::always_inline]] void moveVertexAlongCurve(sf::Vector2f& vertex,
const sf::Vector2f& centerPos, const ssvu::FT ft) const noexcept
const sf::Vector2f& centerPos, const float ft) const noexcept
{
const float rad = getCurveRadians(ft);

Expand Down
4 changes: 1 addition & 3 deletions include/SSVOpenHexagon/Components/SpeedData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#pragma once

#include <SSVUtils/Core/Common/Frametime.hpp>

namespace hg {

struct SpeedData
Expand All @@ -25,7 +23,7 @@ struct SpeedData
_pingPong{pingPong ? -1.f : 1.f}
{}

void update(const ssvu::FT ft) noexcept
void update(const float ft) noexcept
{
if (_accel == 0.f)
{
Expand Down
1 change: 0 additions & 1 deletion include/SSVOpenHexagon/Core/CustomTimelineManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "SSVOpenHexagon/Utils/Clock.hpp"

#include <chrono>
#include <vector>

namespace hg {
Expand Down
1 change: 0 additions & 1 deletion include/SSVOpenHexagon/Core/HGStatus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <SFML/Graphics/Color.hpp>

#include <array>
#include <chrono>
#include <cstddef>
#include <optional>
#include <string>
Expand Down
2 changes: 0 additions & 2 deletions include/SSVOpenHexagon/Core/HexagonClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
#include <SFML/Network/TcpSocket.hpp>
#include <SFML/Network/Packet.hpp>

#include <chrono>
#include <deque>
#include <list>
#include <optional>
#include <sstream>
#include <unordered_set>
Expand Down
31 changes: 15 additions & 16 deletions include/SSVOpenHexagon/Core/HexagonGame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <SSVStart/GameSystem/GameSystem.hpp>
#include <SSVStart/Camera/Camera.hpp>

#include <SSVUtils/Core/Common/Frametime.hpp>
#include <SSVUtils/Timeline/Timeline.hpp>

#include <SFML/Graphics/Color.hpp>
Expand Down Expand Up @@ -356,32 +355,32 @@ class HexagonGame
void advanceByTicks(const int nTicks);

// Update methods
void update(ssvu::FT mFT, const float timescale);
void update(float mFT, const float timescale);
void updateInput();
void updateInput_UpdateJoystickControls();
void updateInput_UpdateTouchControls();
void updateInput_ResolveInputImplToInputMovement();
void updateInput_RecordCurrentInputToLastReplayData();
void updateWalls(ssvu::FT mFT);
void updateWalls(float mFT);
void updateIncrement();
void updateEvents(ssvu::FT mFT);
void updateLevel(ssvu::FT mFT);
void updateEvents(float mFT);
void updateLevel(float mFT);
void updateCustomTimelines();
void updateCustomWalls(ssvu::FT mFT);
void updatePulse(ssvu::FT mFT);
void updateCustomWalls(float mFT);
void updatePulse(float mFT);
void refreshPulse();
void updateBeatPulse(ssvu::FT mFT);
void updateBeatPulse(float mFT);
void refreshBeatPulse();
void updateRotation(ssvu::FT mFT);
void updateCameraShake(ssvu::FT mFT);
void updateFlash(ssvu::FT mFT);
void updatePulse3D(ssvu::FT mFT);
void updateText(ssvu::FT mFT);
void updateRotation(float mFT);
void updateCameraShake(float mFT);
void updateFlash(float mFT);
void updatePulse3D(float mFT);
void updateText(float mFT);
void updateKeyIcons();
void updateLevelInfo();
void updateParticles(ssvu::FT mFT);
void updateTrailParticles(ssvu::FT mFT);
void updateSwapParticles(ssvu::FT mFT);
void updateParticles(float mFT);
void updateTrailParticles(float mFT);
void updateSwapParticles(float mFT);

// Post update methods
void postUpdate();
Expand Down
1 change: 0 additions & 1 deletion include/SSVOpenHexagon/Core/HexagonServer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <SFML/Network/TcpSocket.hpp>
#include <SFML/Network/UdpSocket.hpp>

#include <chrono>
#include <list>
#include <optional>
#include <sstream>
Expand Down
2 changes: 0 additions & 2 deletions include/SSVOpenHexagon/Core/LeaderboardCache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
#include "SSVOpenHexagon/Utils/Clock.hpp"

#include <string>
#include <sstream>
#include <vector>
#include <chrono>
#include <unordered_map>
#include <optional>

Expand Down
7 changes: 2 additions & 5 deletions include/SSVOpenHexagon/Core/MenuGame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

#include <SSVMenuSystem/SSVMenuSystem.hpp>

#include <SSVUtils/Core/Common/Frametime.hpp>

#include <SFML/Graphics/Color.hpp>
#include <SFML/Graphics/Font.hpp>
#include <SFML/Graphics/RectangleShape.hpp>
Expand All @@ -31,7 +29,6 @@
#include <SFML/System/Vector2.hpp>

#include <array>
#include <chrono>
#include <cctype>
#include <functional>
#include <optional>
Expand Down Expand Up @@ -208,7 +205,7 @@ class MenuGame
LevelStatus levelStatus;
int ignoreInputs;

void update(ssvu::FT mFT);
void update(float mFT);
void setIndex(int mIdx);
void refreshCamera();
void reloadAssets(const bool reloadEntirePack);
Expand Down Expand Up @@ -455,7 +452,7 @@ class MenuGame
void calcPackChangeScrollFold(const float mLevelListHeight);
void calcPackChangeScrollStretch(const float mLevelListHeight);
void quickPackFoldStretch();
void scrollLevelListToTargetY(ssvu::FT mFT);
void scrollLevelListToTargetY(float mFT);

void checkWindowTopScroll(
const float scroll, std::function<void(const float)> action);
Expand Down
1 change: 0 additions & 1 deletion include/SSVOpenHexagon/Data/LevelData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#pragma once

#include <set>
#include <string>
#include <unordered_map>
#include <vector>
Expand Down
4 changes: 1 addition & 3 deletions include/SSVOpenHexagon/Data/StyleData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#include "SSVOpenHexagon/Data/ColorData.hpp"
#include "SSVOpenHexagon/Data/CapColor.hpp"

#include <SSVUtils/Core/Common/Frametime.hpp>

#include <SFML/Graphics/Color.hpp>
#include <SFML/System/Vector2.hpp>

Expand Down Expand Up @@ -106,7 +104,7 @@ class StyleData
explicit StyleData();
explicit StyleData(const ssvuj::Obj& mRoot);

void update(ssvu::FT mFT, float mMult = 1.f);
void update(float mFT, float mMult = 1.f);

void computeColors();

Expand Down
3 changes: 1 addition & 2 deletions include/SSVOpenHexagon/Global/Assets.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <optional>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

namespace sf {
Expand All @@ -23,8 +24,6 @@ namespace ssvu::FileSystem {
class Path;
}

namespace ssvufs = ssvu::FileSystem;

namespace hg {

namespace Steam {
Expand Down
3 changes: 3 additions & 0 deletions include/SSVOpenHexagon/Global/Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include "SSVOpenHexagon/Core/Joystick.hpp"
#include "SSVOpenHexagon/Utils/Casts.hpp"

#include <SFML/Window/Mouse.hpp>
#include <SFML/Window/Keyboard.hpp>

#include <vector>
#include <string>
#include <array>
Expand Down
1 change: 1 addition & 0 deletions include/SSVOpenHexagon/Global/Imgui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace sf {
class Event;
class RenderTarget;
class RenderWindow;
class Window;
} // namespace sf

namespace hg::Imgui {
Expand Down
Loading

0 comments on commit 2b7d9f7

Please sign in to comment.