From 26d403c9b73785e3b5dd1adc9919219a8765f409 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 3 Apr 2024 14:37:01 +0200 Subject: [PATCH] [sfml] Update to 2.6.1 on macOS, require VS 2022 on Windows, update README.md for Windows --- spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp | 2 +- spine-sdl/src/spine-sdl-cpp.cpp | 4 ++-- spine-sfml/c/CMakeLists.txt | 4 ++-- spine-sfml/c/README.md | 6 +++--- spine-sfml/cpp/CMakeLists.txt | 10 ++++++---- spine-sfml/cpp/README.md | 10 +++++----- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp index 095b23f20..32bb5e4aa 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp @@ -1370,7 +1370,7 @@ Animation *SkeletonJson::readAnimation(Json *root, SkeletonData *skeletonData) { int frames = timelineMap->_size; if (strcmp(timelineName, "reset") == 0) { PhysicsConstraintResetTimeline *timeline = new (__FILE__, __LINE__) PhysicsConstraintResetTimeline(frames, index); - for (int frame = 0; keyMap != nullptr; keyMap = keyMap->_next, frame++) { + for (frame = 0; keyMap != nullptr; keyMap = keyMap->_next, frame++) { timeline->setFrame(frame, Json::getFloat(keyMap, "time", 0)); } timelines.add(timeline); diff --git a/spine-sdl/src/spine-sdl-cpp.cpp b/spine-sdl/src/spine-sdl-cpp.cpp index 9c213aec4..841168656 100644 --- a/spine-sdl/src/spine-sdl-cpp.cpp +++ b/spine-sdl/src/spine-sdl-cpp.cpp @@ -51,11 +51,11 @@ SkeletonDrawable::~SkeletonDrawable() { delete skeleton; } -void SkeletonDrawable::update(float delta) { +void SkeletonDrawable::update(float delta, Physics physics) { animationState->update(delta); animationState->apply(*skeleton); skeleton->update(delta); - skeleton->updateWorldTransform(Physics_Update); + skeleton->updateWorldTransform(physics); } void SkeletonDrawable::draw(SDL_Renderer *renderer) { diff --git a/spine-sfml/c/CMakeLists.txt b/spine-sfml/c/CMakeLists.txt index f1fa62258..dcc33a080 100644 --- a/spine-sfml/c/CMakeLists.txt +++ b/spine-sfml/c/CMakeLists.txt @@ -5,8 +5,8 @@ set(DEPS_DIR "${CMAKE_CURRENT_LIST_DIR}/dependencies/") if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_OSX_ARCHITECTURES x86_64) set(ONLY_ACTIVE_ARCH NO) - set(SFML_URL "https://www.sfml-dev.org/files/SFML-2.5.1-macOS-clang.tar.gz") - set(SFML_DIR ${DEPS_DIR}/SFML-2.5.1-macos-clang) + set(SFML_URL "https://www.sfml-dev.org/files/SFML-2.6.1-macOS-clang-64-bit.tar.gz") + set(SFML_DIR ${DEPS_DIR}/SFML-2.6.1-macOS-clang-64-bit) if (NOT EXISTS "${SFML_DIR}") message("Downloading SFML for Mac OS X") file(DOWNLOAD "${SFML_URL}" "${DEPS_DIR}/sfml.tar.gz") diff --git a/spine-sfml/c/README.md b/spine-sfml/c/README.md index 4fabf8cfa..dce1e02ce 100644 --- a/spine-sfml/c/README.md +++ b/spine-sfml/c/README.md @@ -30,14 +30,14 @@ See the [Spine Runtimes documentation](http://esotericsoftware.com/spine-documen The Spine SFML example works on Windows, Linux and Mac OS X. ### Windows -1. Install [Visual Studio 2015 Community](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx). Make sure you install support for C++ as well as th Windows SDK for XP/7/8. +1. Install [Visual Studio 2022 Community](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx). Make sure you install support for C++ as well as th Windows SDK for XP/7/8. 2. Install CMake via the [Windows installer package](https://cmake.org/download/). 3. Download the Spine Runtimes repository using git (`git clone https://github.com/esotericsoftware/spine-runtimes`) or download it as a zip via the download button above. 4. Run CMake GUI from the start menu 5. Click `Browse Source` and select the directory `spine-runtimes` 6. Click `Browse Build` and select the `spine-runtimes/spine-sfml/build` directory. You can create the `build` folder directly in the file dialog via `New Folder`. -7. Click `Configure`. Then click `Generate`. This will create a Visual Studio 2015 solution file called `spine.sln` in `spine-runtimes/spine-sfml/build` and also download the SFML dependencies. -8. Open the `spine.sln` file in Visual Studio 2015 +7. Click `Configure`. Check `SPINE_SFML`. Then click `Generate`. This will create a Visual Studio 2015 solution file called `spine.sln` in `spine-runtimes/spine-sfml/build` and also download the SFML dependencies. +8. Open the `spine.sln` file in Visual Studio 2022 9. Right click the `spine-sfml-example` project in the solution explorer and select `Set as Startup Project` from the context menu 10. Right click the `spine-sfml-example` project in the solution explorer and select `Properties` from the context menu 11. Select `Debugging` in the left-hand list, then set `Working Directory` to `$(OutputPath)` diff --git a/spine-sfml/cpp/CMakeLists.txt b/spine-sfml/cpp/CMakeLists.txt index f6f7608ac..8215285e5 100644 --- a/spine-sfml/cpp/CMakeLists.txt +++ b/spine-sfml/cpp/CMakeLists.txt @@ -1,10 +1,12 @@ # -# First download and extract SFML 2.5.1 for the respective OS we are on +# First download and extract SFML 2.6.1 for the respective OS we are on # set(DEPS_DIR "${CMAKE_CURRENT_LIST_DIR}/dependencies/") if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(SFML_URL "https://www.sfml-dev.org/files/SFML-2.5.1-macOS-clang.tar.gz") - set(SFML_DIR ${DEPS_DIR}/SFML-2.5.1-macos-clang) + set(CMAKE_OSX_ARCHITECTURES x86_64) + set(ONLY_ACTIVE_ARCH NO) + set(SFML_URL "https://www.sfml-dev.org/files/SFML-2.6.1-macOS-clang-64-bit.tar.gz") + set(SFML_DIR ${DEPS_DIR}/SFML-2.6.1-macOS-clang-64-bit) if (NOT EXISTS "${SFML_DIR}") message("Downloading SFML for Mac OS X") file(DOWNLOAD "${SFML_URL}" "${DEPS_DIR}/sfml.tar.gz") @@ -12,7 +14,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") COMMAND ${CMAKE_COMMAND} -E tar xzf ${DEPS_DIR}/sfml.tar.gz WORKING_DIRECTORY ${DEPS_DIR} ) - # copy freetype over to Frameworks/ so rpath resoultion works + # copy freetype over to Frameworks/ so rpath resolution works execute_process( COMMAND ${CMAKE_COMMAND} -E copy_directory ${SFML_DIR}/extlibs/freetype.framework ${SFML_DIR}/Frameworks/freetype.framework WORKING_DIRECTORY ${SFML_DIR} diff --git a/spine-sfml/cpp/README.md b/spine-sfml/cpp/README.md index 722bd797f..f094107da 100644 --- a/spine-sfml/cpp/README.md +++ b/spine-sfml/cpp/README.md @@ -29,16 +29,16 @@ See the [Spine Runtimes documentation](http://esotericsoftware.com/spine-documen The Spine SFML example works on Windows, Linux and Mac OS X. ### Windows -1. Install [Visual Studio 2015 Community](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx). Make sure you install support for C++ as well as th Windows SDK for XP/7/8. +1. Install [Visual Studio 2022 Community](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx). Make sure you install support for C++ as well as th Windows SDK for XP/7/8. 2. Install CMake via the [Windows installer package](https://cmake.org/download/). 3. Download the Spine Runtimes repository using git (`git clone https://github.com/esotericsoftware/spine-runtimes`) or download it as a zip via the download button above. 4. Run CMake GUI from the start menu 5. Click `Browse Source` and select the directory `spine-runtimes` 6. Click `Browse Build` and select the `spine-runtimes/spine-sfml/build` directory. You can create the `build` folder directly in the file dialog via `New Folder`. -7. Click `Configure`. Then click `Generate`. This will create a Visual Studio 2015 solution file called `spine.sln` in `spine-runtimes/spine-sfml/build` and also download the SFML dependencies. -8. Open the `spine.sln` file in Visual Studio 2015 -9. Right click the `spine-sfml-example` project in the solution explorer and select `Set as Startup Project` from the context menu -10. Right click the `spine-sfml-example` project in the solution explorer and select `Properties` from the context menu +7. Click `Configure`. Check `SPINE_SFML`. Then click `Generate`. This will create a Visual Studio 2015 solution file called `spine.sln` in `spine-runtimes/spine-sfml/build` and also download the SFML dependencies. +8. Open the `spine.sln` file in Visual Studio 2022 +9. Right click the `spine-sfml-cpp-example` project in the solution explorer and select `Set as Startup Project` from the context menu +10. Right click the `spine-sfml-cpp-example` project in the solution explorer and select `Properties` from the context menu 11. Select `Debugging` in the left-hand list, then set `Working Directory` to `$(OutputPath)` 12. Click `Local Windows Debugger` to run the example