Эх сурвалжийг харах

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

Mario Zechner 1 жил өмнө
parent
commit
26d403c9b7

+ 1 - 1
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);

+ 2 - 2
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) {

+ 2 - 2
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")

+ 3 - 3
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)`

+ 6 - 4
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}

+ 5 - 5
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