diff --git a/spine-cocos2dx/README.md b/spine-cocos2dx/README.md index 1a0f9fa81..2cefd2b16 100644 --- a/spine-cocos2dx/README.md +++ b/spine-cocos2dx/README.md @@ -36,6 +36,7 @@ The Spine cocos2d-x example works on Windows and Mac OS X. 5. Click `Browse Source` and select the directory `spine-runtimes` 6. Click `Browse Build` and select the `spine-runtimes/spine-cocos2dx/build` directory. You can create the `build` folder directly in the file dialog via `New Folder`. 7. Click `Configure`. This will download the cocos2d-x dependency and wire it up with the example source code in `spine-runtimes/spine-cocos2dx/example`. The download is 400mb, so get yourself a cup of tea. +7. Open the file `spine-cocos2dx\example\cocos2d\cocos\2d\cocos2dx.props` and remove the `libSpine.lib` entry from the `` tag. 8. Open the `spine-runtimes/spine-cocos2dx/example/proj.win32/spine-cocos2d-x.sln` file in Visual Studio 2015. Visual Studio may ask you to install the Windows XP/7 SDK, which you should install. 9. Expand the cocos2d_libs sub project and delete the `editor-support/spine` group. This will remove the outdated Spine cocos2d-x runtime shipped by cocos2d-x from your build. 9. Expand `References` of the cocos2d_libs sub project, and remove the entry for `libSpine`, which should be marked with an error. diff --git a/spine-cocos2dx/example/proj.win32/main.cpp b/spine-cocos2dx/example/proj.win32/main.cpp index 61ae71ffc..8c9931073 100644 --- a/spine-cocos2dx/example/proj.win32/main.cpp +++ b/spine-cocos2dx/example/proj.win32/main.cpp @@ -2,9 +2,7 @@ #include "AppDelegate.h" #include "cocos2d.h" -USING_NS_CC; - -int APIENTRY _tWinMain(HINSTANCE hInstance, +int wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) @@ -14,5 +12,5 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // create the application instance AppDelegate app; - return Application::getInstance()->run(); + return cocos2d::Application::getInstance()->run(); } diff --git a/spine-cocos2dx/example/proj.win32/spine-cocos2d-x.vcxproj b/spine-cocos2dx/example/proj.win32/spine-cocos2d-x.vcxproj index 9c3f07100..917041d6a 100644 --- a/spine-cocos2dx/example/proj.win32/spine-cocos2d-x.vcxproj +++ b/spine-cocos2dx/example/proj.win32/spine-cocos2d-x.vcxproj @@ -155,6 +155,7 @@ xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y + @@ -165,6 +166,7 @@ xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y + @@ -182,6 +184,7 @@ xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y + diff --git a/spine-cocos2dx/example/proj.win32/spine-cocos2d-x.vcxproj.filters b/spine-cocos2dx/example/proj.win32/spine-cocos2d-x.vcxproj.filters index ec02b77cb..78febbba7 100644 --- a/spine-cocos2dx/example/proj.win32/spine-cocos2d-x.vcxproj.filters +++ b/spine-cocos2dx/example/proj.win32/spine-cocos2d-x.vcxproj.filters @@ -156,6 +156,15 @@ spine + + spine + + + spine + + + spine-cocos2dx + diff --git a/spine-cocos2dx/src/spine/SkeletonTwoColorBatch.cpp b/spine-cocos2dx/src/spine/SkeletonTwoColorBatch.cpp index 544490d6f..0501a93ef 100644 --- a/spine-cocos2dx/src/spine/SkeletonTwoColorBatch.cpp +++ b/spine-cocos2dx/src/spine/SkeletonTwoColorBatch.cpp @@ -28,7 +28,6 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #include -#include "external/xxhash/xxhash.h" #include #include @@ -84,9 +83,8 @@ void TwoColorTrianglesCommand::generateMaterialID() { setSkipBatching(true); } else { - int glProgram = (int)_glProgram->getProgram(); - int intArray[4] = { glProgram, (int)_textureID, (int)_blendType.src, (int)_blendType.dst}; - _materialID = XXH32((const void*)intArray, sizeof(intArray), 0); + int glProgram = (int)_glProgram->getProgram(); + _materialID = glProgram + (int)_textureID + (int)_blendType.src + (int)_blendType.dst; } }