[sfml] Update to 2.6.1 on macOS, require VS 2022 on Windows, update README.md for Windows

This commit is contained in:
Mario Zechner 2024-04-03 14:37:01 +02:00
parent 78fc6daaf0
commit 26d403c9b7
6 changed files with 19 additions and 17 deletions

View File

@ -1370,7 +1370,7 @@ Animation *SkeletonJson::readAnimation(Json *root, SkeletonData *skeletonData) {
int frames = timelineMap->_size; int frames = timelineMap->_size;
if (strcmp(timelineName, "reset") == 0) { if (strcmp(timelineName, "reset") == 0) {
PhysicsConstraintResetTimeline *timeline = new (__FILE__, __LINE__) PhysicsConstraintResetTimeline(frames, index); 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)); timeline->setFrame(frame, Json::getFloat(keyMap, "time", 0));
} }
timelines.add(timeline); timelines.add(timeline);

View File

@ -51,11 +51,11 @@ SkeletonDrawable::~SkeletonDrawable() {
delete skeleton; delete skeleton;
} }
void SkeletonDrawable::update(float delta) { void SkeletonDrawable::update(float delta, Physics physics) {
animationState->update(delta); animationState->update(delta);
animationState->apply(*skeleton); animationState->apply(*skeleton);
skeleton->update(delta); skeleton->update(delta);
skeleton->updateWorldTransform(Physics_Update); skeleton->updateWorldTransform(physics);
} }
void SkeletonDrawable::draw(SDL_Renderer *renderer) { void SkeletonDrawable::draw(SDL_Renderer *renderer) {

View File

@ -5,8 +5,8 @@ set(DEPS_DIR "${CMAKE_CURRENT_LIST_DIR}/dependencies/")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_OSX_ARCHITECTURES x86_64) set(CMAKE_OSX_ARCHITECTURES x86_64)
set(ONLY_ACTIVE_ARCH NO) set(ONLY_ACTIVE_ARCH NO)
set(SFML_URL "https://www.sfml-dev.org/files/SFML-2.5.1-macOS-clang.tar.gz") 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.5.1-macos-clang) set(SFML_DIR ${DEPS_DIR}/SFML-2.6.1-macOS-clang-64-bit)
if (NOT EXISTS "${SFML_DIR}") if (NOT EXISTS "${SFML_DIR}")
message("Downloading SFML for Mac OS X") message("Downloading SFML for Mac OS X")
file(DOWNLOAD "${SFML_URL}" "${DEPS_DIR}/sfml.tar.gz") file(DOWNLOAD "${SFML_URL}" "${DEPS_DIR}/sfml.tar.gz")

View File

@ -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. The Spine SFML example works on Windows, Linux and Mac OS X.
### Windows ### 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/). 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. 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 4. Run CMake GUI from the start menu
5. Click `Browse Source` and select the directory `spine-runtimes` 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`. 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. 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 2015 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 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 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)` 11. Select `Debugging` in the left-hand list, then set `Working Directory` to `$(OutputPath)`

View File

@ -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/") set(DEPS_DIR "${CMAKE_CURRENT_LIST_DIR}/dependencies/")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(SFML_URL "https://www.sfml-dev.org/files/SFML-2.5.1-macOS-clang.tar.gz") set(CMAKE_OSX_ARCHITECTURES x86_64)
set(SFML_DIR ${DEPS_DIR}/SFML-2.5.1-macos-clang) 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}") if (NOT EXISTS "${SFML_DIR}")
message("Downloading SFML for Mac OS X") message("Downloading SFML for Mac OS X")
file(DOWNLOAD "${SFML_URL}" "${DEPS_DIR}/sfml.tar.gz") 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 COMMAND ${CMAKE_COMMAND} -E tar xzf ${DEPS_DIR}/sfml.tar.gz
WORKING_DIRECTORY ${DEPS_DIR} WORKING_DIRECTORY ${DEPS_DIR}
) )
# copy freetype over to Frameworks/ so rpath resoultion works # copy freetype over to Frameworks/ so rpath resolution works
execute_process( execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_directory ${SFML_DIR}/extlibs/freetype.framework ${SFML_DIR}/Frameworks/freetype.framework COMMAND ${CMAKE_COMMAND} -E copy_directory ${SFML_DIR}/extlibs/freetype.framework ${SFML_DIR}/Frameworks/freetype.framework
WORKING_DIRECTORY ${SFML_DIR} WORKING_DIRECTORY ${SFML_DIR}

View File

@ -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. The Spine SFML example works on Windows, Linux and Mac OS X.
### Windows ### 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/). 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. 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 4. Run CMake GUI from the start menu
5. Click `Browse Source` and select the directory `spine-runtimes` 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`. 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. 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 2015 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 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-example` project in the solution explorer and select `Properties` 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)` 11. Select `Debugging` in the left-hand list, then set `Working Directory` to `$(OutputPath)`
12. Click `Local Windows Debugger` to run the example 12. Click `Local Windows Debugger` to run the example