Skip to content

Commit

Permalink
Adapt to newest SFML
Browse files Browse the repository at this point in the history
  • Loading branch information
vittorioromeo committed Jun 25, 2024
1 parent 12ef5e6 commit a2e16cd
Show file tree
Hide file tree
Showing 64 changed files with 1,484 additions and 1,236 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
cp /mingw64/bin/libwinpthread-1.dll _RELEASE
cp /mingw64/bin/libstdc++-6.dll _RELEASE
cp /mingw64/bin/libgcc_s_seh-1.dll _RELEASE
cp /mingw64/bin/libopenal-1.dll _RELEASE
cp _RELEASE/*.dll build/test
- name: Upload artifacts
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ set(SFML_ENABLE_PCH true)
CPMAddPackage(
NAME SFML
GITHUB_REPOSITORY vittorioromeo/SFML
GIT_TAG 5c6d2ef623ca07fc528d794b763bbf67395d4b90
GIT_TAG 33a4e38c2df3406bc85864f59d0674a9d0bd7482
)

set_target_properties(sfml-system PROPERTIES UNITY_BUILD ON)
Expand Down Expand Up @@ -360,7 +360,7 @@ vrm_cmake_include_vc_dependency_once(vc_detection)
# Targets
# -----------------------------------------------------------------------------

if(WIN32 AND "${vrm_cmake_build_type_lower}" STREQUAL "release")
if(WIN32 AND "${vrm_cmake_build_type_lower}" MATCHES "rel")
set(SSVOH_BUILD_WIN32_CONSOLE TRUE)
else()
set(SSVOH_BUILD_WIN32_CONSOLE FALSE)
Expand Down
Binary file modified _RELEASE/discord_game_sdk.dll
Binary file not shown.
Binary file modified _RELEASE/sdkencryptedappticket64.dll
Binary file not shown.
Binary file modified _RELEASE/sdkencryptedappticket64.lib
Binary file not shown.
Binary file modified _RELEASE/steam_api64.dll
Binary file not shown.
Binary file modified _RELEASE/steam_api64.lib
Binary file not shown.
1 change: 0 additions & 1 deletion build/copylibs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ function copyTo
cp /c/msys64/mingw64/bin/libstdc++-6.dll $1 &
cp /c/msys64/mingw64/bin/libgcc_s_seh-1.dll $1 &
cp /c/msys64/mingw64/bin/libwinpthread-1.dll $1 &
cp /c/msys64/mingw64/bin/libopenal-1.dll $1 &
}

copyTo "../_RELEASE"
Expand Down
13 changes: 11 additions & 2 deletions build/make_debug_client_win10_msys_1_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

set -e

echo ""
echo ""
echo "--------------------------------------------------------------------"
echo "| BUILDING WITH NINJA |"
echo "--------------------------------------------------------------------"
echo ""

ninja

echo ""
echo ""
echo "--------------------------------------------------------------------"
Expand All @@ -11,14 +20,14 @@ echo ""

./copylibs.sh
(cd ./test && rm -Rf ./Packs/ && ln -sf ../../_RELEASE/Packs .)
(cd ./test && rm -Rf ./Replays/ && ln -sf ../../_RELEASE/Replays .)
echo "Done."

echo ""
echo ""
echo "--------------------------------------------------------------------"
echo "| BUILDING WITH NINJA |"
echo "| BUILDING TESTS WITH NINJA |"
echo "--------------------------------------------------------------------"
echo ""

ninja
ninja check
2 changes: 0 additions & 2 deletions buildrel/copylibs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
function copyTo
{
cp ./_deps/zlib-build/libzlib.dll $1 &
cp /c/msys64/mingw64/bin/libssp-0.dll $1 &
cp /c/msys64/mingw64/bin/libstdc++-6.dll $1 &
cp /c/msys64/mingw64/bin/libgcc_s_seh-1.dll $1 &
cp /c/msys64/mingw64/bin/libwinpthread-1.dll $1 &
cp /c/msys64/mingw64/bin/libopenal-1.dll $1 &
}

copyTo "../_RELEASE"
Expand Down
13 changes: 11 additions & 2 deletions buildrel/make_release_client_win10_msys_1_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

set -e

echo ""
echo ""
echo "--------------------------------------------------------------------"
echo "| BUILDING WITH NINJA |"
echo "--------------------------------------------------------------------"
echo ""

ninja

echo ""
echo ""
echo "--------------------------------------------------------------------"
Expand All @@ -11,14 +20,14 @@ echo ""

./copylibs.sh
(cd ./test && rm -Rf ./Packs/ && ln -sf ../../_RELEASE/Packs .)
(cd ./test && rm -Rf ./Replays/ && ln -sf ../../_RELEASE/Replays .)
echo "Done."

echo ""
echo ""
echo "--------------------------------------------------------------------"
echo "| BUILDING WITH NINJA |"
echo "| BUILDING TESTS WITH NINJA |"
echo "--------------------------------------------------------------------"
echo ""

ninja
ninja check
8 changes: 2 additions & 6 deletions include/SSVOpenHexagon/Core/HexagonGame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@

#include <SSVStart/GameSystem/GameSystem.hpp>
#include <SSVStart/Camera/Camera.hpp>
#include <SSVStart/VertexVector/VertexVector.hpp>

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

#include <SFML/Graphics/Color.hpp>
#include <SFML/Graphics/Drawable.hpp>
#include <SFML/Graphics/Font.hpp>
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Graphics/RenderTexture.hpp>
Expand Down Expand Up @@ -522,10 +520,8 @@ class HexagonGame
const std::string& mPackId, const std::string& mId);

// Graphics-related methods
void render(sf::Drawable& mDrawable,
const sf::RenderStates& mStates = sf::RenderStates::Default);

void render(const sf::Sprite& mSprite, const sf::Texture& mTexture);
template <typename... Ts>
void render(Ts&&... xs);

// Setters
void setSides(unsigned int mSides);
Expand Down
3 changes: 0 additions & 3 deletions include/SSVOpenHexagon/Core/MenuGame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <SSVUtils/Core/Common/Frametime.hpp>

#include <SFML/Graphics/Color.hpp>
#include <SFML/Graphics/Drawable.hpp>
#include <SFML/Graphics/Font.hpp>
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Graphics/Sprite.hpp>
Expand Down Expand Up @@ -299,8 +298,6 @@ class MenuGame
[[nodiscard]] bool mouseLeftRisingEdge() const;

void draw();
void render(sf::Drawable& mDrawable);
void render(const sf::Sprite& mSprite, const sf::Texture& mTexture);

// Helper functions
[[nodiscard]] float getFPSMult() const;
Expand Down
1 change: 0 additions & 1 deletion include/SSVOpenHexagon/Global/PCH.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@
#include <SSVStart/Utils/Input.hpp>
#include <SSVStart/Utils/SFML.hpp>
#include <SSVStart/Utils/Vector2.hpp>
#include <SSVStart/VertexVector/VertexVector.hpp>

//
//
Expand Down
7 changes: 3 additions & 4 deletions include/SSVOpenHexagon/Utils/FastVertexVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include <SFML/Graphics/Color.hpp>
#include <SFML/Graphics/PrimitiveType.hpp>
#include <SFML/Graphics/Drawable.hpp>
#include <SFML/Graphics/RenderTarget.hpp>
#include <SFML/Graphics/Vertex.hpp>

Expand All @@ -21,7 +20,7 @@
namespace hg::Utils {

template <sf::PrimitiveType TPrimitive>
struct FastVertexVector : public sf::Drawable
struct FastVertexVector
{
private:
union VertexUnion
Expand Down Expand Up @@ -118,8 +117,8 @@ struct FastVertexVector : public sf::Drawable
((new (&_data[_size++]._v) sf::Vertex{positions, color}), ...);
}

void draw(sf::RenderTarget& mRenderTarget,
sf::RenderStates mRenderStates) const override
void draw(
sf::RenderTarget& mRenderTarget, sf::RenderStates mRenderStates) const
{
if (_data == nullptr) [[unlikely]]
{
Expand Down
1 change: 0 additions & 1 deletion prepare_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ cp ./_RELEASE/SSVOpenHexagon.exe ./_PREPARED_RELEASE
cp ./_RELEASE/SSVOpenHexagon-Console.exe ./_PREPARED_RELEASE

cp ./_RELEASE/libzlib.dll ./_PREPARED_RELEASE
cp ./_RELEASE/libopenal-1.dll ./_PREPARED_RELEASE
cp ./_RELEASE/steam_api64.dll ./_PREPARED_RELEASE
cp ./_RELEASE/discord_game_sdk.dll ./_PREPARED_RELEASE
cp ./_RELEASE/sdkencryptedappticket64.dll ./_PREPARED_RELEASE
Expand Down
3 changes: 2 additions & 1 deletion public/discord/achievement_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ namespace discord {

class AchievementEvents final {
public:
static void OnUserAchievementUpdate(void* callbackData, DiscordUserAchievement* userAchievement)
static void DISCORD_CALLBACK OnUserAchievementUpdate(void* callbackData,
DiscordUserAchievement* userAchievement)
{
auto* core = reinterpret_cast<Core*>(callbackData);
if (!core) {
Expand Down
14 changes: 7 additions & 7 deletions public/discord/activity_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace discord {

class ActivityEvents final {
public:
static void OnActivityJoin(void* callbackData, char const* secret)
static void DISCORD_CALLBACK OnActivityJoin(void* callbackData, char const* secret)
{
auto* core = reinterpret_cast<Core*>(callbackData);
if (!core) {
Expand All @@ -24,7 +24,7 @@ class ActivityEvents final {
module.OnActivityJoin(static_cast<const char*>(secret));
}

static void OnActivitySpectate(void* callbackData, char const* secret)
static void DISCORD_CALLBACK OnActivitySpectate(void* callbackData, char const* secret)
{
auto* core = reinterpret_cast<Core*>(callbackData);
if (!core) {
Expand All @@ -35,7 +35,7 @@ class ActivityEvents final {
module.OnActivitySpectate(static_cast<const char*>(secret));
}

static void OnActivityJoinRequest(void* callbackData, DiscordUser* user)
static void DISCORD_CALLBACK OnActivityJoinRequest(void* callbackData, DiscordUser* user)
{
auto* core = reinterpret_cast<Core*>(callbackData);
if (!core) {
Expand All @@ -46,10 +46,10 @@ class ActivityEvents final {
module.OnActivityJoinRequest(*reinterpret_cast<User const*>(user));
}

static void OnActivityInvite(void* callbackData,
EDiscordActivityActionType type,
DiscordUser* user,
DiscordActivity* activity)
static void DISCORD_CALLBACK OnActivityInvite(void* callbackData,
EDiscordActivityActionType type,
DiscordUser* user,
DiscordActivity* activity)
{
auto* core = reinterpret_cast<Core*>(callbackData);
if (!core) {
Expand Down
1 change: 0 additions & 1 deletion public/discord/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include <functional>
#include <vector>
#include <utility>

namespace discord {

Expand Down
Loading

0 comments on commit a2e16cd

Please sign in to comment.